mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-26 15:03:04 +00:00
Initial annotations/nullability changes (#3392)
This commit is contained in:
1 parent
1fa0c0c548
commit
9cf74914e7
37 files changed
+172
-104
No files matched your search
@@ -25,6 +25,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* This event is called when an item is rendered in an item frame.
|
||||
*
|
||||
@@ -44,6 +46,7 @@ public class RenderItemInFrameEvent extends Event
|
||||
renderer = renderItemFrame;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public ItemStack getItem()
|
||||
{
|
||||
return item;
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.util.EnumHand;
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
@@ -23,7 +24,7 @@ public class RenderSpecificHandEvent extends Event
|
||||
private final float equipProgress;
|
||||
private final ItemStack stack;
|
||||
|
||||
public RenderSpecificHandEvent(EnumHand hand, float partialTicks, float interpolatedPitch, float swingProgress, float equipProgress, ItemStack stack)
|
||||
public RenderSpecificHandEvent(EnumHand hand, float partialTicks, float interpolatedPitch, float swingProgress, float equipProgress, @Nonnull ItemStack stack)
|
||||
{
|
||||
this.hand = hand;
|
||||
this.partialTicks = partialTicks;
|
||||
@@ -70,7 +71,7 @@ public class RenderSpecificHandEvent extends Event
|
||||
/**
|
||||
* @return The ItemStack to be rendered, or null.
|
||||
*/
|
||||
@Nullable
|
||||
@Nonnull
|
||||
public ItemStack getItemStack()
|
||||
{
|
||||
return stack;
|
||||
|
||||
@@ -32,7 +32,7 @@ public abstract class RenderTooltipEvent extends Event
|
||||
protected int y;
|
||||
protected FontRenderer fr;
|
||||
|
||||
public RenderTooltipEvent(@Nullable ItemStack stack, @Nonnull List<String> lines, int x, int y, @Nonnull FontRenderer fr)
|
||||
public RenderTooltipEvent(@Nonnull ItemStack stack, @Nonnull List<String> lines, int x, int y, @Nonnull FontRenderer fr)
|
||||
{
|
||||
this.stack = stack;
|
||||
this.lines = Collections.unmodifiableList(lines); // Leave editing to ItemTooltipEvent
|
||||
@@ -44,7 +44,7 @@ public abstract class RenderTooltipEvent extends Event
|
||||
/**
|
||||
* @return The stack which the tooltip is being rendered for. As tooltips can be drawn without itemstacks, this return is {@link Nullable}.
|
||||
*/
|
||||
@Nullable
|
||||
@Nonnull
|
||||
public ItemStack getStack()
|
||||
{
|
||||
return stack;
|
||||
|
||||
Reference in new issue
Block a user