Scaffold NeoForge port
Some checks failed
Build / build (push) Failing after 13s

This commit is contained in:
MrSphay
2026-05-04 12:09:37 +02:00
parent 0b99b2130a
commit dcd08a876e
559 changed files with 19697 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
/*
* Decompiled with CFR 0.152.
*/
package com.vinlanx.explosionoverhaul;
import com.vinlanx.explosionoverhaul.client.ConcussionAudioEffect;
import java.util.function.Supplier;
import net.minecraft.network.FriendlyByteBuf;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.fml.DistExecutor;
import net.neoforged.neoforge.network.NetworkEvent;
public class StartConcussionPacket {
private final float power;
private final double distance;
private final boolean hasDirectLineOfSight;
private final boolean explosionInCave;
public StartConcussionPacket(float power, double distance, boolean hasDirectLineOfSight, boolean explosionInCave) {
this.power = power;
this.distance = distance;
this.hasDirectLineOfSight = hasDirectLineOfSight;
this.explosionInCave = explosionInCave;
}
public StartConcussionPacket(FriendlyByteBuf buf) {
this.power = buf.readFloat();
this.distance = buf.readDouble();
this.hasDirectLineOfSight = buf.readBoolean();
this.explosionInCave = buf.readBoolean();
}
public void encode(FriendlyByteBuf buf) {
buf.writeFloat(this.power);
buf.writeDouble(this.distance);
buf.writeBoolean(this.hasDirectLineOfSight);
buf.writeBoolean(this.explosionInCave);
}
public static StartConcussionPacket decode(FriendlyByteBuf buf) {
return new StartConcussionPacket(buf);
}
public float getPower() {
return this.power;
}
public double getDistance() {
return this.distance;
}
public boolean hasDirectLineOfSight() {
return this.hasDirectLineOfSight;
}
public boolean isExplosionInCave() {
return this.explosionInCave;
}
public static void handle(StartConcussionPacket packet, Supplier<NetworkEvent.Context> ctxSupplier) {
NetworkEvent.Context ctx = ctxSupplier.get();
ctx.enqueueWork(() -> DistExecutor.unsafeRunWhenOn((Dist)Dist.CLIENT, () -> () -> ConcussionAudioEffect.start(packet.power, packet.distance, packet.hasDirectLineOfSight, packet.isExplosionInCave())));
ctx.setPacketHandled(true);
}
}