diff --git a/gradle.properties b/gradle.properties index 0350b37..859aa9f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,7 +33,7 @@ developmentEnvironmentUserName = Kam # Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8. # See https://github.com/bsideup/jabel for details on how this works. -enableModernJavaSyntax = true +enableModernJavaSyntax = false # Enables injecting missing generics into the decompiled source code for a better coding experience # Turns most publicly visible List, Map, etc. into proper List, Map types @@ -157,4 +157,4 @@ disableCheckstyle = true # e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be always native build. # WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want! # Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you. -# ideaOverrideBuildType = idea +#ideaOverrideBuildType = idea diff --git a/settings.gradle b/settings.gradle index 69d2d74..1e614a5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,5 +17,5 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.15' } diff --git a/src/main/java/com/goodbird/npcgecko/entity/EntityCustomModel.java b/src/main/java/com/goodbird/npcgecko/entity/EntityCustomModel.java index 5b7f1ad..5cb1a01 100644 --- a/src/main/java/com/goodbird/npcgecko/entity/EntityCustomModel.java +++ b/src/main/java/com/goodbird/npcgecko/entity/EntityCustomModel.java @@ -98,19 +98,15 @@ public class EntityCustomModel extends EntityCreature implements IAnimatable, IA dialogAnim = new AnimationBuilder().playOnce(name); } public void activateReceivedAnim(EnumSyncAutoAnim type) { - switch (type) { - case HURT -> { - if(!hurtAnimName.isEmpty()) - hurtAnim = new AnimationBuilder().playOnce(hurtAnimName); - } - case MELEE_ATTACK -> { - if(!meleeAttackAnimName.isEmpty()) - attackAnim = new AnimationBuilder().playOnce(meleeAttackAnimName); - } - case RANGED_ATTACK -> { - if(!rangedAttackAnimName.isEmpty()) - attackAnim = new AnimationBuilder().playOnce(rangedAttackAnimName); - } + if(type == EnumSyncAutoAnim.HURT){ + if(!hurtAnimName.isEmpty()) + hurtAnim = new AnimationBuilder().playOnce(hurtAnimName); + }else if(type == EnumSyncAutoAnim.MELEE_ATTACK){ + if(!meleeAttackAnimName.isEmpty()) + attackAnim = new AnimationBuilder().playOnce(meleeAttackAnimName); + }else if(type == EnumSyncAutoAnim.RANGED_ATTACK){ + if(!rangedAttackAnimName.isEmpty()) + attackAnim = new AnimationBuilder().playOnce(rangedAttackAnimName); } } diff --git a/src/main/java/com/goodbird/npcgecko/mixin/impl/MixinGeckoAddon.java b/src/main/java/com/goodbird/npcgecko/mixin/impl/MixinGeckoAddon.java index 05edf69..31c0426 100644 --- a/src/main/java/com/goodbird/npcgecko/mixin/impl/MixinGeckoAddon.java +++ b/src/main/java/com/goodbird/npcgecko/mixin/impl/MixinGeckoAddon.java @@ -3,6 +3,7 @@ package com.goodbird.npcgecko.mixin.impl; import com.goodbird.npcgecko.entity.EntityCustomModel; import com.goodbird.npcgecko.mixin.IDataDisplay; import com.goodbird.npcgecko.utils.NpcTextureUtils; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.ResourceLocation; import kamkeel.addon.GeckoAddon; @@ -27,7 +28,9 @@ public class MixinGeckoAddon { if(!supportEnabled) return; - if (entity instanceof EntityCustomModel modelEntity && copied instanceof EntityNPCInterface npc) { + if (entity instanceof EntityCustomModel && copied instanceof EntityNPCInterface) { + EntityCustomModel modelEntity = (EntityCustomModel) entity; + EntityNPCInterface npc = (EntityNPCInterface) copied; IDataDisplay display = (IDataDisplay) npc.display; modelEntity.textureResLoc = NpcTextureUtils.getNpcTexture((EntityNPCInterface) copied); modelEntity.modelResLoc = new ResourceLocation(display.getCustomModelData().getModel());