diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/Ah6Model.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/Ah6Model.java index c8b6b3f09..c4dcad9de 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/Ah6Model.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/Ah6Model.java @@ -15,7 +15,7 @@ public class Ah6Model extends GeoModel { @Override public ResourceLocation getModelResource(Ah6Entity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/ah_6.geo.json"); + return ModUtils.loc("geo/ah_6.geo.json"); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/AnnihilatorModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/AnnihilatorModel.java index c8778c5d5..41829ca60 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/AnnihilatorModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/AnnihilatorModel.java @@ -22,9 +22,7 @@ public class AnnihilatorModel extends GeoModel { @Override public ResourceLocation getModelResource(AnnihilatorEntity entity) { - return ModUtils.loc("geo/annihilator.geo.json"); - // Player player = Minecraft.getInstance().player; // // int distance = 0; @@ -87,6 +85,5 @@ public class AnnihilatorModel extends GeoModel { ledRed3.setHidden(!ledGreen3.isHidden()); ledRed4.setHidden(!ledGreen4.isHidden()); ledRed5.setHidden(!ledGreen5.isHidden()); - } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/CannonShellEntityModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/CannonShellEntityModel.java index 3cd7ae1d0..b82207287 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/CannonShellEntityModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/CannonShellEntityModel.java @@ -8,24 +8,25 @@ import software.bernie.geckolib.core.animation.AnimationState; import software.bernie.geckolib.model.GeoModel; public class CannonShellEntityModel extends GeoModel { - @Override - public ResourceLocation getAnimationResource(CannonShellEntity entity) { - return new ResourceLocation(ModUtils.MODID, "animations/cannon_shell.animation.json"); - } - @Override - public ResourceLocation getModelResource(CannonShellEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/cannon_shell.geo.json"); - } + @Override + public ResourceLocation getAnimationResource(CannonShellEntity entity) { + return ModUtils.loc("animations/cannon_shell.animation.json"); + } - @Override - public ResourceLocation getTextureResource(CannonShellEntity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/entity/cannon_shell.png"); - } + @Override + public ResourceLocation getModelResource(CannonShellEntity entity) { + return ModUtils.loc("geo/cannon_shell.geo.json"); + } - @Override - public void setCustomAnimations(CannonShellEntity animatable, long instanceId, AnimationState animationState) { - CoreGeoBone bone = getAnimationProcessor().getBone("bone"); - bone.setHidden(animatable.tickCount <= 1); - } + @Override + public ResourceLocation getTextureResource(CannonShellEntity entity) { + return ModUtils.loc("textures/entity/cannon_shell.png"); + } + + @Override + public void setCustomAnimations(CannonShellEntity animatable, long instanceId, AnimationState animationState) { + CoreGeoBone bone = getAnimationProcessor().getBone("bone"); + bone.setHidden(animatable.tickCount <= 1); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/ClaymoreModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/ClaymoreModel.java index 1963a9b53..59397b8e2 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/ClaymoreModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/ClaymoreModel.java @@ -27,5 +27,4 @@ public class ClaymoreModel extends GeoModel { } return ModUtils.loc("textures/entity/claymore.png"); } - } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/DroneModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/DroneModel.java index d257fda80..80bd34191 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/DroneModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/DroneModel.java @@ -19,98 +19,94 @@ import static com.atsuishio.superbwarfare.entity.DroneEntity.*; import static com.atsuishio.superbwarfare.event.ClientEventHandler.droneBodyAngle; public class DroneModel extends GeoModel { - public static float rotX = 0; - public static float rotZ = 0; - public static float rotation = 0; + public static float rotX = 0; + public static float rotZ = 0; + public static float rotation = 0; - @Override - public ResourceLocation getAnimationResource(DroneEntity entity) { - return new ResourceLocation(ModUtils.MODID, "animations/drone.animation.json"); - } + @Override + public ResourceLocation getAnimationResource(DroneEntity entity) { + return ModUtils.loc("animations/drone.animation.json"); + } - @Override - public ResourceLocation getModelResource(DroneEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/drone.geo.json"); - } + @Override + public ResourceLocation getModelResource(DroneEntity entity) { + return ModUtils.loc("geo/drone.geo.json"); + } - @Override - public ResourceLocation getTextureResource(DroneEntity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/entity/drone.png"); - } + @Override + public ResourceLocation getTextureResource(DroneEntity entity) { + return ModUtils.loc("textures/entity/drone.png"); + } - @Override - public void setCustomAnimations(DroneEntity animatable, long instanceId, AnimationState animationState) { - CoreGeoBone ammo1 = getAnimationProcessor().getBone("ammo1"); - CoreGeoBone ammo2 = getAnimationProcessor().getBone("ammo2"); - CoreGeoBone ammo3 = getAnimationProcessor().getBone("ammo3"); - CoreGeoBone ammo4 = getAnimationProcessor().getBone("ammo4"); - CoreGeoBone ammo5 = getAnimationProcessor().getBone("ammo5"); - CoreGeoBone ammo6 = getAnimationProcessor().getBone("ammo6"); - CoreGeoBone shell = getAnimationProcessor().getBone("shell"); - CoreGeoBone main = getAnimationProcessor().getBone("0"); + @Override + public void setCustomAnimations(DroneEntity animatable, long instanceId, AnimationState animationState) { + CoreGeoBone ammo1 = getAnimationProcessor().getBone("ammo1"); + CoreGeoBone ammo2 = getAnimationProcessor().getBone("ammo2"); + CoreGeoBone ammo3 = getAnimationProcessor().getBone("ammo3"); + CoreGeoBone ammo4 = getAnimationProcessor().getBone("ammo4"); + CoreGeoBone ammo5 = getAnimationProcessor().getBone("ammo5"); + CoreGeoBone ammo6 = getAnimationProcessor().getBone("ammo6"); + CoreGeoBone shell = getAnimationProcessor().getBone("shell"); + CoreGeoBone main = getAnimationProcessor().getBone("0"); ammo6.setHidden(animatable.getEntityData().get(AMMO) <= 5); - ammo5.setHidden(animatable.getEntityData().get(AMMO) <= 4); - ammo4.setHidden(animatable.getEntityData().get(AMMO) <= 3); - ammo3.setHidden(animatable.getEntityData().get(AMMO) <= 2); - ammo2.setHidden(animatable.getEntityData().get(AMMO) <= 1); - ammo1.setHidden(animatable.getEntityData().get(AMMO) <= 0); + ammo5.setHidden(animatable.getEntityData().get(AMMO) <= 4); + ammo4.setHidden(animatable.getEntityData().get(AMMO) <= 3); + ammo3.setHidden(animatable.getEntityData().get(AMMO) <= 2); + ammo2.setHidden(animatable.getEntityData().get(AMMO) <= 1); + ammo1.setHidden(animatable.getEntityData().get(AMMO) <= 0); shell.setHidden(!animatable.getEntityData().get(KAMIKAZE)); - float times = Math.min(Minecraft.getInstance().getDeltaFrameTime(), 1); + float times = Math.min(Minecraft.getInstance().getDeltaFrameTime(), 1); - if (Minecraft.getInstance().options.keyRight.isDown()) { - rotZ = Mth.lerp(0.025f * times, rotZ, -0.25f); - } else if (Minecraft.getInstance().options.keyLeft.isDown()) { - rotZ = Mth.lerp(0.025f * times, rotZ, 0.25f); - } else { - rotZ = Mth.lerp(0.04f * times, rotZ, 0); - } + if (Minecraft.getInstance().options.keyRight.isDown()) { + rotZ = Mth.lerp(0.025f * times, rotZ, -0.25f); + } else if (Minecraft.getInstance().options.keyLeft.isDown()) { + rotZ = Mth.lerp(0.025f * times, rotZ, 0.25f); + } else { + rotZ = Mth.lerp(0.04f * times, rotZ, 0); + } - main.setRotZ(rotZ); + main.setRotZ(rotZ); - droneBodyAngle(rotZ); + droneBodyAngle(rotZ); - //螺旋桨控制 + // 螺旋桨控制 + CoreGeoBone wingFL = getAnimationProcessor().getBone("wingFL"); + CoreGeoBone wingFR = getAnimationProcessor().getBone("wingFR"); + CoreGeoBone wingBL = getAnimationProcessor().getBone("wingBL"); + CoreGeoBone wingBR = getAnimationProcessor().getBone("wingBR"); - CoreGeoBone wingFL = getAnimationProcessor().getBone("wingFL"); - CoreGeoBone wingFR = getAnimationProcessor().getBone("wingFR"); - CoreGeoBone wingBL = getAnimationProcessor().getBone("wingBL"); - CoreGeoBone wingBR = getAnimationProcessor().getBone("wingBR"); + rotation = (float) Mth.lerp(times, rotation, animatable.onGround() ? 0 : 0.2); - rotation = (float) Mth.lerp(times, rotation, animatable.onGround() ? 0 : 0.2); + wingFL.setRotY(wingFL.getRotY() - rotation); + wingFR.setRotY(wingFL.getRotY() - rotation); + wingBL.setRotY(wingFL.getRotY() - rotation); + wingBR.setRotY(wingFL.getRotY() - rotation); - wingFL.setRotY(wingFL.getRotY() - rotation); - wingFR.setRotY(wingFL.getRotY() - rotation); - wingBL.setRotY(wingFL.getRotY() - rotation); - wingBR.setRotY(wingFL.getRotY() - rotation); + CoreGeoBone weapon = getAnimationProcessor().getBone("Weapon"); + String id = animatable.getEntityData().get(CONTROLLER); + UUID uuid; + try { + uuid = UUID.fromString(id); + } catch (IllegalArgumentException e) { + return; + } - CoreGeoBone weapon = getAnimationProcessor().getBone("Weapon"); + Player player = animatable.level().getPlayerByUUID(uuid); + if (player != null) { + ItemStack stack = player.getMainHandItem(); + DroneEntity drone = EntityFindUtil.findDrone(player.level(), stack.getOrCreateTag().getString("LinkedDrone")); - String id = animatable.getEntityData().get(CONTROLLER); - - UUID uuid; - try { - uuid = UUID.fromString(id); - } catch (IllegalArgumentException e) { - return; - } - - Player player = animatable.level().getPlayerByUUID(uuid); - - if (player != null) { - ItemStack stack = player.getMainHandItem(); - DroneEntity drone = EntityFindUtil.findDrone(player.level(), stack.getOrCreateTag().getString("LinkedDrone")); - - if (stack.is(ModItems.MONITOR.get()) && stack.getOrCreateTag().getBoolean("Using") && stack.getOrCreateTag().getBoolean("Linked")) { - if (drone != null && drone.getUUID() == animatable.getUUID()) { - weapon.setHidden(true); - } + if (stack.is(ModItems.MONITOR.get()) && stack.getOrCreateTag().getBoolean("Using") && stack.getOrCreateTag().getBoolean("Linked")) { + if (drone != null && drone.getUUID() == animatable.getUUID()) { + weapon.setHidden(true); + } } else { - weapon.setHidden(false); - } - } - } + weapon.setHidden(false); + } + } + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/GunGrenadeModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/GunGrenadeModel.java index 871b61a9b..3676db4ef 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/GunGrenadeModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/GunGrenadeModel.java @@ -8,26 +8,27 @@ import software.bernie.geckolib.core.animation.AnimationState; import software.bernie.geckolib.model.GeoModel; public class GunGrenadeModel extends GeoModel { - @Override - public ResourceLocation getAnimationResource(GunGrenadeEntity entity) { - return new ResourceLocation(ModUtils.MODID, "animations/cannon_shell.animation.json"); - } - @Override - public ResourceLocation getModelResource(GunGrenadeEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/cannon_shell.geo.json"); - } + @Override + public ResourceLocation getAnimationResource(GunGrenadeEntity entity) { + return ModUtils.loc("animations/cannon_shell.animation.json"); + } - @Override - public ResourceLocation getTextureResource(GunGrenadeEntity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/entity/cannon_shell.png"); - } + @Override + public ResourceLocation getModelResource(GunGrenadeEntity entity) { + return ModUtils.loc("geo/cannon_shell.geo.json"); + } - @Override - public void setCustomAnimations(GunGrenadeEntity animatable, long instanceId, AnimationState animationState) { - CoreGeoBone bone = getAnimationProcessor().getBone("bone"); - bone.setScaleX(0.2f); - bone.setScaleY(0.2f); - bone.setScaleZ(0.2f); - } + @Override + public ResourceLocation getTextureResource(GunGrenadeEntity entity) { + return ModUtils.loc("textures/entity/cannon_shell.png"); + } + + @Override + public void setCustomAnimations(GunGrenadeEntity animatable, long instanceId, AnimationState animationState) { + CoreGeoBone bone = getAnimationProcessor().getBone("bone"); + bone.setScaleX(0.2f); + bone.setScaleY(0.2f); + bone.setScaleZ(0.2f); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/HandGrenadeEntityModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/HandGrenadeEntityModel.java index 823c222dd..1a77ba6df 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/HandGrenadeEntityModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/HandGrenadeEntityModel.java @@ -6,18 +6,19 @@ import net.minecraft.resources.ResourceLocation; import software.bernie.geckolib.model.GeoModel; public class HandGrenadeEntityModel extends GeoModel { - @Override - public ResourceLocation getAnimationResource(HandGrenadeEntity entity) { - return null; - } - @Override - public ResourceLocation getModelResource(HandGrenadeEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/hand_grenade.geo.json"); - } + @Override + public ResourceLocation getAnimationResource(HandGrenadeEntity entity) { + return null; + } - @Override - public ResourceLocation getTextureResource(HandGrenadeEntity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/entity/hand_grenade.png"); - } + @Override + public ResourceLocation getModelResource(HandGrenadeEntity entity) { + return ModUtils.loc("geo/hand_grenade.geo.json"); + } + + @Override + public ResourceLocation getTextureResource(HandGrenadeEntity entity) { + return ModUtils.loc("textures/entity/hand_grenade.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/HeliRocketModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/HeliRocketModel.java index 9ac2614a3..bce2d6280 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/HeliRocketModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/HeliRocketModel.java @@ -6,19 +6,19 @@ import net.minecraft.resources.ResourceLocation; import software.bernie.geckolib.model.GeoModel; public class HeliRocketModel extends GeoModel { - @Override - public ResourceLocation getAnimationResource(HeliRocketEntity entity) { - return new ResourceLocation(ModUtils.MODID, "animations/rpg_rocket.animation.json"); - } - @Override - public ResourceLocation getModelResource(HeliRocketEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/heli_rocket.geo.json"); - } + @Override + public ResourceLocation getAnimationResource(HeliRocketEntity entity) { + return ModUtils.loc("animations/rpg_rocket.animation.json"); + } - @Override - public ResourceLocation getTextureResource(HeliRocketEntity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/entity/heli_rocket.png"); - } + @Override + public ResourceLocation getModelResource(HeliRocketEntity entity) { + return ModUtils.loc("geo/heli_rocket.geo.json"); + } + @Override + public ResourceLocation getTextureResource(HeliRocketEntity entity) { + return ModUtils.loc("textures/entity/heli_rocket.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/JavelinMissileModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/JavelinMissileModel.java index 8399ac368..e0be95d98 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/JavelinMissileModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/JavelinMissileModel.java @@ -6,19 +6,19 @@ import net.minecraft.resources.ResourceLocation; import software.bernie.geckolib.model.GeoModel; public class JavelinMissileModel extends GeoModel { - @Override - public ResourceLocation getAnimationResource(JavelinMissileEntity entity) { - return new ResourceLocation(ModUtils.MODID, "animations/javelin_missile.animation.json"); - } - @Override - public ResourceLocation getModelResource(JavelinMissileEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/javelin_missile.geo.json"); - } + @Override + public ResourceLocation getAnimationResource(JavelinMissileEntity entity) { + return ModUtils.loc("animations/javelin_missile.animation.json"); + } - @Override - public ResourceLocation getTextureResource(JavelinMissileEntity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/entity/javelin_missile.png"); - } + @Override + public ResourceLocation getModelResource(JavelinMissileEntity entity) { + return ModUtils.loc("geo/javelin_missile.geo.json"); + } + @Override + public ResourceLocation getTextureResource(JavelinMissileEntity entity) { + return ModUtils.loc("textures/entity/javelin_missile.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/Mle1934Model.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/Mle1934Model.java index ebf6fc986..e9974d216 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/Mle1934Model.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/Mle1934Model.java @@ -13,9 +13,10 @@ import software.bernie.geckolib.model.GeoModel; import software.bernie.geckolib.model.data.EntityModelData; public class Mle1934Model extends GeoModel { + @Override public ResourceLocation getAnimationResource(Mle1934Entity entity) { - return new ResourceLocation(ModUtils.MODID, "animations/mle1934.animation.json"); + return ModUtils.loc("animations/mle1934.animation.json"); } @Override @@ -23,27 +24,26 @@ public class Mle1934Model extends GeoModel { Player player = Minecraft.getInstance().player; int distance = 0; - if (player != null) { distance = (int) player.position().distanceTo(entity.position()); } if (distance < 32) { - return new ResourceLocation(ModUtils.MODID, "geo/mle1934.geo.json"); - } else{ - return new ResourceLocation(ModUtils.MODID, "geo/mle1934_lod1.geo.json"); + return ModUtils.loc("geo/mle1934.geo.json"); + } else { + return ModUtils.loc("geo/mle1934_lod1.geo.json"); } } @Override public ResourceLocation getTextureResource(Mle1934Entity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/entity/mle1934.png"); + return ModUtils.loc("textures/entity/mle1934.png"); } @Override - public void setCustomAnimations(Mle1934Entity animatable, long instanceId, AnimationState animationState) { - CoreGeoBone barrle = getAnimationProcessor().getBone("barrel"); - EntityModelData entityData = (EntityModelData) animationState.getData(DataTickets.ENTITY_MODEL_DATA); - barrle.setRotX((entityData.headPitch()) * Mth.DEG_TO_RAD); + public void setCustomAnimations(Mle1934Entity animatable, long instanceId, AnimationState animationState) { + CoreGeoBone barrel = getAnimationProcessor().getBone("barrel"); + EntityModelData entityData = animationState.getData(DataTickets.ENTITY_MODEL_DATA); + barrel.setRotX((entityData.headPitch()) * Mth.DEG_TO_RAD); } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/MortarShellEntityModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/MortarShellEntityModel.java index e0e3688a6..53f4e6c52 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/MortarShellEntityModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/MortarShellEntityModel.java @@ -6,19 +6,19 @@ import net.minecraft.resources.ResourceLocation; import software.bernie.geckolib.model.GeoModel; public class MortarShellEntityModel extends GeoModel { - @Override - public ResourceLocation getAnimationResource(MortarShellEntity entity) { - return null; - } - @Override - public ResourceLocation getModelResource(MortarShellEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/mortar_shell.geo.json"); - } + @Override + public ResourceLocation getAnimationResource(MortarShellEntity entity) { + return null; + } - @Override - public ResourceLocation getTextureResource(MortarShellEntity entity) { - return ModUtils.loc("textures/entity/mortar.png"); - } + @Override + public ResourceLocation getModelResource(MortarShellEntity entity) { + return ModUtils.loc("geo/mortar_shell.geo.json"); + } + @Override + public ResourceLocation getTextureResource(MortarShellEntity entity) { + return ModUtils.loc("textures/entity/mortar.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/ProjectileEntityModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/ProjectileEntityModel.java index 07851f12e..96dc2aab7 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/ProjectileEntityModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/ProjectileEntityModel.java @@ -14,6 +14,7 @@ import software.bernie.geckolib.core.animation.AnimationState; import software.bernie.geckolib.model.GeoModel; public class ProjectileEntityModel extends GeoModel { + @Override public ResourceLocation getAnimationResource(ProjectileEntity entity) { return null; @@ -23,7 +24,7 @@ public class ProjectileEntityModel extends GeoModel { public ResourceLocation getModelResource(ProjectileEntity entity) { Player player = Minecraft.getInstance().player; if (player == null) { - return new ResourceLocation(ModUtils.MODID, "geo/projectile_entity2.geo.json"); + return ModUtils.loc("geo/projectile_entity2.geo.json"); } if ((ClientEventHandler.zoom && !player.getMainHandItem().is(ModItems.MINIGUN.get())) @@ -31,15 +32,15 @@ public class ProjectileEntityModel extends GeoModel { || player.getMainHandItem().is(ModItems.GLOCK_18.get()) || player.getMainHandItem().is(ModItems.BOCEK.get()) || (player.getVehicle() instanceof IArmedVehicleEntity iVehicle && iVehicle.isDriver(player) && !player.getMainHandItem().is(ModTags.Items.GUN))) { - return new ResourceLocation(ModUtils.MODID, "geo/projectile_entity.geo.json"); + return ModUtils.loc("geo/projectile_entity.geo.json"); } else { - return new ResourceLocation(ModUtils.MODID, "geo/projectile_entity2.geo.json"); + return ModUtils.loc("geo/projectile_entity2.geo.json"); } } @Override public ResourceLocation getTextureResource(ProjectileEntity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/entity/empty.png"); + return ModUtils.loc("textures/entity/empty.png"); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/RgoGrenadeEntityModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/RgoGrenadeEntityModel.java index 136df7242..8f44fc7f4 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/RgoGrenadeEntityModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/RgoGrenadeEntityModel.java @@ -6,18 +6,19 @@ import net.minecraft.resources.ResourceLocation; import software.bernie.geckolib.model.GeoModel; public class RgoGrenadeEntityModel extends GeoModel { - @Override - public ResourceLocation getAnimationResource(RgoGrenadeEntity entity) { - return null; - } - @Override - public ResourceLocation getModelResource(RgoGrenadeEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/rgo_grenade.geo.json"); - } + @Override + public ResourceLocation getAnimationResource(RgoGrenadeEntity entity) { + return null; + } - @Override - public ResourceLocation getTextureResource(RgoGrenadeEntity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/item/rgo_grenade.png"); - } + @Override + public ResourceLocation getModelResource(RgoGrenadeEntity entity) { + return ModUtils.loc("geo/rgo_grenade.geo.json"); + } + + @Override + public ResourceLocation getTextureResource(RgoGrenadeEntity entity) { + return ModUtils.loc("textures/item/rgo_grenade.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/RpgRocketModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/RpgRocketModel.java index 95cea59b7..b845ae496 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/RpgRocketModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/RpgRocketModel.java @@ -6,19 +6,19 @@ import net.minecraft.resources.ResourceLocation; import software.bernie.geckolib.model.GeoModel; public class RpgRocketModel extends GeoModel { - @Override - public ResourceLocation getAnimationResource(RpgRocketEntity entity) { - return new ResourceLocation(ModUtils.MODID, "animations/rpg_rocket.animation.json"); - } - @Override - public ResourceLocation getModelResource(RpgRocketEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/rpg_rocket.geo.json"); - } + @Override + public ResourceLocation getAnimationResource(RpgRocketEntity entity) { + return ModUtils.loc("animations/rpg_rocket.animation.json"); + } - @Override - public ResourceLocation getTextureResource(RpgRocketEntity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/entity/rpg_rocket.png"); - } + @Override + public ResourceLocation getModelResource(RpgRocketEntity entity) { + return ModUtils.loc("geo/rpg_rocket.geo.json"); + } + @Override + public ResourceLocation getTextureResource(RpgRocketEntity entity) { + return ModUtils.loc("textures/entity/rpg_rocket.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/SenpaiModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/SenpaiModel.java index d90e493a2..79b456a7a 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/SenpaiModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/SenpaiModel.java @@ -6,6 +6,7 @@ import net.minecraft.resources.ResourceLocation; import software.bernie.geckolib.model.GeoModel; public class SenpaiModel extends GeoModel { + @Override public ResourceLocation getAnimationResource(SenpaiEntity entity) { return ModUtils.loc("animations/senpai.animation.json"); @@ -20,5 +21,4 @@ public class SenpaiModel extends GeoModel { public ResourceLocation getTextureResource(SenpaiEntity entity) { return ModUtils.loc("textures/entity/senpai.png"); } - } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/SpeedboatModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/SpeedboatModel.java index 2ca639914..481b546a9 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/SpeedboatModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/SpeedboatModel.java @@ -14,7 +14,7 @@ public class SpeedboatModel extends GeoModel { @Override public ResourceLocation getModelResource(SpeedboatEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/speedboat.geo.json"); + return ModUtils.loc("geo/speedboat.geo.json"); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/TargetModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/TargetModel.java index 23de434cb..9c74b947a 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/TargetModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/TargetModel.java @@ -6,18 +6,19 @@ import net.minecraft.resources.ResourceLocation; import software.bernie.geckolib.model.GeoModel; public class TargetModel extends GeoModel { + @Override public ResourceLocation getAnimationResource(TargetEntity entity) { - return new ResourceLocation(ModUtils.MODID, "animations/target.animation.json"); + return ModUtils.loc("animations/target.animation.json"); } @Override public ResourceLocation getModelResource(TargetEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/target.geo.json"); + return ModUtils.loc("geo/target.geo.json"); } @Override public ResourceLocation getTextureResource(TargetEntity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/entity/target.png"); + return ModUtils.loc("textures/entity/target.png"); } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/TaserBulletProjectileModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/TaserBulletProjectileModel.java index 1170508fb..6c4f17127 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/TaserBulletProjectileModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/TaserBulletProjectileModel.java @@ -6,18 +6,19 @@ import net.minecraft.resources.ResourceLocation; import software.bernie.geckolib.model.GeoModel; public class TaserBulletProjectileModel extends GeoModel { - @Override - public ResourceLocation getAnimationResource(TaserBulletProjectileEntity entity) { - return null; - } - @Override - public ResourceLocation getModelResource(TaserBulletProjectileEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/taser_rod.geo.json"); - } + @Override + public ResourceLocation getAnimationResource(TaserBulletProjectileEntity entity) { + return null; + } - @Override - public ResourceLocation getTextureResource(TaserBulletProjectileEntity entity) { - return new ResourceLocation(ModUtils.MODID, "textures/entity/taser_rod.png"); - } + @Override + public ResourceLocation getModelResource(TaserBulletProjectileEntity entity) { + return ModUtils.loc("geo/taser_rod.geo.json"); + } + + @Override + public ResourceLocation getTextureResource(TaserBulletProjectileEntity entity) { + return ModUtils.loc("textures/entity/taser_rod.png"); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/WheelChairModel.java b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/WheelChairModel.java index 343a7b719..22f09743d 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/model/entity/WheelChairModel.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/model/entity/WheelChairModel.java @@ -15,7 +15,7 @@ public class WheelChairModel extends GeoModel { @Override public ResourceLocation getModelResource(WheelChairEntity entity) { - return new ResourceLocation(ModUtils.MODID, "geo/wheel_chair.geo.json"); + return ModUtils.loc("geo/wheel_chair.geo.json"); } @Override