Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
[Bleeding] Made Iron Golems and Ocelots throw EntityDeathEvent. This fixes BUKKIT-1010.
Dieser Commit ist enthalten in:
Ursprung
1c641ed982
Commit
0ba2d285f0
@ -1,5 +1,7 @@
|
|||||||
package net.minecraft.server;
|
package net.minecraft.server;
|
||||||
|
|
||||||
|
import org.bukkit.craftbukkit.inventory.CraftItemStack; // CraftBukkit
|
||||||
|
|
||||||
public class EntityIronGolem extends EntityGolem {
|
public class EntityIronGolem extends EntityGolem {
|
||||||
|
|
||||||
private int b = 0;
|
private int b = 0;
|
||||||
@ -133,19 +135,24 @@ public class EntityIronGolem extends EntityGolem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void dropDeathLoot(boolean flag, int i) {
|
protected void dropDeathLoot(boolean flag, int i) {
|
||||||
|
// CraftBukkit start
|
||||||
|
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
|
||||||
int j = this.random.nextInt(3);
|
int j = this.random.nextInt(3);
|
||||||
|
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
for (k = 0; k < j; ++k) {
|
for (k = 0; k < j; ++k) {
|
||||||
this.b(Block.RED_ROSE.id, 1);
|
loot.add(new CraftItemStack(Block.RED_ROSE.id, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
k = 3 + this.random.nextInt(3);
|
k = 3 + this.random.nextInt(3);
|
||||||
|
|
||||||
for (int l = 0; l < k; ++l) {
|
for (int l = 0; l < k; ++l) {
|
||||||
this.b(Item.IRON_INGOT.id, 1);
|
loot.add(new CraftItemStack(Item.IRON_INGOT.id, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
|
||||||
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
public int m_() {
|
public int m_() {
|
||||||
|
@ -100,7 +100,9 @@ public class EntityOcelot extends EntityTameableAnimal {
|
|||||||
return super.damageEntity(damagesource, i);
|
return super.damageEntity(damagesource, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void dropDeathLoot(boolean flag, int i) {}
|
protected void dropDeathLoot(boolean flag, int i) {
|
||||||
|
super.dropDeathLoot(flag, i); // CraftBukkit - Calls EntityDeathEvent
|
||||||
|
}
|
||||||
|
|
||||||
public boolean b(EntityHuman entityhuman) {
|
public boolean b(EntityHuman entityhuman) {
|
||||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren