2022-11-19 12:16:58 +01:00
|
|
|
package dev.tilera.auracore.network;
|
|
|
|
|
|
|
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
|
|
|
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
|
|
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
2023-01-08 13:52:59 +01:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2022-11-19 12:16:58 +01:00
|
|
|
import net.minecraft.client.Minecraft;
|
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import thaumcraft.client.fx.bolt.FXLightningBolt;
|
|
|
|
|
|
|
|
public class NodeZapPacketHandler implements IMessageHandler<NodeZapPacket, IMessage> {
|
|
|
|
|
2023-01-08 13:52:59 +01:00
|
|
|
@SideOnly(Side.CLIENT)
|
2022-11-19 12:16:58 +01:00
|
|
|
@Override
|
|
|
|
public IMessage onMessage(NodeZapPacket message, MessageContext ctx) {
|
|
|
|
World world = Minecraft.getMinecraft().theWorld;
|
|
|
|
Entity targetedEntity = world.getEntityByID(message.entityID);
|
|
|
|
if (targetedEntity != null) {
|
|
|
|
FXLightningBolt bolt = new FXLightningBolt(world, message.x, message.y, message.z, targetedEntity.posX, targetedEntity.posY, targetedEntity.posZ, world.rand.nextLong(), 10, 2.0f, 5);
|
|
|
|
bolt.defaultFractal();
|
|
|
|
bolt.setType(3);
|
|
|
|
bolt.finalizeBolt();
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|