Remove redundant Nonnull annotations (everything is Nonnull by default)

This commit is contained in:
mezz committed 2016-12-22 19:45:08 -08:00
1 parent abf6ccb3ed
commit 8bf6b19a63
26 files changed
+22 -76

No files matched your search

@@ -5,7 +5,6 @@
******************************************************************************/
package forestry.api.apiculture;
import javax.annotation.Nonnull;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -31,7 +30,6 @@ public class BeeManager {
/**
* List of items that can induce swarming. Integer denotes x in 1000 chance.
*/
@Nonnull
public static final Map<ItemStack, Integer> inducers = new HashMap<>();
/**
@@ -5,7 +5,6 @@
******************************************************************************/
package forestry.api.arboriculture;
import javax.annotation.Nonnull;
import java.awt.Color;
import forestry.api.genetics.IClassification;
@@ -30,7 +29,7 @@ public interface ITreeFactory {
* @param generator The tree generator
* @return a new tree species allele.
*/
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, @Nonnull IWoodProvider woodProvider, ITreeGenerator generator);
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, IWoodProvider woodProvider, ITreeGenerator generator);
/**
* Get one of the built-in Forestry leaf types. Default type is deciduous.
@@ -1,7 +1,5 @@
package forestry.apiculture.compat;
import javax.annotation.Nonnull;
import forestry.api.apiculture.BeeManager;
import forestry.api.genetics.IAlleleSpecies;
import forestry.apiculture.PluginApiculture;
@@ -30,7 +28,7 @@ public class ApicultureJeiPlugin extends BlankModPlugin {
}
@Override
public void register(@Nonnull IModRegistry registry) {
public void register(IModRegistry registry) {
ItemRegistryApiculture items = PluginApiculture.items;
JeiUtil.addDescription(registry, "frames",
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.arboriculture.tiles;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.Random;
@@ -57,7 +56,6 @@ public abstract class TileTreeContainer extends TileEntity implements IStreamabl
ownerHandler.readFromNBT(nbttagcompound);
}
@Nonnull
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
nbttagcompound = super.writeToNBT(nbttagcompound);
@@ -131,7 +129,6 @@ public abstract class TileTreeContainer extends TileEntity implements IStreamabl
return !Block.isEqualTo(oldState.getBlock(), newSate.getBlock());
}
@Nonnull
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
return new SPacketUpdateTileEntity(this.getPos(), 0, getUpdateTag());
@@ -144,7 +141,6 @@ public abstract class TileTreeContainer extends TileEntity implements IStreamabl
handleUpdateTag(nbt);
}
@Nonnull
@Override
public NBTTagCompound getUpdateTag() {
NBTTagCompound tag = super.getUpdateTag();
@@ -152,7 +148,7 @@ public abstract class TileTreeContainer extends TileEntity implements IStreamabl
}
@Override
public void handleUpdateTag(@Nonnull NBTTagCompound tag) {
public void handleUpdateTag(NBTTagCompound tag) {
super.handleUpdateTag(tag);
NBTUtilForestry.readStreamableFromNbt(this, tag);
}
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.core;
import javax.annotation.Nonnull;
import com.google.common.base.Preconditions;
import forestry.api.core.CamouflageManager;
@@ -31,7 +30,7 @@ import org.apache.commons.lang3.tuple.Pair;
public class CamouflageHandlerDefault implements ICamouflageItemHandler {
@Override
public boolean canHandle(@Nonnull ItemStack stack) {
public boolean canHandle(ItemStack stack) {
if (stack.isEmpty() || Block.getBlockFromItem(stack.getItem()) == Blocks.AIR) {
return false;
}
@@ -53,7 +52,7 @@ public class CamouflageHandlerDefault implements ICamouflageItemHandler {
@SideOnly(Side.CLIENT)
@Override
public Pair<IBlockState, IBakedModel> getModel(@Nonnull ItemStack stack, ICamouflageHandler camouflageHandler, ICamouflagedTile camouflageTile) {
public Pair<IBlockState, IBakedModel> getModel(ItemStack stack, ICamouflageHandler camouflageHandler, ICamouflagedTile camouflageTile) {
Preconditions.checkNotNull(camouflageHandler);
Preconditions.checkArgument(!stack.isEmpty(), "Stack cannot be empty");
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.core.circuits;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
@@ -27,14 +26,12 @@ import net.minecraft.util.text.TextFormatting;
public class CircuitBoard<T> implements ICircuitBoard {
@Nonnull
private final EnumCircuitBoardType type;
@Nullable
private final ICircuitLayout layout;
@Nonnull
private final ICircuit[] circuits;
public CircuitBoard(@Nonnull EnumCircuitBoardType type, @Nullable ICircuitLayout layout, @Nonnull ICircuit[] circuits) {
public CircuitBoard(EnumCircuitBoardType type, @Nullable ICircuitLayout layout, ICircuit[] circuits) {
this.type = type;
this.layout = layout;
this.circuits = circuits;
@@ -166,13 +163,11 @@ public class CircuitBoard<T> implements ICircuitBoard {
}
}
@Nonnull
@Override
public ICircuit[] getCircuits() {
return circuits;
}
@Nonnull
@Override
public ICircuitSocketType getSocketType() {
return layout.getSocketType();
@@ -10,43 +10,35 @@
******************************************************************************/
package forestry.core.circuits;
import javax.annotation.Nonnull;
import forestry.api.circuits.ICircuitLayout;
import forestry.api.circuits.ICircuitSocketType;
import forestry.core.utils.Translator;
public class CircuitLayout implements ICircuitLayout {
@Nonnull
private final String uid;
@Nonnull
private final ICircuitSocketType socketType;
public CircuitLayout(@Nonnull String uid, @Nonnull ICircuitSocketType socketType) {
public CircuitLayout(String uid, ICircuitSocketType socketType) {
this.uid = uid;
this.socketType = socketType;
}
@Nonnull
@Override
public String getUID() {
return "forestry." + this.uid;
}
@Nonnull
@Override
public String getName() {
return Translator.translateToLocal("for.circuit.layout." + this.uid + ".name");
}
@Nonnull
@Override
public String getUsage() {
return Translator.translateToLocal("for.circuit.layout." + this.uid + ".usage");
}
@Nonnull
@Override
public ICircuitSocketType getSocketType() {
return socketType;
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.core.fluids;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import forestry.core.utils.InventoryUtil;
@@ -41,7 +40,7 @@ public final class FluidHelper {
}
}
public static boolean canAcceptFluid(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing facing, @Nonnull FluidStack fluid) {
public static boolean canAcceptFluid(World world, BlockPos pos, EnumFacing facing, FluidStack fluid) {
IFluidHandler capability = FluidUtil.getFluidHandler(world, pos, facing);
if (capability != null) {
if (capability.getTankProperties() == null) {
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.core.gui;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.awt.Rectangle;
import java.io.IOException;
@@ -261,7 +260,6 @@ public abstract class GuiForestry<C extends Container, I extends IInventory> ext
super.drawGradientRect(par1, par2, par3, par4, par5, par6);
}
@Nonnull
public List<Rectangle> getExtraGuiAreas() {
return ledgerManager.getLedgerAreas();
}
@@ -36,12 +36,9 @@ public class SlotFiltered extends SlotWatched {
@Override
public boolean isItemValid(ItemStack itemstack) {
if (itemstack.isEmpty()) {
return true;
}
int slotIndex = getSlotIndex();
return !filterSlotDelegate.isLocked(slotIndex) &&
filterSlotDelegate.canSlotAccept(slotIndex, itemstack);
(itemstack.isEmpty() || filterSlotDelegate.canSlotAccept(slotIndex, itemstack));
}
public SlotFiltered setBlockedTexture(String ident) {
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.core.gui.slots;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import forestry.core.gui.tooltips.IToolTipProvider;
@@ -51,7 +50,7 @@ public class SlotForestry extends Slot implements IToolTipProvider {
}
@Override
public void putStack(@Nonnull ItemStack itemStack) {
public void putStack(ItemStack itemStack) {
if (!isPhantom() || canAdjustPhantom()) {
super.putStack(itemStack);
}
@@ -1,10 +1,10 @@
package forestry.core.inventory;
import forestry.api.core.INbtReadable;
import forestry.api.core.INbtWritable;
import forestry.core.tiles.IFilterSlotDelegate;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.nbt.NBTTagCompound;
public interface IInventoryAdapter extends ISidedInventory, IFilterSlotDelegate, INbtWritable {
void readFromNBT(NBTTagCompound nbt);
public interface IInventoryAdapter extends ISidedInventory, IFilterSlotDelegate, INbtWritable, INbtReadable {
}
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.core.network;
import javax.annotation.Nonnull;
import forestry.core.network.packets.PacketHandlerDummyClient;
@@ -65,18 +64,16 @@ public enum PacketIdClient implements IPacketId {
public static final PacketIdClient[] VALUES = values();
@Nonnull
private IForestryPacketHandlerClient packetHandler;
PacketIdClient() {
this.packetHandler = PacketHandlerDummyClient.instance;
}
public void setPacketHandler(@Nonnull IForestryPacketHandlerClient packetHandler) {
public void setPacketHandler(IForestryPacketHandlerClient packetHandler) {
this.packetHandler = packetHandler;
}
@Nonnull
public IForestryPacketHandlerClient getPacketHandler() {
return packetHandler;
}
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.core.network;
import javax.annotation.Nonnull;
import forestry.core.network.packets.PacketHandlerDummyServer;
@@ -43,18 +42,16 @@ public enum PacketIdServer implements IPacketId {
public static final PacketIdServer[] VALUES = values();
@Nonnull
private IForestryPacketHandlerServer packetHandler;
PacketIdServer() {
this.packetHandler = PacketHandlerDummyServer.instance;
}
public void setPacketHandler(@Nonnull IForestryPacketHandlerServer packetHandler) {
public void setPacketHandler(IForestryPacketHandlerServer packetHandler) {
this.packetHandler = packetHandler;
}
@Nonnull
public IForestryPacketHandlerServer getPacketHandler() {
return packetHandler;
}
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.core.proxy;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
@@ -114,7 +113,7 @@ public class ProxyRender {
/* FX */
public void addBeeHiveFX(@Nonnull IBeeHousing housing, @Nonnull IBeeGenome genome, @Nonnull List<BlockPos> flowerPositions) {
public void addBeeHiveFX(IBeeHousing housing, IBeeGenome genome, List<BlockPos> flowerPositions) {
}
public void addEntityHoneyDustFX(World world, double x, double y, double z) {
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.core.proxy;
import javax.annotation.Nonnull;
import java.util.List;
import com.google.common.collect.ImmutableMap;
@@ -140,7 +139,7 @@ public class ProxyRenderClient extends ProxyRender {
}
@Override
public void registerBlockModel(@Nonnull final BlockModelEntry index) {
public void registerBlockModel(final BlockModelEntry index) {
ModelManager.getInstance().registerCustomBlockModel(index);
if (index.addStateMapper) {
StateMapperBase ignoreState = new BlockModeStateMapper(index);
@@ -149,7 +148,7 @@ public class ProxyRenderClient extends ProxyRender {
}
@Override
public void registerModel(@Nonnull ModelEntry index) {
public void registerModel(ModelEntry index) {
ModelManager.getInstance().registerCustomModel(index);
}
@@ -206,7 +205,7 @@ public class ProxyRenderClient extends ProxyRender {
}
@Override
public void addBeeHiveFX(@Nonnull IBeeHousing housing, @Nonnull IBeeGenome genome, @Nonnull List<BlockPos> flowerPositions) {
public void addBeeHiveFX(IBeeHousing housing, IBeeGenome genome, List<BlockPos> flowerPositions) {
World world = housing.getWorldObj();
if (!shouldSpawnParticle(world)) {
return;
@@ -1,6 +1,5 @@
package forestry.core.render;
import javax.annotation.Nonnull;
import java.io.IOException;
import java.util.Map;
@@ -33,14 +32,14 @@ public class TextureMapForestry extends TextureMap {
}
@Override
public void loadTexture(@Nonnull IResourceManager resourceManager) throws IOException {
public void loadTexture(IResourceManager resourceManager) throws IOException {
this.initMissingImage();
this.deleteGlTexture();
this.loadTextureAtlas(resourceManager);
}
@Override
public void loadTextureAtlas(@Nonnull IResourceManager resourceManager) {
public void loadTextureAtlas(IResourceManager resourceManager) {
int i = Minecraft.getGLMaximumTextureSize();
Stitcher stitcher = new Stitcher(i, i, 0, 0);
this.mapUploadedSprites.clear();
@@ -10,7 +10,6 @@
// ******************************************************************************/
//package forestry.energy.tiles;
//
//import javax.annotation.Nonnull;
//import java.io.IOException;
//
//import forestry.api.circuits.ChipsetManager;
@@ -10,7 +10,6 @@
// ******************************************************************************/
//package forestry.energy.tiles;
//
//import javax.annotation.Nonnull;
//import javax.annotation.Nullable;
//import java.io.IOException;
//
@@ -1,6 +1,5 @@
//package forestry.farming.logic;
//
//import javax.annotation.Nonnull;
//
//import java.util.Collection;
//import java.util.List;
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.farming.logic;
import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Stack;
@@ -36,7 +35,7 @@ public abstract class FarmLogicCrops extends FarmLogicWatered {
}
@Override
public boolean isAcceptedGround(@Nonnull IBlockState blockState) {
public boolean isAcceptedGround(IBlockState blockState) {
return super.isAcceptedGround(blockState) || blockState.getBlock() == Blocks.FARMLAND;
}
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.farming.tiles;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import forestry.core.fluids.ITankManager;
@@ -20,7 +19,6 @@ import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
public class TileFarmValve extends TileFarm implements ILiquidTankTile {
@Nonnull
@Override
public ITankManager getTankManager() {
return getMultiblockLogic().getController().getTankManager();
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.lepidopterology.genetics;
import javax.annotation.Nonnull;
import com.google.common.base.Preconditions;
import forestry.api.genetics.EnumTolerance;
@@ -58,13 +57,11 @@ public class ButterflyGenome extends Genome implements IButterflyGenome {
/* SPECIES */
@Override
@Nonnull
public IAlleleButterflySpecies getPrimary() {
return (IAlleleButterflySpecies) getActiveAllele(EnumButterflyChromosome.SPECIES);
}
@Override
@Nonnull
public IAlleleButterflySpecies getSecondary() {
return (IAlleleButterflySpecies) getInactiveAllele(EnumButterflyChromosome.SPECIES);
}
@@ -135,7 +132,6 @@ public class ButterflyGenome extends Genome implements IButterflyGenome {
}
@Override
@Nonnull
public ISpeciesRoot getSpeciesRoot() {
return ButterflyManager.butterflyRoot;
}
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.mail.tiles;
import javax.annotation.Nonnull;
import java.io.IOException;
import com.google.common.base.Preconditions;
@@ -71,7 +70,6 @@ public class TileTrader extends TileBase implements IOwnedTile {
}
/* SAVING & LOADING */
@Nonnull
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
nbttagcompound = super.writeToNBT(nbttagcompound);
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.plugins;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.HashSet;
import java.util.List;
@@ -45,7 +44,6 @@ public abstract class BlankForestryPlugin implements IForestryPlugin {
return "";
}
@Nonnull
@Override
public Set<String> getDependencyUids() {
Set<String> dependencyUids = new HashSet<>();
@@ -10,7 +10,6 @@
// ******************************************************************************/
//package forestry.plugins.compat;
//
//import javax.annotation.Nonnull;
//import java.util.Set;
//
//import com.google.common.collect.ImmutableMap;