From 1cbde901bacb7620e555d1725c95619641caba8e Mon Sep 17 00:00:00 2001 From: Andrew Ardill Date: Fri, 21 Jan 2011 16:54:30 +1100 Subject: [PATCH] Entity audit. Adds checks for null entities, and adds conformity. --- .../net/minecraft/server/BlockCactus.java | 7 +-- .../java/net/minecraft/server/Entity.java | 18 +++---- .../net/minecraft/server/EntityAnimals.java | 8 +-- .../net/minecraft/server/EntityArrow.java | 8 +-- .../java/net/minecraft/server/EntityBoat.java | 36 +++++++++++--- .../net/minecraft/server/EntityChicken.java | 8 +-- .../java/net/minecraft/server/EntityCow.java | 8 +-- .../net/minecraft/server/EntityCreature.java | 8 +-- .../net/minecraft/server/EntityCreeper.java | 8 +-- .../java/net/minecraft/server/EntityEgg.java | 10 ++-- .../minecraft/server/EntityFallingSand.java | 17 ++++--- .../net/minecraft/server/EntityFireball.java | 10 ++-- .../java/net/minecraft/server/EntityFish.java | 6 +-- .../net/minecraft/server/EntityFlying.java | 8 +-- .../net/minecraft/server/EntityGhast.java | 8 +-- .../java/net/minecraft/server/EntityItem.java | 22 ++++----- .../net/minecraft/server/EntityLiving.java | 9 ++-- .../net/minecraft/server/EntityMinecart.java | 49 +++++++++++++------ .../java/net/minecraft/server/EntityMobs.java | 10 ++-- .../net/minecraft/server/EntityPainting.java | 8 +-- .../java/net/minecraft/server/EntityPig.java | 8 +-- .../net/minecraft/server/EntityPigZombie.java | 8 +-- .../net/minecraft/server/EntityPlayer.java | 10 ++-- .../net/minecraft/server/EntityPlayerMP.java | 10 ++-- .../net/minecraft/server/EntitySheep.java | 8 +-- .../net/minecraft/server/EntitySkeleton.java | 10 ++-- .../net/minecraft/server/EntitySlime.java | 8 +-- .../net/minecraft/server/EntitySnowball.java | 10 ++-- .../net/minecraft/server/EntitySpider.java | 8 +-- .../net/minecraft/server/EntitySquid.java | 8 +-- .../net/minecraft/server/EntityTNTPrimed.java | 8 +-- .../net/minecraft/server/EntityWaterMob.java | 8 +-- .../net/minecraft/server/EntityZombie.java | 6 +-- .../minecraft/server/EntityZombieSimple.java | 8 +-- 34 files changed, 211 insertions(+), 173 deletions(-) diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java index 1d28821750..64a3455adf 100644 --- a/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java @@ -1,11 +1,6 @@ package net.minecraft.server; // CraftBukkit start -import org.bukkit.entity.LivingEntity; -import org.bukkit.craftbukkit.block.CraftBlock; -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.craftbukkit.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.entity.EntityDamageByBlockEvent; import org.bukkit.event.entity.EntityDamageEvent; @@ -102,7 +97,7 @@ public class BlockCactus extends Block { if(entity instanceof EntityLiving) { CraftServer server = ((WorldServer) world).getServer(); org.bukkit.block.Block damager = ((WorldServer) world).getWorld().getBlockAt(i, j, k); - org.bukkit.entity.Entity damagee = entity.getBukkitEntity(); + org.bukkit.entity.Entity damagee = (entity == null)?null:entity.getBukkitEntity(); DamageCause damageType = EntityDamageEvent.DamageCause.CONTACT; int damageDone = 1; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index f29af59e44..8fd6672a48 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1,13 +1,13 @@ package net.minecraft.server; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.Event.Type; import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityDamageByBlockEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -//CraftBukkit end +// CraftBukkit end import java.util.List; import java.util.Random; @@ -76,7 +76,7 @@ public abstract class Entity { public int ai; public int aj; - protected org.bukkit.entity.Entity bukkitEntity; //CraftBukkit + protected org.bukkit.entity.Entity bukkitEntity; // CraftBukkit public Entity(World world) { g = a++; @@ -117,7 +117,7 @@ public abstract class Entity { af.a(0, ((Byte.valueOf((byte) 0)))); a(); - bukkitEntity = null; //CraftBukkit + bukkitEntity = null; // CraftBukkit } protected abstract void a(); @@ -489,7 +489,7 @@ public abstract class Entity { b(1); if (!flag2) { Z++; - //CraftBukkit start + // CraftBukkit start if(Z <= 0){ // not on fire yet CraftServer server = ((WorldServer) l).getServer(); @@ -506,7 +506,7 @@ public abstract class Entity { // reset fire level back to max Z = 300; } - //CraftBukkit end + // CraftBukkit end } } else if (Z <= 0) { Z = -Y; @@ -922,7 +922,7 @@ public abstract class Entity { // e(null) doesn't really fly for overloaded methods, // so this method is needed - //CraftBukkit end + // CraftBukkit end d = 0.0D; e = 0.0D; @@ -982,9 +982,9 @@ public abstract class Entity { } } - //CraftBukkit start + // CraftBukkit start public org.bukkit.entity.Entity getBukkitEntity(){ return this.bukkitEntity; } - //CraftBukkit end + // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityAnimals.java b/src/main/java/net/minecraft/server/EntityAnimals.java index 09df7f6f25..01050e000b 100644 --- a/src/main/java/net/minecraft/server/EntityAnimals.java +++ b/src/main/java/net/minecraft/server/EntityAnimals.java @@ -1,18 +1,18 @@ package net.minecraft.server; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftAnimals; -//CraftBukkit end +// CraftBukkit end public abstract class EntityAnimals extends EntityCreature implements IAnimals { public EntityAnimals(World world) { super(world); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftAnimals(server, this); - //CraftBukkit end + // CraftBukkit end } protected float a(int i, int j, int k) { diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java index 88c0b53db3..5ac3746b81 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -2,13 +2,13 @@ package net.minecraft.server; import java.util.List; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.entity.CraftArrow; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.entity.EntityDamageByProjectileEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -//CraftBukkit end +// CraftBukkit end public class EntityArrow extends Entity { @@ -34,10 +34,10 @@ public class EntityArrow extends Entity { am = 0; a(0.5F, 0.5F); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftArrow(server, this); - //CraftBukkit end + // CraftBukkit end } public EntityArrow(World world, double d1, double d2, double d3) { diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index 9fbb132b7f..0e929470a7 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -9,6 +9,7 @@ import org.bukkit.craftbukkit.entity.CraftBoat; import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.craftbukkit.CraftMappable; import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.entity.Vehicle; import org.bukkit.event.Event.Type; import org.bukkit.event.vehicle.VehicleCreateEvent; @@ -50,10 +51,10 @@ public class EntityBoat extends Entity implements CraftMappable { // CraftBukkit M = false; handleCreation(world); // CraftBukkit - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftBoat(server, this); - //CraftBukkit end + // CraftBukkit end } protected void a() {} @@ -86,7 +87,9 @@ public class EntityBoat extends Entity implements CraftMappable { // CraftBukkit // CraftBukkit start private void handleCreation(World world) { CraftServer server = ((WorldServer) world).getServer(); - VehicleCreateEvent event = new VehicleCreateEvent( Type.VEHICLE_CREATE, (Vehicle) this.getBukkitEntity()); + Type eventType = Type.VEHICLE_CREATE; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + VehicleCreateEvent event = new VehicleCreateEvent(eventType, vehicle); server.getPluginManager().callEvent(event); } // CraftBukkit end @@ -97,7 +100,12 @@ public class EntityBoat extends Entity implements CraftMappable { // CraftBukkit public boolean a(Entity entity, int i) { // CraftBukkit start - VehicleDamageEvent event = new VehicleDamageEvent( Type.VEHICLE_DAMAGE, (Vehicle) this.getBukkitEntity(), entity.getBukkitEntity(), i); + Type eventType = Type.VEHICLE_DAMAGE; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + org.bukkit.entity.Entity attacker = (entity == null)?null:entity.getBukkitEntity(); + int damage = i; + + VehicleDamageEvent event = new VehicleDamageEvent(eventType, vehicle, attacker, damage); ((WorldServer) l).getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -290,7 +298,13 @@ public class EntityBoat extends Entity implements CraftMappable { // CraftBukkit // CraftBukkit start CraftServer server = ((WorldServer)l).getServer(); - VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, (Vehicle) this.getBukkitEntity(), new Location(((WorldServer)l).getWorld(), prevX, prevY, prevZ, prevYaw, prevPitch), new Location(((WorldServer)l).getWorld(), p, q, r, v, w)); + CraftWorld world = ((WorldServer)l).getWorld(); + Type eventType = Type.VEHICLE_MOVE; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch); + Location to = new Location(world, p, q, r, v, w); + + VehicleMoveEvent event = new VehicleMoveEvent(eventType, vehicle, from, to); server.getPluginManager().callEvent(event); // CraftBukkit end @@ -325,7 +339,11 @@ public class EntityBoat extends Entity implements CraftMappable { // CraftBukkit // CraftBukkit start public void c(Entity entity) { CraftServer server = ((WorldServer)l).getServer(); - VehicleEntityCollisionEvent collsionEvent = new VehicleEntityCollisionEvent( Type.VEHICLE_COLLISION_ENTITY, (Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); + Type eventType = Type.VEHICLE_COLLISION_ENTITY; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + org.bukkit.entity.Entity hitEntity = (entity == null)?null:entity.getBukkitEntity(); + + VehicleEntityCollisionEvent collsionEvent = new VehicleEntityCollisionEvent(eventType, vehicle, hitEntity); server.getPluginManager().callEvent(collsionEvent); if (collsionEvent.isCancelled()) { @@ -347,7 +365,11 @@ public class EntityBoat extends Entity implements CraftMappable { // CraftBukkit if (!l.z) { // CraftBukkit start CraftServer server = ((WorldServer)l).getServer(); - VehicleEnterEvent event = new VehicleEnterEvent( Type.VEHICLE_ENTER, (Vehicle) this.getBukkitEntity(), entityplayer.getBukkitEntity()); + Type eventType = Type.VEHICLE_ENTER; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + org.bukkit.entity.Entity player = entityplayer.getBukkitEntity(); + + VehicleEnterEvent event = new VehicleEnterEvent(eventType, vehicle, player); server.getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java index 64dfced3d6..252d65fa87 100644 --- a/src/main/java/net/minecraft/server/EntityChicken.java +++ b/src/main/java/net/minecraft/server/EntityChicken.java @@ -2,10 +2,10 @@ package net.minecraft.server; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftChicken; -//CraftBukkit end +// CraftBukkit end public class EntityChicken extends EntityAnimals { @@ -27,10 +27,10 @@ public class EntityChicken extends EntityAnimals { a(0.3F, 0.4F); aZ = 4; am = W.nextInt(6000) + 6000; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftChicken(server, this); - //CraftBukkit end + // CraftBukkit end } public void o() { diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java index d19d40d13d..a6dabbd686 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java @@ -1,9 +1,9 @@ package net.minecraft.server; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftCow; -//CraftBukkit end +// CraftBukkit end public class EntityCow extends EntityAnimals { @@ -11,10 +11,10 @@ public class EntityCow extends EntityAnimals { super(world); aP = "/mob/cow.png"; a(0.9F, 1.3F); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftCow(server, this); - //CraftBukkit end + // CraftBukkit end } public void a(NBTTagCompound nbttagcompound) { diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java index 35f6da6fe3..801b64ad7d 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -2,10 +2,10 @@ package net.minecraft.server; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftCreature; -//CraftBukkit end +// CraftBukkit end public class EntityCreature extends EntityLiving { @@ -16,10 +16,10 @@ public class EntityCreature extends EntityLiving { public EntityCreature(World world) { super(world); e = false; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftCreature(server, this); - //CraftBukkit end + // CraftBukkit end } protected void d() { diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java index c6b7f2e684..3427bac3ab 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -2,10 +2,10 @@ package net.minecraft.server; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftCreeper; -//CraftBukkit end +// CraftBukkit end public class EntityCreeper extends EntityMobs { @@ -15,10 +15,10 @@ public class EntityCreeper extends EntityMobs { public EntityCreeper(World world) { super(world); aP = "/mob/creeper.png"; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftCreeper(server, this); - //CraftBukkit end + // CraftBukkit end } protected void a() { diff --git a/src/main/java/net/minecraft/server/EntityEgg.java b/src/main/java/net/minecraft/server/EntityEgg.java index 82c1a24037..54db05c7f0 100644 --- a/src/main/java/net/minecraft/server/EntityEgg.java +++ b/src/main/java/net/minecraft/server/EntityEgg.java @@ -37,10 +37,10 @@ public class EntityEgg extends Entity { a = 0; am = 0; a(0.25F, 0.25F); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftEgg(server, this); - //CraftBukkit end + // CraftBukkit end } protected void a() {} @@ -176,7 +176,7 @@ public class EntityEgg extends Entity { DamageCause damageCause = EntityDamageEvent.DamageCause.ENTITY_ATTACK; int damage = 0; - //TODO @see EntityArrow#162 + // TODO @see EntityArrow#162 EntityDamageByProjectileEvent edbpe = new EntityDamageByProjectileEvent(shooter, damagee, projectile, damageCause, damage); server.getPluginManager().callEvent(edbpe); @@ -196,7 +196,7 @@ public class EntityEgg extends Entity { } } - // Craftbukkit start + // CraftBukkit start boolean hatching = !this.l.z && W.nextInt(8) == 0; byte numHatching = (hatching && W.nextInt(32) == 0) ? (byte) 4 : (byte) 1; if (!hatching) { @@ -207,7 +207,7 @@ public class EntityEgg extends Entity { if (ak instanceof EntityPlayerMP) { CraftServer server = ((WorldServer) l).getServer(); Type eventType = Type.PLAYER_EGG_THROW; - Player player = (Player) ak.getBukkitEntity(); + Player player = (ak == null)?null:(Player) ak.getBukkitEntity(); PlayerEggThrowEvent event = new PlayerEggThrowEvent(eventType, player, hatching, numHatching, hatchingType); server.getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/EntityFallingSand.java b/src/main/java/net/minecraft/server/EntityFallingSand.java index 41ab39760b..f9a95a9be0 100644 --- a/src/main/java/net/minecraft/server/EntityFallingSand.java +++ b/src/main/java/net/minecraft/server/EntityFallingSand.java @@ -1,9 +1,9 @@ package net.minecraft.server; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftFallingSand; -//CraftBukkit end +// CraftBukkit end public class EntityFallingSand extends Entity { @@ -13,11 +13,16 @@ public class EntityFallingSand extends Entity { public EntityFallingSand(World world) { super(world); b = 0; + // CraftBukkit start + CraftServer server = ((WorldServer) this.l).getServer(); + this.bukkitEntity = new CraftFallingSand(server, this); + // CraftBukkit end } public EntityFallingSand(World world, double d, double d1, double d2, int i) { - super(world); - b = 0; + // CraftBukkit start + this(world); + // CraftBukkit end a = i; this.i = true; a(0.98F, 0.98F); @@ -30,10 +35,6 @@ public class EntityFallingSand extends Entity { m = d; n = d1; o = d2; - //CraftBukkit start - CraftServer server = ((WorldServer) this.l).getServer(); - this.bukkitEntity = new CraftFallingSand(server, this); - //CraftBukkit end } protected void a() {} diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java index 9100e8c0ea..ee5ba52b74 100644 --- a/src/main/java/net/minecraft/server/EntityFireball.java +++ b/src/main/java/net/minecraft/server/EntityFireball.java @@ -3,13 +3,13 @@ package net.minecraft.server; import java.util.List; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.entity.CraftFireball; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.entity.EntityDamageByProjectileEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -//CraftBukkit end +// CraftBukkit end public class EntityFireball extends Entity { @@ -38,10 +38,10 @@ public class EntityFireball extends Entity { ap = 0; a(1.0F, 1.0F); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftFireball(server, this); - //CraftBukkit end + // CraftBukkit end } protected void a() {} @@ -141,7 +141,7 @@ public class EntityFireball extends Entity { DamageCause damageCause = EntityDamageEvent.DamageCause.ENTITY_ATTACK; int damage = 0; - //TODO @see EntityArrow#162 + // TODO @see EntityArrow#162 EntityDamageByProjectileEvent edbpe = new EntityDamageByProjectileEvent(shooter, damagee, projectile, damageCause, damage); server.getPluginManager().callEvent(edbpe); diff --git a/src/main/java/net/minecraft/server/EntityFish.java b/src/main/java/net/minecraft/server/EntityFish.java index 2bedb3674a..4d63e7c0cb 100644 --- a/src/main/java/net/minecraft/server/EntityFish.java +++ b/src/main/java/net/minecraft/server/EntityFish.java @@ -9,7 +9,7 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.entity.EntityDamageByProjectileEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -//CraftBukkit end +// CraftBukkit end public class EntityFish extends Entity { @@ -197,7 +197,7 @@ public class EntityFish extends Entity { if (movingobjectposition != null) { if (movingobjectposition.g != null) { // CraftBukkit start - //TODO add EntityDamagedByProjectileEvent : fishing hook? + // TODO add EntityDamagedByProjectileEvent : fishing hook? boolean bounce; if (movingobjectposition.g instanceof EntityLiving) { CraftServer server = ((WorldServer) this.l).getServer(); @@ -207,7 +207,7 @@ public class EntityFish extends Entity { DamageCause damageCause = EntityDamageEvent.DamageCause.ENTITY_ATTACK; int damage = 0; - //TODO @see EntityArrow#162 + // TODO @see EntityArrow#162 EntityDamageByProjectileEvent edbpe = new EntityDamageByProjectileEvent(shooter, damagee, projectile, damageCause, damage); server.getPluginManager().callEvent(edbpe); diff --git a/src/main/java/net/minecraft/server/EntityFlying.java b/src/main/java/net/minecraft/server/EntityFlying.java index 8df4b9a18e..06666c66e8 100644 --- a/src/main/java/net/minecraft/server/EntityFlying.java +++ b/src/main/java/net/minecraft/server/EntityFlying.java @@ -1,18 +1,18 @@ package net.minecraft.server; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftFlying; -//CraftBukkit end +// CraftBukkit end public class EntityFlying extends EntityLiving { public EntityFlying(World world) { super(world); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftFlying(server, this); - //CraftBukkit end + // CraftBukkit end } protected void a(float f) {} diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java index e7dcd822e8..931861b10f 100644 --- a/src/main/java/net/minecraft/server/EntityGhast.java +++ b/src/main/java/net/minecraft/server/EntityGhast.java @@ -3,10 +3,10 @@ package net.minecraft.server; import java.util.List; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftGhast; -//CraftBukkit end +// CraftBukkit end public class EntityGhast extends EntityFlying implements IMobs { @@ -29,10 +29,10 @@ public class EntityGhast extends EntityFlying implements IMobs { aP = "/mob/ghast.png"; a(4F, 4F); ae = true; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftGhast(server, this); - //CraftBukkit end + // CraftBukkit end } protected void d() { diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java index b6e5a4ead2..dfcd451730 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -2,10 +2,10 @@ package net.minecraft.server; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftItem; -//CraftBukkit end +// CraftBukkit end public class EntityItem extends Entity { @@ -17,12 +17,9 @@ public class EntityItem extends Entity { public float d; public EntityItem(World world, double d1, double d2, double d3, ItemStack itemstack) { - super(world); - b = 0; - f = 5; - d = (float) (Math.random() * 3.1415926535897931D * 2D); - a(0.25F, 0.25F); - H = J / 2.0F; + // CraftBukkit start + this(world); + // CraftBukkit end a(d1, d2, d3); a = itemstack; v = (float) (Math.random() * 360D); @@ -30,10 +27,7 @@ public class EntityItem extends Entity { t = 0.20000000298023224D; u = (float) (Math.random() * 0.20000000298023224D - 0.10000000149011612D); M = false; - //CraftBukkit start - CraftServer server = ((WorldServer) this.l).getServer(); - this.bukkitEntity = new CraftItem(server, this); - //CraftBukkit end + } public EntityItem(World world) { @@ -43,6 +37,10 @@ public class EntityItem extends Entity { d = (float) (Math.random() * 3.1415926535897931D * 2D); a(0.25F, 0.25F); H = J / 2.0F; + // CraftBukkit start + CraftServer server = ((WorldServer) this.l).getServer(); + this.bukkitEntity = new CraftItem(server, this); + // CraftBukkit end } protected void a() {} diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index fb0debdd9f..dc8f462038 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -3,13 +3,12 @@ package net.minecraft.server; import java.util.List; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftLivingEntity; -//CraftBukkit end -import org.bukkit.event.entity.EntityDamageByBlockEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +// CraftBukkit end public abstract class EntityLiving extends Entity { @@ -101,10 +100,10 @@ public abstract class EntityLiving extends Entity { aG = (float) Math.random() * 12398F; v = (float) (Math.random() * 3.1415927410125732D * 2D); S = 0.5F; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftLivingEntity(server, this); - //CraftBukkit end + // CraftBukkit end } protected void a() {} diff --git a/src/main/java/net/minecraft/server/EntityMinecart.java b/src/main/java/net/minecraft/server/EntityMinecart.java index 8fdec5c0c8..07b3d43877 100644 --- a/src/main/java/net/minecraft/server/EntityMinecart.java +++ b/src/main/java/net/minecraft/server/EntityMinecart.java @@ -9,6 +9,7 @@ import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.craftbukkit.entity.CraftPoweredMinecart; import org.bukkit.craftbukkit.entity.CraftStorageMinecart; import org.bukkit.craftbukkit.CraftMappable; +import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.entity.CraftMinecart; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Vehicle; @@ -133,12 +134,12 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable M = false; handleCreation(world); // CraftBukkit - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftMinecart(server, this); this.bukkitPoweredMinecart = new CraftPoweredMinecart(server, this); this.bukkitStorageMinecart = new CraftStorageMinecart(server, this); - //CraftBukkit end + // CraftBukkit end } protected void a() {} @@ -172,7 +173,10 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable // CraftBukkit start private void handleCreation(World world) { CraftServer server = ((WorldServer) world).getServer(); - VehicleCreateEvent event = new VehicleCreateEvent(Type.VEHICLE_CREATE, (Vehicle) this.getBukkitEntity()); + Type eventType = Type.VEHICLE_CREATE; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + + VehicleCreateEvent event = new VehicleCreateEvent(eventType, vehicle); server.getPluginManager().callEvent(event); } // CraftBukkit end @@ -183,11 +187,12 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable public boolean a(Entity entity, int i) { // CraftBukkit start - org.bukkit.entity.Entity passenger = null; - if ((EntityLiving)entity != null) { - passenger = entity.getBukkitEntity(); - } - VehicleDamageEvent event = new VehicleDamageEvent(Type.VEHICLE_DAMAGE, (Vehicle) this.getBukkitEntity(), passenger, i); + Type eventType = Type.VEHICLE_DAMAGE; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + org.bukkit.entity.Entity passenger = (entity == null)?null:entity.getBukkitEntity(); + int damage = i; + + VehicleDamageEvent event = new VehicleDamageEvent(eventType, vehicle, passenger, damage); ((WorldServer)l).getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -510,7 +515,13 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable // CraftBukkit start CraftServer server = ((WorldServer)this.l).getServer(); - VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, (Vehicle) this.getBukkitEntity(), new Location(((WorldServer)this.l).getWorld(), prevX, prevY, prevZ, prevYaw, prevPitch), new Location(((WorldServer)this.l).getWorld(), p, q, r, v, w)); + CraftWorld world = ((WorldServer)this.l).getWorld(); + Type eventType = Type.VEHICLE_MOVE; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch); + Location to = new Location(world, p, q, r, v, w); + + VehicleMoveEvent event = new VehicleMoveEvent(eventType , vehicle , from, to); server.getPluginManager().callEvent(event); // CraftBukkit end @@ -646,7 +657,11 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable // CraftBukkit start CraftServer server = ((WorldServer)l).getServer(); - VehicleEntityCollisionEvent collsionEvent = new VehicleEntityCollisionEvent(Type.VEHICLE_COLLISION_ENTITY, (Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); + Type eventType = Type.VEHICLE_COLLISION_ENTITY; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + org.bukkit.entity.Entity hitEntity = (entity == null)?null:entity.getBukkitEntity(); + + VehicleEntityCollisionEvent collsionEvent = new VehicleEntityCollisionEvent(eventType, vehicle, hitEntity); server.getPluginManager().callEvent(collsionEvent); if (collsionEvent.isCancelled()) { @@ -655,7 +670,9 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable if ((entity instanceof EntityLiving) && !(entity instanceof EntityPlayer) && d == 0 && s * s + u * u > 0.01D && j == null && entity.k == null) { if (!collsionEvent.isPickupCancelled()) { - VehicleEnterEvent enterEvent = new VehicleEnterEvent(Type.VEHICLE_ENTER, (Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); + eventType = Type.VEHICLE_ENTER; + + VehicleEnterEvent enterEvent = new VehicleEnterEvent(eventType, vehicle, hitEntity); server.getPluginManager().callEvent(enterEvent); if (!enterEvent.isCancelled()) { @@ -772,7 +789,11 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable if (!l.z) { // CraftBukkit start CraftServer server = ((WorldServer) l).getServer(); - VehicleEnterEvent event = new VehicleEnterEvent(Type.VEHICLE_ENTER, (Vehicle) this.getBukkitEntity(), entityplayer.getBukkitEntity()); + Type eventType = Type.VEHICLE_ENTER; + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + org.bukkit.entity.Entity player = (entityplayer == null)?null:entityplayer.getBukkitEntity(); + + VehicleEnterEvent event = new VehicleEnterEvent(eventType, vehicle, player); server.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -808,7 +829,7 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable return entityplayer.b(((Entity) (this))) <= 64D; } - //CraftBukkit start + // CraftBukkit start @Override public org.bukkit.entity.Entity getBukkitEntity(){ if (this.d == CraftMinecart.Type.StorageMinecart.getId()) { @@ -819,5 +840,5 @@ public class EntityMinecart extends Entity implements IInventory, CraftMappable return this.bukkitEntity; } } - //CraftBukkit end + // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityMobs.java b/src/main/java/net/minecraft/server/EntityMobs.java index 0dffa62b22..df910e41d5 100644 --- a/src/main/java/net/minecraft/server/EntityMobs.java +++ b/src/main/java/net/minecraft/server/EntityMobs.java @@ -2,14 +2,14 @@ package net.minecraft.server; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.entity.CraftMonster; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -//CraftBukkit end +// CraftBukkit end public class EntityMobs extends EntityCreature implements IMobs { @@ -19,10 +19,10 @@ public class EntityMobs extends EntityCreature implements IMobs { super(world); c = 2; aZ = 20; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftMonster(server, this); - //CraftBukkit end + // CraftBukkit end } public void o() { @@ -72,7 +72,7 @@ public class EntityMobs extends EntityCreature implements IMobs { if(entity instanceof EntityLiving) { CraftServer server = ((WorldServer) l).getServer(); org.bukkit.entity.Entity damager = this.getBukkitEntity(); - org.bukkit.entity.Entity damagee = entity.getBukkitEntity(); + org.bukkit.entity.Entity damagee = (entity == null)?null:entity.getBukkitEntity(); DamageCause damageType = EntityDamageEvent.DamageCause.ENTITY_ATTACK; int damageDone = c; diff --git a/src/main/java/net/minecraft/server/EntityPainting.java b/src/main/java/net/minecraft/server/EntityPainting.java index 4373395f22..65c3661e3b 100644 --- a/src/main/java/net/minecraft/server/EntityPainting.java +++ b/src/main/java/net/minecraft/server/EntityPainting.java @@ -2,10 +2,10 @@ package net.minecraft.server; import java.util.*; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftPainting; -//CraftBukkit end +// CraftBukkit end public class EntityPainting extends Entity { @@ -22,10 +22,10 @@ public class EntityPainting extends Entity { a = 0; H = 0.0F; a(0.5F, 0.5F); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftPainting(server, this); - //CraftBukkit end + // CraftBukkit end } public EntityPainting(World world, int i, int j, int k, int l) { diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java index 2b67d72cab..634beea0f9 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -1,9 +1,9 @@ package net.minecraft.server; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftPig; -//CraftBukkit end +// CraftBukkit end public class EntityPig extends EntityAnimals { @@ -11,10 +11,10 @@ public class EntityPig extends EntityAnimals { super(world); aP = "/mob/pig.png"; a(0.9F, 0.9F); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftPig(server, this); - //CraftBukkit end + // CraftBukkit end } protected void a() { diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java index f0451a0762..f22ea2f04f 100644 --- a/src/main/java/net/minecraft/server/EntityPigZombie.java +++ b/src/main/java/net/minecraft/server/EntityPigZombie.java @@ -3,10 +3,10 @@ package net.minecraft.server; import java.util.List; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftPigZombie; -//CraftBukkit end +// CraftBukkit end public class EntityPigZombie extends EntityZombie { @@ -22,10 +22,10 @@ public class EntityPigZombie extends EntityZombie { bC = 0.5F; c = 5; ae = true; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftPigZombie(server, this); - //CraftBukkit end + // CraftBukkit end } public void b_() { diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index aa8a9ed347..4cc6e137a6 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -3,13 +3,13 @@ package net.minecraft.server; import java.util.List; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -//CraftBukkit end +// CraftBukkit end public abstract class EntityPlayer extends EntityLiving { @@ -51,10 +51,10 @@ public abstract class EntityPlayer extends EntityLiving { aR = 180F; Y = 20; aP = "/mob/char.png"; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftHumanEntity(server, this); - //CraftBukkit end + // CraftBukkit end } public void b_() { @@ -343,7 +343,7 @@ public abstract class EntityPlayer extends EntityLiving { if(entity instanceof EntityLiving) { CraftServer server = ((WorldServer) l).getServer(); org.bukkit.entity.Entity damager = this.getBukkitEntity(); - org.bukkit.entity.Entity damagee = entity.getBukkitEntity(); + org.bukkit.entity.Entity damagee = (entity == null)?null:entity.getBukkitEntity(); DamageCause damageType = EntityDamageEvent.DamageCause.ENTITY_ATTACK; int damageDone = i; diff --git a/src/main/java/net/minecraft/server/EntityPlayerMP.java b/src/main/java/net/minecraft/server/EntityPlayerMP.java index 5f1b184bd8..41390b9cc9 100644 --- a/src/main/java/net/minecraft/server/EntityPlayerMP.java +++ b/src/main/java/net/minecraft/server/EntityPlayerMP.java @@ -2,10 +2,10 @@ package net.minecraft.server; import java.util.*; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftPlayer; -//CraftBukkit end +// CraftBukkit end public class EntityPlayerMP extends EntityPlayer implements ICrafting { @@ -48,10 +48,10 @@ public class EntityPlayerMP extends EntityPlayer implements ICrafting { aw = s; c = iteminworldmanager; H = 0.0F; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftPlayer(server, this); - //CraftBukkit end + // CraftBukkit end } public void l() { @@ -200,7 +200,7 @@ public class EntityPlayerMP extends EntityPlayer implements ICrafting { // e(null) doesn't really fly for overloaded methods, // so this method is needed - //CraftBukkit end + // CraftBukkit end super.setPassengerOf(entity); a.b(((Packet) (new Packet39(((Entity) (this)), k)))); a.a(p, q, r, v, w); diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java index 5e51fa985f..725624a906 100644 --- a/src/main/java/net/minecraft/server/EntitySheep.java +++ b/src/main/java/net/minecraft/server/EntitySheep.java @@ -2,10 +2,10 @@ package net.minecraft.server; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftSheep; -//CraftBukkit end +// CraftBukkit end public class EntitySheep extends EntityAnimals { @@ -49,10 +49,10 @@ public class EntitySheep extends EntityAnimals { super(world); aP = "/mob/sheep.png"; a(0.9F, 1.3F); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftSheep(server, this); - //CraftBukkit end + // CraftBukkit end } protected void a() { diff --git a/src/main/java/net/minecraft/server/EntitySkeleton.java b/src/main/java/net/minecraft/server/EntitySkeleton.java index b18ef99f31..8b22a5d7fd 100644 --- a/src/main/java/net/minecraft/server/EntitySkeleton.java +++ b/src/main/java/net/minecraft/server/EntitySkeleton.java @@ -2,7 +2,7 @@ package net.minecraft.server; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.entity.CraftSkeleton; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.Event.Type; @@ -16,10 +16,10 @@ public class EntitySkeleton extends EntityMobs { public EntitySkeleton(World world) { super(world); aP = "/mob/skeleton.png"; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftSkeleton(server, this); - //CraftBukkit end + // CraftBukkit end } protected String e() { @@ -41,7 +41,9 @@ public class EntitySkeleton extends EntityMobs { if (f1 > 0.5F && l.i(MathHelper.b(p), MathHelper.b(q), MathHelper.b(r)) && W.nextFloat() * 30F < (f1 - 0.4F) * 2.0F) { // CraftBukkit start CraftServer server = ((WorldServer) l).getServer(); - EntityCombustEvent event = new EntityCombustEvent(Type.ENTITY_COMBUST, this.getBukkitEntity()); + Type eventType = Type.ENTITY_COMBUST; + org.bukkit.entity.Entity entity = this.getBukkitEntity(); + EntityCombustEvent event = new EntityCombustEvent(eventType, entity); server.getPluginManager().callEvent(event); if (!event.isCancelled()) { Z = 300; diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java index c18e70a810..6e4eb685c0 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java @@ -2,10 +2,10 @@ package net.minecraft.server; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftSlime; -//CraftBukkit stop +// CraftBukkit stop public class EntitySlime extends EntityLiving implements IMobs { @@ -23,10 +23,10 @@ public class EntitySlime extends EntityLiving implements IMobs { H = 0.0F; d = W.nextInt(20) + 10; a(c); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftSlime(server, this); - //CraftBukkit end + // CraftBukkit end } public void a(int j) { diff --git a/src/main/java/net/minecraft/server/EntitySnowball.java b/src/main/java/net/minecraft/server/EntitySnowball.java index 4bda59e8b3..72bfc6e048 100644 --- a/src/main/java/net/minecraft/server/EntitySnowball.java +++ b/src/main/java/net/minecraft/server/EntitySnowball.java @@ -3,13 +3,13 @@ package net.minecraft.server; import java.util.List; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftSnowball; import org.bukkit.event.entity.EntityDamageByProjectileEvent; import org.bukkit.event.entity.EntityDamageEvent; -//CraftBukkit end import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +// CraftBukkit end public class EntitySnowball extends Entity { @@ -33,10 +33,10 @@ public class EntitySnowball extends Entity { a = 0; am = 0; a(0.25F, 0.25F); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftSnowball(server, this); - //CraftBukkit end + // CraftBukkit end } protected void a() {} @@ -172,7 +172,7 @@ public class EntitySnowball extends Entity { DamageCause damageCause = EntityDamageEvent.DamageCause.ENTITY_ATTACK; int damage = 0; - //TODO @see EntityArrow#162 + // TODO @see EntityArrow#162 EntityDamageByProjectileEvent edbpe = new EntityDamageByProjectileEvent(shooter, damagee, projectile, damageCause, damage); server.getPluginManager().callEvent(edbpe); diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java index ee01de3133..1d1c746c01 100644 --- a/src/main/java/net/minecraft/server/EntitySpider.java +++ b/src/main/java/net/minecraft/server/EntitySpider.java @@ -2,10 +2,10 @@ package net.minecraft.server; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftSpider; -//CraftBukkit stop +// CraftBukkit stop public class EntitySpider extends EntityMobs { @@ -14,10 +14,10 @@ public class EntitySpider extends EntityMobs { aP = "/mob/spider.png"; a(1.4F, 0.9F); bC = 0.8F; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftSpider(server, this); - //CraftBukkit end + // CraftBukkit end } public double k() { diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java index e6b02ffa50..4e8fdb70da 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java @@ -2,10 +2,10 @@ package net.minecraft.server; import java.util.Random; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftSquid; -//CraftBukkit stop +// CraftBukkit stop public class EntitySquid extends EntityWaterMob { @@ -43,10 +43,10 @@ public class EntitySquid extends EntityWaterMob { aP = "/mob/squid.png"; a(0.95F, 0.95F); ap = (1.0F / (W.nextFloat() + 1.0F)) * 0.2F; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftSquid(server, this); - //CraftBukkit end + // CraftBukkit end } public void a(NBTTagCompound nbttagcompound) { diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java index 4f228f58ab..f0a5a8d21a 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -1,9 +1,9 @@ package net.minecraft.server; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftTNTPrimed; -//CraftBukkit stop +// CraftBukkit stop public class EntityTNTPrimed extends Entity { @@ -15,10 +15,10 @@ public class EntityTNTPrimed extends Entity { i = true; a(0.98F, 0.98F); H = J / 2.0F; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftTNTPrimed(server, this); - //CraftBukkit end + // CraftBukkit end } public EntityTNTPrimed(World world, double d1, double d2, double d3) { diff --git a/src/main/java/net/minecraft/server/EntityWaterMob.java b/src/main/java/net/minecraft/server/EntityWaterMob.java index e83d9c5c19..bc8c5feb69 100644 --- a/src/main/java/net/minecraft/server/EntityWaterMob.java +++ b/src/main/java/net/minecraft/server/EntityWaterMob.java @@ -1,18 +1,18 @@ package net.minecraft.server; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftWaterMob; -//CraftBukkit stop +// CraftBukkit stop public class EntityWaterMob extends EntityCreature implements IAnimals { public EntityWaterMob(World world) { super(world); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftWaterMob(server, this); - //CraftBukkit end + // CraftBukkit end } public boolean d_() { diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java index e717f89283..cae35d82ee 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -1,6 +1,6 @@ package net.minecraft.server; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.entity.CraftZombie; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.Event.Type; @@ -14,10 +14,10 @@ public class EntityZombie extends EntityMobs { aP = "/mob/zombie.png"; bC = 0.5F; c = 5; - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftZombie(server, this); - //CraftBukkit end + // CraftBukkit end } public void o() { diff --git a/src/main/java/net/minecraft/server/EntityZombieSimple.java b/src/main/java/net/minecraft/server/EntityZombieSimple.java index 0b76a3bfbe..7fcbf6a4f9 100644 --- a/src/main/java/net/minecraft/server/EntityZombieSimple.java +++ b/src/main/java/net/minecraft/server/EntityZombieSimple.java @@ -1,9 +1,9 @@ package net.minecraft.server; -//CraftBukkit start +// CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftGiant; -//CraftBukkit stop +// CraftBukkit stop public class EntityZombieSimple extends EntityMobs { @@ -15,10 +15,10 @@ public class EntityZombieSimple extends EntityMobs { aZ *= 10; H *= 6F; a(I * 6F, J * 6F); - //CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.l).getServer(); this.bukkitEntity = new CraftGiant(server, this); - //CraftBukkit end + // CraftBukkit end } protected float a(int i, int j, int k) {