2016-03-13 16:38:07 +01:00
|
|
|
--- a/net/minecraft/server/PathfinderGoalHorseTrap.java
|
|
|
|
+++ b/net/minecraft/server/PathfinderGoalHorseTrap.java
|
2018-09-15 11:16:42 +02:00
|
|
|
@@ -18,16 +18,17 @@
|
|
|
|
this.a.s(false);
|
|
|
|
this.a.setTamed(true);
|
|
|
|
this.a.setAgeRaw(0);
|
|
|
|
- this.a.world.strikeLightning(new EntityLightning(this.a.world, this.a.locX, this.a.locY, this.a.locZ, true));
|
|
|
|
+ ((WorldServer) this.a.world).strikeLightning(new EntityLightning(this.a.world, this.a.locX, this.a.locY, this.a.locZ, true), org.bukkit.event.weather.LightningStrikeEvent.Cause.TRAP); // CraftBukkit
|
2016-03-13 16:38:07 +01:00
|
|
|
EntitySkeleton entityskeleton = this.a(difficultydamagescaler, this.a);
|
|
|
|
|
|
|
|
- entityskeleton.startRiding(this.a);
|
|
|
|
+ if (entityskeleton != null) entityskeleton.startRiding(this.a); // CraftBukkit
|
|
|
|
|
|
|
|
for (int i = 0; i < 3; ++i) {
|
2016-11-17 02:41:03 +01:00
|
|
|
EntityHorseAbstract entityhorseabstract = this.a(difficultydamagescaler);
|
|
|
|
+ if (entityhorseabstract == null) continue; // CraftBukkit
|
|
|
|
EntitySkeleton entityskeleton1 = this.a(difficultydamagescaler, entityhorseabstract);
|
2016-03-13 16:38:07 +01:00
|
|
|
|
2016-11-17 02:41:03 +01:00
|
|
|
- entityskeleton1.startRiding(entityhorseabstract);
|
|
|
|
+ if (entityskeleton1 != null) entityskeleton1.startRiding(entityhorseabstract); // CraftBukkit
|
|
|
|
entityhorseabstract.f(this.a.getRandom().nextGaussian() * 0.5D, 0.0D, this.a.getRandom().nextGaussian() * 0.5D);
|
2016-03-13 16:38:07 +01:00
|
|
|
}
|
|
|
|
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -42,7 +43,7 @@
|
2018-08-26 04:00:00 +02:00
|
|
|
entityhorseskeleton.di();
|
2016-11-17 02:41:03 +01:00
|
|
|
entityhorseskeleton.setTamed(true);
|
|
|
|
entityhorseskeleton.setAgeRaw(0);
|
|
|
|
- entityhorseskeleton.world.addEntity(entityhorseskeleton);
|
|
|
|
+ if (!entityhorseskeleton.world.addEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.TRAP)) return null; // CraftBukkit
|
|
|
|
return entityhorseskeleton;
|
2016-03-13 16:38:07 +01:00
|
|
|
}
|
|
|
|
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -59,7 +60,7 @@
|
2016-03-13 16:38:07 +01:00
|
|
|
|
2016-11-17 02:41:03 +01:00
|
|
|
entityskeleton.setSlot(EnumItemSlot.MAINHAND, EnchantmentManager.a(entityskeleton.getRandom(), entityskeleton.getItemInMainHand(), (int) (5.0F + difficultydamagescaler.d() * (float) entityskeleton.getRandom().nextInt(18)), false));
|
|
|
|
entityskeleton.setSlot(EnumItemSlot.HEAD, EnchantmentManager.a(entityskeleton.getRandom(), entityskeleton.getEquipment(EnumItemSlot.HEAD), (int) (5.0F + difficultydamagescaler.d() * (float) entityskeleton.getRandom().nextInt(18)), false));
|
2016-03-13 16:38:07 +01:00
|
|
|
- entityskeleton.world.addEntity(entityskeleton);
|
|
|
|
+ if (!entityskeleton.world.addEntity(entityskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.JOCKEY)) return null; // CraftBukkit
|
|
|
|
return entityskeleton;
|
|
|
|
}
|
|
|
|
}
|