2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/EntitySkeleton.java
|
|
|
|
+++ b/net/minecraft/server/EntitySkeleton.java
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -2,13 +2,14 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
import java.util.Calendar;
|
2016-05-10 13:47:39 +02:00
|
|
|
import javax.annotation.Nullable;
|
2014-11-25 22:32:16 +01:00
|
|
|
+import org.bukkit.event.entity.EntityCombustEvent; // CraftBukkit
|
2016-05-10 13:47:39 +02:00
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
public class EntitySkeleton extends EntityMonster implements IRangedEntity {
|
|
|
|
|
2016-02-29 22:32:46 +01:00
|
|
|
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.b);
|
|
|
|
private static final DataWatcherObject<Boolean> b = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.h);
|
|
|
|
private final PathfinderGoalBowShoot c = new PathfinderGoalBowShoot(this, 1.0D, 20, 15.0F);
|
2016-06-09 03:43:49 +02:00
|
|
|
- private final PathfinderGoalMeleeAttack bx = new PathfinderGoalMeleeAttack(this, 1.2D, flag) {
|
|
|
|
+ private final PathfinderGoalMeleeAttack bx = new PathfinderGoalMeleeAttack(this, 1.2D, false) { // CraftBukkit decompile error flag -> false
|
2016-02-29 22:32:46 +01:00
|
|
|
public void d() {
|
|
|
|
super.d();
|
|
|
|
EntitySkeleton.this.a(false);
|
2016-06-09 03:43:49 +02:00
|
|
|
@@ -105,7 +106,14 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (flag) {
|
|
|
|
- this.setOnFire(8);
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
|
|
|
|
+ this.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
+
|
|
|
|
+ if (!event.isCancelled()) {
|
|
|
|
+ this.setOnFire(event.getDuration());
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-06-09 03:43:49 +02:00
|
|
|
@@ -128,7 +136,7 @@
|
2015-04-13 12:47:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void die(DamageSource damagesource) {
|
|
|
|
- super.die(damagesource);
|
|
|
|
+ // super.die(damagesource); // CraftBukkit
|
|
|
|
if (damagesource.i() instanceof EntityArrow && damagesource.getEntity() instanceof EntityHuman) {
|
|
|
|
EntityHuman entityhuman = (EntityHuman) damagesource.getEntity();
|
|
|
|
double d0 = entityhuman.locX - this.locX;
|
2016-06-09 03:43:49 +02:00
|
|
|
@@ -141,6 +149,7 @@
|
2016-02-29 22:32:46 +01:00
|
|
|
((EntityCreeper) damagesource.getEntity()).setCausedHeadDrop();
|
2016-06-09 03:43:49 +02:00
|
|
|
this.a(new ItemStack(Items.SKULL, 1, this.getSkeletonType() == EnumSkeletonType.WITHER ? 1 : 0), 0.0F);
|
2015-04-13 12:47:47 +02:00
|
|
|
}
|
|
|
|
+ super.die(damagesource); // CraftBukkit - moved from above
|
2016-03-07 09:51:42 +01:00
|
|
|
|
2015-04-13 12:47:47 +02:00
|
|
|
}
|
|
|
|
|
2016-06-09 03:43:49 +02:00
|
|
|
@@ -234,7 +243,14 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2016-06-09 03:43:49 +02:00
|
|
|
flag = flag || EnchantmentManager.a(Enchantments.ARROW_FIRE, (EntityLiving) this) > 0;
|
|
|
|
if (flag) {
|
2016-02-29 22:32:46 +01:00
|
|
|
- entitytippedarrow.setOnFire(100);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start - call EntityCombustEvent
|
2016-02-29 22:32:46 +01:00
|
|
|
+ EntityCombustEvent event = new EntityCombustEvent(entitytippedarrow.getBukkitEntity(), 100);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ this.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
+
|
|
|
|
+ if (!event.isCancelled()) {
|
2016-02-29 22:32:46 +01:00
|
|
|
+ entitytippedarrow.setOnFire(event.getDuration());
|
2014-11-25 22:32:16 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2016-06-09 03:43:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ItemStack itemstack = this.b(EnumHand.OFF_HAND);
|
|
|
|
@@ -245,8 +261,20 @@
|
|
|
|
entitytippedarrow.a(new MobEffect(MobEffects.SLOWER_MOVEMENT, 600));
|
|
|
|
}
|
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
2016-02-29 22:32:46 +01:00
|
|
|
+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getItemInMainHand(), entitytippedarrow, 0.8F);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ if (event.isCancelled()) {
|
|
|
|
+ event.getProjectile().remove();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
2016-02-29 22:32:46 +01:00
|
|
|
+ if (event.getProjectile() == entitytippedarrow.getBukkitEntity()) {
|
|
|
|
+ world.addEntity(entitytippedarrow);
|
2016-06-09 03:43:49 +02:00
|
|
|
+ }
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit end
|
2016-06-09 03:43:49 +02:00
|
|
|
+
|
|
|
|
this.a(SoundEffects.fz, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F));
|
2016-02-29 22:32:46 +01:00
|
|
|
- this.world.addEntity(entitytippedarrow);
|
|
|
|
+ // this.world.addEntity(entitytippedarrow); // CraftBukkit - moved up
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
2016-06-09 03:43:49 +02:00
|
|
|
public EnumSkeletonType getSkeletonType() {
|