use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnStopParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class EntityStopra method onUpdate.
@Override
public void onUpdate() {
if (player == null)
return;
int rotation = 0;
if (!world.isRemote)
PacketDispatcher.sendToAllAround(new SpawnStopParticles(this, 2), player, 64.0D);
this.rotationYaw = (rotation + 1) % 360;
if (ticksExisted > TICKS)
setDead();
if (ticksExisted < 10)
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0D);
else
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.10000000149011612D);
AxisAlignedBB aabb = player.getEntityBoundingBox().grow(DISTANCE, DISTANCE, DISTANCE);
List list = this.world.getEntitiesWithinAABBExcludingEntity(player, aabb);
if (!list.isEmpty()) {
for (int i = 0; i < list.size(); i++) {
Entity e = (Entity) list.get(i);
if (e instanceof EntityLiving) {
if (ticksExisted < TICKS) {
((EntityLivingBase) e).motionX = 0;
((EntityLivingBase) e).motionY = 0;
((EntityLivingBase) e).motionZ = 0;
}
}
if (e instanceof EntityPlayerMP) {
((EntityPlayerMP) e).getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0D);
}
}
}
aabb.grow(-DISTANCE, -DISTANCE, -DISTANCE);
super.onUpdate();
}
use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnStopParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class EntityStop method onUpdate.
@Override
public void onUpdate() {
if (player == null)
return;
int rotation = 0;
if (!world.isRemote)
PacketDispatcher.sendToAllAround(new SpawnStopParticles(this, 1), player, 64.0D);
this.rotationYaw = (rotation + 1) % 360;
if (ticksExisted > TICKS)
setDead();
if (ticksExisted < 10)
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0D);
else
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.10000000149011612D);
AxisAlignedBB aabb = player.getEntityBoundingBox().grow(DISTANCE, DISTANCE, DISTANCE);
List list = this.world.getEntitiesWithinAABBExcludingEntity(player, aabb);
if (!list.isEmpty()) {
for (int i = 0; i < list.size(); i++) {
Entity e = (Entity) list.get(i);
if (e instanceof EntityLiving) {
if (ticksExisted < TICKS) {
((EntityLivingBase) e).motionX = 0;
((EntityLivingBase) e).motionY = 0;
((EntityLivingBase) e).motionZ = 0;
}
}
if (e instanceof EntityPlayerMP) {
((EntityPlayerMP) e).getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0D);
}
/*if (!world.isRemote) {
if (ticksExisted < 50) {
((EntityPlayerMP) player).connection.sendPacket(new SPacketEntityVelocity(e.getEntityId(), 0, 0, 0));
}
}*/
}
}
aabb.grow(-DISTANCE, -DISTANCE, -DISTANCE);
super.onUpdate();
}
use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnStopParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class EntityStopga method onUpdate.
@Override
public void onUpdate() {
if (player == null)
return;
int rotation = 0;
if (!world.isRemote)
PacketDispatcher.sendToAllAround(new SpawnStopParticles(this, 3), player, 64.0D);
this.rotationYaw = (rotation + 1) % 360;
if (ticksExisted > TICKS)
setDead();
if (ticksExisted < 10)
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0D);
else
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.10000000149011612D);
AxisAlignedBB aabb = player.getEntityBoundingBox().grow(DISTANCE, DISTANCE, DISTANCE);
List list = this.world.getEntitiesWithinAABBExcludingEntity(player, aabb);
if (!list.isEmpty()) {
for (int i = 0; i < list.size(); i++) {
Entity e = (Entity) list.get(i);
if (e instanceof EntityLiving) {
if (ticksExisted < TICKS) {
((EntityLivingBase) e).motionX = 0;
((EntityLivingBase) e).motionY = 0;
((EntityLivingBase) e).motionZ = 0;
}
}
if (e instanceof EntityPlayerMP) {
((EntityPlayerMP) e).getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0D);
}
}
}
aabb.grow(-DISTANCE, -DISTANCE, -DISTANCE);
super.onUpdate();
}
use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnStopParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.
the class MagicStop method process.
@Override
public void process(EntityPlayer player, Side side) {
if (!player.getCapability(ModCapabilities.CHEAT_MODE, null).getCheatMode())
player.getCapability(ModCapabilities.PLAYER_STATS, null).remMP(Constants.getCost(Strings.Spell_Aero));
World world = player.world;
if (!world.isRemote)
switch(player.getCapability(ModCapabilities.MAGIC_STATE, null).getMagicLevel(Strings.Spell_Stop)) {
case 1:
world.spawnEntity(new EntityStop(world, player, player.posX, player.posY, player.posZ));
PacketDispatcher.sendToAllAround(new SpawnStopParticles(player, 1), player, 64.0D);
break;
case 2:
world.spawnEntity(new EntityStopra(world, player, player.posX, player.posY, player.posZ));
PacketDispatcher.sendToAllAround(new SpawnStopParticles(player, 2), player, 64.0D);
break;
case 3:
world.spawnEntity(new EntityStopga(world, player, player.posX, player.posY, player.posZ));
PacketDispatcher.sendToAllAround(new SpawnStopParticles(player, 3), player, 64.0D);
break;
}
PacketDispatcher.sendTo(new SyncMagicData(player.getCapability(ModCapabilities.MAGIC_STATE, null), player.getCapability(ModCapabilities.PLAYER_STATS, null)), (EntityPlayerMP) player);
}
Aggregations