From 0a3a933b77b1f67aecb51b643a3fdf5335d468a4 Mon Sep 17 00:00:00 2001 From: temp1011 <34900092+temp1011@users.noreply.github.com> Date: Thu, 14 Jun 2018 17:07:31 +0100 Subject: [PATCH] Cleanup (#2138) --- .../forestry/api/climate/IClimateState.java | 2 +- .../java/forestry/api/core/ForestryAPI.java | 2 +- .../forestry/api/farming/IFarmRegistry.java | 6 +++--- .../java/forestry/api/fuels/FermenterFuel.java | 2 +- .../forestry/api/genetics/IClimateHelper.java | 8 ++++---- .../forestry/api/genetics/IFilterLogic.java | 2 +- .../forestry/api/genetics/ISpeciesRoot.java | 6 +++--- .../api/greenhouse/IGreenhouseHousing.java | 4 ++-- .../java/forestry/apiculture/ApiaristAI.java | 2 +- .../forestry/apiculture/HasFlowersCache.java | 2 +- .../java/forestry/apiculture/HiveConfig.java | 2 +- .../apiculture/commands/CommandBeeGive.java | 2 +- .../entities/EntityMinecartBeeHousingBase.java | 2 +- .../apiculture/flowers/FlowerRegistry.java | 4 +--- .../apiculture/genetics/BeekeepingMode.java | 4 +--- .../multiblock/AlvearyController.java | 2 +- .../network/packets/PacketAlvearyChange.java | 4 ++-- .../network/packets/PacketBeeLogicActive.java | 2 +- .../packets/PacketBeeLogicActiveEntity.java | 2 +- .../packets/PacketBeeLogicEntityRequest.java | 4 ++-- .../network/packets/PacketCandleUpdate.java | 4 ++-- .../packets/PacketHabitatBiomePointer.java | 4 ++-- .../PacketImprintSelectionResponse.java | 4 ++-- .../apiculture/tiles/TileBeeHousingBase.java | 2 +- .../blocks/BlockDecorativeWoodPile.java | 4 ++-- .../commands/CommandTreeSpawn.java | 2 +- .../arboriculture/commands/TreeGenHelper.java | 4 ++-- .../compat/ArboricultureJeiPlugin.java | 4 ---- .../arboriculture/genetics/TreePlugin.java | 2 +- .../arboriculture/models/MultipartModel.java | 3 +-- .../network/PacketRipeningUpdate.java | 4 ++-- .../arboriculture/tiles/TileFruitPod.java | 2 +- .../arboriculture/tiles/TileLeaves.java | 6 ++---- .../arboriculture/tiles/TileTreeContainer.java | 2 +- .../book/data/structure/StructureInfo.java | 4 +--- .../book/gui/GuiForestryBookCategories.java | 2 +- .../book/gui/GuiForestryBookEntries.java | 2 +- .../book/gui/GuiForestryBookPages.java | 2 +- .../book/gui/elements/MultiblockElement.java | 4 ++-- .../core/commands/CommandModeInfo.java | 2 +- .../forestry/core/commands/CommandModeSet.java | 2 +- src/main/java/forestry/core/config/Config.java | 8 ++++---- .../forestry/core/fluids/StandardTank.java | 2 +- .../multiblock/FakeMultiblockController.java | 2 +- .../forestry/core/network/ForestryPacket.java | 2 +- .../network/packets/PacketActiveUpdate.java | 2 +- .../network/packets/PacketChipsetClick.java | 4 ++-- .../network/packets/PacketErrorUpdate.java | 4 ++-- .../packets/PacketErrorUpdateEntity.java | 4 ++-- .../core/network/packets/PacketFXSignal.java | 2 +- .../packets/PacketGenomeTrackerSync.java | 2 +- .../core/network/packets/PacketGuiEnergy.java | 4 ++-- .../network/packets/PacketGuiLayoutSelect.java | 4 ++-- .../packets/PacketGuiSelectRequest.java | 4 ++-- .../core/network/packets/PacketGuiUpdate.java | 2 +- .../network/packets/PacketGuiUpdateEntity.java | 2 +- .../packets/PacketHandlerDummyServer.java | 2 +- .../packets/PacketItemStackDisplay.java | 2 +- .../network/packets/PacketPipetteClick.java | 4 ++-- .../network/packets/PacketSocketUpdate.java | 2 +- .../packets/PacketSolderingIronClick.java | 4 ++-- .../network/packets/PacketTankLevelUpdate.java | 4 ++-- .../network/packets/PacketUpdateClimate.java | 2 +- .../java/forestry/core/owner/OwnerHandler.java | 2 +- .../core/render/TextureMapForestry.java | 2 +- .../core/tiles/EscritoireGameToken.java | 2 +- .../network/packets/PacketExtractItem.java | 4 ++-- .../network/packets/PacketInsertItem.java | 4 ++-- .../java/forestry/energy/EnergyManager.java | 2 +- .../forestry/energy/tiles/TileEuGenerator.java | 2 +- .../factory/inventory/InventoryRainmaker.java | 7 ++++--- .../factory/inventory/InventorySqueezer.java | 4 +--- .../packets/PacketRecipeTransferRequest.java | 2 +- .../packets/PacketRecipeTransferUpdate.java | 2 +- .../forestry/factory/tiles/TileRaintank.java | 4 +--- .../multiblock/FarmFertilizerManager.java | 2 +- .../multiblock/FarmHydrationManager.java | 2 +- .../greenhouse/climate/ClimateSource.java | 5 ++--- .../climate/GreenhouseClimateManager.java | 2 +- .../multiblock/GreenhouseLimits.java | 2 +- .../blocks/GreenhouseBlockCache.java | 2 +- .../storage/GreenhouseProviderClient.java | 2 +- .../storage/GreenhouseProviderServer.java | 2 +- .../blocks/world/GreenhouseBlockManager.java | 2 +- .../multiblock/blocks/world/NextTickEntry.java | 2 +- .../packets/PacketCamouflageSelection.java | 2 +- .../network/packets/PacketGreenhouseData.java | 2 +- .../packets/PacketGreenhouseDataRequest.java | 4 ++-- .../packets/PacketSelectClimateTargeted.java | 4 ++-- .../proxy/ProxyGreenhouseClient.java | 18 ++++++------------ .../entities/AIButterflyRest.java | 5 ++--- .../lepidopterology/tiles/TileCocoon.java | 2 +- .../forestry/mail/commands/CommandMail.java | 2 +- .../packets/PacketLetterInfoRequest.java | 4 ++-- .../network/packets/PacketLetterTextSet.java | 4 ++-- .../packets/PacketPOBoxInfoResponse.java | 4 ++-- .../packets/PacketTraderAddressRequest.java | 4 ++-- .../packets/PacketTraderAddressResponse.java | 4 ++-- .../java/forestry/sorting/FakeFilterLogic.java | 2 +- .../java/forestry/sorting/FilterLogic.java | 10 ++++------ .../packets/PacketFilterChangeGenome.java | 4 ++-- .../packets/PacketFilterChangeRule.java | 4 ++-- .../network/packets/PacketGuiFilterUpdate.java | 2 +- .../packets/PacketWorktableMemoryUpdate.java | 2 +- .../packets/PacketWorktableRecipeRequest.java | 2 +- 105 files changed, 158 insertions(+), 184 deletions(-) diff --git a/src/main/java/forestry/api/climate/IClimateState.java b/src/main/java/forestry/api/climate/IClimateState.java index 61ffcdd29..56fa5db2d 100644 --- a/src/main/java/forestry/api/climate/IClimateState.java +++ b/src/main/java/forestry/api/climate/IClimateState.java @@ -12,7 +12,7 @@ import forestry.api.core.INbtWritable; /** * A {@link IClimateState} is used to store and handle temperature and humidity. * - * The values are oriented on the values of {@link Biome#getTemperature()} and {@link Biome#getRainfall()}. + * The values are oriented on the values of {@link Biome#getDefaultTemperature()} and {@link Biome#getRainfall()}. */ public interface IClimateState extends INbtWritable { diff --git a/src/main/java/forestry/api/core/ForestryAPI.java b/src/main/java/forestry/api/core/ForestryAPI.java index 5e9cbe806..b8a186087 100644 --- a/src/main/java/forestry/api/core/ForestryAPI.java +++ b/src/main/java/forestry/api/core/ForestryAPI.java @@ -26,7 +26,7 @@ import forestry.api.modules.IModuleManager; * If you need to distribute API files, try to only include the parts you are actually * using to minimize conflicts due to API changes. *

- * .core - Miscallenous base classes and interfaces as well as some basics for tools, armor, game modes and stuff needed by biome mods. + * .core - Miscellaneous base classes and interfaces as well as some basics for tools, armor, game modes and stuff needed by biome mods. * .fuels - Managers and classes to facilitate adding fuels to various engines and machines. * .recipes - Managers and helpers to facilitate adding new recipes to various machines. * .storage - Managers, events and interfaces for defining new backpacks and handling backpack behaviour. diff --git a/src/main/java/forestry/api/farming/IFarmRegistry.java b/src/main/java/forestry/api/farming/IFarmRegistry.java index d580b5133..c8dad116f 100644 --- a/src/main/java/forestry/api/farming/IFarmRegistry.java +++ b/src/main/java/forestry/api/farming/IFarmRegistry.java @@ -63,13 +63,13 @@ public interface IFarmRegistry { } /** - * @param itemStack - * @param value The value of the fertitlizer. The value of the forestry fertelizer is 500. + * @param itemStack the fertilizer itemstack + * @param value The value of the fertilizer. The value of the forestry fertilizer is 500. */ void registerFertilizer(ItemStack itemStack, int value); /** - * @return The value of the fertitlizer + * @return The value of the fertilizer */ int getFertilizeValue(ItemStack itemStack); diff --git a/src/main/java/forestry/api/fuels/FermenterFuel.java b/src/main/java/forestry/api/fuels/FermenterFuel.java index 28cfd2b9a..63bfd75e9 100644 --- a/src/main/java/forestry/api/fuels/FermenterFuel.java +++ b/src/main/java/forestry/api/fuels/FermenterFuel.java @@ -26,7 +26,7 @@ public class FermenterFuel { } /** - * How much is fermeted per work cycle, i.e. how much biomass is produced per cycle. + * How much is fermented per work cycle, i.e. how much biomass is produced per cycle. */ public int getFermentPerCycle() { return fermentPerCycle; diff --git a/src/main/java/forestry/api/genetics/IClimateHelper.java b/src/main/java/forestry/api/genetics/IClimateHelper.java index b88ca690e..1458e76f0 100644 --- a/src/main/java/forestry/api/genetics/IClimateHelper.java +++ b/src/main/java/forestry/api/genetics/IClimateHelper.java @@ -33,20 +33,20 @@ public interface IClimateHelper { /** * Gets a collection of humidities which fit the given parameters. * - * @param prefered Base humidity from which to measure. + * @param preferred Base humidity from which to measure. * @param tolerance Tolerance to apply to the base humidity. * @return A collection of humidities which fall within the given parameters. */ - Collection getToleratedHumidity(EnumHumidity prefered, EnumTolerance tolerance); + Collection getToleratedHumidity(EnumHumidity preferred, EnumTolerance tolerance); /** * Gets a collection of temperatures which fit the given parameters. * - * @param prefered Base temperature from which to measure. + * @param preferred Base temperature from which to measure. * @param tolerance Tolerance to apply to the base temperatures. * @return A collection of temperatures which fall within the given parameters. */ - Collection getToleratedTemperature(EnumTemperature prefered, EnumTolerance tolerance); + Collection getToleratedTemperature(EnumTemperature preferred, EnumTolerance tolerance); /** * Gets a localized, human readable string for the given temperature. diff --git a/src/main/java/forestry/api/genetics/IFilterLogic.java b/src/main/java/forestry/api/genetics/IFilterLogic.java index f76506595..30d5afcc5 100644 --- a/src/main/java/forestry/api/genetics/IFilterLogic.java +++ b/src/main/java/forestry/api/genetics/IFilterLogic.java @@ -20,7 +20,7 @@ public interface IFilterLogic extends INbtWritable, INbtReadable { void writeGuiData(PacketBuffer data); @SideOnly(Side.CLIENT) - void readGuiData(PacketBuffer data) throws IOException; + void readGuiData(PacketBuffer data); Collection getValidDirections(ItemStack itemStack, EnumFacing from); diff --git a/src/main/java/forestry/api/genetics/ISpeciesRoot.java b/src/main/java/forestry/api/genetics/ISpeciesRoot.java index 276f12d3d..56da678d9 100644 --- a/src/main/java/forestry/api/genetics/ISpeciesRoot.java +++ b/src/main/java/forestry/api/genetics/ISpeciesRoot.java @@ -70,13 +70,13 @@ public interface ISpeciesRoot { IIndividual getMember(NBTTagCompound compound); - void registerTranslator(Object translatorKey, IIndividualTranslator translator); + void registerTranslator(Object translatorKey, IIndividualTranslator translator); @Nullable - IIndividualTranslator getTranslator(Object translatorKey); + IIndividualTranslator getTranslator(Object translatorKey); @Nullable - I translateMember(O objectToTranslator); + I translateMember(O objectToTranslator); @Nullable ISpeciesType getType(ItemStack itemStack); diff --git a/src/main/java/forestry/api/greenhouse/IGreenhouseHousing.java b/src/main/java/forestry/api/greenhouse/IGreenhouseHousing.java index 5689f38e6..ad9860b06 100644 --- a/src/main/java/forestry/api/greenhouse/IGreenhouseHousing.java +++ b/src/main/java/forestry/api/greenhouse/IGreenhouseHousing.java @@ -12,7 +12,7 @@ import forestry.api.core.IErrorLogicSource; public interface IGreenhouseHousing extends IErrorLogicSource, IClimateHousing{ /** - * @return The current tempreture as an enum. + * @return The current temperature as an enum. */ EnumTemperature getTemperature(); @@ -22,7 +22,7 @@ public interface IGreenhouseHousing extends IErrorLogicSource, IClimateHousing{ EnumHumidity getHumidity(); /** - * @return The current tempreture as an float. Range: 0.0F ~ 2.0F + * @return The current temperature as an float. Range: 0.0F ~ 2.0F */ float getExactTemperature(); diff --git a/src/main/java/forestry/apiculture/ApiaristAI.java b/src/main/java/forestry/apiculture/ApiaristAI.java index 8b80370ef..cfbbfe547 100644 --- a/src/main/java/forestry/apiculture/ApiaristAI.java +++ b/src/main/java/forestry/apiculture/ApiaristAI.java @@ -30,7 +30,7 @@ public class ApiaristAI extends EntityAIMoveToBlock { private final EntityVillager villager; private boolean hasDrone; private boolean hasPrincess; - private InventoryBasic villagerInventory; + private final InventoryBasic villagerInventory; private static final int SLOT_PRODUCT_1 = InventoryBeeHousing.SLOT_PRODUCT_1; private static final int SLOT_PRODUCT_COUNT = InventoryBeeHousing.SLOT_PRODUCT_COUNT; diff --git a/src/main/java/forestry/apiculture/HasFlowersCache.java b/src/main/java/forestry/apiculture/HasFlowersCache.java index 12d57197f..e8ac05a60 100644 --- a/src/main/java/forestry/apiculture/HasFlowersCache.java +++ b/src/main/java/forestry/apiculture/HasFlowersCache.java @@ -225,7 +225,7 @@ public class HasFlowersCache implements INbtWritable, INbtReadable { } } - public void readData(PacketBuffer data) throws IOException { + public void readData(PacketBuffer data) { flowerCoords.clear(); flowers.clear(); diff --git a/src/main/java/forestry/apiculture/HiveConfig.java b/src/main/java/forestry/apiculture/HiveConfig.java index cd164f7e1..70aa9a057 100644 --- a/src/main/java/forestry/apiculture/HiveConfig.java +++ b/src/main/java/forestry/apiculture/HiveConfig.java @@ -16,7 +16,7 @@ import forestry.api.apiculture.hives.IHiveRegistry; import forestry.core.config.LocalizedConfiguration; public class HiveConfig { - private static final Map configs = new EnumMap(IHiveRegistry.HiveType.class); + private static final Map configs = new EnumMap<>(IHiveRegistry.HiveType.class); private static final String CATEGORY = "world.generate.beehives.blacklist"; private final Set blacklistedTypes = new HashSet<>(); diff --git a/src/main/java/forestry/apiculture/commands/CommandBeeGive.java b/src/main/java/forestry/apiculture/commands/CommandBeeGive.java index ca2531c00..0699632d9 100644 --- a/src/main/java/forestry/apiculture/commands/CommandBeeGive.java +++ b/src/main/java/forestry/apiculture/commands/CommandBeeGive.java @@ -97,7 +97,7 @@ public class CommandBeeGive extends SubCommand { CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.bee.give.given", player.getName(), bee.getGenome().getPrimary().getAlleleName(), beeType.getName()); } - private static IBeeGenome getBeeGenome(String speciesName) throws SpeciesNotFoundException, TemplateNotFoundException { + private static IBeeGenome getBeeGenome(String speciesName) throws SpeciesNotFoundException { IAlleleBeeSpecies species = null; for (String uid : AlleleManager.alleleRegistry.getRegisteredAlleles().keySet()) { diff --git a/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java b/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java index 0c7097c3e..0b30af7c1 100644 --- a/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java +++ b/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java @@ -172,7 +172,7 @@ public abstract class EntityMinecartBeeHousingBase extends EntityMinecartContain } @Override - public void readGuiData(PacketBufferForestry data) throws IOException { + public void readGuiData(PacketBufferForestry data) { breedingProgressPercent = data.readVarInt(); } diff --git a/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java b/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java index 04e04349f..df2bfe6c1 100644 --- a/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java +++ b/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java @@ -319,9 +319,7 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe } } - if (isAcceptedFlower(blockState, acceptedBlocks, acceptedBlockStates)) { - return true; - } + return isAcceptedFlower(blockState, acceptedBlocks, acceptedBlockStates); } } return false; diff --git a/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java b/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java index 64a5b5aa0..83dc37d65 100755 --- a/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java +++ b/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java @@ -99,9 +99,7 @@ public class BeekeepingMode implements IBeekeepingMode { float mutationModifier = beeModifier.getMutationModifier(queen.getGenome(), queen.getMate(), 1.0f); if (mutationModifier > 10) { - if (housing.getWorldObj().rand.nextFloat() * 100 < 0.4 * (mutationModifier * mutationModifier - 100)) { - return true; - } + return housing.getWorldObj().rand.nextFloat() * 100 < 0.4 * (mutationModifier * mutationModifier - 100); } return false; diff --git a/src/main/java/forestry/apiculture/multiblock/AlvearyController.java b/src/main/java/forestry/apiculture/multiblock/AlvearyController.java index 188983836..b7ef95358 100644 --- a/src/main/java/forestry/apiculture/multiblock/AlvearyController.java +++ b/src/main/java/forestry/apiculture/multiblock/AlvearyController.java @@ -430,7 +430,7 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple } @Override - public void readGuiData(PacketBufferForestry data) throws IOException { + public void readGuiData(PacketBufferForestry data) { breedingProgressPercent = data.readVarInt(); tempChange = data.readVarInt() / 100.0F; humidChange = data.readVarInt() / 100.0F; diff --git a/src/main/java/forestry/apiculture/network/packets/PacketAlvearyChange.java b/src/main/java/forestry/apiculture/network/packets/PacketAlvearyChange.java index fb70e421e..0ceee4410 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketAlvearyChange.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketAlvearyChange.java @@ -37,14 +37,14 @@ public class PacketAlvearyChange extends ForestryPacket implements IForestryPack } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(controllerPos); } @SideOnly(Side.CLIENT) public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { BlockPos pos = data.readBlockPos(); TileUtil.actOnTile(player.world, pos, IMultiblockComponent.class, tile -> tile.getMultiblockLogic().getController().reassemble()); } diff --git a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActive.java b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActive.java index 6820a9057..ee33d2469 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActive.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActive.java @@ -40,7 +40,7 @@ public class PacketBeeLogicActive extends ForestryPacket implements IForestryPac } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(tilePos); beekeepingLogic.writeData(data); } diff --git a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActiveEntity.java b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActiveEntity.java index dfc44393d..fea5323b9 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActiveEntity.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActiveEntity.java @@ -42,7 +42,7 @@ public class PacketBeeLogicActiveEntity extends ForestryPacket implements IFores } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeEntityById(entity); beekeepingLogic.writeData(data); } diff --git a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicEntityRequest.java b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicEntityRequest.java index 8fec0e58e..77407dbb6 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicEntityRequest.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicEntityRequest.java @@ -35,13 +35,13 @@ public class PacketBeeLogicEntityRequest extends ForestryPacket implements IFore } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeEntityById(entity); } public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { Entity entity = data.readEntityById(player.world); if (entity instanceof IBeeHousing) { IBeeHousing beeHousing = (IBeeHousing) entity; diff --git a/src/main/java/forestry/apiculture/network/packets/PacketCandleUpdate.java b/src/main/java/forestry/apiculture/network/packets/PacketCandleUpdate.java index fcb08ddfa..83fb0a303 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketCandleUpdate.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketCandleUpdate.java @@ -41,7 +41,7 @@ public class PacketCandleUpdate extends ForestryPacket implements IForestryPacke } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeInt(colour); data.writeBoolean(lit); @@ -50,7 +50,7 @@ public class PacketCandleUpdate extends ForestryPacket implements IForestryPacke @SideOnly(Side.CLIENT) public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { BlockPos pos = data.readBlockPos(); int colour = data.readInt(); boolean lit = data.readBoolean(); diff --git a/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java b/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java index ffbdeb476..88f62505f 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java @@ -31,7 +31,7 @@ public class PacketHabitatBiomePointer extends ForestryPacket implements IForest } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); } @@ -43,7 +43,7 @@ public class PacketHabitatBiomePointer extends ForestryPacket implements IForest @SideOnly(Side.CLIENT) public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { BlockPos pos = data.readBlockPos(); TextureHabitatLocator.getInstance().setTargetCoordinates(pos); } diff --git a/src/main/java/forestry/apiculture/network/packets/PacketImprintSelectionResponse.java b/src/main/java/forestry/apiculture/network/packets/PacketImprintSelectionResponse.java index ea1610800..c5143c729 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketImprintSelectionResponse.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketImprintSelectionResponse.java @@ -38,7 +38,7 @@ public class PacketImprintSelectionResponse extends ForestryPacket implements IF } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeVarInt(primary); data.writeVarInt(secondary); } @@ -46,7 +46,7 @@ public class PacketImprintSelectionResponse extends ForestryPacket implements IF @SideOnly(Side.CLIENT) public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { Container container = player.openContainer; if (container instanceof ContainerImprinter) { int primaryIndex = data.readVarInt(); diff --git a/src/main/java/forestry/apiculture/tiles/TileBeeHousingBase.java b/src/main/java/forestry/apiculture/tiles/TileBeeHousingBase.java index 164736f7c..d5bfe2fac 100644 --- a/src/main/java/forestry/apiculture/tiles/TileBeeHousingBase.java +++ b/src/main/java/forestry/apiculture/tiles/TileBeeHousingBase.java @@ -163,7 +163,7 @@ public abstract class TileBeeHousingBase extends TileBase implements IBeeHousing } @Override - public void readGuiData(PacketBufferForestry data) throws IOException { + public void readGuiData(PacketBufferForestry data) { breedingProgressPercent = data.readVarInt(); } diff --git a/src/main/java/forestry/arboriculture/blocks/BlockDecorativeWoodPile.java b/src/main/java/forestry/arboriculture/blocks/BlockDecorativeWoodPile.java index 8e4f35d13..79ab83741 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockDecorativeWoodPile.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockDecorativeWoodPile.java @@ -24,7 +24,7 @@ import forestry.api.core.IModelManager; import forestry.api.core.Tabs; public class BlockDecorativeWoodPile extends BlockRotatedPillar implements IItemModelRegister { - public static final PropertyEnum AXIS = PropertyEnum.create("axis", EnumFacing.Axis.class); + public static final PropertyEnum AXIS = PropertyEnum.create("axis", EnumFacing.Axis.class); public BlockDecorativeWoodPile() { super(Material.WOOD); @@ -111,7 +111,7 @@ public class BlockDecorativeWoodPile extends BlockRotatedPillar implements IItem } protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[]{AXIS}); + return new BlockStateContainer(this, AXIS); } protected ItemStack getSilkTouchDrop(IBlockState state) { diff --git a/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java b/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java index 0b746d462..3b191e1ab 100644 --- a/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java +++ b/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java @@ -40,7 +40,7 @@ public final class CommandTreeSpawn extends SubCommand { } @Override - public void executeSubCommand(MinecraftServer server, ICommandSender sender, String[] args) throws PlayerNotFoundException, SpeciesNotFoundException, TemplateNotFoundException { + public void executeSubCommand(MinecraftServer server, ICommandSender sender, String[] args) throws SpeciesNotFoundException, TemplateNotFoundException { if (args.length < 1 || args.length > 2) { printHelp(sender); return; diff --git a/src/main/java/forestry/arboriculture/commands/TreeGenHelper.java b/src/main/java/forestry/arboriculture/commands/TreeGenHelper.java index fd68eb183..fab3ec113 100644 --- a/src/main/java/forestry/arboriculture/commands/TreeGenHelper.java +++ b/src/main/java/forestry/arboriculture/commands/TreeGenHelper.java @@ -28,7 +28,7 @@ import net.minecraft.world.gen.feature.WorldGenerator; public final class TreeGenHelper { - public static WorldGenerator getWorldGen(String treeName, EntityPlayer player, BlockPos pos) throws SpeciesNotFoundException, TemplateNotFoundException { + public static WorldGenerator getWorldGen(String treeName, EntityPlayer player, BlockPos pos) throws SpeciesNotFoundException { ITreeGenome treeGenome = getTreeGenome(treeName); ITree tree = TreeManager.treeRoot.getTree(player.world, treeGenome); return tree.getTreeGenerator(player.world, pos, true); @@ -69,7 +69,7 @@ public final class TreeGenHelper { return false; } - private static ITreeGenome getTreeGenome(String speciesName) throws SpeciesNotFoundException, TemplateNotFoundException { + private static ITreeGenome getTreeGenome(String speciesName) throws SpeciesNotFoundException { IAlleleTreeSpecies species = null; for (String uid : AlleleManager.alleleRegistry.getRegisteredAlleles().keySet()) { diff --git a/src/main/java/forestry/arboriculture/compat/ArboricultureJeiPlugin.java b/src/main/java/forestry/arboriculture/compat/ArboricultureJeiPlugin.java index 6d9b7b597..9facd4336 100644 --- a/src/main/java/forestry/arboriculture/compat/ArboricultureJeiPlugin.java +++ b/src/main/java/forestry/arboriculture/compat/ArboricultureJeiPlugin.java @@ -2,12 +2,8 @@ package forestry.arboriculture.compat; import com.google.common.base.Preconditions; -import net.minecraft.util.ResourceLocation; - -import forestry.api.core.ForestryAPI; import forestry.arboriculture.ModuleArboriculture; import forestry.arboriculture.items.ItemRegistryArboriculture; -import forestry.core.config.Constants; import forestry.core.utils.JeiUtil; import forestry.modules.ForestryModuleUids; import forestry.modules.ModuleHelper; diff --git a/src/main/java/forestry/arboriculture/genetics/TreePlugin.java b/src/main/java/forestry/arboriculture/genetics/TreePlugin.java index fea6f3a07..b823be8cc 100644 --- a/src/main/java/forestry/arboriculture/genetics/TreePlugin.java +++ b/src/main/java/forestry/arboriculture/genetics/TreePlugin.java @@ -29,7 +29,7 @@ public class TreePlugin extends DatabasePlugin { private TreePlugin() { super(new TreeDatabaseTab(DatabaseMode.ACTIVE), new TreeDatabaseTab(DatabaseMode.INACTIVE), - new ProductsTab(()-> ItemFruit.EnumFruit.CHERRY.getStack()), + new ProductsTab(ItemFruit.EnumFruit.CHERRY::getStack), new MutationsTab(()->ModuleArboriculture.getItems().grafter.getItemStack())); NonNullList treeList = NonNullList.create(); ModuleArboriculture.getItems().sapling.addCreativeItems(treeList, false); diff --git a/src/main/java/forestry/arboriculture/models/MultipartModel.java b/src/main/java/forestry/arboriculture/models/MultipartModel.java index a896b4838..b33a30159 100755 --- a/src/main/java/forestry/arboriculture/models/MultipartModel.java +++ b/src/main/java/forestry/arboriculture/models/MultipartModel.java @@ -47,8 +47,7 @@ public class MultipartModel implements IModel { partModels = builder.build(); } - private MultipartModel(ResourceLocation location, Multipart multipart, ImmutableMap partModels) - throws Exception { + private MultipartModel(ResourceLocation location, Multipart multipart, ImmutableMap partModels) { this.location = location; this.multipart = multipart; this.partModels = partModels; diff --git a/src/main/java/forestry/arboriculture/network/PacketRipeningUpdate.java b/src/main/java/forestry/arboriculture/network/PacketRipeningUpdate.java index e5cb8d7c7..86dd7b210 100644 --- a/src/main/java/forestry/arboriculture/network/PacketRipeningUpdate.java +++ b/src/main/java/forestry/arboriculture/network/PacketRipeningUpdate.java @@ -39,7 +39,7 @@ public class PacketRipeningUpdate extends ForestryPacket implements IForestryPac } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeVarInt(value); } @@ -47,7 +47,7 @@ public class PacketRipeningUpdate extends ForestryPacket implements IForestryPac @SideOnly(Side.CLIENT) public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { BlockPos pos = data.readBlockPos(); int value = data.readVarInt(); diff --git a/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java b/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java index 1f57e8cc8..5093bfcab 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java +++ b/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java @@ -209,7 +209,7 @@ public class TileFruitPod extends TileEntity implements IFruitBearer, IStreamabl } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { IAllele stored = AlleleManager.alleleRegistry.getAllele(data.readString()); if (stored instanceof IAlleleFruit) { allele = (IAlleleFruit) stored; diff --git a/src/main/java/forestry/arboriculture/tiles/TileLeaves.java b/src/main/java/forestry/arboriculture/tiles/TileLeaves.java index 5e40a7070..17c85a376 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileLeaves.java +++ b/src/main/java/forestry/arboriculture/tiles/TileLeaves.java @@ -189,9 +189,7 @@ public class TileLeaves extends TileTreeContainer implements IPollinatable, IFru private boolean shouldConvertToDefaultLeaves() { if (getOwnerHandler().getOwner() == null) { // null owner likely means it's a worldgen tree ITree tree = getTree(); - if (tree != null && tree.getGenome().matchesTemplateGenome()) { - return true; - } + return tree != null && tree.getGenome().matchesTemplateGenome(); } return false; } @@ -389,7 +387,7 @@ public class TileLeaves extends TileTreeContainer implements IPollinatable, IFru } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { String speciesUID = data.readString(); // this is called instead of super.readData, be careful! diff --git a/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java b/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java index 5b6d6f415..d2b772780 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java +++ b/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java @@ -83,7 +83,7 @@ public abstract class TileTreeContainer extends TileEntity implements IStreamabl } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { String speciesUID = data.readString(); ITree tree = getTree(speciesUID); setTree(tree); diff --git a/src/main/java/forestry/book/data/structure/StructureInfo.java b/src/main/java/forestry/book/data/structure/StructureInfo.java index f4241fbee..8360eda98 100644 --- a/src/main/java/forestry/book/data/structure/StructureInfo.java +++ b/src/main/java/forestry/book/data/structure/StructureInfo.java @@ -93,9 +93,7 @@ public class StructureInfo { private boolean inside(int x, int y, int z, int[] rangeStart, int[] rangeEnd) { if (x >= rangeStart[0] && x <= rangeEnd[0]) { if (y >= rangeStart[1] && y <= rangeEnd[1]) { - if (z >= rangeStart[2] && z <= rangeEnd[2]) { - return true; - } + return z >= rangeStart[2] && z <= rangeEnd[2]; } } diff --git a/src/main/java/forestry/book/gui/GuiForestryBookCategories.java b/src/main/java/forestry/book/gui/GuiForestryBookCategories.java index 26ef6b6d6..9bd5bd639 100644 --- a/src/main/java/forestry/book/gui/GuiForestryBookCategories.java +++ b/src/main/java/forestry/book/gui/GuiForestryBookCategories.java @@ -57,7 +57,7 @@ public class GuiForestryBookCategories extends GuiForesterBook { } @Override - protected void actionPerformed(GuiButton button) throws IOException { + protected void actionPerformed(GuiButton button) { if (button instanceof GuiButtonBookCategory) { GuiButtonBookCategory buttonCategory = (GuiButtonBookCategory) button; mc.displayGuiScreen(new GuiForestryBookEntries(book, buttonCategory.category)); diff --git a/src/main/java/forestry/book/gui/GuiForestryBookEntries.java b/src/main/java/forestry/book/gui/GuiForestryBookEntries.java index 53cb8d958..5f0849cf7 100644 --- a/src/main/java/forestry/book/gui/GuiForestryBookEntries.java +++ b/src/main/java/forestry/book/gui/GuiForestryBookEntries.java @@ -62,7 +62,7 @@ public class GuiForestryBookEntries extends GuiForesterBook { } @Override - protected void actionPerformed(GuiButton button) throws IOException { + protected void actionPerformed(GuiButton button) { if (button instanceof GuiButtonPage) { GuiButtonPage pageButton = (GuiButtonPage) button; if (pageButton.left) { diff --git a/src/main/java/forestry/book/gui/GuiForestryBookPages.java b/src/main/java/forestry/book/gui/GuiForestryBookPages.java index e21ea9ace..db5d87df6 100644 --- a/src/main/java/forestry/book/gui/GuiForestryBookPages.java +++ b/src/main/java/forestry/book/gui/GuiForestryBookPages.java @@ -114,7 +114,7 @@ public class GuiForestryBookPages extends GuiForesterBook { } @Override - protected void actionPerformed(GuiButton button) throws IOException { + protected void actionPerformed(GuiButton button) { if (button instanceof GuiButtonPage) { GuiButtonPage pageButton = (GuiButtonPage) button; if (pageButton.left) { diff --git a/src/main/java/forestry/book/gui/elements/MultiblockElement.java b/src/main/java/forestry/book/gui/elements/MultiblockElement.java index bb4f14dca..173a3554e 100644 --- a/src/main/java/forestry/book/gui/elements/MultiblockElement.java +++ b/src/main/java/forestry/book/gui/elements/MultiblockElement.java @@ -48,8 +48,8 @@ public class MultiblockElement extends GuiElement { private boolean canTick = false; private int tick = 0; - private float rotX = 0; - private float rotY = 0; + private float rotX; + private float rotY; private StructureInfo structureData; private StructureBlockAccess blockAccess; diff --git a/src/main/java/forestry/core/commands/CommandModeInfo.java b/src/main/java/forestry/core/commands/CommandModeInfo.java index bc3f91a0d..705e00040 100644 --- a/src/main/java/forestry/core/commands/CommandModeInfo.java +++ b/src/main/java/forestry/core/commands/CommandModeInfo.java @@ -36,7 +36,7 @@ public class CommandModeInfo extends SubCommand { } @Override - public void executeSubCommand(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { + public void executeSubCommand(MinecraftServer server, ICommandSender sender, String[] args) { if (args.length <= 0) { printHelp(sender); return; diff --git a/src/main/java/forestry/core/commands/CommandModeSet.java b/src/main/java/forestry/core/commands/CommandModeSet.java index 973f3308b..afbcf9f1e 100644 --- a/src/main/java/forestry/core/commands/CommandModeSet.java +++ b/src/main/java/forestry/core/commands/CommandModeSet.java @@ -33,7 +33,7 @@ public final class CommandModeSet extends SubCommand { } @Override - public void executeSubCommand(MinecraftServer server, ICommandSender sender, String[] args) throws WrongUsageException { + public void executeSubCommand(MinecraftServer server, ICommandSender sender, String[] args) { if (args.length == 0 || args.length > 2) { printHelp(sender); return; diff --git a/src/main/java/forestry/core/config/Config.java b/src/main/java/forestry/core/config/Config.java index 8dc00cdb2..0f6b32709 100755 --- a/src/main/java/forestry/core/config/Config.java +++ b/src/main/java/forestry/core/config/Config.java @@ -79,16 +79,16 @@ public class Config { public static boolean generateApatiteOre = true; public static boolean generateCopperOre = true; public static boolean generateTinOre = true; - public static Set blacklistedOreDims = new HashSet(); - public static Set whitelistedOreDims = new HashSet(); + public static Set blacklistedOreDims = new HashSet<>(); + public static Set whitelistedOreDims = new HashSet<>(); private static float generateBeehivesAmount = 1.0f; public static boolean generateBeehivesDebug = false; public static boolean logHivePlacement = false; public static boolean enableVillagers = true; public static boolean generateTrees = true; public static float generateTreesAmount = 1.0F; - public static Set blacklistedTreeDims = new HashSet(); - public static Set whitelistedTreeDims = new HashSet(); + public static Set blacklistedTreeDims = new HashSet<>(); + public static Set whitelistedTreeDims = new HashSet<>(); // Retrogen public static boolean doRetrogen = false; diff --git a/src/main/java/forestry/core/fluids/StandardTank.java b/src/main/java/forestry/core/fluids/StandardTank.java index 94c929ba7..327cdeb75 100644 --- a/src/main/java/forestry/core/fluids/StandardTank.java +++ b/src/main/java/forestry/core/fluids/StandardTank.java @@ -119,7 +119,7 @@ public class StandardTank extends FluidTank implements IStreamable { } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { fluid = data.readFluidStack(); } diff --git a/src/main/java/forestry/core/multiblock/FakeMultiblockController.java b/src/main/java/forestry/core/multiblock/FakeMultiblockController.java index e7faea857..653e51fb6 100644 --- a/src/main/java/forestry/core/multiblock/FakeMultiblockController.java +++ b/src/main/java/forestry/core/multiblock/FakeMultiblockController.java @@ -192,7 +192,7 @@ public abstract class FakeMultiblockController implements IMultiblockControllerI } @Override - public void readGuiData(PacketBufferForestry data) throws IOException { + public void readGuiData(PacketBufferForestry data) { } } diff --git a/src/main/java/forestry/core/network/ForestryPacket.java b/src/main/java/forestry/core/network/ForestryPacket.java index 934a7f87c..bf1660f11 100755 --- a/src/main/java/forestry/core/network/ForestryPacket.java +++ b/src/main/java/forestry/core/network/ForestryPacket.java @@ -34,5 +34,5 @@ public abstract class ForestryPacket implements IForestryPacket { return new FMLProxyPacket(data, PacketHandler.channelId); } - protected abstract void writeData(PacketBufferForestry data) throws IOException; + protected abstract void writeData(PacketBufferForestry data); } diff --git a/src/main/java/forestry/core/network/packets/PacketActiveUpdate.java b/src/main/java/forestry/core/network/packets/PacketActiveUpdate.java index 18924e327..452627de4 100644 --- a/src/main/java/forestry/core/network/packets/PacketActiveUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketActiveUpdate.java @@ -45,7 +45,7 @@ public class PacketActiveUpdate extends ForestryPacket implements IForestryPacke } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeBoolean(active); } diff --git a/src/main/java/forestry/core/network/packets/PacketChipsetClick.java b/src/main/java/forestry/core/network/packets/PacketChipsetClick.java index 90777c3b6..6ea7ab244 100644 --- a/src/main/java/forestry/core/network/packets/PacketChipsetClick.java +++ b/src/main/java/forestry/core/network/packets/PacketChipsetClick.java @@ -30,7 +30,7 @@ public class PacketChipsetClick extends ForestryPacket implements IForestryPacke } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeVarInt(slot); } @@ -41,7 +41,7 @@ public class PacketChipsetClick extends ForestryPacket implements IForestryPacke public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { int slot = data.readVarInt(); if (player.openContainer instanceof IContainerSocketed) { diff --git a/src/main/java/forestry/core/network/packets/PacketErrorUpdate.java b/src/main/java/forestry/core/network/packets/PacketErrorUpdate.java index 9175e6f39..1c9dd0f98 100644 --- a/src/main/java/forestry/core/network/packets/PacketErrorUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketErrorUpdate.java @@ -36,7 +36,7 @@ public class PacketErrorUpdate extends ForestryPacket implements IForestryPacket } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); errorLogic.writeData(data); } @@ -49,7 +49,7 @@ public class PacketErrorUpdate extends ForestryPacket implements IForestryPacket @SideOnly(Side.CLIENT) public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { BlockPos pos = data.readBlockPos(); TileUtil.actOnTile(player.world, pos, IErrorLogicSource.class, errorSourceTile -> { diff --git a/src/main/java/forestry/core/network/packets/PacketErrorUpdateEntity.java b/src/main/java/forestry/core/network/packets/PacketErrorUpdateEntity.java index 4ca9c30b2..53e498624 100644 --- a/src/main/java/forestry/core/network/packets/PacketErrorUpdateEntity.java +++ b/src/main/java/forestry/core/network/packets/PacketErrorUpdateEntity.java @@ -39,7 +39,7 @@ public class PacketErrorUpdateEntity extends ForestryPacket implements IForestry } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeEntityById(entity); errorLogic.writeData(data); } @@ -47,7 +47,7 @@ public class PacketErrorUpdateEntity extends ForestryPacket implements IForestry @SideOnly(Side.CLIENT) public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { Entity entity = data.readEntityById(player.world); if (entity instanceof IErrorLogicSource) { IErrorLogicSource errorSourceTile = (IErrorLogicSource) entity; diff --git a/src/main/java/forestry/core/network/packets/PacketFXSignal.java b/src/main/java/forestry/core/network/packets/PacketFXSignal.java index 6861af0d7..36c6c6a9f 100644 --- a/src/main/java/forestry/core/network/packets/PacketFXSignal.java +++ b/src/main/java/forestry/core/network/packets/PacketFXSignal.java @@ -61,7 +61,7 @@ public class PacketFXSignal extends ForestryPacket implements IForestryPacketCli } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeByte(visualFX.ordinal()); data.writeByte(soundFX.ordinal()); diff --git a/src/main/java/forestry/core/network/packets/PacketGenomeTrackerSync.java b/src/main/java/forestry/core/network/packets/PacketGenomeTrackerSync.java index 062d0c4ef..fb1a356cc 100644 --- a/src/main/java/forestry/core/network/packets/PacketGenomeTrackerSync.java +++ b/src/main/java/forestry/core/network/packets/PacketGenomeTrackerSync.java @@ -41,7 +41,7 @@ public class PacketGenomeTrackerSync extends ForestryPacket implements IForestry } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeCompoundTag(nbt); } diff --git a/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java b/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java index ba015ba36..9ca9e9a4d 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java @@ -37,7 +37,7 @@ public class PacketGuiEnergy extends ForestryPacket implements IForestryPacketCl } @Override - public void writeData(PacketBufferForestry data) throws IOException { + public void writeData(PacketBufferForestry data) { data.writeVarInt(windowId); data.writeVarInt(value); } @@ -45,7 +45,7 @@ public class PacketGuiEnergy extends ForestryPacket implements IForestryPacketCl @SideOnly(Side.CLIENT) public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { int windowId = data.readVarInt(); int value = data.readVarInt(); if (player.openContainer instanceof ContainerTile && player.openContainer.windowId == windowId) { diff --git a/src/main/java/forestry/core/network/packets/PacketGuiLayoutSelect.java b/src/main/java/forestry/core/network/packets/PacketGuiLayoutSelect.java index a045706fd..6f0f3f2ba 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiLayoutSelect.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiLayoutSelect.java @@ -38,14 +38,14 @@ public class PacketGuiLayoutSelect extends ForestryPacket implements IForestryPa } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeString(layoutUid); } @SideOnly(Side.CLIENT) public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { String layoutUid = data.readString(); Container container = player.openContainer; if (!(container instanceof ContainerSolderingIron)) { diff --git a/src/main/java/forestry/core/network/packets/PacketGuiSelectRequest.java b/src/main/java/forestry/core/network/packets/PacketGuiSelectRequest.java index 822ece664..0b561e990 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiSelectRequest.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiSelectRequest.java @@ -36,14 +36,14 @@ public class PacketGuiSelectRequest extends ForestryPacket implements IForestryP } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeVarInt(primaryIndex); data.writeVarInt(secondaryIndex); } public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { int primary = data.readVarInt(); int secondary = data.readVarInt(); diff --git a/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java b/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java index 0e84e46ad..d106f1006 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java @@ -37,7 +37,7 @@ public class PacketGuiUpdate extends ForestryPacket implements IForestryPacketCl } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); guiDataTile.writeGuiData(data); } diff --git a/src/main/java/forestry/core/network/packets/PacketGuiUpdateEntity.java b/src/main/java/forestry/core/network/packets/PacketGuiUpdateEntity.java index 43a67ed67..e2a9bd1e2 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiUpdateEntity.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiUpdateEntity.java @@ -38,7 +38,7 @@ public class PacketGuiUpdateEntity extends ForestryPacket implements IForestryPa } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeEntityById(entity); streamableGui.writeGuiData(data); } diff --git a/src/main/java/forestry/core/network/packets/PacketHandlerDummyServer.java b/src/main/java/forestry/core/network/packets/PacketHandlerDummyServer.java index 38348306d..b5caf700d 100644 --- a/src/main/java/forestry/core/network/packets/PacketHandlerDummyServer.java +++ b/src/main/java/forestry/core/network/packets/PacketHandlerDummyServer.java @@ -24,7 +24,7 @@ public class PacketHandlerDummyServer extends PacketHandlerDummy implements IFor } @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { } } diff --git a/src/main/java/forestry/core/network/packets/PacketItemStackDisplay.java b/src/main/java/forestry/core/network/packets/PacketItemStackDisplay.java index 80d2156e3..4d11ce869 100644 --- a/src/main/java/forestry/core/network/packets/PacketItemStackDisplay.java +++ b/src/main/java/forestry/core/network/packets/PacketItemStackDisplay.java @@ -36,7 +36,7 @@ public class PacketItemStackDisplay extends ForestryPacket implements IForestryP } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeItemStack(itemStack); } diff --git a/src/main/java/forestry/core/network/packets/PacketPipetteClick.java b/src/main/java/forestry/core/network/packets/PacketPipetteClick.java index d33bdfbc4..62e79c7d3 100644 --- a/src/main/java/forestry/core/network/packets/PacketPipetteClick.java +++ b/src/main/java/forestry/core/network/packets/PacketPipetteClick.java @@ -28,7 +28,7 @@ public class PacketPipetteClick extends ForestryPacket implements IForestryPacke } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeVarInt(slot); } @@ -39,7 +39,7 @@ public class PacketPipetteClick extends ForestryPacket implements IForestryPacke public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { int slot = data.readVarInt(); if (player.openContainer instanceof IContainerLiquidTanks) { ((IContainerLiquidTanks) player.openContainer).handlePipetteClick(slot, player); diff --git a/src/main/java/forestry/core/network/packets/PacketSocketUpdate.java b/src/main/java/forestry/core/network/packets/PacketSocketUpdate.java index 2475541e2..1b6f63b8a 100644 --- a/src/main/java/forestry/core/network/packets/PacketSocketUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketSocketUpdate.java @@ -46,7 +46,7 @@ public class PacketSocketUpdate extends ForestryPacket implements IForestryPacke } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeItemStacks(itemStacks); } diff --git a/src/main/java/forestry/core/network/packets/PacketSolderingIronClick.java b/src/main/java/forestry/core/network/packets/PacketSolderingIronClick.java index 8b745fe6b..ec5456b35 100644 --- a/src/main/java/forestry/core/network/packets/PacketSolderingIronClick.java +++ b/src/main/java/forestry/core/network/packets/PacketSolderingIronClick.java @@ -34,13 +34,13 @@ public class PacketSolderingIronClick extends ForestryPacket implements IForestr } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeVarInt(slot); } public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { int slot = data.readVarInt(); if (!(player.openContainer instanceof IContainerSocketed)) { diff --git a/src/main/java/forestry/core/network/packets/PacketTankLevelUpdate.java b/src/main/java/forestry/core/network/packets/PacketTankLevelUpdate.java index 5335dab98..b3329d027 100644 --- a/src/main/java/forestry/core/network/packets/PacketTankLevelUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketTankLevelUpdate.java @@ -45,7 +45,7 @@ public class PacketTankLevelUpdate extends ForestryPacket implements IForestryPa } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeVarInt(tankIndex); data.writeFluidStack(contents); @@ -55,7 +55,7 @@ public class PacketTankLevelUpdate extends ForestryPacket implements IForestryPa public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { BlockPos pos = data.readBlockPos(); int tankIndex = data.readVarInt(); FluidStack contents = data.readFluidStack(); diff --git a/src/main/java/forestry/core/network/packets/PacketUpdateClimate.java b/src/main/java/forestry/core/network/packets/PacketUpdateClimate.java index c6f9d2793..07be96ae2 100644 --- a/src/main/java/forestry/core/network/packets/PacketUpdateClimate.java +++ b/src/main/java/forestry/core/network/packets/PacketUpdateClimate.java @@ -44,7 +44,7 @@ public class PacketUpdateClimate extends ForestryPacket implements IForestryPack } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); container.writeData(data); } diff --git a/src/main/java/forestry/core/owner/OwnerHandler.java b/src/main/java/forestry/core/owner/OwnerHandler.java index 8029f22d2..3fcf270ad 100644 --- a/src/main/java/forestry/core/owner/OwnerHandler.java +++ b/src/main/java/forestry/core/owner/OwnerHandler.java @@ -50,7 +50,7 @@ public class OwnerHandler implements IOwnerHandler, IStreamable, INbtWritable, I } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { if (data.readBoolean()) { GameProfile owner = new GameProfile(new UUID(data.readLong(), data.readLong()), data.readString()); setOwner(owner); diff --git a/src/main/java/forestry/core/render/TextureMapForestry.java b/src/main/java/forestry/core/render/TextureMapForestry.java index e38731214..c01be8771 100755 --- a/src/main/java/forestry/core/render/TextureMapForestry.java +++ b/src/main/java/forestry/core/render/TextureMapForestry.java @@ -34,7 +34,7 @@ public class TextureMapForestry extends TextureMap { } @Override - public void loadTexture(IResourceManager resourceManager) throws IOException { + public void loadTexture(IResourceManager resourceManager) { this.initMissingImage(); this.deleteGlTexture(); this.loadTextureAtlas(resourceManager); diff --git a/src/main/java/forestry/core/tiles/EscritoireGameToken.java b/src/main/java/forestry/core/tiles/EscritoireGameToken.java index adfcff2ca..b9d40aa46 100644 --- a/src/main/java/forestry/core/tiles/EscritoireGameToken.java +++ b/src/main/java/forestry/core/tiles/EscritoireGameToken.java @@ -175,7 +175,7 @@ public class EscritoireGameToken implements INbtWritable, IStreamable { } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { state = data.readEnum(State.VALUES); if (data.readBoolean()) { String speciesUid = data.readString(); diff --git a/src/main/java/forestry/database/network/packets/PacketExtractItem.java b/src/main/java/forestry/database/network/packets/PacketExtractItem.java index 16359e681..5308b48f6 100644 --- a/src/main/java/forestry/database/network/packets/PacketExtractItem.java +++ b/src/main/java/forestry/database/network/packets/PacketExtractItem.java @@ -31,7 +31,7 @@ public class PacketExtractItem extends ForestryPacket implements IForestryPacket } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeInt(invIndex); data.writeByte(flags); } @@ -43,7 +43,7 @@ public class PacketExtractItem extends ForestryPacket implements IForestryPacket public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { int invIndex = data.readInt(); byte flags = data.readByte(); diff --git a/src/main/java/forestry/database/network/packets/PacketInsertItem.java b/src/main/java/forestry/database/network/packets/PacketInsertItem.java index b62a71010..6de24c91a 100644 --- a/src/main/java/forestry/database/network/packets/PacketInsertItem.java +++ b/src/main/java/forestry/database/network/packets/PacketInsertItem.java @@ -24,7 +24,7 @@ public class PacketInsertItem extends ForestryPacket implements IForestryPacketS } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBoolean(single); } @@ -35,7 +35,7 @@ public class PacketInsertItem extends ForestryPacket implements IForestryPacketS public static class Handler implements IForestryPacketHandlerServer{ @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { boolean single = data.readBoolean(); Container container = player.openContainer; if(!(container instanceof ContainerDatabase)){ diff --git a/src/main/java/forestry/energy/EnergyManager.java b/src/main/java/forestry/energy/EnergyManager.java index ce29d14bf..e8c96ee42 100644 --- a/src/main/java/forestry/energy/EnergyManager.java +++ b/src/main/java/forestry/energy/EnergyManager.java @@ -66,7 +66,7 @@ public class EnergyManager extends EnergyStorage implements IStreamable, INbtRea } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { int energyStored = data.readVarInt(); setEnergyStored(energyStored); } diff --git a/src/main/java/forestry/energy/tiles/TileEuGenerator.java b/src/main/java/forestry/energy/tiles/TileEuGenerator.java index 08bd3e9ee..58af644d5 100755 --- a/src/main/java/forestry/energy/tiles/TileEuGenerator.java +++ b/src/main/java/forestry/energy/tiles/TileEuGenerator.java @@ -197,7 +197,7 @@ public class TileEuGenerator extends TileBase implements ISidedInventory, ILiqui } @Override - public void readGuiData(PacketBufferForestry data) throws IOException { + public void readGuiData(PacketBufferForestry data) { if (ic2EnergySource != null) { ic2EnergySource.setEnergyStored(data.readDouble()); } diff --git a/src/main/java/forestry/factory/inventory/InventoryRainmaker.java b/src/main/java/forestry/factory/inventory/InventoryRainmaker.java index d63b2eef8..9ca59086a 100644 --- a/src/main/java/forestry/factory/inventory/InventoryRainmaker.java +++ b/src/main/java/forestry/factory/inventory/InventoryRainmaker.java @@ -10,11 +10,12 @@ ******************************************************************************/ package forestry.factory.inventory; +import net.minecraft.item.ItemStack; + import forestry.api.fuels.FuelManager; import forestry.api.fuels.RainSubstrate; import forestry.core.inventory.InventoryAdapterTile; import forestry.factory.tiles.TileMillRainmaker; -import net.minecraft.item.ItemStack; public class InventoryRainmaker extends InventoryAdapterTile { private static final int SLOT_SUBSTRATE = 0; @@ -30,8 +31,8 @@ public class InventoryRainmaker extends InventoryAdapterTile RainSubstrate substrate = FuelManager.rainSubstrate.get(itemStack); if (tile.getWorld().isRaining() && substrate.isReverse()) { return true; - } else if (!tile.getWorld().isRaining() && !substrate.isReverse()) { - return true; + } else { + return !tile.getWorld().isRaining() && !substrate.isReverse(); } } } diff --git a/src/main/java/forestry/factory/inventory/InventorySqueezer.java b/src/main/java/forestry/factory/inventory/InventorySqueezer.java index 3f07ade70..6ec7e54ad 100644 --- a/src/main/java/forestry/factory/inventory/InventorySqueezer.java +++ b/src/main/java/forestry/factory/inventory/InventorySqueezer.java @@ -46,9 +46,7 @@ public class InventorySqueezer extends InventoryAdapterTile { return false; } - if (SqueezerRecipeManager.canUse(itemStack)) { - return true; - } + return SqueezerRecipeManager.canUse(itemStack); } return false; diff --git a/src/main/java/forestry/factory/network/packets/PacketRecipeTransferRequest.java b/src/main/java/forestry/factory/network/packets/PacketRecipeTransferRequest.java index f6bb733c6..a59d8c45e 100644 --- a/src/main/java/forestry/factory/network/packets/PacketRecipeTransferRequest.java +++ b/src/main/java/forestry/factory/network/packets/PacketRecipeTransferRequest.java @@ -38,7 +38,7 @@ public class PacketRecipeTransferRequest extends ForestryPacket implements IFore } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeItemStacks(craftingInventory); } diff --git a/src/main/java/forestry/factory/network/packets/PacketRecipeTransferUpdate.java b/src/main/java/forestry/factory/network/packets/PacketRecipeTransferUpdate.java index 5d3673e0c..36b094d0e 100644 --- a/src/main/java/forestry/factory/network/packets/PacketRecipeTransferUpdate.java +++ b/src/main/java/forestry/factory/network/packets/PacketRecipeTransferUpdate.java @@ -39,7 +39,7 @@ public class PacketRecipeTransferUpdate extends ForestryPacket implements IFores } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeItemStacks(craftingInventory); } diff --git a/src/main/java/forestry/factory/tiles/TileRaintank.java b/src/main/java/forestry/factory/tiles/TileRaintank.java index ed882baca..ac9a0b721 100755 --- a/src/main/java/forestry/factory/tiles/TileRaintank.java +++ b/src/main/java/forestry/factory/tiles/TileRaintank.java @@ -137,9 +137,7 @@ public class TileRaintank extends TileBase implements ISidedInventory, ILiquidTa if (!resourceTank.isEmpty()) { IFluidHandler fluidDestination = FluidUtil.getFluidHandler(world, pos.down(), EnumFacing.UP); if (fluidDestination != null) { - if (FluidUtil.tryFluidTransfer(fluidDestination, tankManager, Fluid.BUCKET_VOLUME / 20, true) != null) { - return true; - } + return FluidUtil.tryFluidTransfer(fluidDestination, tankManager, Fluid.BUCKET_VOLUME / 20, true) != null; } } return false; diff --git a/src/main/java/forestry/farming/multiblock/FarmFertilizerManager.java b/src/main/java/forestry/farming/multiblock/FarmFertilizerManager.java index 99887e966..b35d126c5 100644 --- a/src/main/java/forestry/farming/multiblock/FarmFertilizerManager.java +++ b/src/main/java/forestry/farming/multiblock/FarmFertilizerManager.java @@ -84,7 +84,7 @@ public class FarmFertilizerManager implements INbtWritable, INbtReadable, IStrea } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { storedFertilizer = data.readVarInt(); } } diff --git a/src/main/java/forestry/farming/multiblock/FarmHydrationManager.java b/src/main/java/forestry/farming/multiblock/FarmHydrationManager.java index 1d11e0af1..16f37ffe1 100644 --- a/src/main/java/forestry/farming/multiblock/FarmHydrationManager.java +++ b/src/main/java/forestry/farming/multiblock/FarmHydrationManager.java @@ -98,7 +98,7 @@ public class FarmHydrationManager implements IFarmLedgerDelegate, INbtWritable, } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { hydrationDelay = data.readVarInt(); ticksSinceRainfall = data.readVarInt(); } diff --git a/src/main/java/forestry/greenhouse/climate/ClimateSource.java b/src/main/java/forestry/greenhouse/climate/ClimateSource.java index 1a2adfccc..e8d6f1944 100644 --- a/src/main/java/forestry/greenhouse/climate/ClimateSource.java +++ b/src/main/java/forestry/greenhouse/climate/ClimateSource.java @@ -216,10 +216,9 @@ public abstract class ClimateSource implements IC private boolean canChange(float value, float target, ClimateSourceMode mode) { if (mode == ClimateSourceMode.POSITIVE && value < target) { return true; - } else if (mode == ClimateSourceMode.NEGATIVE && value > target) { - return true; + } else { + return mode == ClimateSourceMode.NEGATIVE && value > target; } - return false; } @Override diff --git a/src/main/java/forestry/greenhouse/climate/GreenhouseClimateManager.java b/src/main/java/forestry/greenhouse/climate/GreenhouseClimateManager.java index 82a38b703..01dc2d899 100644 --- a/src/main/java/forestry/greenhouse/climate/GreenhouseClimateManager.java +++ b/src/main/java/forestry/greenhouse/climate/GreenhouseClimateManager.java @@ -37,7 +37,7 @@ public class GreenhouseClimateManager implements IGreenhouseClimateManager { private GreenhouseClimateManager() { managers = new World2ObjectMap(world -> new ClimateSourceWorldManager()); - modifiers = new TreeSet((firstModifier, secondModifier) -> firstModifier.getPriority() > secondModifier.getPriority() ? 1 : -1); + modifiers = new TreeSet<>((firstModifier, secondModifier) -> firstModifier.getPriority() > secondModifier.getPriority() ? 1 : -1); } public static GreenhouseClimateManager getInstance() { diff --git a/src/main/java/forestry/greenhouse/multiblock/GreenhouseLimits.java b/src/main/java/forestry/greenhouse/multiblock/GreenhouseLimits.java index a2c5814d2..4cba80695 100644 --- a/src/main/java/forestry/greenhouse/multiblock/GreenhouseLimits.java +++ b/src/main/java/forestry/greenhouse/multiblock/GreenhouseLimits.java @@ -38,7 +38,7 @@ public class GreenhouseLimits implements IGreenhouseLimits { height = compound.getInteger("height"); } - public GreenhouseLimits(PacketBufferForestry data) throws IOException { + public GreenhouseLimits(PacketBufferForestry data) { minimumCoordinates = data.readPosition(); maximumCoordinates = data.readPosition(); depth = data.readInt(); diff --git a/src/main/java/forestry/greenhouse/multiblock/blocks/GreenhouseBlockCache.java b/src/main/java/forestry/greenhouse/multiblock/blocks/GreenhouseBlockCache.java index 5018b284b..f1e0451b5 100644 --- a/src/main/java/forestry/greenhouse/multiblock/blocks/GreenhouseBlockCache.java +++ b/src/main/java/forestry/greenhouse/multiblock/blocks/GreenhouseBlockCache.java @@ -53,7 +53,7 @@ public class GreenhouseBlockCache implements IStreamable { } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { positions.clear(); int size = data.readInt(); for (int i = 0; i < size; i++) { diff --git a/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderClient.java b/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderClient.java index 698f4b6d5..220c56f00 100644 --- a/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderClient.java +++ b/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderClient.java @@ -68,7 +68,7 @@ public class GreenhouseProviderClient extends GreenhouseProvider { storage.clearBlocks(false); storage.createBlocksFromCache(); Minecraft mc = Minecraft.getMinecraft(); - mc.addScheduledTask(() -> markBlockForRenderUpdate()); + mc.addScheduledTask(this::markBlockForRenderUpdate); } /* CHUNK LOADING */ diff --git a/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderServer.java b/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderServer.java index 7e90405ed..4bd5245af 100644 --- a/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderServer.java +++ b/src/main/java/forestry/greenhouse/multiblock/blocks/storage/GreenhouseProviderServer.java @@ -122,7 +122,7 @@ public class GreenhouseProviderServer extends GreenhouseProvider { } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { // Only read on the client side } diff --git a/src/main/java/forestry/greenhouse/multiblock/blocks/world/GreenhouseBlockManager.java b/src/main/java/forestry/greenhouse/multiblock/blocks/world/GreenhouseBlockManager.java index 0bc416269..f05ef55c9 100644 --- a/src/main/java/forestry/greenhouse/multiblock/blocks/world/GreenhouseBlockManager.java +++ b/src/main/java/forestry/greenhouse/multiblock/blocks/world/GreenhouseBlockManager.java @@ -35,7 +35,7 @@ public class GreenhouseBlockManager implements IGreenhouseBlockManager { private World2ObjectMap managers; private GreenhouseBlockManager() { - managers = new World2ObjectMap(world -> new ChunkManager(world)); + managers = new World2ObjectMap(ChunkManager::new); } public static GreenhouseBlockManager getInstance() { diff --git a/src/main/java/forestry/greenhouse/multiblock/blocks/world/NextTickEntry.java b/src/main/java/forestry/greenhouse/multiblock/blocks/world/NextTickEntry.java index 2f2abe22e..0c7ae8233 100644 --- a/src/main/java/forestry/greenhouse/multiblock/blocks/world/NextTickEntry.java +++ b/src/main/java/forestry/greenhouse/multiblock/blocks/world/NextTickEntry.java @@ -51,7 +51,7 @@ class NextTickEntry implements Comparable { @Override public int compareTo(NextTickEntry o) { - return this.scheduledTime < o.scheduledTime ? -1 : (this.scheduledTime > o.scheduledTime ? 1 : 0); + return Long.compare(this.scheduledTime, o.scheduledTime); } public BlockPos getPosition() { diff --git a/src/main/java/forestry/greenhouse/network/packets/PacketCamouflageSelection.java b/src/main/java/forestry/greenhouse/network/packets/PacketCamouflageSelection.java index 571835cbd..ebd0da3a1 100644 --- a/src/main/java/forestry/greenhouse/network/packets/PacketCamouflageSelection.java +++ b/src/main/java/forestry/greenhouse/network/packets/PacketCamouflageSelection.java @@ -32,7 +32,7 @@ public abstract class PacketCamouflageSelection extends ForestryPacket { } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeShort(handlerType.ordinal()); data.writeItemStack(camouflageStack); diff --git a/src/main/java/forestry/greenhouse/network/packets/PacketGreenhouseData.java b/src/main/java/forestry/greenhouse/network/packets/PacketGreenhouseData.java index 8fd70c3cb..31d36aabb 100644 --- a/src/main/java/forestry/greenhouse/network/packets/PacketGreenhouseData.java +++ b/src/main/java/forestry/greenhouse/network/packets/PacketGreenhouseData.java @@ -45,7 +45,7 @@ public class PacketGreenhouseData extends ForestryPacket implements IForestryPac } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); provider.writeData(data); } diff --git a/src/main/java/forestry/greenhouse/network/packets/PacketGreenhouseDataRequest.java b/src/main/java/forestry/greenhouse/network/packets/PacketGreenhouseDataRequest.java index e406f0285..16fb93776 100644 --- a/src/main/java/forestry/greenhouse/network/packets/PacketGreenhouseDataRequest.java +++ b/src/main/java/forestry/greenhouse/network/packets/PacketGreenhouseDataRequest.java @@ -36,7 +36,7 @@ public class PacketGreenhouseDataRequest extends ForestryPacket implements IFore } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(position); } @@ -47,7 +47,7 @@ public class PacketGreenhouseDataRequest extends ForestryPacket implements IFore public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { BlockPos position = data.readBlockPos(); World world = player.world; IGreenhouseControllerInternal controller = MultiblockUtil.getController(world, position, IGreenhouseComponent.class); diff --git a/src/main/java/forestry/greenhouse/network/packets/PacketSelectClimateTargeted.java b/src/main/java/forestry/greenhouse/network/packets/PacketSelectClimateTargeted.java index 007241264..fd23d3da2 100644 --- a/src/main/java/forestry/greenhouse/network/packets/PacketSelectClimateTargeted.java +++ b/src/main/java/forestry/greenhouse/network/packets/PacketSelectClimateTargeted.java @@ -41,14 +41,14 @@ public class PacketSelectClimateTargeted extends ForestryPacket implements IFore } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeClimateState(climateState); } public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { BlockPos pos = data.readBlockPos(); IClimateState climateState = data.readClimateState(); diff --git a/src/main/java/forestry/greenhouse/proxy/ProxyGreenhouseClient.java b/src/main/java/forestry/greenhouse/proxy/ProxyGreenhouseClient.java index 5c7d7b332..11bcf2003 100644 --- a/src/main/java/forestry/greenhouse/proxy/ProxyGreenhouseClient.java +++ b/src/main/java/forestry/greenhouse/proxy/ProxyGreenhouseClient.java @@ -98,21 +98,15 @@ public class ProxyGreenhouseClient extends ProxyGreenhouse { MinecraftForge.EVENT_BUS.register(this); ORIGINAL_GRASS_COLOR = BiomeColorHelper.GRASS_COLOR; - BiomeColorHelper.GRASS_COLOR = new BiomeColorHelper.ColorResolver() { - @Override - public int getColorAtPos(Biome biome, BlockPos blockPosition) { - COLOR_BLOCK_POSITION = blockPosition; - return ORIGINAL_GRASS_COLOR.getColorAtPos(biome, blockPosition); - } + BiomeColorHelper.GRASS_COLOR = (biome, blockPosition) -> { + COLOR_BLOCK_POSITION = blockPosition; + return ORIGINAL_GRASS_COLOR.getColorAtPos(biome, blockPosition); }; ORIGINAL_FOLIAGE_COLOR = BiomeColorHelper.FOLIAGE_COLOR; - BiomeColorHelper.FOLIAGE_COLOR = new BiomeColorHelper.ColorResolver() { - @Override - public int getColorAtPos(Biome biome, BlockPos blockPosition) { - COLOR_BLOCK_POSITION = blockPosition; - return ORIGINAL_FOLIAGE_COLOR.getColorAtPos(biome, blockPosition); - } + BiomeColorHelper.FOLIAGE_COLOR = (biome, blockPosition) -> { + COLOR_BLOCK_POSITION = blockPosition; + return ORIGINAL_FOLIAGE_COLOR.getColorAtPos(biome, blockPosition); }; } diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java index 659e22a98..ff4c74c0e 100755 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java @@ -116,9 +116,8 @@ public class AIButterflyRest extends AIButterflyBase { return true; } else if (block instanceof IGrowable) { return true; - } else if (blockState.getMaterial() == Material.PLANTS) { - return true; + } else { + return blockState.getMaterial() == Material.PLANTS; } - return false; } } diff --git a/src/main/java/forestry/lepidopterology/tiles/TileCocoon.java b/src/main/java/forestry/lepidopterology/tiles/TileCocoon.java index 0d81306a5..d67a637bf 100644 --- a/src/main/java/forestry/lepidopterology/tiles/TileCocoon.java +++ b/src/main/java/forestry/lepidopterology/tiles/TileCocoon.java @@ -104,7 +104,7 @@ public class TileCocoon extends TileEntity implements IStreamable, IOwnedTile, I } @Override - public void readData(PacketBufferForestry data) throws IOException { + public void readData(PacketBufferForestry data) { String speciesUID = data.readString(); IButterfly caterpillar = getButterfly(speciesUID); setCaterpillar(caterpillar); diff --git a/src/main/java/forestry/mail/commands/CommandMail.java b/src/main/java/forestry/mail/commands/CommandMail.java index d351c8011..9d9cbee0b 100644 --- a/src/main/java/forestry/mail/commands/CommandMail.java +++ b/src/main/java/forestry/mail/commands/CommandMail.java @@ -48,7 +48,7 @@ public class CommandMail extends SubCommand { } @Override - public void executeSubCommand(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { + public void executeSubCommand(MinecraftServer server, ICommandSender sender, String[] args) { if (!(sender instanceof EntityPlayer)) { return; } diff --git a/src/main/java/forestry/mail/network/packets/PacketLetterInfoRequest.java b/src/main/java/forestry/mail/network/packets/PacketLetterInfoRequest.java index b9deb5919..3fb4f3c33 100644 --- a/src/main/java/forestry/mail/network/packets/PacketLetterInfoRequest.java +++ b/src/main/java/forestry/mail/network/packets/PacketLetterInfoRequest.java @@ -36,7 +36,7 @@ public class PacketLetterInfoRequest extends ForestryPacket implements IForestry } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeString(recipientName); data.writeEnum(addressType, EnumAddressee.values()); } @@ -44,7 +44,7 @@ public class PacketLetterInfoRequest extends ForestryPacket implements IForestry public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { String recipientName = data.readString(); EnumAddressee addressType = data.readEnum(EnumAddressee.values()); diff --git a/src/main/java/forestry/mail/network/packets/PacketLetterTextSet.java b/src/main/java/forestry/mail/network/packets/PacketLetterTextSet.java index 3ebb505c9..22d38fe79 100644 --- a/src/main/java/forestry/mail/network/packets/PacketLetterTextSet.java +++ b/src/main/java/forestry/mail/network/packets/PacketLetterTextSet.java @@ -33,14 +33,14 @@ public class PacketLetterTextSet extends ForestryPacket implements IForestryPack } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeString(string); } public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { if (player.openContainer instanceof ContainerLetter) { String string = data.readString(); ((ContainerLetter) player.openContainer).handleSetText(string); diff --git a/src/main/java/forestry/mail/network/packets/PacketPOBoxInfoResponse.java b/src/main/java/forestry/mail/network/packets/PacketPOBoxInfoResponse.java index d02e275cd..4534a81d3 100644 --- a/src/main/java/forestry/mail/network/packets/PacketPOBoxInfoResponse.java +++ b/src/main/java/forestry/mail/network/packets/PacketPOBoxInfoResponse.java @@ -36,7 +36,7 @@ public class PacketPOBoxInfoResponse extends ForestryPacket implements IForestry } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeInt(poboxInfo.playerLetters); data.writeInt(poboxInfo.tradeLetters); } @@ -45,7 +45,7 @@ public class PacketPOBoxInfoResponse extends ForestryPacket implements IForestry public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { POBoxInfo poboxInfo = new POBoxInfo(data.readInt(), data.readInt()); GuiMailboxInfo.instance.setPOBoxInfo(player, poboxInfo); } diff --git a/src/main/java/forestry/mail/network/packets/PacketTraderAddressRequest.java b/src/main/java/forestry/mail/network/packets/PacketTraderAddressRequest.java index 786f127d1..904298e2e 100644 --- a/src/main/java/forestry/mail/network/packets/PacketTraderAddressRequest.java +++ b/src/main/java/forestry/mail/network/packets/PacketTraderAddressRequest.java @@ -37,7 +37,7 @@ public class PacketTraderAddressRequest extends ForestryPacket implements IFores } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeString(addressName); } @@ -45,7 +45,7 @@ public class PacketTraderAddressRequest extends ForestryPacket implements IFores public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { BlockPos pos = data.readBlockPos(); String addressName = data.readString(); diff --git a/src/main/java/forestry/mail/network/packets/PacketTraderAddressResponse.java b/src/main/java/forestry/mail/network/packets/PacketTraderAddressResponse.java index d7af20e02..a87aa8ef9 100644 --- a/src/main/java/forestry/mail/network/packets/PacketTraderAddressResponse.java +++ b/src/main/java/forestry/mail/network/packets/PacketTraderAddressResponse.java @@ -39,7 +39,7 @@ public class PacketTraderAddressResponse extends ForestryPacket implements IFore } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeString(addressName); } @@ -48,7 +48,7 @@ public class PacketTraderAddressResponse extends ForestryPacket implements IFore public static class Handler implements IForestryPacketHandlerClient { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayer player) { BlockPos pos = data.readBlockPos(); String addressName = data.readString(); diff --git a/src/main/java/forestry/sorting/FakeFilterLogic.java b/src/main/java/forestry/sorting/FakeFilterLogic.java index b2a9d191d..02c410352 100644 --- a/src/main/java/forestry/sorting/FakeFilterLogic.java +++ b/src/main/java/forestry/sorting/FakeFilterLogic.java @@ -27,7 +27,7 @@ public final class FakeFilterLogic implements IFilterLogic { } @Override - public void readGuiData(PacketBuffer data) throws IOException { + public void readGuiData(PacketBuffer data) { } diff --git a/src/main/java/forestry/sorting/FilterLogic.java b/src/main/java/forestry/sorting/FilterLogic.java index 0ada601a2..a1adc7585 100644 --- a/src/main/java/forestry/sorting/FilterLogic.java +++ b/src/main/java/forestry/sorting/FilterLogic.java @@ -92,8 +92,8 @@ public class FilterLogic implements IFilterLogic { @Override public void writeGuiData(PacketBuffer data) { - for (int i = 0; i < filterRules.length; i++) { - data.writeShort(AlleleManager.filterRegistry.getId(filterRules[i])); + for (IFilterRuleType filterRule : filterRules) { + data.writeShort(AlleleManager.filterRegistry.getId(filterRule)); } for (int i = 0; i < 6; i++) { @@ -122,7 +122,7 @@ public class FilterLogic implements IFilterLogic { @SideOnly(Side.CLIENT) @Override - public void readGuiData(PacketBuffer data) throws IOException { + public void readGuiData(PacketBuffer data) { for (int i = 0; i < filterRules.length; i++) { filterRules[i] = AlleleManager.filterRegistry.getRule(data.readShort()); } @@ -192,9 +192,7 @@ public class FilterLogic implements IFilterLogic { IGenome genome = ind.getGenome(); IAllele active = genome.getPrimary(); IAllele inactive = genome.getSecondary(); - if (!isValidAllelePair(facing, active.getUID(), inactive.getUID())) { - return false; - } + return isValidAllelePair(facing, active.getUID(), inactive.getUID()); } return true; } diff --git a/src/main/java/forestry/sorting/network/packets/PacketFilterChangeGenome.java b/src/main/java/forestry/sorting/network/packets/PacketFilterChangeGenome.java index d9743dad2..814d71b27 100644 --- a/src/main/java/forestry/sorting/network/packets/PacketFilterChangeGenome.java +++ b/src/main/java/forestry/sorting/network/packets/PacketFilterChangeGenome.java @@ -35,7 +35,7 @@ public class PacketFilterChangeGenome extends ForestryPacket implements IForestr } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeShort(facing.getIndex()); data.writeShort(index); @@ -55,7 +55,7 @@ public class PacketFilterChangeGenome extends ForestryPacket implements IForestr public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { BlockPos pos = data.readBlockPos(); EnumFacing facing = EnumFacing.getFront(data.readShort()); short index = data.readShort(); diff --git a/src/main/java/forestry/sorting/network/packets/PacketFilterChangeRule.java b/src/main/java/forestry/sorting/network/packets/PacketFilterChangeRule.java index 30946b1bd..a60bee3a5 100644 --- a/src/main/java/forestry/sorting/network/packets/PacketFilterChangeRule.java +++ b/src/main/java/forestry/sorting/network/packets/PacketFilterChangeRule.java @@ -29,7 +29,7 @@ public class PacketFilterChangeRule extends ForestryPacket implements IForestryP } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); data.writeShort(facing.getIndex()); data.writeShort(AlleleManager.filterRegistry.getId(rule)); @@ -42,7 +42,7 @@ public class PacketFilterChangeRule extends ForestryPacket implements IForestryP public static class Handler implements IForestryPacketHandlerServer { @Override - public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) throws IOException { + public void onPacketData(PacketBufferForestry data, EntityPlayerMP player) { BlockPos pos = data.readBlockPos(); EnumFacing facing = EnumFacing.getFront(data.readShort()); IFilterRuleType rule = AlleleManager.filterRegistry.getRuleOrDefault(data.readShort()); diff --git a/src/main/java/forestry/sorting/network/packets/PacketGuiFilterUpdate.java b/src/main/java/forestry/sorting/network/packets/PacketGuiFilterUpdate.java index 66262eb98..dd4a24dbe 100644 --- a/src/main/java/forestry/sorting/network/packets/PacketGuiFilterUpdate.java +++ b/src/main/java/forestry/sorting/network/packets/PacketGuiFilterUpdate.java @@ -28,7 +28,7 @@ public class PacketGuiFilterUpdate extends ForestryPacket implements IForestryPa } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); logic.writeGuiData(data); } diff --git a/src/main/java/forestry/worktable/network/packets/PacketWorktableMemoryUpdate.java b/src/main/java/forestry/worktable/network/packets/PacketWorktableMemoryUpdate.java index f32b4bbc4..45ebacaa4 100644 --- a/src/main/java/forestry/worktable/network/packets/PacketWorktableMemoryUpdate.java +++ b/src/main/java/forestry/worktable/network/packets/PacketWorktableMemoryUpdate.java @@ -42,7 +42,7 @@ public class PacketWorktableMemoryUpdate extends ForestryPacket implements IFore } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); recipeMemory.writeData(data); } diff --git a/src/main/java/forestry/worktable/network/packets/PacketWorktableRecipeRequest.java b/src/main/java/forestry/worktable/network/packets/PacketWorktableRecipeRequest.java index 40f61daea..b00594a46 100644 --- a/src/main/java/forestry/worktable/network/packets/PacketWorktableRecipeRequest.java +++ b/src/main/java/forestry/worktable/network/packets/PacketWorktableRecipeRequest.java @@ -44,7 +44,7 @@ public class PacketWorktableRecipeRequest extends ForestryPacket implements IFor } @Override - protected void writeData(PacketBufferForestry data) throws IOException { + protected void writeData(PacketBufferForestry data) { data.writeBlockPos(pos); recipe.writeData(data); }