diff --git a/src/main/java/com/atsuishio/superbwarfare/client/ClientSoundHandler.java b/src/main/java/com/atsuishio/superbwarfare/client/ClientSoundHandler.java new file mode 100644 index 000000000..98fae0819 --- /dev/null +++ b/src/main/java/com/atsuishio/superbwarfare/client/ClientSoundHandler.java @@ -0,0 +1,39 @@ +package com.atsuishio.superbwarfare.client; + +import com.atsuishio.superbwarfare.Mod; +import com.atsuishio.superbwarfare.entity.LoudlyEntity; +import com.atsuishio.superbwarfare.entity.vehicle.A10Entity; +import com.atsuishio.superbwarfare.entity.vehicle.Hpj11Entity; +import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity; +import com.atsuishio.superbwarfare.entity.vehicle.base.TrackEntity; +import net.minecraft.client.Minecraft; +import net.minecraft.world.entity.Entity; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; + +@OnlyIn(Dist.CLIENT) +public class ClientSoundHandler { + + public static void playClientSoundInstance(Entity entity) { + if (entity instanceof LoudlyEntity) { + Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySound(entity)); + Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySoundClose(entity)); + } else { + Mod.queueClientWork(60, () -> { + if (entity instanceof MobileVehicleEntity mobileVehicle) { + if (mobileVehicle instanceof TrackEntity) { + Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.TrackSound(mobileVehicle)); + } + if (mobileVehicle instanceof A10Entity) { + Minecraft.getInstance().getSoundManager().play(new VehicleFireSoundInstance.A10FireSound(mobileVehicle)); + } + if (mobileVehicle instanceof Hpj11Entity) { + Minecraft.getInstance().getSoundManager().play(new VehicleFireSoundInstance.HPJ11CloseFireSound(mobileVehicle)); + } + Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.EngineSound(mobileVehicle, mobileVehicle.getEngineSound())); + Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.SwimSound(mobileVehicle)); + } + }); + } + } +} diff --git a/src/main/resources/data/superbwarfare/recipe/xy_100_crafting.json b/src/main/resources/data/superbwarfare/recipe/xy_100_crafting.json deleted file mode 100644 index b23ef999d..000000000 --- a/src/main/resources/data/superbwarfare/recipe/xy_100_crafting.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "category": "misc", - "pattern": [ - "dbf", - "eee", - "hgh" - ], - "key": { - "b": { - "item": "superbwarfare:light_armament_module" - }, - "d": { - "item": "superbwarfare:large_battery_pack" - }, - "e": { - "item": "superbwarfare:cemented_carbide_block" - }, - "f": { - "item": "superbwarfare:heavy_armament_module" - }, - "g": { - "item": "superbwarfare:large_motor" - }, - "h": { - "item": "superbwarfare:track" - } - }, - "result": { - "id": "superbwarfare:container", - "components": { - "minecraft:block_entity_data": { - "id": "superbwarfare:container", - "EntityType": "superbwarfare:yx_100" - } - } - } -} \ No newline at end of file