From 44125e86268edbae7921e297d8134203fddb9f1c Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Sun, 18 May 2025 20:01:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4c4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...iveChargingStationBlockEntityRenderer.java | 4 +- .../entity/projectile/C4Entity.java | 2 +- .../mixins/ClientPacketListenerMixin.java | 58 ++++++++----------- 3 files changed, 28 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/client/renderer/block/CreativeChargingStationBlockEntityRenderer.java b/src/main/java/com/atsuishio/superbwarfare/client/renderer/block/CreativeChargingStationBlockEntityRenderer.java index 848d2379a..46085eebb 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/renderer/block/CreativeChargingStationBlockEntityRenderer.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/renderer/block/CreativeChargingStationBlockEntityRenderer.java @@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.client.renderer.block; import com.atsuishio.superbwarfare.block.CreativeChargingStationBlock; import com.atsuishio.superbwarfare.block.entity.CreativeChargingStationBlockEntity; -import com.atsuishio.superbwarfare.client.renderer.CustomRenderType; +import com.atsuishio.superbwarfare.client.renderer.ModRenderTypes; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; @@ -41,7 +41,7 @@ public class CreativeChargingStationBlockEntityRenderer implements BlockEntityRe var alpha = 0.2f; - var builder = bufferSource.getBuffer(CustomRenderType.BLOCK_OVERLAY); + var builder = bufferSource.getBuffer(ModRenderTypes.BLOCK_OVERLAY); var m4f = poseStack.last().pose(); // east diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/C4Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/C4Entity.java index 151b7165e..614932286 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/C4Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/C4Entity.java @@ -354,7 +354,7 @@ public class C4Entity extends Entity implements GeoEntity, OwnableEntity { return false; } else { Entity entity = this.getOwner(); - return entity == null || !entity.isPassengerOfSameVehicle(pTarget); + return entity == null || (entity == pTarget && this.tickCount > 2) || !entity.isPassengerOfSameVehicle(pTarget); } } diff --git a/src/main/java/com/atsuishio/superbwarfare/mixins/ClientPacketListenerMixin.java b/src/main/java/com/atsuishio/superbwarfare/mixins/ClientPacketListenerMixin.java index 1a3141601..052cd040f 100644 --- a/src/main/java/com/atsuishio/superbwarfare/mixins/ClientPacketListenerMixin.java +++ b/src/main/java/com/atsuishio/superbwarfare/mixins/ClientPacketListenerMixin.java @@ -1,14 +1,5 @@ package com.atsuishio.superbwarfare.mixins; -import com.atsuishio.superbwarfare.Mod; -import com.atsuishio.superbwarfare.client.LoudlyEntitySoundInstance; -import com.atsuishio.superbwarfare.client.VehicleFireSoundInstance; -import com.atsuishio.superbwarfare.client.VehicleSoundInstance; -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 com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; import com.atsuishio.superbwarfare.init.ModKeyMappings; import net.minecraft.client.Minecraft; @@ -78,28 +69,29 @@ public abstract class ClientPacketListenerMixin { vehicle.entityIndexOverride = null; } - @Inject(method = "postAddEntitySoundInstance(Lnet/minecraft/world/entity/Entity;)V", at = @At("RETURN")) - private void postAddEntitySoundInstance(Entity pEntity, CallbackInfo ci) { - if (pEntity instanceof LoudlyEntity) { - Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySound(pEntity)); - Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySoundClose(pEntity)); - } else { - Mod.queueClientWork(30, () -> { - if (pEntity 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)); - } - }); - } - } + // TODO what is this +// @Inject(method = "postAddEntitySoundInstance(Lnet/minecraft/world/entity/Entity;)V", at = @At("RETURN")) +// private void postAddEntitySoundInstance(Entity pEntity, CallbackInfo ci) { +// if (pEntity instanceof LoudlyEntity) { +// Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySound(pEntity)); +// Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySoundClose(pEntity)); +// } else { +// Mod.queueClientWork(30, () -> { +// if (pEntity 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)); +// } +// }); +// } +// } }