diff --git a/src/main/java/net/mcreator/superbwarfare/client/model/item/SentinelItemModel.java b/src/main/java/net/mcreator/superbwarfare/client/model/item/SentinelItemModel.java index 27a034572..86bff727c 100644 --- a/src/main/java/net/mcreator/superbwarfare/client/model/item/SentinelItemModel.java +++ b/src/main/java/net/mcreator/superbwarfare/client/model/item/SentinelItemModel.java @@ -73,6 +73,7 @@ public class SentinelItemModel extends GeoModel { CoreGeoBone holo = getAnimationProcessor().getBone("holo"); holo.setPosY(0.09f); + stack.getOrCreateTag().putBoolean("HoloHidden", !(gun.getPosX() > 2.4)); shen.setPosX((float) (0.95f * ClientEventHandler.recoilHorizon * fpz * fp)); shen.setPosY((float) (0.4f * fp + 0.44f * fr)); diff --git a/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java b/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java index 8db81b4da..514ce7a9a 100644 --- a/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java +++ b/src/main/java/net/mcreator/superbwarfare/event/ClientEventHandler.java @@ -18,7 +18,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.player.LocalPlayer; import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; import net.minecraft.util.Mth; @@ -281,11 +280,6 @@ public class ClientEventHandler { if (stack.getItem() == ModItems.DEVOTION.get() && (stack.getOrCreateTag().getBoolean("is_normal_reloading") || stack.getOrCreateTag().getBoolean("is_empty_reloading"))) { customRpm = 0; } - - double block_range = player.getEyePosition().distanceTo((Vec3.atLowerCornerOf(player.level().clip( new ClipContext(player.getEyePosition(), player.getEyePosition().add(new Vec3(0, -1 , 0).scale(10)), - ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, player)).getBlockPos()))); - - player.displayClientMessage(Component.literal(new java.text.DecimalFormat("##.#").format(block_range)), true); } public static void shootClient(Player player) { @@ -416,6 +410,8 @@ public class ClientEventHandler { if (stack.is(ModTags.Items.HAS_SHELL_EFFECT)) { if (stack.is(ModTags.Items.SHOTGUN)) { player.playSound(ModSounds.SHELL_CASING_SHOTGUN.get(), (float) Math.max(0.75 - 0.12 * shooterHeight, 0), 1); + } else if (stack.is(ModTags.Items.SNIPER_RIFLE)) { + player.playSound(ModSounds.SHELL_CASING_50CAL.get(), (float) Math.max(1 - 0.15 * shooterHeight, 0), 1); } else { player.playSound(ModSounds.SHELL_CASING_NORMAL.get(), (float) Math.max(1.5 - 0.2 * shooterHeight, 0), 1); } diff --git a/src/main/java/net/mcreator/superbwarfare/event/GunEventHandler.java b/src/main/java/net/mcreator/superbwarfare/event/GunEventHandler.java index 57c58b0c8..9537f59db 100644 --- a/src/main/java/net/mcreator/superbwarfare/event/GunEventHandler.java +++ b/src/main/java/net/mcreator/superbwarfare/event/GunEventHandler.java @@ -183,6 +183,8 @@ public class GunEventHandler { ModUtils.queueServerWork((int) (stack.getOrCreateTag().getDouble("bolt_action_time") / 2 + 1.5 * shooterHeight), () -> { if (stack.is(ModTags.Items.SHOTGUN)) { SoundTool.playLocalSound(serverPlayer, ModSounds.SHELL_CASING_SHOTGUN.get(), (float) Math.max(0.75 - 0.12 * shooterHeight, 0), 1); + } else if (stack.is(ModTags.Items.SNIPER_RIFLE)) { + SoundTool.playLocalSound(serverPlayer, ModSounds.SHELL_CASING_50CAL.get(), (float) Math.max(1 - 0.15 * shooterHeight, 0), 1); } else { SoundTool.playLocalSound(serverPlayer,ModSounds.SHELL_CASING_NORMAL.get(), (float) Math.max(1.5 - 0.2 * shooterHeight, 0), 1); } @@ -734,6 +736,19 @@ public class GunEventHandler { SoundEvent sound1p = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation(ModUtils.MODID, name + "_prepare_empty")); if (sound1p != null && player instanceof ServerPlayer serverPlayer) { SoundTool.playLocalSound(serverPlayer, sound1p, 10f, 1f); + + double shooterHeight = player.getEyePosition().distanceTo((Vec3.atLowerCornerOf(player.level().clip( new ClipContext(player.getEyePosition(), player.getEyePosition().add(new Vec3(0, -1 , 0).scale(10)), + ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, player)).getBlockPos()))); + + ModUtils.queueServerWork((int) (stack.getOrCreateTag().getDouble("prepare_empty") / 2 + 3 + 1.5 * shooterHeight), () -> { + if (stack.is(ModTags.Items.SHOTGUN)) { + SoundTool.playLocalSound(serverPlayer, ModSounds.SHELL_CASING_SHOTGUN.get(), (float) Math.max(0.75 - 0.12 * shooterHeight, 0), 1); + } else if (stack.is(ModTags.Items.SNIPER_RIFLE)) { + SoundTool.playLocalSound(serverPlayer, ModSounds.SHELL_CASING_50CAL.get(), (float) Math.max(1 - 0.15 * shooterHeight, 0), 1); + } else { + SoundTool.playLocalSound(serverPlayer,ModSounds.SHELL_CASING_NORMAL.get(), (float) Math.max(1.5 - 0.2 * shooterHeight, 0), 1); + } + }); } } } @@ -751,6 +766,19 @@ public class GunEventHandler { SoundEvent sound1p = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation(ModUtils.MODID, name + "_prepare_load")); if (sound1p != null && player instanceof ServerPlayer serverPlayer) { SoundTool.playLocalSound(serverPlayer, sound1p, 10f, 1f); + + double shooterHeight = player.getEyePosition().distanceTo((Vec3.atLowerCornerOf(player.level().clip( new ClipContext(player.getEyePosition(), player.getEyePosition().add(new Vec3(0, -1 , 0).scale(10)), + ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, player)).getBlockPos()))); + + ModUtils.queueServerWork((int) (8 + 1.5 * shooterHeight), () -> { + if (stack.is(ModTags.Items.SHOTGUN)) { + SoundTool.playLocalSound(serverPlayer, ModSounds.SHELL_CASING_SHOTGUN.get(), (float) Math.max(0.75 - 0.12 * shooterHeight, 0), 1); + } else if (stack.is(ModTags.Items.SNIPER_RIFLE)) { + SoundTool.playLocalSound(serverPlayer, ModSounds.SHELL_CASING_50CAL.get(), (float) Math.max(1 - 0.15 * shooterHeight, 0), 1); + } else { + SoundTool.playLocalSound(serverPlayer,ModSounds.SHELL_CASING_NORMAL.get(), (float) Math.max(1.5 - 0.2 * shooterHeight, 0), 1); + } + }); } } } @@ -785,6 +813,15 @@ public class GunEventHandler { SoundEvent sound1p = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation(ModUtils.MODID, name + "_end")); if (sound1p != null && player instanceof ServerPlayer serverPlayer) { SoundTool.playLocalSound(serverPlayer, sound1p, 10f, 1f); + + double shooterHeight = player.getEyePosition().distanceTo((Vec3.atLowerCornerOf(player.level().clip( new ClipContext(player.getEyePosition(), player.getEyePosition().add(new Vec3(0, -1 , 0).scale(10)), + ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, player)).getBlockPos()))); + + if (stack.is(ModItems.MARLIN.get())) { + ModUtils.queueServerWork((int) (5 + 1.5 * shooterHeight), () -> { + SoundTool.playLocalSound(serverPlayer,ModSounds.SHELL_CASING_NORMAL.get(), (float) Math.max(1.5 - 0.2 * shooterHeight, 0), 1); + }); + } } } } diff --git a/src/main/java/net/mcreator/superbwarfare/init/ModSounds.java b/src/main/java/net/mcreator/superbwarfare/init/ModSounds.java index 991652d99..5985c15a8 100644 --- a/src/main/java/net/mcreator/superbwarfare/init/ModSounds.java +++ b/src/main/java/net/mcreator/superbwarfare/init/ModSounds.java @@ -313,4 +313,5 @@ public class ModSounds { public static final RegistryObject EDIT = REGISTRY.register("edit", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "edit"))); public static final RegistryObject SHELL_CASING_NORMAL = REGISTRY.register("shell_casing_normal", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "shell_casing_normal"))); public static final RegistryObject SHELL_CASING_SHOTGUN = REGISTRY.register("shell_casing_shotgun", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "shell_casing_shotgun"))); + public static final RegistryObject SHELL_CASING_50CAL = REGISTRY.register("shell_casing_50cal", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "shell_casing_50cal"))); } diff --git a/src/main/resources/assets/superbwarfare/animations/m870.animation.json b/src/main/resources/assets/superbwarfare/animations/m870.animation.json index 12ceedec1..429e63de7 100644 --- a/src/main/resources/assets/superbwarfare/animations/m870.animation.json +++ b/src/main/resources/assets/superbwarfare/animations/m870.animation.json @@ -410,6 +410,21 @@ "0.0": { "vector": [0, 0, 0] }, + "0.025": { + "vector": [0, 0, 0] + }, + "0.05": { + "vector": [0, 0, 0] + }, + "0.1": { + "vector": [0, 0, 0] + }, + "0.275": { + "vector": [0, 200, 0] + }, + "0.3": { + "vector": [0, 0, 0] + }, "0.425": { "vector": [-72.17961, -6.70014, 19.9484] }, @@ -460,6 +475,39 @@ "0.0": { "vector": [0, 0, 0] }, + "0.025": { + "vector": [0, 0, 0] + }, + "0.05": { + "vector": [0, 1.3, -0.2] + }, + "0.1": { + "vector": [0, 1.3, 1.5] + }, + "0.125": { + "vector": [-3.02654, 2.16069, 1.62913] + }, + "0.15": { + "vector": [-5.37048, 2.22716, 1.20688] + }, + "0.175": { + "vector": [-7.70182, 1.8835, 1.28384] + }, + "0.2": { + "vector": [-9.97823, 1.2534, 1.84468] + }, + "0.225": { + "vector": [-12.48333, 0.14037, 2.30914] + }, + "0.25": { + "vector": [-14.74357, -1.21642, 3.06307] + }, + "0.275": { + "vector": [-1508.57, 2.02, 2.78] + }, + "0.3": { + "vector": [0, 0, 0] + }, "0.425": { "vector": [9.31908, -6.8218, 3.01452] }, @@ -526,9 +574,15 @@ }, "scale": { "0.0": { + "vector": [0, 0, 0] + }, + "0.05": { "vector": [1, 1, 1] }, - "0.025": { + "0.225": { + "vector": [1, 1, 1] + }, + "0.25": { "vector": [0, 0, 0] }, "0.525": { @@ -1363,11 +1417,6 @@ } } } - }, - "sound_effects": { - "0.0": { - "effect": "m_870_bolt" - } } }, "animation.m870.finish": { diff --git a/src/main/resources/assets/superbwarfare/animations/marlin.animation.json b/src/main/resources/assets/superbwarfare/animations/marlin.animation.json index 81d9d14f5..6822738f9 100644 --- a/src/main/resources/assets/superbwarfare/animations/marlin.animation.json +++ b/src/main/resources/assets/superbwarfare/animations/marlin.animation.json @@ -1225,6 +1225,96 @@ "vector": [0, 0, 0] } } + }, + "bullet": { + "rotation": { + "0.0": { + "vector": [0, 0, 0] + }, + "0.0833": { + "vector": [0, 0, 0] + }, + "0.1": { + "vector": [0, 0, 0] + }, + "0.15": { + "vector": [0, 0, 0] + }, + "0.3167": { + "vector": [0, 200, 0] + }, + "0.35": { + "vector": [0, 0, 0] + } + }, + "position": { + "0.0": { + "vector": [0, 0, 0] + }, + "0.0833": { + "vector": [0, 0, 0] + }, + "0.1": { + "vector": [0, 0, -0.2] + }, + "0.15": { + "vector": [0, 0, 1.5] + }, + "0.1833": { + "vector": [-2.34434, 0.88942, 2.40796] + }, + "0.2": { + "vector": [-4.29619, 1.38606, 3.12538] + }, + "0.2167": { + "vector": [-5.92165, 1.64297, 3.90861] + }, + "0.2333": { + "vector": [-7.53146, 1.62292, 4.64291] + }, + "0.25": { + "vector": [-9.00843, 1.30099, 5.30362] + }, + "0.2667": { + "vector": [-10.27409, 0.81677, 6.27719] + }, + "0.2833": { + "vector": [-11.60524, 0.00966, 7.71722] + }, + "0.3": { + "vector": [-12.6657, -1.50606, 9.17722] + }, + "0.3333": { + "vector": [-1508.57, 2.02, 2.78] + }, + "0.35": { + "vector": [0, 0, 0] + } + }, + "scale": { + "0.1": { + "vector": [1, 1, 1] + }, + "0.2833": { + "vector": [1, 1, 1] + }, + "0.3": { + "vector": [0, 0, 0] + } + } + }, + "bullethead": { + "scale": { + "0.0": { + "vector": [0, 0, 0] + }, + "0.3333": { + "vector": [0, 0, 0] + }, + "0.3417": { + "vector": [1, 1, 1] + } + } } } } diff --git a/src/main/resources/assets/superbwarfare/sounds.json b/src/main/resources/assets/superbwarfare/sounds.json index ee282e73b..669232672 100644 --- a/src/main/resources/assets/superbwarfare/sounds.json +++ b/src/main/resources/assets/superbwarfare/sounds.json @@ -2213,5 +2213,29 @@ "stream": false } ] + }, + "shell_casing_50cal": { + "sounds": [ + { + "name": "superbwarfare:shells/shell_casing_50cal_1", + "stream": false + }, + { + "name": "superbwarfare:shells/shell_casing_50cal_2", + "stream": false + }, + { + "name": "superbwarfare:shells/shell_casing_50cal_3", + "stream": false + }, + { + "name": "superbwarfare:shells/shell_casing_50cal_4", + "stream": false + }, + { + "name": "superbwarfare:shells/shell_casing_50cal_5", + "stream": false + } + ] } } \ No newline at end of file diff --git a/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_1.ogg b/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_1.ogg new file mode 100644 index 000000000..6d2d8c46e Binary files /dev/null and b/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_1.ogg differ diff --git a/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_2.ogg b/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_2.ogg new file mode 100644 index 000000000..f3c72583a Binary files /dev/null and b/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_2.ogg differ diff --git a/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_3.ogg b/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_3.ogg new file mode 100644 index 000000000..1dc35d735 Binary files /dev/null and b/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_3.ogg differ diff --git a/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_4.ogg b/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_4.ogg new file mode 100644 index 000000000..65eb72b54 Binary files /dev/null and b/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_4.ogg differ diff --git a/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_5.ogg b/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_5.ogg new file mode 100644 index 000000000..c19f3e86c Binary files /dev/null and b/src/main/resources/assets/superbwarfare/sounds/shells/shell_casing_50cal_5.ogg differ