use of net.minecraft.entity.EntityLivingBase in project ArsMagica2 by Mithion.
the class EntitySpellProjectile method getShootingEntity.
private EntityLivingBase getShootingEntity() {
int entityID = this.dataWatcher.getWatchableObjectInt(DW_SHOOTER);
Entity e = this.worldObj.getEntityByID(entityID);
if (e != null && e instanceof EntityLivingBase)
return (EntityLivingBase) e;
return null;
}
use of net.minecraft.entity.EntityLivingBase in project ArsMagica2 by Mithion.
the class AMPacketProcessorClient method handleSpellApplyEffect.
private void handleSpellApplyEffect(byte[] data) {
AMDataReader rdr = new AMDataReader(data, false);
double x = rdr.getDouble();
double y = rdr.getDouble();
double z = rdr.getDouble();
ItemStack spellStack = rdr.getBoolean() ? rdr.getItemStack() : null;
if (spellStack == null)
return;
int casterID = rdr.getInt();
int targetID = rdr.getInt();
Entity caster = Minecraft.getMinecraft().theWorld.getEntityByID(casterID);
Entity target = Minecraft.getMinecraft().theWorld.getEntityByID(targetID);
if (caster == null || target == null || !(caster instanceof EntityLivingBase) || !(target instanceof EntityLivingBase))
return;
SpellHelper.instance.applyStackStage(spellStack, (EntityLivingBase) caster, (EntityLivingBase) target, x, y, z, 0, Minecraft.getMinecraft().theWorld, false, false, 0);
}
use of net.minecraft.entity.EntityLivingBase in project ArsMagica2 by Mithion.
the class AMPacketProcessorServer method handlePossibleClientExpropDesync.
private void handlePossibleClientExpropDesync(byte[] data) {
AMDataReader rdr = new AMDataReader(data, false);
int entityID = rdr.getInt();
EntityLivingBase e = getEntityByID(entityID);
if (e != null && e instanceof EntityPlayer) {
ExtendedProperties props = ExtendedProperties.For(e);
if (!props.detectPossibleDesync()) {
props.setFullSync();
props.forceSync();
}
}
}
use of net.minecraft.entity.EntityLivingBase in project ArsMagica2 by Mithion.
the class AMPacketProcessorServer method handleRequestBetaParticles.
private void handleRequestBetaParticles(byte[] data, EntityPlayerMP player) {
AMDataReader rdr = new AMDataReader(data, false);
int requesterID = rdr.getInt();
int entityID = rdr.getInt();
EntityLivingBase entity = getEntityByID(entityID);
if (player == null || entity == null || !(entity instanceof EntityPlayer))
return;
if (!AMCore.proxy.playerTracker.hasAA((EntityPlayer) entity))
return;
byte[] expropData = ExtendedProperties.For(entity).getAuraData();
AMDataWriter writer = new AMDataWriter();
writer.add(entity.getEntityId());
writer.add(expropData);
AMNetHandler.INSTANCE.sendPacketToClientPlayer(player, AMPacketIDs.REQUEST_BETA_PARTICLES, writer.generate());
}
use of net.minecraft.entity.EntityLivingBase in project ArsMagica2 by Mithion.
the class AMPacketProcessorClient method handleSyncAir.
private void handleSyncAir(byte[] data) {
AMDataReader rdr = new AMDataReader(data, false);
int entityID = rdr.getInt();
int air = rdr.getInt();
EntityLivingBase ent = AMCore.proxy.getEntityByID(entityID);
if (ent == null)
return;
ent.setAir(air);
}
Aggregations