This commit is contained in:
17146 2025-05-18 20:01:10 +08:00 committed by Light_Quanta
parent cb8cba7d21
commit 44125e8626
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
3 changed files with 28 additions and 36 deletions

View file

@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.client.renderer.block;
import com.atsuishio.superbwarfare.block.CreativeChargingStationBlock; import com.atsuishio.superbwarfare.block.CreativeChargingStationBlock;
import com.atsuishio.superbwarfare.block.entity.CreativeChargingStationBlockEntity; 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 com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
@ -41,7 +41,7 @@ public class CreativeChargingStationBlockEntityRenderer implements BlockEntityRe
var alpha = 0.2f; var alpha = 0.2f;
var builder = bufferSource.getBuffer(CustomRenderType.BLOCK_OVERLAY); var builder = bufferSource.getBuffer(ModRenderTypes.BLOCK_OVERLAY);
var m4f = poseStack.last().pose(); var m4f = poseStack.last().pose();
// east // east

View file

@ -354,7 +354,7 @@ public class C4Entity extends Entity implements GeoEntity, OwnableEntity {
return false; return false;
} else { } else {
Entity entity = this.getOwner(); Entity entity = this.getOwner();
return entity == null || !entity.isPassengerOfSameVehicle(pTarget); return entity == null || (entity == pTarget && this.tickCount > 2) || !entity.isPassengerOfSameVehicle(pTarget);
} }
} }

View file

@ -1,14 +1,5 @@
package com.atsuishio.superbwarfare.mixins; 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.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.ModKeyMappings; import com.atsuishio.superbwarfare.init.ModKeyMappings;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -78,28 +69,29 @@ public abstract class ClientPacketListenerMixin {
vehicle.entityIndexOverride = null; vehicle.entityIndexOverride = null;
} }
@Inject(method = "postAddEntitySoundInstance(Lnet/minecraft/world/entity/Entity;)V", at = @At("RETURN")) // TODO what is this
private void postAddEntitySoundInstance(Entity pEntity, CallbackInfo ci) { // @Inject(method = "postAddEntitySoundInstance(Lnet/minecraft/world/entity/Entity;)V", at = @At("RETURN"))
if (pEntity instanceof LoudlyEntity) { // private void postAddEntitySoundInstance(Entity pEntity, CallbackInfo ci) {
Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySound(pEntity)); // if (pEntity instanceof LoudlyEntity) {
Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySoundClose(pEntity)); // Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySound(pEntity));
} else { // Minecraft.getInstance().getSoundManager().play(new LoudlyEntitySoundInstance.EntitySoundClose(pEntity));
Mod.queueClientWork(30, () -> { // } else {
if (pEntity instanceof MobileVehicleEntity mobileVehicle) { // Mod.queueClientWork(30, () -> {
if (mobileVehicle instanceof TrackEntity) { // if (pEntity instanceof MobileVehicleEntity mobileVehicle) {
Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.TrackSound(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 A10Entity) {
} // Minecraft.getInstance().getSoundManager().play(new VehicleFireSoundInstance.A10FireSound(mobileVehicle));
if (mobileVehicle instanceof Hpj11Entity) { // }
Minecraft.getInstance().getSoundManager().play(new VehicleFireSoundInstance.HPJ11CloseFireSound(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)); // Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.EngineSound(mobileVehicle, mobileVehicle.getEngineSound()));
} // Minecraft.getInstance().getSoundManager().play(new VehicleSoundInstance.SwimSound(mobileVehicle));
}); // }
} // });
} // }
// }
} }