Merge branch 'EntityDamageEvent_bugFixes' into HEAD
Dieser Commit ist enthalten in:
Commit
e99980983d
@ -9,6 +9,7 @@ import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.event.entity.EntityDamageByBlockEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
// CraftBukkit end
|
||||
|
||||
import java.util.Random;
|
||||
@ -100,16 +101,21 @@ public class BlockCactus extends Block {
|
||||
|
||||
if(entity instanceof EntityLiving) {
|
||||
CraftServer server = ((WorldServer) world).getServer();
|
||||
CraftEntity toPassIn = new CraftLivingEntity(server, (EntityLiving) entity);
|
||||
EntityDamageByBlockEvent edbbe = new EntityDamageByBlockEvent(((WorldServer) world).getWorld().getBlockAt(i, j, k), toPassIn, EntityDamageEvent.DamageCause.CONTACT, 1);
|
||||
org.bukkit.block.Block damager = ((WorldServer) world).getWorld().getBlockAt(i, j, k);
|
||||
org.bukkit.entity.Entity damagee = entity.getBukkitEntity();
|
||||
DamageCause damageType = EntityDamageEvent.DamageCause.CONTACT;
|
||||
int damageDone = 1;
|
||||
|
||||
EntityDamageByBlockEvent edbbe = new EntityDamageByBlockEvent(damager, damagee, damageType, damageDone);
|
||||
server.getPluginManager().callEvent(edbbe);
|
||||
|
||||
if (!edbbe.isCancelled()){
|
||||
entity.a(((Entity) (null)), edbbe.getDamage());
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
entity.a(((Entity) (null)), 1);
|
||||
}
|
||||
// CraftBukkit end
|
||||
entity.a(((Entity) (null)), 1);
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
//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;
|
||||
// CraftBukkit end
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
//CraftBukkit end
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@ -221,9 +219,12 @@ public abstract class Entity {
|
||||
if (Z % 20 == 0) {
|
||||
// CraftBukkit start
|
||||
if(this instanceof EntityLiving) {
|
||||
CraftServer server = ((WorldServer)l).getServer();
|
||||
CraftServer server = ((WorldServer) l).getServer();
|
||||
org.bukkit.entity.Entity damagee = this.getBukkitEntity();
|
||||
DamageCause damageType = EntityDamageEvent.DamageCause.DROWNING;
|
||||
int damageDone = 1;
|
||||
|
||||
EntityDamageEvent ede = new EntityDamageEvent(this.getBukkitEntity(), EntityDamageEvent.DamageCause.DROWNING, 1);
|
||||
EntityDamageEvent ede = new EntityDamageEvent(damagee, damageType, damageDone);
|
||||
server.getPluginManager().callEvent(ede);
|
||||
|
||||
if (!ede.isCancelled()){
|
||||
@ -254,19 +255,31 @@ public abstract class Entity {
|
||||
if (!ae) {
|
||||
// CraftBukkit start
|
||||
if(this instanceof EntityLiving) {
|
||||
CraftServer server = ((WorldServer)l).getServer();
|
||||
CraftServer server = ((WorldServer) l).getServer();
|
||||
org.bukkit.block.Block damager = null;//((WorldServer) l).getWorld().getBlockAt(i, j, k);
|
||||
org.bukkit.entity.Entity damagee = this.getBukkitEntity();
|
||||
DamageCause damageType = EntityDamageEvent.DamageCause.LAVA;
|
||||
int damageDone = 4;
|
||||
|
||||
EntityDamageByBlockEvent ede = new EntityDamageByBlockEvent(null, this.getBukkitEntity(), EntityDamageEvent.DamageCause.LAVA, 4);
|
||||
EntityDamageByBlockEvent ede = new EntityDamageByBlockEvent(damager, damagee, damageType, damageDone);
|
||||
server.getPluginManager().callEvent(ede);
|
||||
if (!ede.isCancelled()){
|
||||
a(((Entity) (null)), ede.getDamage());
|
||||
}
|
||||
|
||||
EntityCombustEvent ece = new EntityCombustEvent(Type.ENTITY_COMBUST, this.getBukkitEntity());
|
||||
server.getPluginManager().callEvent(ece);
|
||||
if (!ece.isCancelled()){
|
||||
if(Z <= 0){
|
||||
// not on fire yet
|
||||
Type eventType = Type.ENTITY_COMBUST;
|
||||
EntityCombustEvent ece = new EntityCombustEvent(eventType, damagee);
|
||||
server.getPluginManager().callEvent(ece);
|
||||
if (!ece.isCancelled()){
|
||||
Z = 600;
|
||||
}
|
||||
} else {
|
||||
// reset fire level back to max
|
||||
Z = 600;
|
||||
}
|
||||
|
||||
} else {
|
||||
a(((Entity) (null)), 4);
|
||||
Z = 600;
|
||||
@ -473,9 +486,24 @@ public abstract class Entity {
|
||||
b(1);
|
||||
if (!flag2) {
|
||||
Z++;
|
||||
if (Z == 0) {
|
||||
//CraftBukkit start
|
||||
if(Z <= 0){
|
||||
// not on fire yet
|
||||
CraftServer server = ((WorldServer) l).getServer();
|
||||
org.bukkit.entity.Entity damagee = this.getBukkitEntity();
|
||||
Type eventType = Type.ENTITY_COMBUST;
|
||||
|
||||
EntityCombustEvent ece = new EntityCombustEvent(eventType, damagee);
|
||||
server.getPluginManager().callEvent(ece);
|
||||
|
||||
if (!ece.isCancelled()){
|
||||
Z = 300;
|
||||
}
|
||||
} else {
|
||||
// reset fire level back to max
|
||||
Z = 300;
|
||||
}
|
||||
//CraftBukkit end
|
||||
}
|
||||
} else if (Z <= 0) {
|
||||
Z = -Y;
|
||||
@ -505,9 +533,12 @@ public abstract class Entity {
|
||||
if (!ae) {
|
||||
// CraftBukkit start
|
||||
if(this instanceof EntityLiving) {
|
||||
CraftServer server = ((WorldServer)l).getServer();
|
||||
CraftServer server = ((WorldServer) l).getServer();
|
||||
org.bukkit.entity.Entity damagee = this.getBukkitEntity();
|
||||
DamageCause damageType = EntityDamageEvent.DamageCause.FIRE;
|
||||
int damageDone = i1;
|
||||
|
||||
EntityDamageEvent ede = new EntityDamageEvent(this.getBukkitEntity(), EntityDamageEvent.DamageCause.FIRE, i1);
|
||||
EntityDamageEvent ede = new EntityDamageEvent(damagee, damageType, damageDone);
|
||||
server.getPluginManager().callEvent(ede);
|
||||
|
||||
if (!ede.isCancelled()){
|
||||
|
@ -1,7 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftAnimals;
|
||||
//CraftBukkit end
|
||||
|
||||
public abstract class EntityAnimals extends EntityCreature implements IAnimals {
|
||||
|
||||
|
@ -1,12 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.entity.CraftArrow;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
|
@ -5,7 +5,6 @@ import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.entity.CraftArrow;
|
||||
import org.bukkit.craftbukkit.entity.CraftBoat;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.CraftMappable;
|
||||
|
@ -2,9 +2,10 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftAnimals;
|
||||
import org.bukkit.craftbukkit.entity.CraftChicken;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntityChicken extends EntityAnimals {
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftCow;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntityCow extends EntityAnimals {
|
||||
|
||||
|
@ -2,8 +2,10 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftCreature;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntityCreature extends EntityLiving {
|
||||
|
||||
|
@ -2,8 +2,10 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftCreeper;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntityCreeper extends EntityMobs {
|
||||
|
||||
|
@ -6,11 +6,7 @@ import java.util.Random;
|
||||
// CraftBukkit start
|
||||
import org.bukkit.entity.MobType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.craftbukkit.entity.CraftArrow;
|
||||
import org.bukkit.craftbukkit.entity.CraftEgg;
|
||||
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.Event.Type;
|
||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||
|
@ -1,7 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftFallingSand;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntityFallingSand extends Entity {
|
||||
|
||||
|
@ -4,10 +4,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.entity.CraftEgg;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftFireball;
|
||||
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
|
@ -4,11 +4,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.entity.CraftEgg;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftFireball;
|
||||
import org.bukkit.craftbukkit.entity.CraftFish;
|
||||
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
|
@ -1,7 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftFlying;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntityFlying extends EntityLiving {
|
||||
|
||||
|
@ -3,9 +3,10 @@ package net.minecraft.server;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftAnimals;
|
||||
import org.bukkit.craftbukkit.entity.CraftGhast;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntityGhast extends EntityFlying implements IMobs {
|
||||
|
||||
|
@ -2,9 +2,10 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftAnimals;
|
||||
import org.bukkit.craftbukkit.entity.CraftItem;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntityItem extends Entity {
|
||||
|
||||
|
@ -3,9 +3,10 @@ package net.minecraft.server;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftAnimals;
|
||||
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
//CraftBukkit end
|
||||
|
||||
public abstract class EntityLiving extends Entity {
|
||||
|
||||
|
@ -5,7 +5,6 @@ import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.entity.CraftEgg;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftPoweredMinecart;
|
||||
import org.bukkit.craftbukkit.entity.CraftStorageMinecart;
|
||||
|
@ -3,13 +3,9 @@ package net.minecraft.server;
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftMinecart;
|
||||
import org.bukkit.craftbukkit.entity.CraftMonster;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
|
||||
import org.bukkit.event.entity.EntityDamageByBlockEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
|
@ -2,8 +2,10 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftPainting;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntityPainting extends Entity {
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftPig;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntityPig extends EntityAnimals {
|
||||
|
||||
|
@ -3,8 +3,10 @@ package net.minecraft.server;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftPigZombie;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntityPigZombie extends EntityZombie {
|
||||
|
||||
|
@ -3,12 +3,13 @@ package net.minecraft.server;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
//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;
|
||||
// CraftBukkit end
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
//CraftBukkit end
|
||||
|
||||
public abstract class EntityPlayer extends EntityLiving {
|
||||
|
||||
|
@ -2,8 +2,10 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftSheep;
|
||||
//CraftBukkit end
|
||||
|
||||
public class EntitySheep extends EntityAnimals {
|
||||
|
||||
|
@ -2,6 +2,7 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.entity.CraftSkeleton;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.event.Event.Type;
|
||||
|
@ -2,9 +2,10 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftSkeleton;
|
||||
import org.bukkit.craftbukkit.entity.CraftSlime;
|
||||
//CraftBukkit stop
|
||||
|
||||
public class EntitySlime extends EntityLiving implements IMobs {
|
||||
|
||||
|
@ -4,8 +4,6 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftSnowball;
|
||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||
|
@ -2,8 +2,10 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftSpider;
|
||||
//CraftBukkit stop
|
||||
|
||||
public class EntitySpider extends EntityMobs {
|
||||
|
||||
|
@ -2,8 +2,10 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftSquid;
|
||||
//CraftBukkit stop
|
||||
|
||||
public class EntitySquid extends EntityWaterMob {
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftSkeleton;
|
||||
import org.bukkit.craftbukkit.entity.CraftTNTPrimed;
|
||||
//CraftBukkit stop
|
||||
|
||||
public class EntityTNTPrimed extends Entity {
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftWaterMob;
|
||||
//CraftBukkit stop
|
||||
|
||||
public class EntityWaterMob extends EntityCreature implements IAnimals {
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.entity.CraftZombie;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.event.Event.Type;
|
||||
|
@ -1,7 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
//CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftGiant;
|
||||
//CraftBukkit stop
|
||||
|
||||
public class EntityZombieSimple extends EntityMobs {
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren