mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 14:34:28 +00:00
[1.11] Fix nullability issues around ForgeHooks and Capabilities (#3395)
This commit is contained in:
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; }
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user