Ready to go!
This commit is contained in:
parent
7c96dee9dc
commit
7b6e540654
5 changed files with 38 additions and 114 deletions
|
|
@ -6,6 +6,7 @@ import net.minecraft.core.particles.ParticleTypes;
|
|||
import net.minecraftforge.fml.LogicalSide;
|
||||
import net.minecraftforge.network.NetworkEvent;
|
||||
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ClientExplosionParticlePacket {
|
||||
|
|
@ -15,14 +16,17 @@ public class ClientExplosionParticlePacket {
|
|||
double g = 0.0D;
|
||||
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
|
||||
ctx.get().enqueueWork(() -> {
|
||||
if (Minecraft.getInstance().level != null) {
|
||||
Minecraft.getInstance().level.addParticle(
|
||||
ParticleTypes.EXPLOSION,
|
||||
(double) pkt.pos.getX() + 0.5D,
|
||||
(double) pkt.pos.getY() + 0.5D,
|
||||
(double) pkt.pos.getZ() + 0.5D,
|
||||
e,f,g
|
||||
);
|
||||
try {
|
||||
if (Minecraft.getInstance().level != null) {
|
||||
Minecraft.getInstance().level.addParticle(
|
||||
ParticleTypes.EXPLOSION,
|
||||
(double) pkt.pos.getX() + 0.5D,
|
||||
(double) pkt.pos.getY() + 0.5D,
|
||||
(double) pkt.pos.getZ() + 0.5D,
|
||||
e, f, g
|
||||
);
|
||||
}
|
||||
} catch (NoSuchElementException ignored) {
|
||||
}
|
||||
});
|
||||
ctx.get().setPacketHandled(true);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.oitsjustjose.charged_explosives.common.network.PreviewExplosionPacket
|
|||
import net.minecraftforge.fml.LogicalSide;
|
||||
import net.minecraftforge.network.NetworkEvent;
|
||||
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ClientPreviewExplosionPacket {
|
||||
|
|
@ -12,9 +13,15 @@ public class ClientPreviewExplosionPacket {
|
|||
if (ctx.get().getDirection().getReceptionSide() == LogicalSide.CLIENT) {
|
||||
ctx.get().enqueueWork(() -> {
|
||||
if (pkt.action.equals(PreviewExplosionPacket.ACTION_ADD)) {
|
||||
ClientProxy.bdRenderer.addExplosion(pkt.corners);
|
||||
try {
|
||||
ClientProxy.bdRenderer.addExplosion(pkt.corners);
|
||||
} catch (NoSuchElementException ignored) {
|
||||
}
|
||||
} else if (pkt.action.equals(PreviewExplosionPacket.ACTION_REMOVE)) {
|
||||
ClientProxy.bdRenderer.removeExplosion(pkt.corners);
|
||||
try {
|
||||
ClientProxy.bdRenderer.removeExplosion(pkt.corners);
|
||||
} catch (NoSuchElementException ignored) {
|
||||
}
|
||||
}
|
||||
});
|
||||
ctx.get().setPacketHandled(true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue