[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

@@ -23,6 +23,8 @@ import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull;
/**
*
* AnvilUpdateEvent is fired when a player places items in both the left and right slots of a anvil.
@@ -33,27 +35,34 @@ import net.minecraft.item.ItemStack;
@Cancelable
public class AnvilUpdateEvent extends Event
{
@Nonnull
private final ItemStack left; // The left side of the input
@Nonnull
private final ItemStack right; // The right side of the input
private final String name; // The name to set the item, if the user specified one.
@Nonnull
private ItemStack output; // Set this to set the output stack
private int cost; // The base cost, set this to change it if output != null
private int materialCost; // The number of items from the right slot to be consumed during the repair. Leave as 0 to consume the entire stack.
public AnvilUpdateEvent(ItemStack left, ItemStack right, String name, int cost)
public AnvilUpdateEvent(@Nonnull ItemStack left, @Nonnull ItemStack right, String name, int cost)
{
this.left = left;
this.right = right;
this.output = ItemStack.field_190927_a;
this.name = name;
this.setCost(cost);
this.setMaterialCost(0);
}
@Nonnull
public ItemStack getLeft() { return left; }
@Nonnull
public ItemStack getRight() { return right; }
public String getName() { return name; }
@Nonnull
public ItemStack getOutput() { return output; }
public void setOutput(ItemStack output) { this.output = output; }
public void setOutput(@Nonnull ItemStack output) { this.output = output; }
public int getCost() { return cost; }
public void setCost(int cost) { this.cost = cost; }
public int getMaterialCost() { return materialCost; }