From cee6f0f200f1b4ff28553a01ff41957e91048e74 Mon Sep 17 00:00:00 2001 From: Thutmose Date: Sun, 21 Aug 2022 16:34:21 -0400 Subject: [PATCH] fixes some issues with advancements --- .../triggers/BeatLeaderTrigger.java | 6 +++++- .../triggers/BeatTrainerTrigger.java | 6 +++++- .../triggers/BreedPokemobTrigger.java | 8 ++++++-- .../triggers/CatchPokemobTrigger.java | 7 +++++-- .../triggers/EvolvePokemobTrigger.java | 6 +++++- .../triggers/FirstPokemobTrigger.java | 6 +++++- .../triggers/HatchPokemobTrigger.java | 6 +++++- .../triggers/InspectPokemobTrigger.java | 7 +++++-- .../triggers/KillPokemobTrigger.java | 6 +++++- .../triggers/MegaEvolvePokemobTrigger.java | 6 +++++- .../advancements/triggers/UseMoveTrigger.java | 6 +++++- .../impl/capabilities/impl/PokemobHungry.java | 15 ++++++++++++--- src/main/java/pokecube/core/moves/Battle.java | 4 ++-- .../core/moves/templates/Move_Basic.java | 4 ---- .../core/moves/templates/Move_Explode.java | 16 ++++++++-------- .../thut/api/entity/animation/Animation.java | 17 ++++++++++------- src/main/java/thut/api/maths/Vector4.java | 8 ++++++++ .../render/animation/AnimationHelper.java | 16 +++++++++------- .../core/client/render/model/parts/Mesh.java | 3 ++- 19 files changed, 107 insertions(+), 46 deletions(-) diff --git a/src/main/java/pokecube/adventures/advancements/triggers/BeatLeaderTrigger.java b/src/main/java/pokecube/adventures/advancements/triggers/BeatLeaderTrigger.java index 5cce1b05ad..093e6b32a0 100644 --- a/src/main/java/pokecube/adventures/advancements/triggers/BeatLeaderTrigger.java +++ b/src/main/java/pokecube/adventures/advancements/triggers/BeatLeaderTrigger.java @@ -1,5 +1,7 @@ package pokecube.adventures.advancements.triggers; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -64,8 +66,10 @@ public void remove(final CriterionTrigger.Listener listener) public void trigger(final ServerPlayer player, final TrainerBase defeated) { + List> toTrigger = new ArrayList<>(); for (var listener : this.listeners) - if (listener.getTriggerInstance().test(player, defeated)) listener.run(this.playerAdvancements); + if (listener.getTriggerInstance().test(player, defeated)) toTrigger.add(listener); + toTrigger.forEach(l -> l.run(playerAdvancements)); } } diff --git a/src/main/java/pokecube/adventures/advancements/triggers/BeatTrainerTrigger.java b/src/main/java/pokecube/adventures/advancements/triggers/BeatTrainerTrigger.java index 04720f12e4..d777db78d0 100644 --- a/src/main/java/pokecube/adventures/advancements/triggers/BeatTrainerTrigger.java +++ b/src/main/java/pokecube/adventures/advancements/triggers/BeatTrainerTrigger.java @@ -1,5 +1,7 @@ package pokecube.adventures.advancements.triggers; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -64,8 +66,10 @@ public void remove(final CriterionTrigger.Listener listener) public void trigger(final ServerPlayer player, final TrainerBase defeated) { + List> toTrigger = new ArrayList<>(); for (var listener : this.listeners) - if (listener.getTriggerInstance().test(player, defeated)) listener.run(this.playerAdvancements); + if (listener.getTriggerInstance().test(player, defeated)) toTrigger.add(listener); + toTrigger.forEach(l -> l.run(playerAdvancements)); } } diff --git a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/BreedPokemobTrigger.java b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/BreedPokemobTrigger.java index 534bdc1a01..9856aa0f8a 100644 --- a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/BreedPokemobTrigger.java +++ b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/BreedPokemobTrigger.java @@ -1,5 +1,7 @@ package pokecube.core.handlers.playerdata.advancements.triggers; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -86,8 +88,10 @@ public void remove(final CriterionTrigger.Listener listener) public void trigger(final ServerPlayer player, final IPokemob first, final IPokemob second) { - for (final var listener : this.listeners) - if (listener.getTriggerInstance().test(player, first, second)) listener.run(this.playerAdvancements); + List> toTrigger = new ArrayList<>(); + for (var listener : this.listeners) + if (listener.getTriggerInstance().test(player, first, second)) toTrigger.add(listener); + toTrigger.forEach(l -> l.run(playerAdvancements)); } } diff --git a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/CatchPokemobTrigger.java b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/CatchPokemobTrigger.java index 2d228dcdd2..2edf36799c 100644 --- a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/CatchPokemobTrigger.java +++ b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/CatchPokemobTrigger.java @@ -1,5 +1,7 @@ package pokecube.core.handlers.playerdata.advancements.triggers; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -91,9 +93,10 @@ public void remove(final CriterionTrigger.Listener listener) public void trigger(final ServerPlayer player, final IPokemob pokemob) { + List> toTrigger = new ArrayList<>(); for (var listener : this.listeners) - if (listener.getTriggerInstance().test(player, pokemob)) listener.run(this.playerAdvancements); - + if (listener.getTriggerInstance().test(player, pokemob)) toTrigger.add(listener); + toTrigger.forEach(l -> l.run(playerAdvancements)); } } diff --git a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/EvolvePokemobTrigger.java b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/EvolvePokemobTrigger.java index 57ceff67a2..e2021fe2c3 100644 --- a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/EvolvePokemobTrigger.java +++ b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/EvolvePokemobTrigger.java @@ -1,5 +1,7 @@ package pokecube.core.handlers.playerdata.advancements.triggers; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -67,8 +69,10 @@ public void remove(final CriterionTrigger.Listener listener) public void trigger(final ServerPlayer player, final IPokemob pokemob) { + List> toTrigger = new ArrayList<>(); for (var listener : this.listeners) - if (listener.getTriggerInstance().test(player, pokemob)) listener.run(this.playerAdvancements); + if (listener.getTriggerInstance().test(player, pokemob)) toTrigger.add(listener); + toTrigger.forEach(l -> l.run(playerAdvancements)); } } diff --git a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/FirstPokemobTrigger.java b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/FirstPokemobTrigger.java index d84f982625..660bef632c 100644 --- a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/FirstPokemobTrigger.java +++ b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/FirstPokemobTrigger.java @@ -1,5 +1,7 @@ package pokecube.core.handlers.playerdata.advancements.triggers; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -60,8 +62,10 @@ public void remove(final CriterionTrigger.Listener listener) public void trigger(final ServerPlayer player) { + List> toTrigger = new ArrayList<>(); for (var listener : this.listeners) - if (listener.getTriggerInstance().test()) listener.run(this.playerAdvancements); + if (listener.getTriggerInstance().test()) toTrigger.add(listener); + toTrigger.forEach(l -> l.run(playerAdvancements)); } } diff --git a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/HatchPokemobTrigger.java b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/HatchPokemobTrigger.java index 0c862328a2..eb176e12f8 100644 --- a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/HatchPokemobTrigger.java +++ b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/HatchPokemobTrigger.java @@ -1,5 +1,7 @@ package pokecube.core.handlers.playerdata.advancements.triggers; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -67,8 +69,10 @@ public void remove(final CriterionTrigger.Listener listener) public void trigger(final ServerPlayer player, final IPokemob pokemob) { + List> toTrigger = new ArrayList<>(); for (var listener : this.listeners) - if (listener.getTriggerInstance().test(player, pokemob)) listener.run(this.playerAdvancements); + if (listener.getTriggerInstance().test(player, pokemob)) toTrigger.add(listener); + toTrigger.forEach(l -> l.run(playerAdvancements)); } } diff --git a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/InspectPokemobTrigger.java b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/InspectPokemobTrigger.java index e0ef90d85c..526c7b4b1f 100644 --- a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/InspectPokemobTrigger.java +++ b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/InspectPokemobTrigger.java @@ -1,5 +1,7 @@ package pokecube.core.handlers.playerdata.advancements.triggers; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -67,9 +69,10 @@ public void remove(final CriterionTrigger.Listener listener) public void trigger(final ServerPlayer player, final IPokemob pokemob) { + List> toTrigger = new ArrayList<>(); for (var listener : this.listeners) - if (listener.getTriggerInstance().test(player, pokemob)) listener.run(this.playerAdvancements); - + if (listener.getTriggerInstance().test(player, pokemob)) toTrigger.add(listener); + toTrigger.forEach(l -> l.run(playerAdvancements)); } } diff --git a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/KillPokemobTrigger.java b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/KillPokemobTrigger.java index a670066fdb..91dc92fee1 100644 --- a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/KillPokemobTrigger.java +++ b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/KillPokemobTrigger.java @@ -1,5 +1,7 @@ package pokecube.core.handlers.playerdata.advancements.triggers; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -66,8 +68,10 @@ public void remove(final CriterionTrigger.Listener listener) public void trigger(final ServerPlayer player, final IPokemob pokemob) { + List> toTrigger = new ArrayList<>(); for (var listener : this.listeners) - if (listener.getTriggerInstance().test(player, pokemob)) listener.run(this.playerAdvancements); + if (listener.getTriggerInstance().test(player, pokemob)) toTrigger.add(listener); + toTrigger.forEach(l -> l.run(playerAdvancements)); } } diff --git a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/MegaEvolvePokemobTrigger.java b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/MegaEvolvePokemobTrigger.java index 3c93334a69..c6c5dee407 100644 --- a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/MegaEvolvePokemobTrigger.java +++ b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/MegaEvolvePokemobTrigger.java @@ -1,5 +1,7 @@ package pokecube.core.handlers.playerdata.advancements.triggers; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -67,8 +69,10 @@ public void remove(final CriterionTrigger.Listener listener) public void trigger(final ServerPlayer player, final IPokemob pokemob) { + List> toTrigger = new ArrayList<>(); for (var listener : this.listeners) - if (listener.getTriggerInstance().test(player, pokemob)) listener.run(this.playerAdvancements); + if (listener.getTriggerInstance().test(player, pokemob)) toTrigger.add(listener); + toTrigger.forEach(l -> l.run(playerAdvancements)); } } diff --git a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/UseMoveTrigger.java b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/UseMoveTrigger.java index a4b0bf38b6..458d5d8aaa 100644 --- a/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/UseMoveTrigger.java +++ b/src/main/java/pokecube/core/handlers/playerdata/advancements/triggers/UseMoveTrigger.java @@ -1,5 +1,7 @@ package pokecube.core.handlers.playerdata.advancements.triggers; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -70,8 +72,10 @@ public void remove(final CriterionTrigger.Listener listener) public void trigger(final ServerPlayer player, final MovePacket packet) { + List> toTrigger = new ArrayList<>(); for (var listener : this.listeners) - if (listener.getTriggerInstance().test(player, packet)) listener.run(this.playerAdvancements); + if (listener.getTriggerInstance().test(player, packet)) toTrigger.add(listener); + toTrigger.forEach(l -> l.run(playerAdvancements)); } } diff --git a/src/main/java/pokecube/core/impl/capabilities/impl/PokemobHungry.java b/src/main/java/pokecube/core/impl/capabilities/impl/PokemobHungry.java index d1a61a3167..b139055c70 100644 --- a/src/main/java/pokecube/core/impl/capabilities/impl/PokemobHungry.java +++ b/src/main/java/pokecube/core/impl/capabilities/impl/PokemobHungry.java @@ -4,6 +4,7 @@ import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.item.ItemStack; +import pokecube.api.data.PokedexEntry; import pokecube.api.entity.pokemob.Nature; import pokecube.api.entity.pokemob.ai.CombatStates; import pokecube.api.entity.pokemob.ai.GeneralStates; @@ -104,12 +105,20 @@ public int getHungerTime() return this.dataSync().get(this.params.HUNGERDW); } + private float _last_size = 0; + @Override public Vector3 getMobSizes() { - return this.sizes - .set(this.getPokedexEntry().width, this.getPokedexEntry().height, this.getPokedexEntry().length) - .scalarMult(this.getSize()); + float size = this.getSize(); + if (size != _last_size) + { + _last_size = size; + PokedexEntry entry = this.getPokedexEntry(); + this.sizes.set(entry.width, entry.height, entry.length); + this.sizes.scalarMultBy(size); + } + return this.sizes; } /** @return does this pokemon hunt for food */ diff --git a/src/main/java/pokecube/core/moves/Battle.java b/src/main/java/pokecube/core/moves/Battle.java index 39232b316b..9d5407071b 100644 --- a/src/main/java/pokecube/core/moves/Battle.java +++ b/src/main/java/pokecube/core/moves/Battle.java @@ -169,8 +169,8 @@ private void addToSide(final Map side, final Set tea if (this.valid) { final IPokemob poke = PokemobCaps.getPokemobFor(mob); - if (!(mob instanceof Mob)) return; - BrainUtils.initiateCombat((Mob) mob, target); + if (!(mob instanceof Mob mob2)) return; + BrainUtils.initiateCombat(mob2, target); if (poke != null && poke.getAbility() != null) poke.getAbility().startCombat(poke); } } diff --git a/src/main/java/pokecube/core/moves/templates/Move_Basic.java b/src/main/java/pokecube/core/moves/templates/Move_Basic.java index fecc3f0de3..d7870bd101 100644 --- a/src/main/java/pokecube/core/moves/templates/Move_Basic.java +++ b/src/main/java/pokecube/core/moves/templates/Move_Basic.java @@ -64,10 +64,6 @@ public static void silkHarvest(final BlockState state, final BlockPos pos, final worldIn.destroyBlock(pos, false); } - Vector3 v = new Vector3(); - - Vector3 v1 = new Vector3(); - /** * Constructor for a Pokemob move.
* The attack category defines the way the mob will move in order to make diff --git a/src/main/java/pokecube/core/moves/templates/Move_Explode.java b/src/main/java/pokecube/core/moves/templates/Move_Explode.java index bc4464a851..8a8d7919dd 100644 --- a/src/main/java/pokecube/core/moves/templates/Move_Explode.java +++ b/src/main/java/pokecube/core/moves/templates/Move_Explode.java @@ -160,20 +160,20 @@ public void attack(final IPokemob attacker, final Entity attacked) if (!evt.isCanceled()) { final boolean explodeDamage = mob.getLevel() instanceof ServerLevel level && Config.Rules.doBoom(level); - final boolean damagePerms = MoveEventsHandler.canAffectBlock(pokemob, this.v.set(mob), this.getName()); + final boolean damagePerms = MoveEventsHandler.canAffectBlock(pokemob, new Vector3().set(mob), + this.getName()); // If these, we let the explosion handle the damage. if (explodeDamage && damagePerms) boom.doExplosion(); else { // Otherwise spawn in some effects - mob.getLevel().playSound((Player) null, mob.getX(), mob.getY(), mob.getZ(), - SoundEvents.GENERIC_EXPLODE, SoundSource.BLOCKS, 4.0F, - (1.0F + (mob.getLevel().random.nextFloat() - - mob.getLevel().random.nextFloat()) * 0.2F) * 0.7F); - if (this.getPWR() > 200) mob.getLevel().addParticle(ParticleTypes.EXPLOSION, mob.getX(), - mob.getY(), mob.getZ(), 1.0D, 0.0D, 0.0D); - else mob.getLevel().addParticle(ParticleTypes.EXPLOSION, mob.getX(), mob.getY(), + mob.getLevel().playSound((Player) null, mob.getX(), mob.getY(), mob.getZ(), SoundEvents.GENERIC_EXPLODE, + SoundSource.BLOCKS, 4.0F, + (1.0F + (mob.getLevel().random.nextFloat() - mob.getLevel().random.nextFloat()) * 0.2F) * 0.7F); + if (this.getPWR() > 200) mob.getLevel().addParticle(ParticleTypes.EXPLOSION, mob.getX(), mob.getY(), mob.getZ(), 1.0D, 0.0D, 0.0D); + else mob.getLevel().addParticle(ParticleTypes.EXPLOSION, mob.getX(), mob.getY(), mob.getZ(), 1.0D, 0.0D, + 0.0D); // and hit nearby targets normally. this.actualAttack(pokemob, new Vector3().set(pokemob.getEntity()).add(0, pokemob.getSize() * pokemob.getPokedexEntry().height / 2, 0)); diff --git a/src/main/java/thut/api/entity/animation/Animation.java b/src/main/java/thut/api/entity/animation/Animation.java index e343d5f73a..5cfacd8f27 100644 --- a/src/main/java/thut/api/entity/animation/Animation.java +++ b/src/main/java/thut/api/entity/animation/Animation.java @@ -10,6 +10,7 @@ import com.google.common.collect.Ordering; +import thut.api.maths.Vector3; import thut.core.client.render.animation.AnimationXML.Phase; public class Animation @@ -28,20 +29,22 @@ public static interface IPartRenamer public UUID _uuid = UUID.randomUUID(); - public String name = ""; + public String name = ""; public String identifier = ""; - public int length = -1; + public int length = -1; /** * This is used for sorting animations for determining which components * should take priority when multiple animations are specified for a single * part. */ - public int priority = 10; + public int priority = 10; public boolean loops = true; public boolean hasLimbBased = false; + public Vector3 _shift = new Vector3(); + public TreeMap> sets = new TreeMap<>(Ordering.natural()); public ArrayList getComponents(final String key) @@ -76,10 +79,10 @@ public void initLength() this.hasLimbBased = false; for (final Entry> entry : this.sets.entrySet()) for (final AnimationComponent component : entry.getValue()) - { - this.length = Math.max(this.length, component.startKey + component.length); - this.hasLimbBased = this.hasLimbBased || component.limbBased; - } + { + this.length = Math.max(this.length, component.startKey + component.length); + this.hasLimbBased = this.hasLimbBased || component.limbBased; + } } @Override diff --git a/src/main/java/thut/api/maths/Vector4.java b/src/main/java/thut/api/maths/Vector4.java index 5766f80c78..8ab55d3291 100644 --- a/src/main/java/thut/api/maths/Vector4.java +++ b/src/main/java/thut/api/maths/Vector4.java @@ -35,6 +35,14 @@ public Vector4(final Quaternion quat) this.quat = quat; } + @OnlyIn(value = Dist.CLIENT) + public Vector4 set(final Quaternion quat) + { + this.set(quat.i(), quat.j(), quat.k(), quat.r()); + this.quat = quat; + return this; + } + public Vector4(final CompoundTag nbt) { this(); diff --git a/src/main/java/thut/core/client/render/animation/AnimationHelper.java b/src/main/java/thut/core/client/render/animation/AnimationHelper.java index be60518d61..4e0017ffe5 100644 --- a/src/main/java/thut/core/client/render/animation/AnimationHelper.java +++ b/src/main/java/thut/core/client/render/animation/AnimationHelper.java @@ -30,13 +30,15 @@ public class AnimationHelper { private final static Map holderMap = Maps.newHashMap(); + private static final Vector4 _rot = new Vector4(); + public static boolean animate(final Animation animation, final IAnimationHolder animate, final String partName, final IExtendedModelPart part, final float partialTick, final float limbSwing, final int tick) { final ArrayList components = animation.getComponents(partName); if (components == null) return false; boolean animated = false; - final Vector3 temp = new Vector3(); + final Vector3 temp = animation._shift.clear(); float x = 0, y = 0, z = 0; float sx = 1, sy = 1, sz = 1; int aniTick = tick; @@ -59,8 +61,9 @@ public static boolean animate(final Animation animation, final IAnimationHolder if (componentTimer > component.length) componentTimer = component.length; final int length = component.length == 0 ? 1 : component.length; final float ratio = componentTimer / length; - temp.addTo(component.posChange[0] * ratio + component.posOffset[0], component.posChange[1] * ratio - + component.posOffset[1], component.posChange[2] * ratio + component.posOffset[2]); + temp.addTo(component.posChange[0] * ratio + component.posOffset[0], + component.posChange[1] * ratio + component.posOffset[1], + component.posChange[2] * ratio + component.posOffset[2]); x += (float) (component.rotChange[0] * ratio + component.rotOffset[0]); y += (float) (component.rotChange[1] * ratio + component.rotOffset[1]); z += (float) (component.rotChange[2] * ratio + component.rotOffset[2]); @@ -82,7 +85,7 @@ public static boolean animate(final Animation animation, final IAnimationHolder if (z != 0) quat.mul(Vector3f.YN.rotationDegrees(z)); if (x != 0) quat.mul(Vector3f.XP.rotationDegrees(x)); if (y != 0) quat.mul(Vector3f.ZP.rotationDegrees(y)); - part.setPreRotations(new Vector4(quat)); + part.setPreRotations(_rot.set(quat)); } return animated; } @@ -100,9 +103,8 @@ public static boolean doAnimation(List list, final Entity entity, fin limbSwing = 0; } list = Lists.newArrayList(holder.getPlaying()); - for (final Animation animation : list) - animate = AnimationHelper.animate(animation, holder, partName, part, partialTick, limbSwing, - entity.tickCount) || animate; + for (final Animation animation : list) animate = AnimationHelper.animate(animation, holder, partName, part, + partialTick, limbSwing, entity.tickCount) || animate; } return animate; } diff --git a/src/main/java/thut/core/client/render/model/parts/Mesh.java b/src/main/java/thut/core/client/render/model/parts/Mesh.java index 0054211675..12ab399615 100644 --- a/src/main/java/thut/core/client/render/model/parts/Mesh.java +++ b/src/main/java/thut/core/client/render/model/parts/Mesh.java @@ -103,13 +103,14 @@ public Mesh(final Integer[] order, final Vertex[] vert, final Vertex[] norm, fin private final com.mojang.math.Vector3f dummy3 = new com.mojang.math.Vector3f(); private final Vector4f dummy4 = new Vector4f(); + private final TextureCoordinate dummyTex = new TextureCoordinate(0, 0); protected void doRender(final PoseStack mat, final VertexConsumer buffer, final IPartTexturer texturer) { Vertex vertex; Vertex normal; - TextureCoordinate textureCoordinate = new TextureCoordinate(0, 0); + TextureCoordinate textureCoordinate = dummyTex; final boolean flat = this.material.flat; final float red = this.rgbabro[0] / 255f; final float green = this.rgbabro[1] / 255f;