Search in sources :

Example 31 with AMDataWriter

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());
    }
}
Also used : AMDataWriter(am2.network.AMDataWriter)

Example 32 with AMDataWriter

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;
}
Also used : AMDataWriter(am2.network.AMDataWriter)

Example 33 with AMDataWriter

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;
}
Also used : AMDataWriter(am2.network.AMDataWriter)

Example 34 with AMDataWriter

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;
}
Also used : AMDataWriter(am2.network.AMDataWriter)

Example 35 with AMDataWriter

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;
}
Also used : AMDataWriter(am2.network.AMDataWriter)

Aggregations

AMDataWriter (am2.network.AMDataWriter)38 ItemStack (net.minecraft.item.ItemStack)6 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 AMVector3 (am2.api.math.AMVector3)3 TileEntity (net.minecraft.tileentity.TileEntity)3 SkillLearnedEvent (am2.api.events.SkillLearnedEvent)2 ISpellShape (am2.api.spell.component.interfaces.ISpellShape)2 KeystoneCombination (am2.items.ItemKeystone.KeystoneCombination)2 AMDataReader (am2.network.AMDataReader)2 ExtendedProperties (am2.playerextensions.ExtendedProperties)2 KeyValuePair (am2.utility.KeyValuePair)2 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)2 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)2 SpellCastingEvent (am2.api.events.SpellCastingEvent)1 IPowerNode (am2.api.power.IPowerNode)1 ItemSpellBase (am2.api.spell.ItemSpellBase)1 ISpellComponent (am2.api.spell.component.interfaces.ISpellComponent)1 ISpellModifier (am2.api.spell.component.interfaces.ISpellModifier)1 SkillPointTypes (am2.api.spell.enums.SkillPointTypes)1 SpellCastResult (am2.api.spell.enums.SpellCastResult)1