[1.11] Fix nullability issues around ForgeHooks and Capabilities (#3395)

This commit is contained in:
mezz authored and LexManos committed 2016-11-17 10:44:31 -08:00
1 parent bf090cb4c2
commit 150566d9a3
26 files changed
+165 -108

No files matched your search

@@ -38,6 +38,9 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* PlayerDestroyItemEvent is fired when a player destroys an item.<br>
* This event is fired whenever a player destroys an item in
@@ -61,16 +64,20 @@ import net.minecraft.util.EnumHand;
**/
public class PlayerDestroyItemEvent extends PlayerEvent
{
@Nonnull
private final ItemStack original;
@Nullable
private final EnumHand hand; // May be null if this player destroys the item by any use besides holding it.
public PlayerDestroyItemEvent(EntityPlayer player, ItemStack original, EnumHand hand)
public PlayerDestroyItemEvent(EntityPlayer player, @Nonnull ItemStack original, @Nullable EnumHand hand)
{
super(player);
this.original = original;
this.hand = hand;
}
@Nonnull
public ItemStack getOriginal() { return this.original; }
@Nullable
public EnumHand getHand() { return this.hand; }
}