generated from MrSphay/codex-agent-repository-kit
Decompile upstream Explosion Overhaul 0.2.3.0
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.vinlanx.explosionoverhaul;
|
||||
|
||||
import com.vinlanx.explosionoverhaul.client.Blur;
|
||||
import java.util.function.Supplier;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.network.NetworkEvent;
|
||||
|
||||
public class BlurTestPacket {
|
||||
private final int durationSeconds;
|
||||
|
||||
public BlurTestPacket(int durationSeconds) {
|
||||
this.durationSeconds = durationSeconds;
|
||||
}
|
||||
|
||||
public static void encode(BlurTestPacket msg, FriendlyByteBuf buf) {
|
||||
buf.writeInt(msg.durationSeconds);
|
||||
}
|
||||
|
||||
public static BlurTestPacket decode(FriendlyByteBuf buf) {
|
||||
return new BlurTestPacket(buf.readInt());
|
||||
}
|
||||
|
||||
public static void handle(BlurTestPacket msg, Supplier<NetworkEvent.Context> ctxSupplier) {
|
||||
NetworkEvent.Context ctx = ctxSupplier.get();
|
||||
ctx.enqueueWork(() -> BlurTestPacket.handleClient(msg));
|
||||
ctx.setPacketHandled(true);
|
||||
}
|
||||
|
||||
@OnlyIn(value=Dist.CLIENT)
|
||||
private static void handleClient(BlurTestPacket msg) {
|
||||
Blur.start(msg.durationSeconds);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user