mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 11:29:15 +00:00
46c563aExpose more of the village construction parts for building village piece1380c2eAllow access to the type "ComponentVillage"71a3818Documentation and registration for villager stuffe3a343cFix javadoc derp195b1a0Villager trading, manipulation and village enhancement. Still WIP but sh69e66c3Fix exception based logging to actually log the exception!
57 lines
1.7 KiB
Diff
57 lines
1.7 KiB
Diff
--- ../src_base/common/net/minecraft/src/EntityItem.java
|
|
+++ ../src_work/common/net/minecraft/src/EntityItem.java
|
|
@@ -1,6 +1,9 @@
|
|
package net.minecraft.src;
|
|
|
|
import java.util.Iterator;
|
|
+
|
|
+import net.minecraftforge.common.MinecraftForge;
|
|
+import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
|
|
|
@@ -122,6 +125,11 @@
|
|
{
|
|
this.setDead();
|
|
}
|
|
+
|
|
+ if (this.item == null || this.item.stackSize <= 0)
|
|
+ {
|
|
+ this.setDead();
|
|
+ }
|
|
}
|
|
|
|
public boolean func_70289_a(EntityItem par1EntityItem)
|
|
@@ -225,7 +233,7 @@
|
|
NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("Item");
|
|
this.item = ItemStack.loadItemStackFromNBT(var2);
|
|
|
|
- if (this.item == null)
|
|
+ if (this.item == null || this.item.stackSize <= 0)
|
|
{
|
|
this.setDead();
|
|
}
|
|
@@ -238,9 +246,21 @@
|
|
{
|
|
if (!this.worldObj.isRemote)
|
|
{
|
|
+ if (this.delayBeforeCanPickup > 0)
|
|
+ {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ EntityItemPickupEvent event = new EntityItemPickupEvent(par1EntityPlayer, this);
|
|
+
|
|
+ if (MinecraftForge.EVENT_BUS.post(event))
|
|
+ {
|
|
+ return;
|
|
+ }
|
|
+
|
|
int var2 = this.item.stackSize;
|
|
|
|
- if (this.delayBeforeCanPickup == 0 && par1EntityPlayer.inventory.addItemStackToInventory(this.item))
|
|
+ if (this.delayBeforeCanPickup <= 0 && (event.isHandled() || var2 <= 0 || par1EntityPlayer.inventory.addItemStackToInventory(this.item)))
|
|
{
|
|
if (this.item.itemID == Block.wood.blockID)
|
|
{
|