use of am2.network.AMDataWriter in project ArsMagica2 by Mithion.
the class ParticleManagerServer method BoltFromEntityToEntity.
public void BoltFromEntityToEntity(World world, Entity caster, Entity source, Entity target, int damage, int type, int color) {
if (!world.isRemote) {
//send a packet to all clients telling them to spawn this lightning bolt!
AMDataWriter writer = new AMDataWriter();
//what kind of bolt are we doing?
writer.add(PKT_BOLT_ENT_ENT);
writer.add(caster.getEntityId());
writer.add(source.getEntityId());
writer.add(target.getEntityId());
writer.add(damage);
writer.add(type);
writer.add(color);
AMNetHandler.INSTANCE.sendPacketToAllClientsNear(world.provider.dimensionId, caster.posX, caster.posY, caster.posZ, 32, AMPacketIDs.PARTICLE_SPAWN_SPECIAL, writer.generate());
}
}
use of am2.network.AMDataWriter in project ArsMagica2 by Mithion.
the class ParticleManagerServer method spawn.
public Object spawn(World world, String name, double x, double y, double z, Entity target) {
if (!world.isRemote) {
AMDataWriter writer = new AMDataWriter();
writer.add(PKT_ARC_PT_ENT);
writer.add(name);
writer.add(x);
writer.add(y);
writer.add(z);
writer.add(target.getEntityId());
AMNetHandler.INSTANCE.sendPacketToAllClientsNear(world.provider.dimensionId, x, y, z, 32, AMPacketIDs.PARTICLE_SPAWN_SPECIAL, writer.generate());
}
return null;
}
use of am2.network.AMDataWriter in project ArsMagica2 by Mithion.
the class ParticleManagerServer method BeamFromEntityToEntity.
public Object BeamFromEntityToEntity(World world, Entity caster, Entity source, Entity target, int damage, int color) {
if (!world.isRemote) {
//send a packet to all clients telling them to spawn this beam!
AMDataWriter writer = new AMDataWriter();
//what kind of beam are we doing?
writer.add(PKT_BEAM_ENT_ENT);
writer.add(caster.getEntityId());
writer.add(source.getEntityId());
writer.add(target.getEntityId());
writer.add(damage);
writer.add(color);
AMNetHandler.INSTANCE.sendPacketToAllClientsNear(world.provider.dimensionId, caster.posX, caster.posY, caster.posZ, 32, AMPacketIDs.PARTICLE_SPAWN_SPECIAL, writer.generate());
}
return null;
}
use of am2.network.AMDataWriter in project ArsMagica2 by Mithion.
the class ParticleManagerServer method spawn.
public Object spawn(World world, String name, double x, double y, double z, double targetX, double targetY, double targetZ) {
if (!world.isRemote) {
AMDataWriter writer = new AMDataWriter();
writer.add(PKT_ARC_PT_PT);
writer.add(name);
writer.add(x);
writer.add(y);
writer.add(z);
writer.add(targetX);
writer.add(targetY);
writer.add(targetZ);
AMNetHandler.INSTANCE.sendPacketToAllClientsNear(world.provider.dimensionId, x, y, z, 32, AMPacketIDs.PARTICLE_SPAWN_SPECIAL, writer.generate());
}
return null;
}
use of am2.network.AMDataWriter in project ArsMagica2 by Mithion.
the class ParticleManagerServer method BeamFromPointToPoint.
public Object BeamFromPointToPoint(World world, double startX, double startY, double startZ, double endX, double endY, double endZ, int color) {
if (!world.isRemote) {
//send a packet to all clients telling them to spawn this beam!
AMDataWriter writer = new AMDataWriter();
//what kind of beam are we doing?
writer.add(PKT_BEAM_PT_PT);
writer.add(startX);
writer.add(startY);
writer.add(startZ);
writer.add(endX);
writer.add(endY);
writer.add(endZ);
writer.add(color);
AMNetHandler.INSTANCE.sendPacketToAllClientsNear(world.provider.dimensionId, startX, startY, startZ, 32, AMPacketIDs.PARTICLE_SPAWN_SPECIAL, writer.generate());
}
return null;
}
Aggregations