修复意外的图层显示
This commit is contained in:
parent
bb4ac8606a
commit
b2fa32297c
8 changed files with 44 additions and 24 deletions
|
@ -64,24 +64,6 @@ public class MinigunItemModel extends GeoModel<Minigun> {
|
||||||
shen.setRotZ(-0.02f * (float) (fp + 1.3 * fr));
|
shen.setRotZ(-0.02f * (float) (fp + 1.3 * fr));
|
||||||
shen.setPosX(0.5f * (float) fr * (float) ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).recoilHorizon * fp));
|
shen.setPosX(0.5f * (float) fr * (float) ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).recoilHorizon * fp));
|
||||||
|
|
||||||
if (stack.getOrCreateTag().getInt("fire_animation") > 0) {
|
|
||||||
flare.setScaleZ(1);
|
|
||||||
light.setScaleX(1);
|
|
||||||
light.setScaleY(1);
|
|
||||||
light.setScaleZ(1);
|
|
||||||
flare.setScaleX((float) (1 + 0.5 * (Math.random() - 0.5)));
|
|
||||||
flare.setScaleY((float) (1 + 0.5 * (Math.random() - 0.5)));
|
|
||||||
flare.setRotZ((float) (0.5 * (Math.random() - 0.5)));
|
|
||||||
} else {
|
|
||||||
flare.setScaleX(0);
|
|
||||||
flare.setScaleY(0);
|
|
||||||
flare.setScaleZ(0);
|
|
||||||
light.setScaleX(0);
|
|
||||||
light.setScaleY(0);
|
|
||||||
light.setScaleZ(0);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||||
|
|
||||||
float PosX = (float) player.getPersistentData().getDouble("gun_move_posX");
|
float PosX = (float) player.getPersistentData().getDouble("gun_move_posX");
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.mcreator.superbwarfare.client.layer.AK47Layer;
|
import net.mcreator.superbwarfare.client.layer.AK47Layer;
|
||||||
import net.mcreator.superbwarfare.client.model.item.AK47ItemModel;
|
import net.mcreator.superbwarfare.client.model.item.AK47ItemModel;
|
||||||
import net.mcreator.superbwarfare.item.gun.AK47Item;
|
import net.mcreator.superbwarfare.item.gun.AK47Item;
|
||||||
|
import net.mcreator.superbwarfare.network.ModVariables;
|
||||||
import net.mcreator.superbwarfare.tools.AnimUtils;
|
import net.mcreator.superbwarfare.tools.AnimUtils;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.model.PlayerModel;
|
import net.minecraft.client.model.PlayerModel;
|
||||||
|
@ -99,7 +100,9 @@ public class AK47ItemRenderer extends GeoItemRenderer<AK47Item> {
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
itemStack = player.getMainHandItem();
|
itemStack = player.getMainHandItem();
|
||||||
}
|
}
|
||||||
bone.setHidden(itemStack != null && itemStack.getOrCreateTag().getBoolean("HoloHidden"));
|
if (player != null) {
|
||||||
|
bone.setHidden(itemStack.getOrCreateTag().getBoolean("HoloHidden") || !player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).zooming);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.mcreator.superbwarfare.client.layer.BocekLayer;
|
import net.mcreator.superbwarfare.client.layer.BocekLayer;
|
||||||
import net.mcreator.superbwarfare.client.model.item.BocekItemModel;
|
import net.mcreator.superbwarfare.client.model.item.BocekItemModel;
|
||||||
import net.mcreator.superbwarfare.item.gun.BocekItem;
|
import net.mcreator.superbwarfare.item.gun.BocekItem;
|
||||||
|
import net.mcreator.superbwarfare.network.ModVariables;
|
||||||
import net.mcreator.superbwarfare.tools.AnimUtils;
|
import net.mcreator.superbwarfare.tools.AnimUtils;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.model.PlayerModel;
|
import net.minecraft.client.model.PlayerModel;
|
||||||
|
@ -84,7 +85,9 @@ public class BocekItemRenderer extends GeoItemRenderer<BocekItem> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.equals("holo")) {
|
if (name.equals("holo")) {
|
||||||
bone.setHidden(itemStack != null && itemStack.getOrCreateTag().getBoolean("HoloHidden"));
|
if (player_ != null) {
|
||||||
|
bone.setHidden(itemStack.getOrCreateTag().getBoolean("HoloHidden") || !player_.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).zooming);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.equals("arrow")) {
|
if (name.equals("arrow")) {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.mcreator.superbwarfare.client.layer.DevotionLayer;
|
import net.mcreator.superbwarfare.client.layer.DevotionLayer;
|
||||||
import net.mcreator.superbwarfare.client.model.item.DevotionItemModel;
|
import net.mcreator.superbwarfare.client.model.item.DevotionItemModel;
|
||||||
import net.mcreator.superbwarfare.item.gun.Devotion;
|
import net.mcreator.superbwarfare.item.gun.Devotion;
|
||||||
|
import net.mcreator.superbwarfare.network.ModVariables;
|
||||||
import net.mcreator.superbwarfare.tools.AnimUtils;
|
import net.mcreator.superbwarfare.tools.AnimUtils;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.model.PlayerModel;
|
import net.minecraft.client.model.PlayerModel;
|
||||||
|
@ -99,7 +100,9 @@ public class DevotionItemRenderer extends GeoItemRenderer<Devotion> {
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
itemStack = player.getMainHandItem();
|
itemStack = player.getMainHandItem();
|
||||||
}
|
}
|
||||||
bone.setHidden(itemStack != null && itemStack.getOrCreateTag().getBoolean("HoloHidden"));
|
if (player != null) {
|
||||||
|
bone.setHidden(itemStack.getOrCreateTag().getBoolean("HoloHidden") || !player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).zooming);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.mcreator.superbwarfare.client.layer.Hk416Layer;
|
import net.mcreator.superbwarfare.client.layer.Hk416Layer;
|
||||||
import net.mcreator.superbwarfare.client.model.item.Hk416ItemModel;
|
import net.mcreator.superbwarfare.client.model.item.Hk416ItemModel;
|
||||||
import net.mcreator.superbwarfare.item.gun.Hk416Item;
|
import net.mcreator.superbwarfare.item.gun.Hk416Item;
|
||||||
|
import net.mcreator.superbwarfare.network.ModVariables;
|
||||||
import net.mcreator.superbwarfare.tools.AnimUtils;
|
import net.mcreator.superbwarfare.tools.AnimUtils;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.model.PlayerModel;
|
import net.minecraft.client.model.PlayerModel;
|
||||||
|
@ -99,7 +100,9 @@ public class Hk416ItemRenderer extends GeoItemRenderer<Hk416Item> {
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
itemStack = player.getMainHandItem();
|
itemStack = player.getMainHandItem();
|
||||||
}
|
}
|
||||||
bone.setHidden(itemStack != null && itemStack.getOrCreateTag().getBoolean("HoloHidden"));
|
if (player != null) {
|
||||||
|
bone.setHidden(itemStack.getOrCreateTag().getBoolean("HoloHidden") || !player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).zooming);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.mcreator.superbwarfare.client.layer.M98bLayer;
|
import net.mcreator.superbwarfare.client.layer.M98bLayer;
|
||||||
import net.mcreator.superbwarfare.client.model.item.M98bItemModel;
|
import net.mcreator.superbwarfare.client.model.item.M98bItemModel;
|
||||||
import net.mcreator.superbwarfare.item.gun.M98bItem;
|
import net.mcreator.superbwarfare.item.gun.M98bItem;
|
||||||
|
import net.mcreator.superbwarfare.network.ModVariables;
|
||||||
import net.mcreator.superbwarfare.tools.AnimUtils;
|
import net.mcreator.superbwarfare.tools.AnimUtils;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.model.PlayerModel;
|
import net.minecraft.client.model.PlayerModel;
|
||||||
|
@ -99,7 +100,7 @@ public class M98bItemRenderer extends GeoItemRenderer<M98bItem> {
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
itemStack = player.getMainHandItem();
|
itemStack = player.getMainHandItem();
|
||||||
}
|
}
|
||||||
bone.setHidden(itemStack != null && itemStack.getOrCreateTag().getBoolean("HoloHidden"));
|
bone.setHidden((itemStack != null && itemStack.getOrCreateTag().getBoolean("HoloHidden")) || !player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).zooming);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.equals("qiang")) {
|
if (name.equals("qiang")) {
|
||||||
|
|
|
@ -14,6 +14,7 @@ import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
|
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
|
||||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemDisplayContext;
|
import net.minecraft.world.item.ItemDisplayContext;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import software.bernie.geckolib.cache.object.BakedGeoModel;
|
import software.bernie.geckolib.cache.object.BakedGeoModel;
|
||||||
|
@ -76,6 +77,27 @@ public class MinigunItemRenderer extends GeoItemRenderer<Minigun> {
|
||||||
bone.setHidden(this.hiddenBones.contains(name));
|
bone.setHidden(this.hiddenBones.contains(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Player player_ = Minecraft.getInstance().player;
|
||||||
|
ItemStack itemStack = null;
|
||||||
|
if (player_ != null) {
|
||||||
|
itemStack = player_.getMainHandItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.equals("flare")) {
|
||||||
|
if (itemStack != null && itemStack.getOrCreateTag().getDouble("flash_time") > 0) {
|
||||||
|
bone.setHidden(false);
|
||||||
|
bone.setScaleX((float) (1 + 0.5 * (Math.random() - 0.5)));
|
||||||
|
bone.setScaleY((float) (1 + 0.5 * (Math.random() - 0.5)));
|
||||||
|
bone.setRotZ((float) (0.5 * (Math.random() - 0.5)));
|
||||||
|
} else {
|
||||||
|
bone.setHidden(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.equals("light")) {
|
||||||
|
bone.setHidden(itemStack == null || !(itemStack.getOrCreateTag().getDouble("flash_time") > 0));
|
||||||
|
}
|
||||||
|
|
||||||
if (this.transformType.firstPerson() && renderingArms) {
|
if (this.transformType.firstPerson() && renderingArms) {
|
||||||
AbstractClientPlayer player = mc.player;
|
AbstractClientPlayer player = mc.player;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.mcreator.superbwarfare.client.layer.Qbz95Layer;
|
import net.mcreator.superbwarfare.client.layer.Qbz95Layer;
|
||||||
import net.mcreator.superbwarfare.client.model.item.Qbz95ItemModel;
|
import net.mcreator.superbwarfare.client.model.item.Qbz95ItemModel;
|
||||||
import net.mcreator.superbwarfare.item.gun.Qbz95Item;
|
import net.mcreator.superbwarfare.item.gun.Qbz95Item;
|
||||||
|
import net.mcreator.superbwarfare.network.ModVariables;
|
||||||
import net.mcreator.superbwarfare.tools.AnimUtils;
|
import net.mcreator.superbwarfare.tools.AnimUtils;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.model.PlayerModel;
|
import net.minecraft.client.model.PlayerModel;
|
||||||
|
@ -99,7 +100,9 @@ public class Qbz95ItemRenderer extends GeoItemRenderer<Qbz95Item> {
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
itemStack = player.getMainHandItem();
|
itemStack = player.getMainHandItem();
|
||||||
}
|
}
|
||||||
bone.setHidden(itemStack != null && itemStack.getOrCreateTag().getBoolean("HoloHidden"));
|
if (player != null) {
|
||||||
|
bone.setHidden(itemStack.getOrCreateTag().getBoolean("HoloHidden") || !player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).zooming);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue