generated from MrSphay/codex-agent-repository-kit
Decompile upstream Explosion Overhaul 0.2.3.0
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.vinlanx.explosionoverhaul;
|
||||
|
||||
import com.vinlanx.explosionoverhaul.ClientSoundHandler;
|
||||
import java.util.function.Supplier;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.network.NetworkEvent;
|
||||
|
||||
public class SuppressExplosionSoundPacket {
|
||||
private final float power;
|
||||
|
||||
public SuppressExplosionSoundPacket(float power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public static void encode(SuppressExplosionSoundPacket msg, FriendlyByteBuf buf) {
|
||||
buf.writeFloat(msg.power);
|
||||
}
|
||||
|
||||
public static SuppressExplosionSoundPacket decode(FriendlyByteBuf buf) {
|
||||
return new SuppressExplosionSoundPacket(buf.readFloat());
|
||||
}
|
||||
|
||||
public static void handle(SuppressExplosionSoundPacket msg, Supplier<NetworkEvent.Context> ctx) {
|
||||
ctx.get().enqueueWork(() -> DistExecutor.unsafeRunWhenOn((Dist)Dist.CLIENT, () -> () -> ClientSoundHandler.setSuppressVanillaExplosionSound(true, 10)));
|
||||
ctx.get().setPacketHandled(true);
|
||||
}
|
||||
|
||||
public float getPower() {
|
||||
return this.power;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user