2013-06-11 04:06:05 +00:00
|
|
|
From 06619c389d4a286352b99b7867e887145af6839e Mon Sep 17 00:00:00 2001
|
2013-06-02 05:01:04 +00:00
|
|
|
From: Nick Minkler <sleaker@gmail.com>
|
|
|
|
Date: Sun, 2 Jun 2013 15:04:37 +1000
|
|
|
|
Subject: [PATCH] Fix EntityShootBowEvent with Skeletons
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySkeleton.java b/src/main/java/net/minecraft/server/EntitySkeleton.java
|
2013-06-02 06:47:46 +00:00
|
|
|
index 9494627..dba2257 100644
|
2013-06-02 05:01:04 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntitySkeleton.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntitySkeleton.java
|
2013-06-02 06:47:46 +00:00
|
|
|
@@ -245,9 +245,21 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity {
|
2013-06-02 05:01:04 +00:00
|
|
|
if (EnchantmentManager.getEnchantmentLevel(Enchantment.ARROW_FIRE.id, this.bG()) > 0 || this.getSkeletonType() == 1) {
|
|
|
|
entityarrow.setOnFire(100);
|
|
|
|
}
|
|
|
|
+ // Spigot - Skeletons should throw EntityShootBowEvents
|
|
|
|
+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent( this, this.bG(), entityarrow, 1.6F );
|
|
|
|
+ if ( event.isCancelled() )
|
|
|
|
+ {
|
|
|
|
+ event.getProjectile().remove();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if ( event.getProjectile() == entityarrow.getBukkitEntity() )
|
|
|
|
+ {
|
|
|
|
+ this.world.addEntity( entityarrow );
|
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
|
|
|
|
|
|
|
this.makeSound("random.bow", 1.0F, 1.0F / (this.aE().nextFloat() * 0.4F + 0.8F));
|
2013-06-02 06:47:46 +00:00
|
|
|
- this.world.addEntity(entityarrow);
|
|
|
|
+ // this.world.addEntity(entityarrow); // Spigot - moved up
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getSkeletonType() {
|
2013-06-02 05:01:04 +00:00
|
|
|
--
|
|
|
|
1.8.1.2
|
|
|
|
|