generated from MrSphay/codex-agent-repository-kit
Decompile upstream Explosion Overhaul 0.2.3.0
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.vinlanx.explosionoverhaul;
|
||||
|
||||
import com.vinlanx.explosionoverhaul.ScanInfoHUD;
|
||||
import java.util.function.Supplier;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraftforge.network.NetworkEvent;
|
||||
|
||||
public class ScanInfoPacket {
|
||||
private final boolean show;
|
||||
|
||||
public ScanInfoPacket(boolean show) {
|
||||
this.show = show;
|
||||
}
|
||||
|
||||
public void encode(FriendlyByteBuf buf) {
|
||||
buf.writeBoolean(this.show);
|
||||
}
|
||||
|
||||
public static ScanInfoPacket decode(FriendlyByteBuf buf) {
|
||||
boolean show = buf.readBoolean();
|
||||
return new ScanInfoPacket(show);
|
||||
}
|
||||
|
||||
public void handle(Supplier<NetworkEvent.Context> ctx) {
|
||||
ctx.get().enqueueWork(() -> ScanInfoHUD.setVisible(this.show));
|
||||
ctx.get().setPacketHandled(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user