Files
2019-02-24 22:29:41 +08:00

29 lines
1.2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/entity/item/EntityItemFrame.java
+++ ../src-work/minecraft/net/minecraft/entity/item/EntityItemFrame.java
@@ -63,6 +63,9 @@
{
if (!this.world.isRemote)
{
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, source, amount, false) || this.isDead) {
+ return true;
+ }
this.dropItemOrSelf(source.getTrueSource(), false);
this.playSound(SoundEvents.ENTITY_ITEMFRAME_REMOVE_ITEM, 1.0F, 1.0F);
this.setDisplayedItem(ItemStack.EMPTY);
@@ -140,13 +143,14 @@
{
if (!stack.isEmpty())
{
- if (stack.getItem() == Items.FILLED_MAP)
+ if (stack.getItem() instanceof ItemMap)
{
MapData mapdata = ((ItemMap)stack.getItem()).getMapData(stack, this.world);
mapdata.mapDecorations.remove("frame-" + this.getEntityId());
}
stack.setItemFrame((EntityItemFrame)null);
+ this.setDisplayedItem(ItemStack.EMPTY); //Forge: Fix MC-124833 Pistons duplicating Items.
}
}