diff --git a/build.gradle b/build.gradle index 014cadf1c..37800be2c 100755 --- a/build.gradle +++ b/build.gradle @@ -36,6 +36,10 @@ ext.dirLang = "./lang" ext.apiForestry = "./api/forestry" ext.apiRedstoneFlux = "./api/redstoneflux" +// java version +sourceCompatibility = 1.7 +targetCompatibility = 1.7 + minecraft { version = mcversion + "-" + forgeversion runDir = "run" diff --git a/src/main/java/forestry/Forestry.java b/src/main/java/forestry/Forestry.java index 15bd4c5cf..afc2e7140 100644 --- a/src/main/java/forestry/Forestry.java +++ b/src/main/java/forestry/Forestry.java @@ -70,7 +70,7 @@ public class Forestry { public static Forestry instance; private File configFolder; - private static final Map mappedItems = new HashMap(); + private static final Map mappedItems = new HashMap<>(); static { mappedItems.put("Forestry:builderBackpack", ForestryItem.builderBackpack); @@ -87,12 +87,12 @@ public class Forestry { } public Forestry() { - FuelManager.fermenterFuel = new ItemStackMap(); - FuelManager.moistenerResource = new ItemStackMap(); - FuelManager.rainSubstrate = new ItemStackMap(); - FuelManager.bronzeEngineFuel = new FluidMap(); - FuelManager.copperEngineFuel = new ItemStackMap(); - FuelManager.generatorFuel = new FluidMap(); + FuelManager.fermenterFuel = new ItemStackMap<>(); + FuelManager.moistenerResource = new ItemStackMap<>(); + FuelManager.rainSubstrate = new ItemStackMap<>(); + FuelManager.bronzeEngineFuel = new FluidMap<>(); + FuelManager.copperEngineFuel = new ItemStackMap<>(); + FuelManager.generatorFuel = new FluidMap<>(); } @SidedProxy(clientSide = "forestry.core.ForestryClient", serverSide = "forestry.core.ForestryCore") diff --git a/src/main/java/forestry/apiculture/BeekeepingLogic.java b/src/main/java/forestry/apiculture/BeekeepingLogic.java index cce56ee36..33517a3f3 100755 --- a/src/main/java/forestry/apiculture/BeekeepingLogic.java +++ b/src/main/java/forestry/apiculture/BeekeepingLogic.java @@ -60,7 +60,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable { private int queenWorkCycleThrottle; private IEffectData effectData[] = new IEffectData[2]; - private final Stack spawn = new Stack(); + private final Stack spawn = new Stack<>(); private final HasFlowersCache hasFlowersCache = new HasFlowersCache(); private final QueenCanWorkCache queenCanWorkCache = new QueenCanWorkCache(); @@ -112,7 +112,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable { hasFlowersCache.writeToNBT(nbttagcompound); - Stack spawnCopy = new Stack(); + Stack spawnCopy = new Stack<>(); spawnCopy.addAll(spawn); NBTTagList nbttaglist = new NBTTagList(); while (!spawnCopy.isEmpty()) { @@ -373,7 +373,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable { World world = beeHousing.getWorld(); - Stack offspring = new Stack(); + Stack offspring = new Stack<>(); IApiaristTracker breedingTracker = BeeManager.beeRoot.getBreedingTracker(world, beeHousing.getOwner()); // Princess @@ -399,7 +399,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable { IBeeHousingInventory beeInventory = beeHousing.getBeeInventory(); - Collection spawn = new ArrayList(); + Collection spawn = new ArrayList<>(); while (!offspring.isEmpty()) { ItemStack spawned = offspring.pop(); diff --git a/src/main/java/forestry/apiculture/blocks/BlockAlveary.java b/src/main/java/forestry/apiculture/blocks/BlockAlveary.java index 1263b163c..ed065c87c 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockAlveary.java +++ b/src/main/java/forestry/apiculture/blocks/BlockAlveary.java @@ -72,7 +72,7 @@ public class BlockAlveary extends BlockStructure { @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList drop = new ArrayList(); + ArrayList drop = new ArrayList<>(); drop.add(new ItemStack(this, 1, metadata != 1 ? metadata : 0)); return drop; } diff --git a/src/main/java/forestry/apiculture/blocks/BlockBeehives.java b/src/main/java/forestry/apiculture/blocks/BlockBeehives.java index f47bd10fd..4704118af 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockBeehives.java +++ b/src/main/java/forestry/apiculture/blocks/BlockBeehives.java @@ -83,7 +83,7 @@ public class BlockBeehives extends BlockContainer { @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); + ArrayList ret = new ArrayList<>(); // Handle legacy block if (metadata == 0) { diff --git a/src/main/java/forestry/apiculture/blocks/BlockCandle.java b/src/main/java/forestry/apiculture/blocks/BlockCandle.java index 0d0306522..be64827d7 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockCandle.java +++ b/src/main/java/forestry/apiculture/blocks/BlockCandle.java @@ -75,7 +75,7 @@ public class BlockCandle extends BlockTorch { .put("dyeBlack", new Color(20, 20, 20).getRGB()) .build(); - lightingItems = new HashSet(Arrays.asList( + lightingItems = new HashSet<>(Arrays.asList( Items.flint_and_steel, Items.flint, Item.getItemFromBlock(Blocks.torch) @@ -233,7 +233,7 @@ public class BlockCandle extends BlockTorch { /* DROP HANDLING */ // Hack: When harvesting we need to get the drops in onBlockHarvested, // because Mojang destroys the block and tile before calling getDrops. - private final ThreadLocal drop = new ThreadLocal(); + private final ThreadLocal drop = new ThreadLocal<>(); @Override public void onBlockHarvested(World world, int x, int y, int z, int metadata, EntityPlayer player) { @@ -253,7 +253,7 @@ public class BlockCandle extends BlockTorch { dropStack = getCandleDrop(world, x, y, z); } - ArrayList drops = new ArrayList(1); + ArrayList drops = new ArrayList<>(1); drops.add(dropStack); return drops; diff --git a/src/main/java/forestry/apiculture/commands/BeeModeHelper.java b/src/main/java/forestry/apiculture/commands/BeeModeHelper.java index 11cc43f5f..e54fe20e9 100644 --- a/src/main/java/forestry/apiculture/commands/BeeModeHelper.java +++ b/src/main/java/forestry/apiculture/commands/BeeModeHelper.java @@ -25,7 +25,7 @@ public class BeeModeHelper implements ICommandModeHelper { public String[] getModeNames() { ArrayList beekeepingModes = BeeManager.beeRoot.getBeekeepingModes(); int modeStringCount = beekeepingModes.size(); - List modeStrings = new ArrayList(modeStringCount); + List modeStrings = new ArrayList<>(modeStringCount); for (IBeekeepingMode mode : beekeepingModes) { modeStrings.add(mode.getName()); } diff --git a/src/main/java/forestry/apiculture/commands/BeeStatsSaveHelper.java b/src/main/java/forestry/apiculture/commands/BeeStatsSaveHelper.java index fe21a3c99..75a35e6d3 100644 --- a/src/main/java/forestry/apiculture/commands/BeeStatsSaveHelper.java +++ b/src/main/java/forestry/apiculture/commands/BeeStatsSaveHelper.java @@ -53,7 +53,7 @@ public class BeeStatsSaveHelper implements IStatsSaveHelper { @Override public Collection getSpecies() { - Collection species = new ArrayList(); + Collection species = new ArrayList<>(); for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleBeeSpecies) { species.add((IAlleleBeeSpecies) allele); diff --git a/src/main/java/forestry/apiculture/commands/CommandBeeGive.java b/src/main/java/forestry/apiculture/commands/CommandBeeGive.java index 1900b0326..0e113dca2 100644 --- a/src/main/java/forestry/apiculture/commands/CommandBeeGive.java +++ b/src/main/java/forestry/apiculture/commands/CommandBeeGive.java @@ -39,7 +39,7 @@ public class CommandBeeGive extends SubCommand { super("give"); setPermLevel(PermLevel.ADMIN); - List beeTypeStrings = new ArrayList(); + List beeTypeStrings = new ArrayList<>(); for (EnumBeeType type : EnumBeeType.values()) { if (type == EnumBeeType.NONE) { continue; @@ -151,7 +151,7 @@ public class CommandBeeGive extends SubCommand { } private static String[] getSpecies() { - List species = new ArrayList(); + List species = new ArrayList<>(); for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleBeeSpecies) { diff --git a/src/main/java/forestry/apiculture/flowers/Flower.java b/src/main/java/forestry/apiculture/flowers/Flower.java index c3f659468..e93e39689 100644 --- a/src/main/java/forestry/apiculture/flowers/Flower.java +++ b/src/main/java/forestry/apiculture/flowers/Flower.java @@ -12,6 +12,8 @@ package forestry.apiculture.flowers; import com.google.common.base.Objects; +import javax.annotation.Nonnull; + import net.minecraft.block.Block; import net.minecraftforge.oredict.OreDictionary; @@ -46,7 +48,7 @@ final class Flower implements IFlower { } @Override - public int compareTo(IFlower other) { + public int compareTo(@Nonnull IFlower other) { return this.weight.compareTo(other.getWeight()); } diff --git a/src/main/java/forestry/apiculture/flowers/FlowerProvider.java b/src/main/java/forestry/apiculture/flowers/FlowerProvider.java index 8db663df8..b89505274 100644 --- a/src/main/java/forestry/apiculture/flowers/FlowerProvider.java +++ b/src/main/java/forestry/apiculture/flowers/FlowerProvider.java @@ -45,12 +45,13 @@ public class FlowerProvider implements IFlowerProvider { EnumSet plantTypes = pollinatable.getPlantType(); - if (flowerType.equals(FlowerManager.FlowerTypeNether)) { - return plantTypes.contains(EnumPlantType.Nether); - } else if (flowerType.equals(FlowerManager.FlowerTypeCacti)) { - return plantTypes.contains(EnumPlantType.Desert); - } else { - return plantTypes.size() > 1 || !plantTypes.contains(EnumPlantType.Nether); + switch (flowerType) { + case FlowerManager.FlowerTypeNether: + return plantTypes.contains(EnumPlantType.Nether); + case FlowerManager.FlowerTypeCacti: + return plantTypes.contains(EnumPlantType.Desert); + default: + return plantTypes.size() > 1 || !plantTypes.contains(EnumPlantType.Nether); } } diff --git a/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java b/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java index 5319a650f..7b16b479d 100644 --- a/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java +++ b/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java @@ -77,7 +77,7 @@ public final class FlowerRegistry implements IFlowerRegistry { this.registeredBlocks = HashMultimap.create(); this.registeredFlowers = HashMultimap.create(); this.growthRules = ArrayListMultimap.create(); - this.chances = new HashMap>(); + this.chances = new HashMap<>(); registerVanillaGrowthRules(); } @@ -254,12 +254,12 @@ public final class FlowerRegistry implements IFlowerRegistry { @Override public Collection getFlowerTypes() { - return new ArrayList(Sets.union(defaultFlowerTypes, registeredFlowers.keySet())); + return new ArrayList<>(Sets.union(defaultFlowerTypes, registeredFlowers.keySet())); } private TreeMap getChancesMap(String flowerType) { if (!this.chances.containsKey(flowerType)) { - TreeMap flowerChances = new TreeMap(); + TreeMap flowerChances = new TreeMap<>(); double count = 0.0; for (IFlower flower : this.registeredFlowers.get(flowerType)) { if (flower.isPlantable()) { diff --git a/src/main/java/forestry/apiculture/flowers/VanillaFlowerPotGrowthRule.java b/src/main/java/forestry/apiculture/flowers/VanillaFlowerPotGrowthRule.java index 083ee94b9..a99691043 100644 --- a/src/main/java/forestry/apiculture/flowers/VanillaFlowerPotGrowthRule.java +++ b/src/main/java/forestry/apiculture/flowers/VanillaFlowerPotGrowthRule.java @@ -44,16 +44,22 @@ public class VanillaFlowerPotGrowthRule implements IFlowerGrowthRule { BlockFlowerPot flowerPot = (BlockFlowerPot) block; int flower; - if (flowerType.equals(FlowerManager.FlowerTypeVanilla) || flowerType.equals(FlowerManager.FlowerTypeSnow)) { - flower = world.rand.nextInt(2) + 1; - } else if (flowerType.equals(FlowerManager.FlowerTypeJungle)) { - flower = 6; - } else if (flowerType.equals(FlowerManager.FlowerTypeCacti)) { - flower = world.rand.nextInt(2) + 9; - } else if (flowerType.equals(FlowerManager.FlowerTypeMushrooms)) { - flower = world.rand.nextInt(2) + 7; - } else { - return false; + switch (flowerType) { + case FlowerManager.FlowerTypeVanilla: + case FlowerManager.FlowerTypeSnow: + flower = world.rand.nextInt(2) + 1; + break; + case FlowerManager.FlowerTypeJungle: + flower = 6; + break; + case FlowerManager.FlowerTypeCacti: + flower = world.rand.nextInt(2) + 9; + break; + case FlowerManager.FlowerTypeMushrooms: + flower = world.rand.nextInt(2) + 7; + break; + default: + return false; } TileEntityFlowerPot newTile = (TileEntityFlowerPot) flowerPot.createNewTileEntity(world, flower); diff --git a/src/main/java/forestry/apiculture/genetics/Bee.java b/src/main/java/forestry/apiculture/genetics/Bee.java index 5033e61e0..45f14fd64 100644 --- a/src/main/java/forestry/apiculture/genetics/Bee.java +++ b/src/main/java/forestry/apiculture/genetics/Bee.java @@ -250,7 +250,7 @@ public class Bee extends IndividualLiving implements IBee { World world = housing.getWorld(); BiomeGenBase biome = housing.getBiome(); - Set errorStates = new HashSet(); + Set errorStates = new HashSet<>(); IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); @@ -315,7 +315,7 @@ public class Bee extends IndividualLiving implements IBee { @Override public ArrayList getSuitableBiomes() { - ArrayList suitableBiomes = new ArrayList(); + ArrayList suitableBiomes = new ArrayList<>(); for (BiomeGenBase biome : BiomeGenBase.getBiomeGenArray()) { if (isSuitableBiome(biome)) { suitableBiomes.add(biome); @@ -401,7 +401,7 @@ public class Bee extends IndividualLiving implements IBee { // / PRODUCTION @Override public ItemStack[] getProduceList() { - ArrayList products = new ArrayList(); + ArrayList products = new ArrayList<>(); IAlleleBeeSpecies primary = genome.getPrimary(); IAlleleBeeSpecies secondary = genome.getSecondary(); @@ -447,7 +447,7 @@ public class Bee extends IndividualLiving implements IBee { return null; } - List products = new ArrayList(); + List products = new ArrayList<>(); IAlleleBeeSpecies primary = genome.getPrimary(); IAlleleBeeSpecies secondary = genome.getSecondary(); @@ -517,7 +517,7 @@ public class Bee extends IndividualLiving implements IBee { return null; } - List bees = new ArrayList(); + List bees = new ArrayList<>(); ChunkCoordinates housingCoordinates = housing.getCoordinates(); int toCreate = BeeManager.beeRoot.getBeekeepingMode(world).getFinalFertility(this, world, housingCoordinates.posX, housingCoordinates.posY, housingCoordinates.posZ); diff --git a/src/main/java/forestry/apiculture/genetics/BeeHelper.java b/src/main/java/forestry/apiculture/genetics/BeeHelper.java index 76953d1ec..8c2d65067 100755 --- a/src/main/java/forestry/apiculture/genetics/BeeHelper.java +++ b/src/main/java/forestry/apiculture/genetics/BeeHelper.java @@ -208,7 +208,7 @@ public class BeeHelper extends SpeciesRoot implements IBeeRoot { } /* TEMPLATES */ - private static final ArrayList beeTemplates = new ArrayList(); + private static final ArrayList beeTemplates = new ArrayList<>(); @Override public ArrayList getIndividualTemplates() { @@ -230,7 +230,7 @@ public class BeeHelper extends SpeciesRoot implements IBeeRoot { /** * List of possible mutations on species alleles. */ - private static final ArrayList beeMutations = new ArrayList(); + private static final ArrayList beeMutations = new ArrayList<>(); @Override public Collection getMutations(boolean shuffle) { @@ -256,7 +256,7 @@ public class BeeHelper extends SpeciesRoot implements IBeeRoot { } /* BREEDING MODES */ - private final ArrayList beekeepingModes = new ArrayList(); + private final ArrayList beekeepingModes = new ArrayList<>(); private static IBeekeepingMode activeBeekeepingMode; @Override diff --git a/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java b/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java index 4dd3215c5..0fedf7ca7 100755 --- a/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java +++ b/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java @@ -53,7 +53,7 @@ public class BeekeepingMode implements IBeekeepingMode { @Override public ArrayList getDescription() { - ArrayList ret = new ArrayList(); + ArrayList ret = new ArrayList<>(); ret.add("beemode." + name.toLowerCase(Locale.ENGLISH) + ".desc"); return ret; } diff --git a/src/main/java/forestry/apiculture/genetics/HiveDrop.java b/src/main/java/forestry/apiculture/genetics/HiveDrop.java index 088a07465..eee87976c 100755 --- a/src/main/java/forestry/apiculture/genetics/HiveDrop.java +++ b/src/main/java/forestry/apiculture/genetics/HiveDrop.java @@ -25,7 +25,7 @@ import forestry.api.apiculture.IHiveDrop; public class HiveDrop implements IHiveDrop { private final IBeeDefinition beeTemplate; - private final ArrayList additional = new ArrayList(); + private final ArrayList additional = new ArrayList<>(); private final int chance; private float ignobleShare = 0.0f; @@ -59,7 +59,7 @@ public class HiveDrop implements IHiveDrop { @Override public ArrayList getAdditional(World world, int x, int y, int z, int fortune) { - ArrayList ret = new ArrayList(); + ArrayList ret = new ArrayList<>(); for (ItemStack stack : additional) { ret.add(stack.copy()); } diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java index fdf525f7a..a066b454e 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java @@ -45,8 +45,8 @@ import forestry.core.utils.GeneticsUtil; import forestry.core.utils.ItemStackUtil; public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpeciesCustom { - private final Map productChances = new HashMap(); - private final Map specialtyChances = new HashMap(); + private final Map productChances = new HashMap<>(); + private final Map specialtyChances = new HashMap<>(); private final int primaryColour; private final int secondaryColour; @@ -137,7 +137,7 @@ public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpecies @Override public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) { - ArrayList bounty = new ArrayList(); + ArrayList bounty = new ArrayList<>(); Collections.addAll(bounty, super.getResearchBounty(world, researcher, individual, bountyLevel)); if (bountyLevel > 10) { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectResurrection.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectResurrection.java index ec8eddba6..33257a128 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectResurrection.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectResurrection.java @@ -49,7 +49,7 @@ public class AlleleEffectResurrection extends AlleleEffectThrottled { } public static List getReanimationList() { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add(new Resurrectable(new ItemStack(Items.bone), EntitySkeleton.class)); list.add(new Resurrectable(new ItemStack(Items.arrow), EntitySkeleton.class)); list.add(new Resurrectable(new ItemStack(Items.rotten_flesh), EntityZombie.class)); @@ -58,7 +58,7 @@ public class AlleleEffectResurrection extends AlleleEffectThrottled { } public static List getResurrectionList() { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); list.add(new Resurrectable(new ItemStack(Items.gunpowder), EntityCreeper.class)); list.add(new Resurrectable(new ItemStack(Items.ender_pearl), EntityEnderman.class)); list.add(new Resurrectable(new ItemStack(Items.string), EntitySpider.class)); diff --git a/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java b/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java index 6ff2f53ff..a5e8cc8e0 100755 --- a/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java +++ b/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java @@ -39,7 +39,7 @@ public class GuiBeealyzer extends GuiAlyzer { public GuiBeealyzer(EntityPlayer player, BeealyzerInventory inventory) { super("rootBees", player, new ContainerAlyzer(inventory, player), inventory, "gui.beealyzer"); - ArrayList beeList = new ArrayList(); + ArrayList beeList = new ArrayList<>(); ((ItemBeeGE) ForestryItem.beeDroneGE.item()).addCreativeItems(beeList, false); for (ItemStack beeStack : beeList) { IAlleleBeeSpecies species = BeeGenome.getSpecies(beeStack); diff --git a/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java b/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java index a4b25616e..4375c1901 100755 --- a/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java +++ b/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java @@ -49,7 +49,7 @@ public class GuiHabitatLocator extends GuiForestry biomeToHabitat = new EnumMap(BiomeDictionary.Type.class); + private final Map biomeToHabitat = new EnumMap<>(BiomeDictionary.Type.class); private int startX; private int startY; diff --git a/src/main/java/forestry/apiculture/gui/GuiImprinter.java b/src/main/java/forestry/apiculture/gui/GuiImprinter.java index f470ed200..6f179b998 100755 --- a/src/main/java/forestry/apiculture/gui/GuiImprinter.java +++ b/src/main/java/forestry/apiculture/gui/GuiImprinter.java @@ -34,7 +34,7 @@ public class GuiImprinter extends GuiForestry iconStacks = new HashMap(); + private final Map iconStacks = new HashMap<>(); public GuiImprinter(InventoryPlayer inventoryplayer, ImprinterInventory inventory) { super(Constants.TEXTURE_PATH_GUI + "/imprinter.png", new ContainerImprinter(inventoryplayer, inventory), inventory); @@ -42,7 +42,7 @@ public class GuiImprinter extends GuiForestry beeList = new ArrayList(); + List beeList = new ArrayList<>(); ((ItemBeeGE) ForestryItem.beeDroneGE.item()).addCreativeItems(beeList, false); for (ItemStack beeStack : beeList) { IAlleleBeeSpecies species = BeeGenome.getSpecies(beeStack); diff --git a/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java b/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java index e8e21be9c..1273af549 100644 --- a/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java +++ b/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java @@ -59,7 +59,7 @@ public class ItemHabitatLocator extends ItemInventoried { private static final String iconName = "forestry:biomefinder"; - private Set targetBiomes = new HashSet(); + private Set targetBiomes = new HashSet<>(); private boolean biomeFound = false; private int searchRadiusIteration = 0; private int searchAngleIteration = 0; @@ -108,7 +108,7 @@ public class ItemHabitatLocator extends ItemInventoried { private void startBiomeSearch(IBee bee, EntityPlayer player) { - this.targetBiomes = new HashSet(bee.getSuitableBiomes()); + this.targetBiomes = new HashSet<>(bee.getSuitableBiomes()); this.searchAngleIteration = 0; this.searchRadiusIteration = 0; this.biomeFound = false; @@ -237,9 +237,9 @@ public class ItemHabitatLocator extends ItemInventoried { return new ChunkCoordinates(pos.x, pos.y, pos.z); } - private static final Set waterBiomes = new HashSet(); - private static final Set netherBiomes = new HashSet(); - private static final Set endBiomes = new HashSet(); + private static final Set waterBiomes = new HashSet<>(); + private static final Set netherBiomes = new HashSet<>(); + private static final Set endBiomes = new HashSet<>(); static { Collections.addAll(waterBiomes, BiomeDictionary.getBiomesForType(BiomeDictionary.Type.BEACH)); diff --git a/src/main/java/forestry/apiculture/items/ItemHoneycomb.java b/src/main/java/forestry/apiculture/items/ItemHoneycomb.java index 20fe5d546..c18eb25c4 100755 --- a/src/main/java/forestry/apiculture/items/ItemHoneycomb.java +++ b/src/main/java/forestry/apiculture/items/ItemHoneycomb.java @@ -107,7 +107,7 @@ public class ItemHoneycomb extends ItemForestryMultiPass { } private int getRandomCombType(Random random, boolean includeSecret) { - List validCombs = new ArrayList(combs.length); + List validCombs = new ArrayList<>(combs.length); for (int i = 0; i < combs.length; i++) { if (!combs[i].isSecret || includeSecret) { validCombs.add(i); diff --git a/src/main/java/forestry/apiculture/multiblock/AlvearyController.java b/src/main/java/forestry/apiculture/multiblock/AlvearyController.java index 6d7649ec2..a5fcb3658 100644 --- a/src/main/java/forestry/apiculture/multiblock/AlvearyController.java +++ b/src/main/java/forestry/apiculture/multiblock/AlvearyController.java @@ -59,11 +59,11 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple private float humidChange = 0.0f; // PARTS - private final Set beeModifiers = new HashSet(); - private final Set beeListeners = new HashSet(); - private final Set climatisers = new HashSet(); - private final Set activeComponents = new HashSet(); - private final Set allComponents = new HashSet(); + private final Set beeModifiers = new HashSet<>(); + private final Set beeListeners = new HashSet<>(); + private final Set climatisers = new HashSet<>(); + private final Set activeComponents = new HashSet<>(); + private final Set allComponents = new HashSet<>(); // CLIENT private int breedingProgressPercent = 0; diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java index 2d940e272..d6042999f 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java @@ -133,7 +133,7 @@ public class TileAlvearyPlain extends TileAlveary implements IBeeHousing, IClima @Optional.Method(modid = "BuildCraftAPI|statements") @Override public Collection getExternalTriggers(ForgeDirection side, TileEntity tile) { - Collection res = new ArrayList(); + Collection res = new ArrayList<>(); res.add(ApicultureTriggers.missingQueen); res.add(ApicultureTriggers.missingDrone); return res; diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearySwarmer.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearySwarmer.java index a195b23ce..c099885a9 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearySwarmer.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearySwarmer.java @@ -40,7 +40,7 @@ import forestry.core.utils.ItemStackUtil; public class TileAlvearySwarmer extends TileAlvearyWithGui implements ISidedInventory, IActivatable, IAlvearyComponent.Active { private final SwarmerInventory inventory; - private final Stack pendingSpawns = new Stack(); + private final Stack pendingSpawns = new Stack<>(); private boolean active; public TileAlvearySwarmer() { diff --git a/src/main/java/forestry/apiculture/render/ParticleRenderer.java b/src/main/java/forestry/apiculture/render/ParticleRenderer.java index 284850b72..3a5ff6b0f 100755 --- a/src/main/java/forestry/apiculture/render/ParticleRenderer.java +++ b/src/main/java/forestry/apiculture/render/ParticleRenderer.java @@ -159,6 +159,6 @@ public class ParticleRenderer { } private boolean lazyAdd = false; - private final List particles = new ArrayList(); - private final List newParticles = new ArrayList(); + private final List particles = new ArrayList<>(); + private final List newParticles = new ArrayList<>(); } diff --git a/src/main/java/forestry/apiculture/tiles/TileApiary.java b/src/main/java/forestry/apiculture/tiles/TileApiary.java index 5c9cb50a2..2bfbb5925 100644 --- a/src/main/java/forestry/apiculture/tiles/TileApiary.java +++ b/src/main/java/forestry/apiculture/tiles/TileApiary.java @@ -70,7 +70,7 @@ public class TileApiary extends TileAbstractBeeHousing { @Override public Collection getBeeModifiers() { - List beeModifiers = new ArrayList(); + List beeModifiers = new ArrayList<>(); beeModifiers.add(beeModifier); @@ -159,7 +159,7 @@ public class TileApiary extends TileAbstractBeeHousing { } public Collection getFrames() { - Collection hiveFrames = new ArrayList(SLOT_FRAMES_COUNT); + Collection hiveFrames = new ArrayList<>(SLOT_FRAMES_COUNT); for (int i = SLOT_FRAMES_1; i < SLOT_FRAMES_1 + SLOT_FRAMES_COUNT; i++) { ItemStack stackInSlot = getStackInSlot(i); @@ -181,7 +181,7 @@ public class TileApiary extends TileAbstractBeeHousing { @Optional.Method(modid = "BuildCraftAPI|statements") @Override public Collection getExternalTriggers(ForgeDirection side, TileEntity tile) { - LinkedList res = new LinkedList(); + LinkedList res = new LinkedList<>(); res.add(ApicultureTriggers.missingQueen); res.add(ApicultureTriggers.missingDrone); res.add(ApicultureTriggers.noFrames); diff --git a/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java b/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java index 19c5866a8..ca1741a74 100755 --- a/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java +++ b/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java @@ -343,7 +343,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { EnumHumidity biomeHumidity = EnumHumidity.getFromValue(biome.rainfall); // Add bees that can live in this environment - List valid = new ArrayList(); + List valid = new ArrayList<>(); for (IBeeGenome genome : candidates) { if (checkBiomeHazard(genome, biomeTemperature, biomeHumidity)) { valid.add(genome); diff --git a/src/main/java/forestry/apiculture/worldgen/Hive.java b/src/main/java/forestry/apiculture/worldgen/Hive.java index 142aa8746..122d5dafa 100644 --- a/src/main/java/forestry/apiculture/worldgen/Hive.java +++ b/src/main/java/forestry/apiculture/worldgen/Hive.java @@ -25,7 +25,7 @@ import forestry.api.core.EnumTemperature; public final class Hive { private final IHiveDescription hiveDescription; - private final List drops = new ArrayList(); + private final List drops = new ArrayList<>(); public Hive(IHiveDescription hiveDescription) { if (hiveDescription == null) { diff --git a/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java b/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java index 7bd3ba314..280f25436 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java @@ -19,7 +19,7 @@ import net.minecraft.world.World; public class HiveGenGround extends HiveGen { - private final Set groundMaterials = new HashSet(); + private final Set groundMaterials = new HashSet<>(); public HiveGenGround(Block... groundBlocks) { for (Block block : groundBlocks) { diff --git a/src/main/java/forestry/apiculture/worldgen/HiveRegistry.java b/src/main/java/forestry/apiculture/worldgen/HiveRegistry.java index f95619632..5ec9dceb7 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveRegistry.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveRegistry.java @@ -22,7 +22,7 @@ import forestry.api.apiculture.hives.IHiveRegistry; public class HiveRegistry implements IHiveRegistry { - private final Map hives = new HashMap(); + private final Map hives = new HashMap<>(); @Override public void registerHive(String hiveName, IHiveDescription hiveDescription) { @@ -50,7 +50,7 @@ public class HiveRegistry implements IHiveRegistry { } public List getHives() { - return new ArrayList(hives.values()); + return new ArrayList<>(hives.values()); } public List getDrops(String hiveName) { diff --git a/src/main/java/forestry/arboriculture/FruitProviderNone.java b/src/main/java/forestry/arboriculture/FruitProviderNone.java index fa95d7af2..6fba5e7fe 100755 --- a/src/main/java/forestry/arboriculture/FruitProviderNone.java +++ b/src/main/java/forestry/arboriculture/FruitProviderNone.java @@ -37,7 +37,7 @@ public class FruitProviderNone implements IFruitProvider { } } - private static final HashMap overlayTypes = new HashMap(); + private static final HashMap overlayTypes = new HashMap<>(); static { overlayTypes.put("berries", new OverlayType("berries", (short) 1000)); diff --git a/src/main/java/forestry/arboriculture/FruitProviderRandom.java b/src/main/java/forestry/arboriculture/FruitProviderRandom.java index edc3e49fb..31291be08 100755 --- a/src/main/java/forestry/arboriculture/FruitProviderRandom.java +++ b/src/main/java/forestry/arboriculture/FruitProviderRandom.java @@ -28,7 +28,7 @@ import forestry.api.genetics.IFruitFamily; */ public class FruitProviderRandom extends FruitProviderNone { - private final Map products = new HashMap(); + private final Map products = new HashMap<>(); private int colour = 0xffffff; public FruitProviderRandom(String key, IFruitFamily family, ItemStack product, float modifier) { @@ -48,7 +48,7 @@ public class FruitProviderRandom extends FruitProviderNone { @Override public ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime) { - ArrayList product = new ArrayList(); + ArrayList product = new ArrayList<>(); float modeYieldMod = TreeManager.treeRoot.getTreekeepingMode(world).getYieldModifier(genome, 1f); diff --git a/src/main/java/forestry/arboriculture/FruitProviderRipening.java b/src/main/java/forestry/arboriculture/FruitProviderRipening.java index 68cc24110..fbd7fe7a7 100755 --- a/src/main/java/forestry/arboriculture/FruitProviderRipening.java +++ b/src/main/java/forestry/arboriculture/FruitProviderRipening.java @@ -25,7 +25,7 @@ import forestry.api.genetics.IFruitFamily; public class FruitProviderRipening extends FruitProviderNone { - private final Map products = new HashMap(); + private final Map products = new HashMap<>(); private int colourCallow = 0xffffff; @@ -63,7 +63,7 @@ public class FruitProviderRipening extends FruitProviderNone { @Override public ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime) { - ArrayList product = new ArrayList(); + ArrayList product = new ArrayList<>(); float stage = getRipeningStage(ripeningTime); if (stage < 0.5f) { diff --git a/src/main/java/forestry/arboriculture/WoodItemAccess.java b/src/main/java/forestry/arboriculture/WoodItemAccess.java index 8cd607c01..d54b43da5 100644 --- a/src/main/java/forestry/arboriculture/WoodItemAccess.java +++ b/src/main/java/forestry/arboriculture/WoodItemAccess.java @@ -20,16 +20,16 @@ import forestry.api.arboriculture.EnumWoodType; import forestry.api.arboriculture.IWoodItemAccess; public class WoodItemAccess implements IWoodItemAccess { - private static final EnumMap logs = new EnumMap(EnumWoodType.class); - private static final EnumMap logsFireproof = new EnumMap(EnumWoodType.class); - private static final EnumMap planks = new EnumMap(EnumWoodType.class); - private static final EnumMap planksFireproof = new EnumMap(EnumWoodType.class); - private static final EnumMap slabs = new EnumMap(EnumWoodType.class); - private static final EnumMap slabsFireproof = new EnumMap(EnumWoodType.class); - private static final EnumMap fences = new EnumMap(EnumWoodType.class); - private static final EnumMap fencesFireproof = new EnumMap(EnumWoodType.class); - private static final EnumMap stairs = new EnumMap(EnumWoodType.class); - private static final EnumMap stairsFireproof = new EnumMap(EnumWoodType.class); + private static final EnumMap logs = new EnumMap<>(EnumWoodType.class); + private static final EnumMap logsFireproof = new EnumMap<>(EnumWoodType.class); + private static final EnumMap planks = new EnumMap<>(EnumWoodType.class); + private static final EnumMap planksFireproof = new EnumMap<>(EnumWoodType.class); + private static final EnumMap slabs = new EnumMap<>(EnumWoodType.class); + private static final EnumMap slabsFireproof = new EnumMap<>(EnumWoodType.class); + private static final EnumMap fences = new EnumMap<>(EnumWoodType.class); + private static final EnumMap fencesFireproof = new EnumMap<>(EnumWoodType.class); + private static final EnumMap stairs = new EnumMap<>(EnumWoodType.class); + private static final EnumMap stairsFireproof = new EnumMap<>(EnumWoodType.class); private static ItemStack getStack(EnumWoodType woodType, Block block) { NBTTagCompound woodNBT = new NBTTagCompound(); diff --git a/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java b/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java index 2d711ae06..a045342d8 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java @@ -138,7 +138,7 @@ public class BlockArbFence extends BlockFence implements IWoodTyped, ITileEntity @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - return new ArrayList(); + return new ArrayList<>(); } @Override diff --git a/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java b/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java index 68ad4670b..1ce85874a 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java @@ -75,7 +75,7 @@ public class BlockArbStairs extends BlockStairs implements IWoodTyped, ITileEnti @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - return new ArrayList(); + return new ArrayList<>(); } @Override diff --git a/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java b/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java index b8513d886..22302df84 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java @@ -103,7 +103,7 @@ public class BlockForestryLeaves extends BlockNewLeaf implements ITileEntityProv /* DROP HANDLING */ // Hack: When harvesting leaves we need to get the drops in onBlockHarvested, // because Mojang destroys the block and tile before calling getDrops. - private final ThreadLocal> drops = new ThreadLocal>(); + private final ThreadLocal> drops = new ThreadLocal<>(); @Override public void onBlockHarvested(World world, int x, int y, int z, int metadata, EntityPlayer player) { @@ -144,7 +144,7 @@ public class BlockForestryLeaves extends BlockNewLeaf implements ITileEntityProv } private static ArrayList getLeafDrop(World world, @Nullable GameProfile playerProfile, int x, int y, int z, float saplingModifier, int fortune) { - ArrayList prod = new ArrayList(); + ArrayList prod = new ArrayList<>(); TileLeaves tile = getLeafTile(world, x, y, z); if (tile == null || tile.getTree() == null || tile.isDecorative()) { diff --git a/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java b/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java index 2bc13bb4d..509c1006e 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java @@ -80,7 +80,7 @@ public class BlockFruitPod extends BlockCocoa { @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - return new ArrayList(); + return new ArrayList<>(); } @Override diff --git a/src/main/java/forestry/arboriculture/blocks/BlockSapling.java b/src/main/java/forestry/arboriculture/blocks/BlockSapling.java index 962c30be5..8bb698c26 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockSapling.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockSapling.java @@ -150,7 +150,7 @@ public class BlockSapling extends BlockTreeContainer implements IGrowable { /* REMOVING */ @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - return new ArrayList(); + return new ArrayList<>(); } @Override diff --git a/src/main/java/forestry/arboriculture/blocks/BlockSlab.java b/src/main/java/forestry/arboriculture/blocks/BlockSlab.java index 61464f1c3..9356055fc 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockSlab.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockSlab.java @@ -135,7 +135,7 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - return new ArrayList(); + return new ArrayList<>(); } @Override diff --git a/src/main/java/forestry/arboriculture/blocks/BlockWood.java b/src/main/java/forestry/arboriculture/blocks/BlockWood.java index 1d9788557..ebe1f52b9 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockWood.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockWood.java @@ -108,7 +108,7 @@ public abstract class BlockWood extends Block implements ITileEntityProvider, IW @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - return new ArrayList(); + return new ArrayList<>(); } @Override diff --git a/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java b/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java index 5682d2db8..00988755a 100644 --- a/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java +++ b/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java @@ -73,7 +73,7 @@ public final class CommandTreeSpawn extends SubCommand { } private static String[] getSpecies() { - List species = new ArrayList(); + List species = new ArrayList<>(); for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleTreeSpecies) { diff --git a/src/main/java/forestry/arboriculture/commands/TreeModeHelper.java b/src/main/java/forestry/arboriculture/commands/TreeModeHelper.java index a2044b5f3..8443e1af7 100644 --- a/src/main/java/forestry/arboriculture/commands/TreeModeHelper.java +++ b/src/main/java/forestry/arboriculture/commands/TreeModeHelper.java @@ -25,7 +25,7 @@ public class TreeModeHelper implements ICommandModeHelper { public String[] getModeNames() { ArrayList treekeepingModes = TreeManager.treeRoot.getTreekeepingModes(); int modeStringCount = treekeepingModes.size(); - List modeStrings = new ArrayList(modeStringCount); + List modeStrings = new ArrayList<>(modeStringCount); for (ITreekeepingMode mode : treekeepingModes) { modeStrings.add(mode.getName()); } diff --git a/src/main/java/forestry/arboriculture/commands/TreeStatsSaveHelper.java b/src/main/java/forestry/arboriculture/commands/TreeStatsSaveHelper.java index fb3718495..7424a66e5 100644 --- a/src/main/java/forestry/arboriculture/commands/TreeStatsSaveHelper.java +++ b/src/main/java/forestry/arboriculture/commands/TreeStatsSaveHelper.java @@ -38,7 +38,7 @@ public class TreeStatsSaveHelper implements IStatsSaveHelper { @Override public Collection getSpecies() { - Collection species = new ArrayList(); + Collection species = new ArrayList<>(); for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleTreeSpecies) { species.add((IAlleleTreeSpecies) allele); diff --git a/src/main/java/forestry/arboriculture/genetics/Tree.java b/src/main/java/forestry/arboriculture/genetics/Tree.java index 8507b0b65..475040a59 100755 --- a/src/main/java/forestry/arboriculture/genetics/Tree.java +++ b/src/main/java/forestry/arboriculture/genetics/Tree.java @@ -335,7 +335,7 @@ public class Tree extends Individual implements ITree, IPlantable { /* REPRODUCTION */ @Override public ITree[] getSaplings(World world, GameProfile playerProfile, int x, int y, int z, float modifier) { - ArrayList prod = new ArrayList(); + ArrayList prod = new ArrayList<>(); float chance = genome.getFertility() * modifier; diff --git a/src/main/java/forestry/arboriculture/genetics/TreeHelper.java b/src/main/java/forestry/arboriculture/genetics/TreeHelper.java index 4b00f7b92..c58f34031 100755 --- a/src/main/java/forestry/arboriculture/genetics/TreeHelper.java +++ b/src/main/java/forestry/arboriculture/genetics/TreeHelper.java @@ -63,9 +63,9 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot { public static final String UID = "rootTrees"; private static int treeSpeciesCount = -1; private static ITreekeepingMode activeTreekeepingMode; - public static final ArrayList treeTemplates = new ArrayList(); + public static final ArrayList treeTemplates = new ArrayList<>(); - private final ArrayList treekeepingModes = new ArrayList(); + private final ArrayList treekeepingModes = new ArrayList<>(); public TreeHelper() { setResearchSuitability(new ItemStack(Blocks.sapling, 1, OreDictionary.WILDCARD_VALUE), 1.0f); @@ -343,7 +343,7 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot { } /* MUTATIONS */ - private static final List treeMutations = new ArrayList(); + private static final List treeMutations = new ArrayList<>(); @Override public List getMutations(boolean shuffle) { @@ -369,7 +369,7 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot { } /* ILEAFTICKHANDLER */ - private final LinkedList leafTickHandlers = new LinkedList(); + private final LinkedList leafTickHandlers = new LinkedList<>(); @Override public void registerLeafTickHandler(ILeafTickHandler handler) { diff --git a/src/main/java/forestry/arboriculture/genetics/TreekeepingMode.java b/src/main/java/forestry/arboriculture/genetics/TreekeepingMode.java index 9c074110f..39c955156 100755 --- a/src/main/java/forestry/arboriculture/genetics/TreekeepingMode.java +++ b/src/main/java/forestry/arboriculture/genetics/TreekeepingMode.java @@ -45,7 +45,7 @@ public class TreekeepingMode implements ITreekeepingMode { @Override public ArrayList getDescription() { - ArrayList ret = new ArrayList(); + ArrayList ret = new ArrayList<>(); ret.add("treemode." + name.toLowerCase(Locale.ENGLISH) + ".desc"); return ret; } diff --git a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleTreeSpecies.java b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleTreeSpecies.java index 3dff2277d..2da4373d1 100644 --- a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleTreeSpecies.java +++ b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleTreeSpecies.java @@ -41,7 +41,7 @@ public class AlleleTreeSpecies extends AlleleSpecies implements IAlleleTreeSpeci private final ITreeGenerator generator; private final IGermlingIconProvider germlingIconProvider; private final ILeafIconProvider leafIconProvider; - private final List fruits = new ArrayList(); + private final List fruits = new ArrayList<>(); private EnumPlantType nativeType = EnumPlantType.Plains; diff --git a/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java b/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java index 9f004cff9..291516b78 100755 --- a/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java +++ b/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java @@ -47,7 +47,7 @@ public class GuiTreealyzer extends GuiAlyzer { public GuiTreealyzer(EntityPlayer player, TreealyzerInventory inventory) { super("rootTrees", player, new ContainerAlyzer(inventory, player), inventory, "gui.treealyzer"); - ArrayList treeList = new ArrayList(); + ArrayList treeList = new ArrayList<>(); ((ItemGermlingGE) ForestryItem.sapling.item()).addCreativeItems(treeList, false); for (ItemStack treeStack : treeList) { IAlleleTreeSpecies species = TreeGenome.getSpecies(treeStack); @@ -189,12 +189,12 @@ public class GuiTreealyzer extends GuiAlyzer { drawLine(StringUtil.localize("gui.tolerated"), COLUMN_0); - List activeTolerated = new ArrayList(tree.getGenome().getPlantTypes()); + List activeTolerated = new ArrayList<>(tree.getGenome().getPlantTypes()); List inactiveTolerated = Collections.emptyList(); IAllele inactiveAllelePlant = tree.getGenome().getInactiveAllele(EnumTreeChromosome.PLANT); if (inactiveAllelePlant instanceof AllelePlantType) { - inactiveTolerated = new ArrayList(((AllelePlantType) inactiveAllelePlant).getPlantTypes()); + inactiveTolerated = new ArrayList<>(((AllelePlantType) inactiveAllelePlant).getPlantTypes()); } int max = Math.max(activeTolerated.size(), inactiveTolerated.size()); @@ -213,8 +213,8 @@ public class GuiTreealyzer extends GuiAlyzer { // FRUITS drawLine(StringUtil.localize("gui.supports"), COLUMN_0); - List families0 = new ArrayList(tree.getGenome().getPrimary().getSuitableFruit()); - List families1 = new ArrayList(tree.getGenome().getSecondary().getSuitableFruit()); + List families0 = new ArrayList<>(tree.getGenome().getPrimary().getSuitableFruit()); + List families1 = new ArrayList<>(tree.getGenome().getSecondary().getSuitableFruit()); max = Math.max(families0.size(), families1.size()); for (int i = 0; i < max; i++) { diff --git a/src/main/java/forestry/arboriculture/render/TextureLeaves.java b/src/main/java/forestry/arboriculture/render/TextureLeaves.java index 64d44890a..8642e4b1d 100644 --- a/src/main/java/forestry/arboriculture/render/TextureLeaves.java +++ b/src/main/java/forestry/arboriculture/render/TextureLeaves.java @@ -21,7 +21,7 @@ import forestry.api.arboriculture.EnumLeafType; import forestry.core.render.TextureManager; public class TextureLeaves { - private static final Map leafTextures = new EnumMap(EnumLeafType.class); + private static final Map leafTextures = new EnumMap<>(EnumLeafType.class); static { for (EnumLeafType leafType : EnumLeafType.values()) { diff --git a/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java b/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java index 65a58b960..1566d6411 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java +++ b/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java @@ -163,7 +163,7 @@ public class TileFruitPod extends TileEntity implements IFruitBearer, IStreamabl @Override public Collection pickFruit(ItemStack tool) { if (allele == null) { - return new ArrayList(); + return new ArrayList<>(); } Collection fruits = Arrays.asList(getDrop()); diff --git a/src/main/java/forestry/core/blocks/BlockBase.java b/src/main/java/forestry/core/blocks/BlockBase.java index 92e397407..6fbf15ce1 100644 --- a/src/main/java/forestry/core/blocks/BlockBase.java +++ b/src/main/java/forestry/core/blocks/BlockBase.java @@ -50,7 +50,7 @@ import forestry.core.utils.PlayerUtil; public class BlockBase extends BlockForestry { - private final List definitions = new ArrayList(); + private final List definitions = new ArrayList<>(); private final boolean hasTESR; public BlockBase(Material material) { diff --git a/src/main/java/forestry/core/blocks/BlockResourceOre.java b/src/main/java/forestry/core/blocks/BlockResourceOre.java index f10f5c0e6..59e740780 100644 --- a/src/main/java/forestry/core/blocks/BlockResourceOre.java +++ b/src/main/java/forestry/core/blocks/BlockResourceOre.java @@ -49,7 +49,7 @@ public class BlockResourceOre extends Block { @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList drops = new ArrayList(); + ArrayList drops = new ArrayList<>(); if (metadata == 0) { int fortuneModifier = world.rand.nextInt(fortune + 2) - 1; diff --git a/src/main/java/forestry/core/blocks/BlockSoil.java b/src/main/java/forestry/core/blocks/BlockSoil.java index 1eb1b2d75..45345222d 100644 --- a/src/main/java/forestry/core/blocks/BlockSoil.java +++ b/src/main/java/forestry/core/blocks/BlockSoil.java @@ -64,7 +64,7 @@ public class BlockSoil extends Block implements IItemTyped { @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); + ArrayList ret = new ArrayList<>(); SoilType type = getTypeFromMeta(metadata); diff --git a/src/main/java/forestry/core/circuits/CircuitBoard.java b/src/main/java/forestry/core/circuits/CircuitBoard.java index 661e91c9b..5936be72e 100755 --- a/src/main/java/forestry/core/circuits/CircuitBoard.java +++ b/src/main/java/forestry/core/circuits/CircuitBoard.java @@ -56,7 +56,7 @@ public class CircuitBoard implements ICircuitBoard { list.add(EnumChatFormatting.GOLD + layout.getUsage() + ":"); } - List extendedTooltip = new ArrayList(); + List extendedTooltip = new ArrayList<>(); for (ICircuit circuit : circuits) { if (circuit != null) { circuit.addTooltip(extendedTooltip); diff --git a/src/main/java/forestry/core/circuits/CircuitRegistry.java b/src/main/java/forestry/core/circuits/CircuitRegistry.java index 6cc24172a..63c07d9f4 100755 --- a/src/main/java/forestry/core/circuits/CircuitRegistry.java +++ b/src/main/java/forestry/core/circuits/CircuitRegistry.java @@ -28,9 +28,9 @@ import forestry.core.config.ForestryItem; public class CircuitRegistry implements ICircuitRegistry { public static final ICircuitLayout DUMMY_LAYOUT = new CircuitLayout("dummy", CircuitSocketType.NONE); - private static final Map DUMMY_MAP = new LinkedHashMap(); - private final Map layoutMap = new LinkedHashMap(); - private final Map circuitMap = new LinkedHashMap(); + private static final Map DUMMY_MAP = new LinkedHashMap<>(); + private final Map layoutMap = new LinkedHashMap<>(); + private final Map circuitMap = new LinkedHashMap<>(); static { DUMMY_MAP.put("dummy", DUMMY_LAYOUT); diff --git a/src/main/java/forestry/core/circuits/ItemSolderingIron.java b/src/main/java/forestry/core/circuits/ItemSolderingIron.java index e7f6603ff..ff0bd86a6 100755 --- a/src/main/java/forestry/core/circuits/ItemSolderingIron.java +++ b/src/main/java/forestry/core/circuits/ItemSolderingIron.java @@ -58,7 +58,7 @@ public class ItemSolderingIron extends ItemForestry implements ISolderingIron { public static class SolderManager implements ISolderManager { - public static final ArrayList recipes = new ArrayList(); + public static final ArrayList recipes = new ArrayList<>(); @Override public void addRecipe(ICircuitLayout layout, ItemStack resource, ICircuit circuit) { @@ -100,7 +100,7 @@ public class ItemSolderingIron extends ItemForestry implements ISolderingIron { // / INVENTORY MANAGMENT public static class SolderingInventory extends ItemInventory implements IErrorSource { - private final RevolvingList layouts = new RevolvingList(ChipsetManager.circuitRegistry.getRegisteredLayouts().values()); + private final RevolvingList layouts = new RevolvingList<>(ChipsetManager.circuitRegistry.getRegisteredLayouts().values()); private static final short blankSlot = 0; private static final short finishedSlot = 1; diff --git a/src/main/java/forestry/core/commands/CommandHelpers.java b/src/main/java/forestry/core/commands/CommandHelpers.java index da13b73b3..b4f091bcd 100644 --- a/src/main/java/forestry/core/commands/CommandHelpers.java +++ b/src/main/java/forestry/core/commands/CommandHelpers.java @@ -170,7 +170,7 @@ public class CommandHelpers { } } - List commandNames = new ArrayList(); + List commandNames = new ArrayList<>(); for (SubCommand child : command.getChildren()) { commandNames.add(child.getCommandName()); } diff --git a/src/main/java/forestry/core/commands/CommandSaveStats.java b/src/main/java/forestry/core/commands/CommandSaveStats.java index 934351ef9..e3a0810f0 100644 --- a/src/main/java/forestry/core/commands/CommandSaveStats.java +++ b/src/main/java/forestry/core/commands/CommandSaveStats.java @@ -78,7 +78,7 @@ public final class CommandSaveStats extends SubCommand { player = CommandHelpers.getPlayer(sender, sender.getCommandSenderName()); } - Collection statistics = new ArrayList(); + Collection statistics = new ArrayList<>(); String date = DateFormat.getInstance().format(new Date()); statistics.add(StatCollector.translateToLocalFormatted(saveHelper.getUnlocalizedSaveStatsString(), player.getDisplayName(), date)); diff --git a/src/main/java/forestry/core/commands/RootCommand.java b/src/main/java/forestry/core/commands/RootCommand.java index 4d0c2c75f..bc4d02fd0 100644 --- a/src/main/java/forestry/core/commands/RootCommand.java +++ b/src/main/java/forestry/core/commands/RootCommand.java @@ -27,7 +27,7 @@ public class RootCommand extends CommandBase implements IForestryCommand { public static final String ROOT_COMMAND_NAME = "forestry"; public static final String ROOT_COMMAND_ALIAS = "for"; - private final SortedSet children = new TreeSet(new Comparator() { + private final SortedSet children = new TreeSet<>(new Comparator() { @Override public int compare(SubCommand o1, SubCommand o2) { @@ -70,7 +70,7 @@ public class RootCommand extends CommandBase implements IForestryCommand { @Override public List getCommandAliases() { - List aliases = new ArrayList(); + List aliases = new ArrayList<>(); aliases.add(ROOT_COMMAND_ALIAS); return aliases; } diff --git a/src/main/java/forestry/core/commands/SubCommand.java b/src/main/java/forestry/core/commands/SubCommand.java index 580be686a..d16d58565 100644 --- a/src/main/java/forestry/core/commands/SubCommand.java +++ b/src/main/java/forestry/core/commands/SubCommand.java @@ -37,10 +37,10 @@ public abstract class SubCommand implements IForestryCommand { } private final String name; - private final List aliases = new ArrayList(); + private final List aliases = new ArrayList<>(); private PermLevel permLevel = PermLevel.EVERYONE; private IForestryCommand parent; - private final SortedSet children = new TreeSet(new Comparator() { + private final SortedSet children = new TreeSet<>(new Comparator() { @Override public int compare(SubCommand o1, SubCommand o2) { diff --git a/src/main/java/forestry/core/config/Config.java b/src/main/java/forestry/core/config/Config.java index 783ab2d3d..61305dc0e 100755 --- a/src/main/java/forestry/core/config/Config.java +++ b/src/main/java/forestry/core/config/Config.java @@ -44,9 +44,9 @@ public class Config { public static String gameMode; - private static final Set disabledStructures = new HashSet(); - private static final Set disabledFluids = new HashSet(); - private static final Set disabledBlocks = new HashSet(); + private static final Set disabledStructures = new HashSet<>(); + private static final Set disabledFluids = new HashSet<>(); + private static final Set disabledBlocks = new HashSet<>(); public static boolean isDebug = false; @@ -83,7 +83,7 @@ public class Config { private static boolean craftingBronzeEnabled = true; public static boolean craftingStampsEnabled = true; - public static final ArrayList collectorStamps = new ArrayList(); + public static final ArrayList collectorStamps = new ArrayList<>(); public static int farmSize = 2; public static boolean squareFarms = false; @@ -98,7 +98,7 @@ public class Config { // Hints public static boolean enableHints = true; - public static final Map hints = new HashMap(); + public static final Map hints = new HashMap<>(); public static boolean enableEnergyStat = true; public static boolean isStructureEnabled(String uid) { diff --git a/src/main/java/forestry/core/config/ForestryGuiConfig.java b/src/main/java/forestry/core/config/ForestryGuiConfig.java index db1d6afe8..cef80c28a 100644 --- a/src/main/java/forestry/core/config/ForestryGuiConfig.java +++ b/src/main/java/forestry/core/config/ForestryGuiConfig.java @@ -29,7 +29,7 @@ public class ForestryGuiConfig extends GuiConfig { } private static List getConfigCategories() { - List configElements = new ArrayList(); + List configElements = new ArrayList<>(); List commonCategoryNames = Arrays.asList("crafting", "difficulty", "genetics", "performance", "structures", "tweaks", "world"); for (String categoryName : commonCategoryNames) { diff --git a/src/main/java/forestry/core/config/GameMode.java b/src/main/java/forestry/core/config/GameMode.java index 9341c697b..b9cd794c1 100644 --- a/src/main/java/forestry/core/config/GameMode.java +++ b/src/main/java/forestry/core/config/GameMode.java @@ -37,10 +37,10 @@ public class GameMode implements IGameMode { private String identifier = "EASY"; private final String category; - private final Map booleanSettings = new HashMap(); - private final Map integerSettings = new HashMap(); - private final Map floatSettings = new HashMap(); - private final Map stackSettings = new HashMap(); + private final Map booleanSettings = new HashMap<>(); + private final Map integerSettings = new HashMap<>(); + private final Map floatSettings = new HashMap<>(); + private final Map stackSettings = new HashMap<>(); private static final float ENERGY_DEMAND_MODIFIER = 1.0f; private static final float FUEL_MODIFIER = 1.0f; diff --git a/src/main/java/forestry/core/config/SessionVars.java b/src/main/java/forestry/core/config/SessionVars.java index 6cdb8c8ef..623d41872 100755 --- a/src/main/java/forestry/core/config/SessionVars.java +++ b/src/main/java/forestry/core/config/SessionVars.java @@ -14,7 +14,7 @@ import java.util.HashMap; public class SessionVars { - private static final HashMap stringVars = new HashMap(); + private static final HashMap stringVars = new HashMap<>(); private static Class openedLedger; diff --git a/src/main/java/forestry/core/config/Version.java b/src/main/java/forestry/core/config/Version.java index 83c8efd16..8f9ab3d99 100755 --- a/src/main/java/forestry/core/config/Version.java +++ b/src/main/java/forestry/core/config/Version.java @@ -156,7 +156,7 @@ public class Version { BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; - ArrayList changelog = new ArrayList(); + ArrayList changelog = new ArrayList<>(); while ((line = reader.readLine()) != null) { if (line.startsWith("#")) { continue; diff --git a/src/main/java/forestry/core/config/deprecated/Configuration.java b/src/main/java/forestry/core/config/deprecated/Configuration.java index b7ce209b3..82f8d6230 100644 --- a/src/main/java/forestry/core/config/deprecated/Configuration.java +++ b/src/main/java/forestry/core/config/deprecated/Configuration.java @@ -25,7 +25,7 @@ import forestry.core.proxy.Proxies; @Deprecated public class Configuration { - private final TreeMap> categorized = new TreeMap>(); + private final TreeMap> categorized = new TreeMap<>(); public Property get(String key, String category, boolean defaultVal) { diff --git a/src/main/java/forestry/core/errors/ErrorLogic.java b/src/main/java/forestry/core/errors/ErrorLogic.java index 06e8b1a25..3df6b9b3a 100644 --- a/src/main/java/forestry/core/errors/ErrorLogic.java +++ b/src/main/java/forestry/core/errors/ErrorLogic.java @@ -23,7 +23,7 @@ import forestry.api.core.IErrorLogic; import forestry.api.core.IErrorState; public class ErrorLogic implements IErrorLogic { - private final Set errorStates = new HashSet(); + private final Set errorStates = new HashSet<>(); @Override public final boolean setCondition(boolean condition, IErrorState errorState) { diff --git a/src/main/java/forestry/core/errors/ErrorStateRegistry.java b/src/main/java/forestry/core/errors/ErrorStateRegistry.java index 7c90a18a7..f2abf1451 100644 --- a/src/main/java/forestry/core/errors/ErrorStateRegistry.java +++ b/src/main/java/forestry/core/errors/ErrorStateRegistry.java @@ -34,7 +34,7 @@ import forestry.api.core.IErrorStateRegistry; public class ErrorStateRegistry implements IErrorStateRegistry { private static final BiMap states = HashBiMap.create(); - private static final Map stateNames = new HashMap(); + private static final Map stateNames = new HashMap<>(); private static final Set stateView = Collections.unmodifiableSet(states.inverse().keySet()); @Override diff --git a/src/main/java/forestry/core/fluids/BlockForestryFluid.java b/src/main/java/forestry/core/fluids/BlockForestryFluid.java index fd7de90f7..b043b377c 100644 --- a/src/main/java/forestry/core/fluids/BlockForestryFluid.java +++ b/src/main/java/forestry/core/fluids/BlockForestryFluid.java @@ -92,7 +92,7 @@ public class BlockForestryFluid extends BlockFluidClassic { @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { - this.icons = new ArrayList(2); + this.icons = new ArrayList<>(2); String still = "liquid/" + fluidName + "_still"; this.icons.add(TextureManager.getInstance().registerTex(iconRegister, still)); diff --git a/src/main/java/forestry/core/fluids/FluidHelper.java b/src/main/java/forestry/core/fluids/FluidHelper.java index 648260ab1..e064ae96d 100644 --- a/src/main/java/forestry/core/fluids/FluidHelper.java +++ b/src/main/java/forestry/core/fluids/FluidHelper.java @@ -256,7 +256,7 @@ public final class FluidHelper { } public static List getAllFilledContainers(ItemStack empty) { - List filledContainers = new ArrayList(); + List filledContainers = new ArrayList<>(); for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) { ItemStack filledContainer = getFilledContainer(fluid, empty); if (filledContainer != null) { diff --git a/src/main/java/forestry/core/fluids/LiquidRegistryHelper.java b/src/main/java/forestry/core/fluids/LiquidRegistryHelper.java index e1e9ad248..b061a2074 100644 --- a/src/main/java/forestry/core/fluids/LiquidRegistryHelper.java +++ b/src/main/java/forestry/core/fluids/LiquidRegistryHelper.java @@ -30,7 +30,7 @@ import static forestry.core.items.ItemLiquidContainer.EnumContainerType; public class LiquidRegistryHelper { - private static final EnumMap emptyContainers = new EnumMap(EnumContainerType.class); + private static final EnumMap emptyContainers = new EnumMap<>(EnumContainerType.class); static { emptyContainers.put(EnumContainerType.CAN, ForestryItem.canEmpty); diff --git a/src/main/java/forestry/core/fluids/TankManager.java b/src/main/java/forestry/core/fluids/TankManager.java index c750467ac..7f3e9f4d3 100644 --- a/src/main/java/forestry/core/fluids/TankManager.java +++ b/src/main/java/forestry/core/fluids/TankManager.java @@ -49,9 +49,9 @@ import forestry.core.utils.NBTUtil.NBTList; public class TankManager extends ForwardingList implements ITankManager, List { private static final byte NETWORK_DATA = 3; - private final List tanks = new ArrayList(); - private final List prevFluidStacks = new ArrayList(); - private final List prevColor = new ArrayList(); + private final List tanks = new ArrayList<>(); + private final List prevFluidStacks = new ArrayList<>(); + private final List prevColor = new ArrayList<>(); public TankManager() { } diff --git a/src/main/java/forestry/core/fluids/tanks/FilteredTank.java b/src/main/java/forestry/core/fluids/tanks/FilteredTank.java index 9b377660e..e6ec74da0 100644 --- a/src/main/java/forestry/core/fluids/tanks/FilteredTank.java +++ b/src/main/java/forestry/core/fluids/tanks/FilteredTank.java @@ -43,7 +43,7 @@ public class FilteredTank extends StandardTank { public FilteredTank(int capacity, Collection filters, TileEntity tile) { super(capacity, tile); - this.filters = new HashSet(filters); + this.filters = new HashSet<>(filters); } public void addFilter(Fluid filter) { diff --git a/src/main/java/forestry/core/genetics/BreedingTracker.java b/src/main/java/forestry/core/genetics/BreedingTracker.java index 6aa55a003..3712c28af 100755 --- a/src/main/java/forestry/core/genetics/BreedingTracker.java +++ b/src/main/java/forestry/core/genetics/BreedingTracker.java @@ -47,9 +47,9 @@ public abstract class BreedingTracker extends WorldSavedData implements IBreedin public static final String TYPE_KEY = "TYPE"; - private final Set discoveredSpecies = new HashSet(); - private final Set discoveredMutations = new HashSet(); - private final Set researchedMutations = new HashSet(); + private final Set discoveredSpecies = new HashSet<>(); + private final Set discoveredMutations = new HashSet<>(); + private final Set researchedMutations = new HashSet<>(); private String modeName; private final GameProfile username; diff --git a/src/main/java/forestry/core/genetics/Classification.java b/src/main/java/forestry/core/genetics/Classification.java index 01b39a1bf..8a5420cb4 100755 --- a/src/main/java/forestry/core/genetics/Classification.java +++ b/src/main/java/forestry/core/genetics/Classification.java @@ -26,8 +26,8 @@ public class Classification implements IClassification { private IClassification parent; - private final ArrayList members = new ArrayList(); - private final ArrayList groups = new ArrayList(); + private final ArrayList members = new ArrayList<>(); + private final ArrayList groups = new ArrayList<>(); public Classification(EnumClassLevel level, String uid, String scientific) { this.level = level; diff --git a/src/main/java/forestry/core/genetics/ItemResearchNote.java b/src/main/java/forestry/core/genetics/ItemResearchNote.java index deb3f408e..6be53e550 100755 --- a/src/main/java/forestry/core/genetics/ItemResearchNote.java +++ b/src/main/java/forestry/core/genetics/ItemResearchNote.java @@ -76,7 +76,7 @@ public class ItemResearchNote extends ItemForestry { } public ArrayList getTooltip(NBTTagCompound compound) { - ArrayList tooltips = new ArrayList(); + ArrayList tooltips = new ArrayList<>(); if (compound == null || this == NONE) { return tooltips; diff --git a/src/main/java/forestry/core/genetics/SpeciesRoot.java b/src/main/java/forestry/core/genetics/SpeciesRoot.java index ef1fa5969..3fadc2188 100755 --- a/src/main/java/forestry/core/genetics/SpeciesRoot.java +++ b/src/main/java/forestry/core/genetics/SpeciesRoot.java @@ -32,7 +32,7 @@ import forestry.api.genetics.ISpeciesRoot; public abstract class SpeciesRoot implements ISpeciesRoot { /* RESEARCH */ - private final LinkedHashMap researchCatalysts = new LinkedHashMap(); + private final LinkedHashMap researchCatalysts = new LinkedHashMap<>(); @Override public Map getResearchCatalysts() { @@ -45,7 +45,7 @@ public abstract class SpeciesRoot implements ISpeciesRoot { } /* TEMPLATES */ - protected final HashMap speciesTemplates = new HashMap(); + protected final HashMap speciesTemplates = new HashMap<>(); @Override public Map getGenomeTemplates() { @@ -74,7 +74,7 @@ public abstract class SpeciesRoot implements ISpeciesRoot { /* MUTATIONS */ @Override public Collection getCombinations(IAllele other) { - ArrayList combinations = new ArrayList(); + ArrayList combinations = new ArrayList<>(); for (IMutation mutation : getMutations(false)) { if (mutation.isPartner(other)) { combinations.add(mutation); @@ -86,7 +86,7 @@ public abstract class SpeciesRoot implements ISpeciesRoot { @Override public List getCombinations(IAlleleSpecies parentSpecies0, IAlleleSpecies parentSpecies1, boolean shuffle) { - List combinations = new ArrayList(); + List combinations = new ArrayList<>(); String parentSpecies1UID = parentSpecies1.getUID(); for (IMutation mutation : getMutations(shuffle)) { @@ -103,7 +103,7 @@ public abstract class SpeciesRoot implements ISpeciesRoot { @Override public Collection getPaths(IAllele result, IChromosomeType chromosomeType) { - ArrayList paths = new ArrayList(); + ArrayList paths = new ArrayList<>(); for (IMutation mutation : getMutations(false)) { if (mutation.getTemplate()[chromosomeType.ordinal()] == result) { paths.add(mutation); diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java b/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java index 012bbbff5..94a485400 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java @@ -29,7 +29,7 @@ public class AlleleHelper implements IAlleleHelper { private static final String modId = "forestry"; - private final Map> alleleMaps = new HashMap>(); + private final Map> alleleMaps = new HashMap<>(); public void init() { if (PluginManager.Module.APICULTURE.isEnabled()) { @@ -78,14 +78,14 @@ public class AlleleHelper implements IAlleleHelper { createAlleles(EnumAllele.Size.class); } - Map integers = new HashMap(); + Map integers = new HashMap<>(); for (int i = 1; i <= 10; i++) { IAlleleInteger alleleInteger = new AlleleInteger(modId, "i", i + "d", i, true); integers.put(i, alleleInteger); } alleleMaps.put(Integer.class, integers); - Map booleans = new HashMap(); + Map booleans = new HashMap<>(); booleans.put(true, new AlleleBoolean(modId, "bool", true, false)); booleans.put(false, new AlleleBoolean(modId, "bool", false, false)); alleleMaps.put(Boolean.class, booleans); @@ -133,7 +133,7 @@ public class AlleleHelper implements IAlleleHelper { private & IAlleleValue, V> void createAlleles(Class enumClass) { String category = enumClass.getSimpleName().toLowerCase(Locale.ENGLISH); - EnumMap map = new EnumMap(enumClass); + EnumMap map = new EnumMap<>(enumClass); for (K enumValue : enumClass.getEnumConstants()) { IAllele allele = createAllele(category, enumValue); map.put(enumValue, allele); diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleRegistry.java b/src/main/java/forestry/core/genetics/alleles/AlleleRegistry.java index dd322e3df..d04aa9361 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleRegistry.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleRegistry.java @@ -40,7 +40,7 @@ public class AlleleRegistry implements IAlleleRegistry { private static final int ALLELE_ARRAY_SIZE = 2048; /* SPECIES ROOT */ - private final LinkedHashMap rootMap = new LinkedHashMap(16); + private final LinkedHashMap rootMap = new LinkedHashMap<>(16); @Override public void registerSpeciesRoot(ISpeciesRoot root) { @@ -97,15 +97,15 @@ public class AlleleRegistry implements IAlleleRegistry { } /* ALLELES */ - private final LinkedHashMap alleleMap = new LinkedHashMap(ALLELE_ARRAY_SIZE); - private final LinkedHashMap deprecatedAlleleMap = new LinkedHashMap(32); - private final LinkedHashMap classificationMap = new LinkedHashMap(128); - private final LinkedHashMap fruitMap = new LinkedHashMap(64); + private final LinkedHashMap alleleMap = new LinkedHashMap<>(ALLELE_ARRAY_SIZE); + private final LinkedHashMap deprecatedAlleleMap = new LinkedHashMap<>(32); + private final LinkedHashMap classificationMap = new LinkedHashMap<>(128); + private final LinkedHashMap fruitMap = new LinkedHashMap<>(64); /* * Internal HashSet of all alleleHandlers, which trigger when an allele or branch is registered */ - private final HashSet alleleHandlers = new HashSet(); + private final HashSet alleleHandlers = new HashSet<>(); public void initialize() { @@ -234,7 +234,7 @@ public class AlleleRegistry implements IAlleleRegistry { } /* BLACKLIST */ - private final ArrayList blacklist = new ArrayList(); + private final ArrayList blacklist = new ArrayList<>(); @Override public void blacklistAllele(String uid) { diff --git a/src/main/java/forestry/core/genetics/mutations/Mutation.java b/src/main/java/forestry/core/genetics/mutations/Mutation.java index 85cbaefda..fdaa7ad18 100644 --- a/src/main/java/forestry/core/genetics/mutations/Mutation.java +++ b/src/main/java/forestry/core/genetics/mutations/Mutation.java @@ -36,8 +36,8 @@ public abstract class Mutation implements IMutationCustom { private final IAllele[] template; - private final List mutationConditions = new ArrayList(); - private final List specialConditions = new ArrayList(); + private final List mutationConditions = new ArrayList<>(); + private final List specialConditions = new ArrayList<>(); private boolean isSecret = false; diff --git a/src/main/java/forestry/core/gui/ContainerLiquidTanks.java b/src/main/java/forestry/core/gui/ContainerLiquidTanks.java index 225bf9b48..9cfc2f557 100755 --- a/src/main/java/forestry/core/gui/ContainerLiquidTanks.java +++ b/src/main/java/forestry/core/gui/ContainerLiquidTanks.java @@ -26,7 +26,7 @@ public abstract class ContainerLiquidTanks(tile); + this.helper = new ContainerLiquidTanksHelper<>(tile); } @Override diff --git a/src/main/java/forestry/core/gui/ContainerLiquidTanksSocketed.java b/src/main/java/forestry/core/gui/ContainerLiquidTanksSocketed.java index f6a2521ef..de9e3e289 100644 --- a/src/main/java/forestry/core/gui/ContainerLiquidTanksSocketed.java +++ b/src/main/java/forestry/core/gui/ContainerLiquidTanksSocketed.java @@ -29,8 +29,8 @@ public abstract class ContainerLiquidTanksSocketed(tile); - this.tanksHelper = new ContainerLiquidTanksHelper(tile); + this.socketedHelper = new ContainerSocketedHelper<>(tile); + this.tanksHelper = new ContainerLiquidTanksHelper<>(tile); } /* IContainerLiquidTanks */ diff --git a/src/main/java/forestry/core/gui/ContainerSocketed.java b/src/main/java/forestry/core/gui/ContainerSocketed.java index a21db5f0c..496bb5c75 100755 --- a/src/main/java/forestry/core/gui/ContainerSocketed.java +++ b/src/main/java/forestry/core/gui/ContainerSocketed.java @@ -23,7 +23,7 @@ public abstract class ContainerSocketed exte protected ContainerSocketed(T tile, InventoryPlayer playerInventory, int xInv, int yInv) { super(tile, playerInventory, xInv, yInv); - this.helper = new ContainerSocketedHelper(tile); + this.helper = new ContainerSocketedHelper<>(tile); } @Override diff --git a/src/main/java/forestry/core/gui/GuiAlyzer.java b/src/main/java/forestry/core/gui/GuiAlyzer.java index 77cf9aea6..8cf51f33a 100755 --- a/src/main/java/forestry/core/gui/GuiAlyzer.java +++ b/src/main/java/forestry/core/gui/GuiAlyzer.java @@ -54,7 +54,7 @@ public abstract class GuiAlyzer extends GuiForestry private final String guiName; - protected final Map iconStacks = new HashMap(); + protected final Map iconStacks = new HashMap<>(); protected GuiAlyzer(String speciesRoot, EntityPlayer player, ContainerAlyzer container, IInventory inventory, String guiName) { super(Constants.TEXTURE_PATH_GUI + "/beealyzer2.png", container, inventory); @@ -182,7 +182,7 @@ public abstract class GuiAlyzer extends GuiForestry drawLine(StringUtil.localize("gui.alyzer.classification") + ":", 12); newLine(); - Stack hierarchy = new Stack(); + Stack hierarchy = new Stack<>(); IClassification classification = individual.getGenome().getPrimary().getBranch(); while (classification != null) { @@ -251,7 +251,7 @@ public abstract class GuiAlyzer extends GuiForestry RenderHelper.enableGUIStandardItemLighting(); - HashMap combinations = new HashMap(); + HashMap combinations = new HashMap<>(); for (IMutation mutation : speciesRoot.getCombinations(individual.getGenome().getPrimary())) { combinations.put(mutation, individual.getGenome().getPrimary()); diff --git a/src/main/java/forestry/core/gui/GuiNaturalistInventory.java b/src/main/java/forestry/core/gui/GuiNaturalistInventory.java index 2de682ed1..e9f406024 100755 --- a/src/main/java/forestry/core/gui/GuiNaturalistInventory.java +++ b/src/main/java/forestry/core/gui/GuiNaturalistInventory.java @@ -39,7 +39,7 @@ import forestry.core.utils.StringUtil; public class GuiNaturalistInventory extends GuiForestry { private final ISpeciesRoot speciesRoot; private final IBreedingTracker breedingTracker; - private final HashMap iconStacks = new HashMap(); + private final HashMap iconStacks = new HashMap<>(); private final int pageCurrent, pageMax; public GuiNaturalistInventory(ISpeciesRoot speciesRoot, EntityPlayer player, Container container, IPagedInventory inventory, int page, int maxPages) { diff --git a/src/main/java/forestry/core/gui/ledgers/LedgerManager.java b/src/main/java/forestry/core/gui/ledgers/LedgerManager.java index 9f38d5493..c57f3c62d 100644 --- a/src/main/java/forestry/core/gui/ledgers/LedgerManager.java +++ b/src/main/java/forestry/core/gui/ledgers/LedgerManager.java @@ -28,8 +28,8 @@ import forestry.core.proxy.Proxies; public class LedgerManager { - private final List ledgers = new ArrayList(); - private final List errorLedgers = new ArrayList(); + private final List ledgers = new ArrayList<>(); + private final List errorLedgers = new ArrayList<>(); private IErrorSource errorSource; diff --git a/src/main/java/forestry/core/gui/tooltips/ToolTip.java b/src/main/java/forestry/core/gui/tooltips/ToolTip.java index 5722baeac..a14816a52 100755 --- a/src/main/java/forestry/core/gui/tooltips/ToolTip.java +++ b/src/main/java/forestry/core/gui/tooltips/ToolTip.java @@ -20,7 +20,7 @@ import java.util.List; */ public class ToolTip extends ForwardingList { - private final List delegate = new ArrayList(); + private final List delegate = new ArrayList<>(); private final long delay; private long mouseOverStart; diff --git a/src/main/java/forestry/core/gui/widgets/WidgetManager.java b/src/main/java/forestry/core/gui/widgets/WidgetManager.java index ff52cc894..96c306cc2 100644 --- a/src/main/java/forestry/core/gui/widgets/WidgetManager.java +++ b/src/main/java/forestry/core/gui/widgets/WidgetManager.java @@ -24,7 +24,7 @@ public class WidgetManager { public final GuiForestry gui; public final Minecraft minecraft; - protected final List widgets = new ArrayList(); + protected final List widgets = new ArrayList<>(); public WidgetManager(GuiForestry gui) { this.gui = gui; diff --git a/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java b/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java index dd2e267ba..98d49d716 100644 --- a/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java +++ b/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java @@ -36,7 +36,7 @@ public final class AdjacentInventoryCache implements AdjacentTileCache.ICacheLis private final AdjacentTileCache cache; private boolean changed = true; - private final List invs = new LinkedList(); + private final List invs = new LinkedList<>(); private final IInventory[] sides = new IInventory[6]; private final Comparator sorter; private final ITileFilter filter; diff --git a/src/main/java/forestry/core/inventory/InventoryConcatenator.java b/src/main/java/forestry/core/inventory/InventoryConcatenator.java index 5a60b9f0e..2f2336234 100755 --- a/src/main/java/forestry/core/inventory/InventoryConcatenator.java +++ b/src/main/java/forestry/core/inventory/InventoryConcatenator.java @@ -24,8 +24,8 @@ import net.minecraft.item.ItemStack; */ public class InventoryConcatenator implements IInventory { - private final List slotMap = new ArrayList(); - private final List invMap = new ArrayList(); + private final List slotMap = new ArrayList<>(); + private final List invMap = new ArrayList<>(); private InventoryConcatenator() { } diff --git a/src/main/java/forestry/core/inventory/manipulators/InventoryManipulator.java b/src/main/java/forestry/core/inventory/manipulators/InventoryManipulator.java index 651e136bc..e01eedb5f 100755 --- a/src/main/java/forestry/core/inventory/manipulators/InventoryManipulator.java +++ b/src/main/java/forestry/core/inventory/manipulators/InventoryManipulator.java @@ -62,8 +62,8 @@ public class InventoryManipulator { return null; } stack = stack.copy(); - List filledSlots = new ArrayList(inv.getSizeInventory()); - List emptySlots = new ArrayList(inv.getSizeInventory()); + List filledSlots = new ArrayList<>(inv.getSizeInventory()); + List emptySlots = new ArrayList<>(inv.getSizeInventory()); for (IInvSlot slot : InventoryIterator.getIterable(inv)) { if (slot.canPutStackInSlot(stack)) { if (slot.getStackInSlot() == null) { diff --git a/src/main/java/forestry/core/items/ItemLiquidContainer.java b/src/main/java/forestry/core/items/ItemLiquidContainer.java index 832c4a4c4..c5e4b6a1e 100755 --- a/src/main/java/forestry/core/items/ItemLiquidContainer.java +++ b/src/main/java/forestry/core/items/ItemLiquidContainer.java @@ -50,7 +50,7 @@ public class ItemLiquidContainer extends Item { GLASS, JAR, CAN, CAPSULE, REFRACTORY, BUCKET } - private static final Map buckets = new HashMap(); + private static final Map buckets = new HashMap<>(); private boolean isDrink = false; private boolean isAlwaysEdible = false; diff --git a/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java b/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java index 1e87e8801..c4799ae83 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java +++ b/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java @@ -98,7 +98,7 @@ public abstract class MultiblockControllerBase implements ISidedInventory, IRest protected MultiblockControllerBase(World world) { // Multiblock stuff worldObj = world; - connectedParts = new HashSet(); + connectedParts = new HashSet<>(); referenceCoord = null; assemblyState = AssemblyState.Disassembled; @@ -468,7 +468,7 @@ public abstract class MultiblockControllerBase implements ISidedInventory, IRest throw new IllegalArgumentException("The controller with the lowest minimum-coord value must consume the one with the higher coords"); } - Set partsToAcquire = new HashSet(other.connectedParts); + Set partsToAcquire = new HashSet<>(other.connectedParts); // releases all blocks and references gently so they can be incorporated into another multiblock other._onAssimilated(this); @@ -805,7 +805,7 @@ public abstract class MultiblockControllerBase implements ISidedInventory, IRest * Checks all of the parts in the controller. If any are dead or do not exist in the world, they are removed. */ private void auditParts() { - HashSet deadParts = new HashSet(); + HashSet deadParts = new HashSet<>(); for (IMultiblockPart part : connectedParts) { if (part.isInvalid() || worldObj.getTileEntity(part.xCoord, part.yCoord, part.zCoord) != part) { onDetachBlock(part); @@ -838,7 +838,7 @@ public abstract class MultiblockControllerBase implements ISidedInventory, IRest referenceCoord = null; // Reset visitations and find the minimum coordinate - Set deadParts = new HashSet(); + Set deadParts = new HashSet<>(); CoordTriplet c; IMultiblockPart referencePart = null; @@ -885,7 +885,7 @@ public abstract class MultiblockControllerBase implements ISidedInventory, IRest // Now visit all connected parts, breadth-first, starting from reference coord's part IMultiblockPart part; - LinkedList partsToCheck = new LinkedList(); + LinkedList partsToCheck = new LinkedList<>(); int visitedParts = 0; partsToCheck.add(referencePart); @@ -910,7 +910,7 @@ public abstract class MultiblockControllerBase implements ISidedInventory, IRest } // Finally, remove all parts that remain disconnected. - Set removedParts = new HashSet(); + Set removedParts = new HashSet<>(); for (IMultiblockPart orphanCandidate : connectedParts) { if (!orphanCandidate.isVisited()) { deadParts.add(orphanCandidate); @@ -944,7 +944,7 @@ public abstract class MultiblockControllerBase implements ISidedInventory, IRest */ public Set detachAllBlocks() { if (worldObj == null) { - return new HashSet(); + return new HashSet<>(); } IChunkProvider chunkProvider = worldObj.getChunkProvider(); @@ -955,7 +955,7 @@ public abstract class MultiblockControllerBase implements ISidedInventory, IRest } Set detachedParts = connectedParts; - connectedParts = new HashSet(); + connectedParts = new HashSet<>(); return detachedParts; } diff --git a/src/main/java/forestry/core/multiblock/MultiblockRegistry.java b/src/main/java/forestry/core/multiblock/MultiblockRegistry.java index ad3bc7efe..65c063634 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockRegistry.java +++ b/src/main/java/forestry/core/multiblock/MultiblockRegistry.java @@ -15,7 +15,7 @@ import forestry.core.utils.Log; */ public class MultiblockRegistry { // World > WorldRegistry map - private static final Map registries = new HashMap(); + private static final Map registries = new HashMap<>(); /** * Called before Tile Entities are ticked in the world. Do bookkeeping here. diff --git a/src/main/java/forestry/core/multiblock/MultiblockTileEntityBase.java b/src/main/java/forestry/core/multiblock/MultiblockTileEntityBase.java index 6b550dbc1..4b66b9234 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockTileEntityBase.java +++ b/src/main/java/forestry/core/multiblock/MultiblockTileEntityBase.java @@ -66,7 +66,7 @@ public abstract class MultiblockTileEntityBase extends IMultiblockPart implement } if (controllers == null) { - controllers = new HashSet(); + controllers = new HashSet<>(); bestController = candidate; } else if (!controllers.contains(candidate) && candidate.shouldConsume(bestController)) { bestController = candidate; @@ -337,7 +337,7 @@ public abstract class MultiblockTileEntityBase extends IMultiblockPart implement }; TileEntity te; - List neighborParts = new ArrayList(); + List neighborParts = new ArrayList<>(); IChunkProvider chunkProvider = worldObj.getChunkProvider(); for (CoordTriplet neighbor : neighbors) { if (!chunkProvider.chunkExists(neighbor.getChunkX(), neighbor.getChunkZ())) { diff --git a/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java b/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java index 6a7641206..a2f833c12 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java +++ b/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java @@ -50,14 +50,14 @@ public class MultiblockWorldRegistry { public MultiblockWorldRegistry(World world) { worldObj = world; - controllers = new HashSet(); - deadControllers = new HashSet(); - dirtyControllers = new HashSet(); + controllers = new HashSet<>(); + deadControllers = new HashSet<>(); + dirtyControllers = new HashSet<>(); - detachedParts = new HashSet(); - orphanedParts = new HashSet(); + detachedParts = new HashSet<>(); + orphanedParts = new HashSet<>(); - partsAwaitingChunkLoad = new HashMap>(); + partsAwaitingChunkLoad = new HashMap<>(); partsAwaitingChunkLoadMutex = new Object(); orphanedPartsMutex = new Object(); } @@ -101,7 +101,7 @@ public class MultiblockWorldRegistry { synchronized (orphanedPartsMutex) { if (orphanedParts.size() > 0) { orphansToProcess = orphanedParts; - orphanedParts = new HashSet(); + orphanedParts = new HashSet<>(); } } @@ -137,13 +137,13 @@ public class MultiblockWorldRegistry { this.controllers.add(newController); } else if (compatibleControllers.size() > 1) { if (mergePools == null) { - mergePools = new ArrayList>(); + mergePools = new ArrayList<>(); } // THIS IS THE ONLY PLACE WHERE MERGES ARE DETECTED // Multiple compatible controllers indicates an impending merge. // Locate the appropriate merge pool(s) - List> candidatePools = new ArrayList>(); + List> candidatePools = new ArrayList<>(); for (Set candidatePool : mergePools) { if (!Collections.disjoint(candidatePool, compatibleControllers)) { // They share at least one element, so that means they will all touch after the merge @@ -277,7 +277,7 @@ public class MultiblockWorldRegistry { long chunkHash = worldLocation.getChunkXZHash(); synchronized (partsAwaitingChunkLoadMutex) { if (!partsAwaitingChunkLoad.containsKey(chunkHash)) { - partSet = new HashSet(); + partSet = new HashSet<>(); partsAwaitingChunkLoad.put(chunkHash, partSet); } else { partSet = partsAwaitingChunkLoad.get(chunkHash); diff --git a/src/main/java/forestry/core/network/DataInputStreamForestry.java b/src/main/java/forestry/core/network/DataInputStreamForestry.java index 1906fe078..9971d3d75 100644 --- a/src/main/java/forestry/core/network/DataInputStreamForestry.java +++ b/src/main/java/forestry/core/network/DataInputStreamForestry.java @@ -76,7 +76,7 @@ public class DataInputStreamForestry extends DataInputStream { public List readStreamables(Class streamableClass) throws IOException { int length = readVarInt(); - List streamables = new ArrayList(length); + List streamables = new ArrayList<>(length); if (length > 0) { for (int i = 0; i < length; i++) { T streamable = readStreamable(streamableClass); diff --git a/src/main/java/forestry/core/recipes/RecipeUtil.java b/src/main/java/forestry/core/recipes/RecipeUtil.java index 259c202bd..d227ff37d 100644 --- a/src/main/java/forestry/core/recipes/RecipeUtil.java +++ b/src/main/java/forestry/core/recipes/RecipeUtil.java @@ -60,7 +60,7 @@ public abstract class RecipeUtil { */ public static List getOreDictRecipeEquivalents(ItemStack itemStack) { int[] oreDictIds = OreDictionary.getOreIDs(itemStack); - List oreDictNames = new ArrayList(oreDictIds.length); + List oreDictNames = new ArrayList<>(oreDictIds.length); for (int oreId : oreDictIds) { String oreDictName = OreDictionary.getOreName(oreId); oreDictNames.add(oreDictName); @@ -178,7 +178,7 @@ public abstract class RecipeUtil { return Collections.singletonList(repairRecipe); } - List matchingRecipes = new ArrayList(); + List matchingRecipes = new ArrayList<>(); for (Object recipe : CraftingManager.getInstance().getRecipeList()) { IRecipe irecipe = (IRecipe) recipe; diff --git a/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java b/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java index d6c3d309b..1e8aa77f0 100644 --- a/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java +++ b/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java @@ -254,7 +254,7 @@ public class ShapedRecipeCustom implements IDescriptiveRecipe { } } - HashMap hashmap = new HashMap(); + HashMap hashmap = new HashMap<>(); for (; index < materials.length; index += 2) { Character character = (Character) materials[index]; @@ -281,8 +281,8 @@ public class ShapedRecipeCustom implements IDescriptiveRecipe { Object ingredients[] = new Object[columns * rows]; for (int l = 0; l < columns * rows; l++) { char c = s.charAt(l); - if (hashmap.containsKey(Character.valueOf(c))) { - ingredients[l] = hashmap.get(Character.valueOf(c)); + if (hashmap.containsKey(c)) { + ingredients[l] = hashmap.get(c); } else { ingredients[l] = null; } diff --git a/src/main/java/forestry/core/recipes/ShapelessRecipeCustom.java b/src/main/java/forestry/core/recipes/ShapelessRecipeCustom.java index 006f7bc71..e77a16b33 100644 --- a/src/main/java/forestry/core/recipes/ShapelessRecipeCustom.java +++ b/src/main/java/forestry/core/recipes/ShapelessRecipeCustom.java @@ -49,7 +49,7 @@ public class ShapelessRecipeCustom implements IRecipe { @Override public boolean matches(InventoryCrafting inventoryCrafting, World world) { - ArrayList arraylist = new ArrayList(this.ingredients); + ArrayList arraylist = new ArrayList<>(this.ingredients); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { diff --git a/src/main/java/forestry/core/recipes/nei/NEIHandlerShapedCustom.java b/src/main/java/forestry/core/recipes/nei/NEIHandlerShapedCustom.java index 93fcc16a8..8ab6e23c2 100644 --- a/src/main/java/forestry/core/recipes/nei/NEIHandlerShapedCustom.java +++ b/src/main/java/forestry/core/recipes/nei/NEIHandlerShapedCustom.java @@ -26,7 +26,7 @@ public class NEIHandlerShapedCustom extends RecipeHandlerBase { public class CachedShapedCustomRecipe extends CachedBaseRecipe implements INBTMatchingCachedRecipe { private final boolean preservesNbt; - public List inputs = new ArrayList(); + public List inputs = new ArrayList<>(); public PositionedStack output; public CachedShapedCustomRecipe(ShapedRecipeCustom recipe) { diff --git a/src/main/java/forestry/core/recipes/nei/NEIHandlerShapelessCustom.java b/src/main/java/forestry/core/recipes/nei/NEIHandlerShapelessCustom.java index 138301839..20b777b19 100644 --- a/src/main/java/forestry/core/recipes/nei/NEIHandlerShapelessCustom.java +++ b/src/main/java/forestry/core/recipes/nei/NEIHandlerShapelessCustom.java @@ -27,7 +27,7 @@ public class NEIHandlerShapelessCustom extends RecipeHandlerBase { public class CachedShapelessCustomRecipe extends CachedBaseRecipe implements INBTMatchingCachedRecipe { private final boolean preservesNbt; - public List inputs = new ArrayList(); + public List inputs = new ArrayList<>(); public PositionedStack output; public CachedShapelessCustomRecipe(ShapelessRecipeCustom recipe) { diff --git a/src/main/java/forestry/core/recipes/nei/NEIUtils.java b/src/main/java/forestry/core/recipes/nei/NEIUtils.java index 4da40fca6..5fe6208b5 100644 --- a/src/main/java/forestry/core/recipes/nei/NEIUtils.java +++ b/src/main/java/forestry/core/recipes/nei/NEIUtils.java @@ -36,7 +36,7 @@ public class NEIUtils { } public static List getItemVariations(ItemStack base) { - List variations = new ArrayList(); + List variations = new ArrayList<>(); base.getItem().getSubItems(base.getItem(), null, variations); Iterator itr = variations.iterator(); ItemStack stack; diff --git a/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java b/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java index 881321cd5..2bd81c910 100644 --- a/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java +++ b/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java @@ -22,7 +22,7 @@ import codechicken.nei.recipe.GuiRecipe; public class PositionedStackAdv extends PositionedStack { - private final List tooltip = new ArrayList(); + private final List tooltip = new ArrayList<>(); public PositionedStackAdv(Object object, int x, int y) { super(object, x, y); diff --git a/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java b/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java index 665cd3a45..3623e44fc 100644 --- a/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java +++ b/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java @@ -37,7 +37,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements public abstract class CachedBaseRecipe extends CachedRecipe { public List getFluidTanks() { - List tanks = new ArrayList(); + List tanks = new ArrayList<>(); PositionedFluidTank tank = this.getFluidTank(); if (tank != null) { tanks.add(tank); diff --git a/src/main/java/forestry/core/recipes/nei/SetRecipeCommandHandler.java b/src/main/java/forestry/core/recipes/nei/SetRecipeCommandHandler.java index 5003ed96f..f259f4e0b 100644 --- a/src/main/java/forestry/core/recipes/nei/SetRecipeCommandHandler.java +++ b/src/main/java/forestry/core/recipes/nei/SetRecipeCommandHandler.java @@ -39,7 +39,7 @@ public class SetRecipeCommandHandler { return; } - Map stmap = new HashMap(); + Map stmap = new HashMap<>(); for (int i = 0; i < stacks.tagCount(); i++) { NBTTagCompound itemdata = stacks.getCompoundTagAt(i); stmap.put(itemdata.getInteger("slot"), ItemStack.loadItemStackFromNBT(itemdata)); diff --git a/src/main/java/forestry/core/render/RenderBlock.java b/src/main/java/forestry/core/render/RenderBlock.java index 30055bc70..b5e747e05 100644 --- a/src/main/java/forestry/core/render/RenderBlock.java +++ b/src/main/java/forestry/core/render/RenderBlock.java @@ -22,7 +22,7 @@ import forestry.core.ForestryClient; public class RenderBlock implements ISimpleBlockRenderingHandler { - public static final HashMap byBlockRenderer = new HashMap(); + public static final HashMap byBlockRenderer = new HashMap<>(); @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { diff --git a/src/main/java/forestry/core/render/TextureManager.java b/src/main/java/forestry/core/render/TextureManager.java index c0def8bab..c48959c0e 100755 --- a/src/main/java/forestry/core/render/TextureManager.java +++ b/src/main/java/forestry/core/render/TextureManager.java @@ -37,11 +37,11 @@ public class TextureManager implements ITextureManager { return instance; } - private final HashMap defaultIcons = new HashMap(); + private final HashMap defaultIcons = new HashMap<>(); private final IIcon[] textures = new IIcon[2048]; - private final ArrayList iconProvider = new ArrayList(); + private final ArrayList iconProvider = new ArrayList<>(); private TextureManager() { } diff --git a/src/main/java/forestry/core/tiles/AdjacentTileCache.java b/src/main/java/forestry/core/tiles/AdjacentTileCache.java index 5ad273f95..1cc14edb3 100644 --- a/src/main/java/forestry/core/tiles/AdjacentTileCache.java +++ b/src/main/java/forestry/core/tiles/AdjacentTileCache.java @@ -32,7 +32,7 @@ public final class AdjacentTileCache { private final TileEntity[] cache = new TileEntity[6]; private final int[] delay = new int[6]; private final TileEntity source; - private final Set listeners = new LinkedHashSet(); + private final Set listeners = new LinkedHashSet<>(); public interface ICacheListener { diff --git a/src/main/java/forestry/core/tiles/EscritoireGame.java b/src/main/java/forestry/core/tiles/EscritoireGame.java index f282b285d..d5b85a363 100644 --- a/src/main/java/forestry/core/tiles/EscritoireGame.java +++ b/src/main/java/forestry/core/tiles/EscritoireGame.java @@ -235,7 +235,7 @@ public class EscritoireGame implements INBTTagable, IStreamable { gameTokens = new GameToken[boardSize]; ISpeciesRoot root = individual.getGenome().getPrimary().getRoot(); - ArrayList pairs = new ArrayList(); + ArrayList pairs = new ArrayList<>(); for (int i = 0; i < boardSize / 2; i++) { IIndividual token = root.templateAsIndividual(root.getRandomTemplate(rand)); pairs.add(root.getMemberStack(token, 0)); @@ -276,7 +276,7 @@ public class EscritoireGame implements INBTTagable, IStreamable { } private int[] getUnrevealedTokens(int count) { - ArrayList existing = new ArrayList(); + ArrayList existing = new ArrayList<>(); int remaining = countUnrevealedTokens(); int[] unrevealed = new int[count < remaining ? count : remaining]; @@ -447,7 +447,7 @@ public class EscritoireGame implements INBTTagable, IStreamable { } private Collection getRevealedSingles(GameToken exclude) { - ArrayList singles = new ArrayList(); + ArrayList singles = new ArrayList<>(); for (GameToken token : gameTokens) { if (!token.isRevealed || token == exclude) { diff --git a/src/main/java/forestry/core/tiles/TileAnalyzer.java b/src/main/java/forestry/core/tiles/TileAnalyzer.java index c6cba1a8f..1cb722288 100644 --- a/src/main/java/forestry/core/tiles/TileAnalyzer.java +++ b/src/main/java/forestry/core/tiles/TileAnalyzer.java @@ -244,7 +244,7 @@ public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiqui return true; } - Set errors = new HashSet(getErrorLogic().getErrorStates()); + Set errors = new HashSet<>(getErrorLogic().getErrorStates()); errors.remove(EnumErrorCode.NOPOWER); return errors.size() == 0; } diff --git a/src/main/java/forestry/core/utils/ClimateUtil.java b/src/main/java/forestry/core/utils/ClimateUtil.java index f04643297..946ea3fe7 100644 --- a/src/main/java/forestry/core/utils/ClimateUtil.java +++ b/src/main/java/forestry/core/utils/ClimateUtil.java @@ -40,7 +40,7 @@ public class ClimateUtil implements IClimateHelper { public ArrayList getToleratedHumidity(EnumHumidity prefered, EnumTolerance tolerance) { - ArrayList tolerated = new ArrayList(); + ArrayList tolerated = new ArrayList<>(); tolerated.add(prefered); switch (tolerance) { @@ -98,7 +98,7 @@ public class ClimateUtil implements IClimateHelper { public ArrayList getToleratedTemperature(EnumTemperature prefered, EnumTolerance tolerance) { - ArrayList tolerated = new ArrayList(); + ArrayList tolerated = new ArrayList<>(); tolerated.add(prefered); switch (tolerance) { diff --git a/src/main/java/forestry/core/utils/ForestryModEnvWarningCallable.java b/src/main/java/forestry/core/utils/ForestryModEnvWarningCallable.java index bac8ff280..094ccb7d1 100755 --- a/src/main/java/forestry/core/utils/ForestryModEnvWarningCallable.java +++ b/src/main/java/forestry/core/utils/ForestryModEnvWarningCallable.java @@ -38,7 +38,7 @@ public class ForestryModEnvWarningCallable implements ICrashCallable { } private ForestryModEnvWarningCallable() { - this.modIDs = new ArrayList(); + this.modIDs = new ArrayList<>(); if (FMLCommonHandler.instance().getSide() == Side.CLIENT && FMLClientHandler.instance().hasOptifine()) { modIDs.add("Optifine"); @@ -57,7 +57,7 @@ public class ForestryModEnvWarningCallable implements ICrashCallable { // No need to do anything. } - this.disabledModules = new ArrayList(); + this.disabledModules = new ArrayList<>(); for (PluginManager.Module module : PluginManager.configDisabledModules) { disabledModules.add(module.configName()); } diff --git a/src/main/java/forestry/core/utils/GeneticsUtil.java b/src/main/java/forestry/core/utils/GeneticsUtil.java index 1ba51dc3f..af6376fbe 100644 --- a/src/main/java/forestry/core/utils/GeneticsUtil.java +++ b/src/main/java/forestry/core/utils/GeneticsUtil.java @@ -48,7 +48,7 @@ public class GeneticsUtil { private static Set getErsatzBlocks() { if (ersatzSpecimenBlocks == null) { - ersatzSpecimenBlocks = new HashSet(); + ersatzSpecimenBlocks = new HashSet<>(); for (ItemStack ersatzSpecimen : AlleleManager.ersatzSpecimen.keySet()) { Block ersatzBlock = ItemStackUtil.getBlock(ersatzSpecimen); if (ersatzBlock != null) { diff --git a/src/main/java/forestry/core/utils/InventoryUtil.java b/src/main/java/forestry/core/utils/InventoryUtil.java index 41f156e53..69d292ff2 100644 --- a/src/main/java/forestry/core/utils/InventoryUtil.java +++ b/src/main/java/forestry/core/utils/InventoryUtil.java @@ -270,14 +270,14 @@ public abstract class InventoryUtil { return false; } - List> pipes = new ArrayList>(); + List> pipes = new ArrayList<>(); boolean foundPipe = false; for (ForgeDirection side : directions) { TileEntity tile = tileCache.getTileOnSide(side); if (tile instanceof IPipeTile) { IPipeTile pipe = (IPipeTile) tile; if (pipe.getPipeType() == IPipeTile.PipeType.ITEM && pipe.isPipeConnected(side.getOpposite())) { - pipes.add(new AbstractMap.SimpleEntry(side, pipe)); + pipes.add(new AbstractMap.SimpleEntry<>(side, pipe)); foundPipe = true; } } diff --git a/src/main/java/forestry/core/utils/ItemStackUtil.java b/src/main/java/forestry/core/utils/ItemStackUtil.java index 0a7998b00..17ea6848d 100644 --- a/src/main/java/forestry/core/utils/ItemStackUtil.java +++ b/src/main/java/forestry/core/utils/ItemStackUtil.java @@ -89,7 +89,7 @@ public abstract class ItemStackUtil { /** */ public static ItemStack[] condenseStacks(ItemStack[] stacks) { - List condensed = new ArrayList(); + List condensed = new ArrayList<>(); for (ItemStack stack : stacks) { if (stack == null) { @@ -313,7 +313,7 @@ public abstract class ItemStackUtil { } private static List getItemStacks(List stacks) { - List itemStacks = new ArrayList(stacks.size()); + List itemStacks = new ArrayList<>(stacks.size()); for (Stack stack : stacks) { Item item = stack.getItem(); if (item != null) { diff --git a/src/main/java/forestry/core/utils/NBTUtil.java b/src/main/java/forestry/core/utils/NBTUtil.java index 3a5d36163..f5b1c267e 100644 --- a/src/main/java/forestry/core/utils/NBTUtil.java +++ b/src/main/java/forestry/core/utils/NBTUtil.java @@ -70,7 +70,7 @@ public abstract class NBTUtil { public static NBTList getNBTList(NBTTagCompound nbt, String tag, EnumNBTType type) { NBTTagList nbtList = nbt.getTagList(tag, type.ordinal()); - return new NBTList(nbtList); + return new NBTList<>(nbtList); } public static class NBTList extends ForwardingList { diff --git a/src/main/java/forestry/core/utils/Stack.java b/src/main/java/forestry/core/utils/Stack.java index 246ab5bc1..9c92367d9 100644 --- a/src/main/java/forestry/core/utils/Stack.java +++ b/src/main/java/forestry/core/utils/Stack.java @@ -38,7 +38,7 @@ public class Stack { public static List parseStackStrings(String[] parts, int missingMetaValue) { - List stacks = new ArrayList(); + List stacks = new ArrayList<>(); for (String itemStackString : parts) { Stack stack = parseStackString(itemStackString, missingMetaValue); diff --git a/src/main/java/forestry/core/utils/datastructures/RevolvingList.java b/src/main/java/forestry/core/utils/datastructures/RevolvingList.java index 633d1859e..8faf699fc 100644 --- a/src/main/java/forestry/core/utils/datastructures/RevolvingList.java +++ b/src/main/java/forestry/core/utils/datastructures/RevolvingList.java @@ -22,7 +22,7 @@ import java.util.LinkedList; */ public class RevolvingList extends ForwardingCollection { - private final Deque list = new LinkedList(); + private final Deque list = new LinkedList<>(); public RevolvingList() { } diff --git a/src/main/java/forestry/energy/tiles/TileEnginePeat.java b/src/main/java/forestry/energy/tiles/TileEnginePeat.java index 39e8511f3..d3480a133 100644 --- a/src/main/java/forestry/energy/tiles/TileEnginePeat.java +++ b/src/main/java/forestry/energy/tiles/TileEnginePeat.java @@ -348,7 +348,7 @@ public class TileEnginePeat extends TileEngine implements ISidedInventory { @Optional.Method(modid = "BuildCraftAPI|statements") @Override public Collection getExternalTriggers(ForgeDirection side, TileEntity tile) { - LinkedList res = new LinkedList(); + LinkedList res = new LinkedList<>(); res.add(FactoryTriggers.lowFuel25); res.add(FactoryTriggers.lowFuel10); return res; diff --git a/src/main/java/forestry/factory/recipes/RecipeMemory.java b/src/main/java/forestry/factory/recipes/RecipeMemory.java index ecee084ca..0bc9cf117 100644 --- a/src/main/java/forestry/factory/recipes/RecipeMemory.java +++ b/src/main/java/forestry/factory/recipes/RecipeMemory.java @@ -39,13 +39,13 @@ public class RecipeMemory implements INBTTagable, IStreamable { public static final int capacity = 9; private static final Container DUMMY_CONTAINER = new ContainerDummy(); - private static final List> memoryBlacklist = new ArrayList>(); + private static final List> memoryBlacklist = new ArrayList<>(); static { memoryBlacklist.add(ItemMap.class); // almost every ItemMap is unique } - private LinkedList recipes = new LinkedList(); + private LinkedList recipes = new LinkedList<>(); private long lastUpdate; private static boolean isValid(World world, Recipe recipe) { @@ -61,7 +61,7 @@ public class RecipeMemory implements INBTTagable, IStreamable { } public void validate(World world) { - LinkedList validRecipes = new LinkedList(); + LinkedList validRecipes = new LinkedList<>(); for (Recipe recipe : recipes) { if (isValid(world, recipe)) { validRecipes.add(recipe); @@ -165,7 +165,7 @@ public class RecipeMemory implements INBTTagable, IStreamable { @Override public void readFromNBT(NBTTagCompound nbttagcompound) { - recipes = new LinkedList(); + recipes = new LinkedList<>(); if (!nbttagcompound.hasKey("RecipeMemory")) { return; } diff --git a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCentrifuge.java b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCentrifuge.java index 1ecd1d6b4..efe65b205 100644 --- a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCentrifuge.java +++ b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCentrifuge.java @@ -56,7 +56,7 @@ public class CraftGuideCentrifuge implements RecipeProvider { for (ICentrifugeRecipe recipe : TileCentrifuge.RecipeManager.recipes) { Object[] array = new Object[11]; - List> entries = new ArrayList>(recipe.getAllProducts().entrySet()); + List> entries = new ArrayList<>(recipe.getAllProducts().entrySet()); for (int i = 0; i < Math.min(entries.size(), 9); i++) { Entry entry = entries.get(i); diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerBottler.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerBottler.java index 3830de644..e01564a2b 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerBottler.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerBottler.java @@ -35,7 +35,7 @@ import codechicken.nei.PositionedStack; public class NEIHandlerBottler extends RecipeHandlerBase { - private static final List recipes = new ArrayList(); + private static final List recipes = new ArrayList<>(); @Override public void prepare() { diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerCarpenter.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerCarpenter.java index b44d3207c..76f731aca 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerCarpenter.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerCarpenter.java @@ -45,7 +45,7 @@ public class NEIHandlerCarpenter extends RecipeHandlerBase { public class CachedCarpenterRecipe extends CachedBaseRecipe { - public List inputs = new ArrayList(); + public List inputs = new ArrayList<>(); public PositionedFluidTank tank; public PositionedStack output; diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerCentrifuge.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerCentrifuge.java index 6ff391cc8..bc79b29d4 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerCentrifuge.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerCentrifuge.java @@ -45,7 +45,7 @@ public class NEIHandlerCentrifuge extends RecipeHandlerBase { public class CachedCentrifugeRecipe extends CachedBaseRecipe { public PositionedStack inputs; - public List outputs = new ArrayList(); + public List outputs = new ArrayList<>(); public CachedCentrifugeRecipe(ICentrifugeRecipe recipe, boolean genPerms) { if (recipe.getInput() != null) { @@ -65,7 +65,7 @@ public class NEIHandlerCentrifuge extends RecipeHandlerBase { if (entrySet.size() == 0) { return; } - PriorityQueue> sortByChance = new PriorityQueue>(entrySet.size(), highestChanceComparator); + PriorityQueue> sortByChance = new PriorityQueue<>(entrySet.size(), highestChanceComparator); sortByChance.addAll(entrySet); int i = 0; diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java index 9bedee045..b3a42b424 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java @@ -45,16 +45,16 @@ public class NEIHandlerFabricator extends RecipeHandlerBase { private final boolean preservesNbt; - public List smeltingInput = new ArrayList(); + public List smeltingInput = new ArrayList<>(); public PositionedFluidTank tank; - public List inputs = new ArrayList(); + public List inputs = new ArrayList<>(); public PositionedStack output; public CachedFabricatorRecipe(IFabricatorRecipe recipe, boolean genPerms) { this.preservesNbt = recipe.preservesNbt(); if (recipe.getLiquid() != null) { this.tank = new PositionedFluidTank(recipe.getLiquid(), 2000, new Rectangle(21, 37, 16, 16)); - List smeltingInput = new ArrayList(); + List smeltingInput = new ArrayList<>(); for (TileFabricator.Smelting s : getSmeltingInputs().get(recipe.getLiquid().getFluid())) { smeltingInput.add(s.getResource()); } @@ -253,7 +253,7 @@ public class NEIHandlerFabricator extends RecipeHandlerBase { } private static Map> getSmeltingInputs() { - Map> smeltingInputs = new HashMap>(); + Map> smeltingInputs = new HashMap<>(); for (TileFabricator.Smelting smelting : TileFabricator.RecipeManager.smeltings) { Fluid fluid = smelting.getProduct().getFluid(); if (!smeltingInputs.containsKey(fluid)) { diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerFermenter.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerFermenter.java index e62edd4dc..94afe0e47 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerFermenter.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerFermenter.java @@ -49,9 +49,9 @@ public class NEIHandlerFermenter extends RecipeHandlerBase { public class CachedFermenterRecipe extends CachedBaseRecipe implements INBTMatchingCachedRecipe { - public List tanks = new ArrayList(); + public List tanks = new ArrayList<>(); public PositionedStack resource; - public List inputItems = new ArrayList(); + public List inputItems = new ArrayList<>(); public CachedFermenterRecipe(TileFermenter.Recipe recipe, ItemStack fermentable, boolean genPerms) { if (recipe.liquid != null) { @@ -70,7 +70,7 @@ public class NEIHandlerFermenter extends RecipeHandlerBase { } this.inputItems.add(new PositionedStack(fermentable, 80, 8)); - List fuels = new ArrayList(); + List fuels = new ArrayList<>(); for (FermenterFuel fuel : FuelManager.fermenterFuel.values()) { fuels.add(fuel.item); } @@ -148,7 +148,7 @@ public class NEIHandlerFermenter extends RecipeHandlerBase { private List getCachedRecipes(TileFermenter.Recipe recipe, boolean generatePermutations) { if (recipe.resource != null && recipe.resource.getItem() instanceof IVariableFermentable) { - List crecipes = new ArrayList(); + List crecipes = new ArrayList<>(); for (ItemStack stack : NEIUtils.getItemVariations(recipe.resource)) { crecipes.add(new CachedFermenterRecipe(recipe, stack, generatePermutations)); } diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerMoistener.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerMoistener.java index e54e385b4..53e3a3785 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerMoistener.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerMoistener.java @@ -37,7 +37,7 @@ public class NEIHandlerMoistener extends RecipeHandlerBase { public class CachedMoistenerRecipe extends CachedBaseRecipe { public PositionedFluidTank tank; - public List fuels = new ArrayList(); + public List fuels = new ArrayList<>(); public PositionedStack input; public PositionedStack output; diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerSqueezer.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerSqueezer.java index b572376ed..178b2603c 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerSqueezer.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerSqueezer.java @@ -43,7 +43,7 @@ public class NEIHandlerSqueezer extends RecipeHandlerBase { public class CachedSqueezerRecipe extends CachedBaseRecipe { - public List inputs = new ArrayList(); + public List inputs = new ArrayList<>(); public PositionedFluidTank tank; public PositionedStackAdv remnants = null; public int processingTime; @@ -77,7 +77,7 @@ public class NEIHandlerSqueezer extends RecipeHandlerBase { ItemStack emptyContainer = recipe.getEmptyContainer(); List ingredients = FluidHelper.getAllFilledContainers(emptyContainer); setIngredients(new Object[]{ingredients}); - List fluids = new ArrayList(); + List fluids = new ArrayList<>(); for (ItemStack ingredient : ingredients) { FluidStack fluidStack = FluidHelper.getFluidStackInContainer(ingredient); fluids.add(fluidStack); diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerStill.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerStill.java index d2f47fd61..30ff2a4d8 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerStill.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerStill.java @@ -33,7 +33,7 @@ public class NEIHandlerStill extends RecipeHandlerBase { public class CachedStillRecipe extends CachedBaseRecipe { - public List tanks = new ArrayList(); + public List tanks = new ArrayList<>(); public CachedStillRecipe(TileStill.Recipe recipe) { if (recipe.input != null) { diff --git a/src/main/java/forestry/factory/tiles/TileBottler.java b/src/main/java/forestry/factory/tiles/TileBottler.java index ac54d2345..4c3d535f8 100644 --- a/src/main/java/forestry/factory/tiles/TileBottler.java +++ b/src/main/java/forestry/factory/tiles/TileBottler.java @@ -86,7 +86,7 @@ public class TileBottler extends TilePowered implements ISidedInventory, ILiquid public static class RecipeManager implements ICraftingProvider { - public static final ArrayList recipes = new ArrayList(); + public static final ArrayList recipes = new ArrayList<>(); /** * @return Recipe matching both res and empty, null if none @@ -126,7 +126,7 @@ public class TileBottler extends TilePowered implements ISidedInventory, ILiquid @Override public Map getRecipes() { - HashMap recipeList = new HashMap(); + HashMap recipeList = new HashMap<>(); for (Recipe recipe : recipes) { recipeList.put(new Object[]{recipe.input, recipe.can}, new Object[]{recipe.bottled}); @@ -359,7 +359,7 @@ public class TileBottler extends TilePowered implements ISidedInventory, ILiquid @Optional.Method(modid = "BuildCraftAPI|statements") @Override public Collection getExternalTriggers(ForgeDirection side, TileEntity tile) { - LinkedList res = new LinkedList(); + LinkedList res = new LinkedList<>(); res.add(FactoryTriggers.lowResource25); res.add(FactoryTriggers.lowResource10); return res; diff --git a/src/main/java/forestry/factory/tiles/TileCarpenter.java b/src/main/java/forestry/factory/tiles/TileCarpenter.java index efbe0c6e9..0706c087b 100644 --- a/src/main/java/forestry/factory/tiles/TileCarpenter.java +++ b/src/main/java/forestry/factory/tiles/TileCarpenter.java @@ -95,7 +95,7 @@ public class TileCarpenter extends TilePowered implements ISidedInventory, ILiqu setHints(Config.hints.get("carpenter")); resourceTank = new FilteredTank(Constants.PROCESSOR_TANK_CAPACITY, RecipeManager.recipeFluids); - craftingInventory = new TileInventoryAdapter(this, 10, "CraftItems"); + craftingInventory = new TileInventoryAdapter<>(this, 10, "CraftItems"); craftPreviewInventory = new InventoryCraftResult(); setInternalInventory(new CarpenterInventoryAdapter(this)); @@ -507,9 +507,9 @@ public class TileCarpenter extends TilePowered implements ISidedInventory, ILiqu public static class RecipeManager implements ICarpenterManager { - public static final ArrayList recipes = new ArrayList(); - private static final Set recipeFluids = new HashSet(); - private static final List boxes = new ArrayList(); + public static final ArrayList recipes = new ArrayList<>(); + private static final Set recipeFluids = new HashSet<>(); + private static final List boxes = new ArrayList<>(); public void addCrating(ItemStack itemStack) { ItemStack uncrated = ((forestry.core.items.ItemCrated) itemStack.getItem()).getContained(); @@ -580,7 +580,7 @@ public class TileCarpenter extends TilePowered implements ISidedInventory, ILiqu @Override public Map getRecipes() { - HashMap recipeList = new HashMap(); + HashMap recipeList = new HashMap<>(); for (Recipe recipe : recipes) { recipeList.put(recipe.internal.getIngredients(), new Object[]{recipe.getCraftingResult()}); diff --git a/src/main/java/forestry/factory/tiles/TileCentrifuge.java b/src/main/java/forestry/factory/tiles/TileCentrifuge.java index 7b7acfa28..ed9c6a137 100644 --- a/src/main/java/forestry/factory/tiles/TileCentrifuge.java +++ b/src/main/java/forestry/factory/tiles/TileCentrifuge.java @@ -75,7 +75,7 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn /* MEMBER */ private ICentrifugeRecipe currentRecipe; - private final Stack pendingProducts = new Stack(); + private final Stack pendingProducts = new Stack<>(); public TileCentrifuge() { super(800, Constants.MACHINE_MAX_ENERGY, 4200); @@ -223,7 +223,7 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn @Optional.Method(modid = "BuildCraftAPI|statements") @Override public Collection getExternalTriggers(ForgeDirection side, TileEntity tile) { - LinkedList res = new LinkedList(); + LinkedList res = new LinkedList<>(); res.add(FactoryTriggers.lowResource25); res.add(FactoryTriggers.lowResource10); return res; @@ -320,7 +320,7 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn @Override public Collection getProducts(Random random) { - List products = new ArrayList(); + List products = new ArrayList<>(); for (Map.Entry entry : this.outputs.entrySet()) { float probability = entry.getValue(); @@ -343,7 +343,7 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn public static class RecipeManager implements ICentrifugeManager { - public static final List recipes = new ArrayList(); + public static final List recipes = new ArrayList<>(); @Override public void addRecipe(ICentrifugeRecipe recipe) { @@ -372,7 +372,7 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn @Override public Map getRecipes() { - HashMap recipeList = new HashMap(); + HashMap recipeList = new HashMap<>(); for (ICentrifugeRecipe recipe : recipes) { Set productsKeys = recipe.getAllProducts().keySet(); diff --git a/src/main/java/forestry/factory/tiles/TileFabricator.java b/src/main/java/forestry/factory/tiles/TileFabricator.java index 076d4dbb6..8bb38605e 100644 --- a/src/main/java/forestry/factory/tiles/TileFabricator.java +++ b/src/main/java/forestry/factory/tiles/TileFabricator.java @@ -82,7 +82,7 @@ public class TileFabricator extends TilePowered implements ICrafter, ILiquidTank public TileFabricator() { super(1100, 3300, 200); - craftingInventory = new TileInventoryAdapter(this, SLOT_CRAFTING_COUNT, "CraftItems"); + craftingInventory = new TileInventoryAdapter<>(this, SLOT_CRAFTING_COUNT, "CraftItems"); setInternalInventory(new FabricatorInventoryAdapter(this)); moltenTank = new FilteredTank(2 * Constants.BUCKET_VOLUME, Fluids.GLASS.getFluid()); moltenTank.tankMode = StandardTank.TankMode.INTERNAL; @@ -475,8 +475,8 @@ public class TileFabricator extends TilePowered implements ICrafter, ILiquidTank public static class RecipeManager implements IFabricatorManager { - public static final List recipes = new ArrayList(); - public static final List smeltings = new ArrayList(); + public static final List recipes = new ArrayList<>(); + public static final List smeltings = new ArrayList<>(); @Override public void addRecipe(IFabricatorRecipe recipe) { @@ -556,7 +556,7 @@ public class TileFabricator extends TilePowered implements ICrafter, ILiquidTank @Override public Map getRecipes() { - HashMap recipeList = new HashMap(); + HashMap recipeList = new HashMap<>(); for (IFabricatorRecipe recipe : recipes) { recipeList.put(recipe.getIngredients(), new Object[]{recipe.getRecipeOutput()}); diff --git a/src/main/java/forestry/factory/tiles/TileFermenter.java b/src/main/java/forestry/factory/tiles/TileFermenter.java index 98e9bfcbd..a6ec8c973 100644 --- a/src/main/java/forestry/factory/tiles/TileFermenter.java +++ b/src/main/java/forestry/factory/tiles/TileFermenter.java @@ -108,9 +108,9 @@ public class TileFermenter extends TilePowered implements ISidedInventory, ILiqu public static class RecipeManager implements IFermenterManager { - public static final ArrayList recipes = new ArrayList(); - public static final HashSet recipeFluidInputs = new HashSet(); - public static final HashSet recipeFluidOutputs = new HashSet(); + public static final ArrayList recipes = new ArrayList<>(); + public static final HashSet recipeFluidInputs = new HashSet<>(); + public static final HashSet recipeFluidOutputs = new HashSet<>(); @Override public void addRecipe(ItemStack resource, int fermentationValue, float modifier, FluidStack output, FluidStack liquid) { @@ -152,7 +152,7 @@ public class TileFermenter extends TilePowered implements ISidedInventory, ILiqu @Override public Map getRecipes() { - HashMap recipeList = new HashMap(); + HashMap recipeList = new HashMap<>(); for (Recipe recipe : recipes) { recipeList.put(new Object[]{recipe.resource, recipe.liquid}, new Object[]{recipe.output}); @@ -541,7 +541,7 @@ public class TileFermenter extends TilePowered implements ISidedInventory, ILiqu @Optional.Method(modid = "BuildCraftAPI|statements") @Override public Collection getExternalTriggers(ForgeDirection side, TileEntity tile) { - LinkedList res = new LinkedList(); + LinkedList res = new LinkedList<>(); res.add(FactoryTriggers.lowResource25); res.add(FactoryTriggers.lowResource10); return res; diff --git a/src/main/java/forestry/factory/tiles/TileMoistener.java b/src/main/java/forestry/factory/tiles/TileMoistener.java index c530c4522..5a7a38d0e 100644 --- a/src/main/java/forestry/factory/tiles/TileMoistener.java +++ b/src/main/java/forestry/factory/tiles/TileMoistener.java @@ -83,7 +83,7 @@ public class TileMoistener extends TileBase implements ISidedInventory, ILiquidT public static class RecipeManager implements IMoistenerManager { - public static final ArrayList recipes = new ArrayList(); + public static final ArrayList recipes = new ArrayList<>(); @Override public void addRecipe(ItemStack resource, ItemStack product, int timePerItem) { @@ -115,7 +115,7 @@ public class TileMoistener extends TileBase implements ISidedInventory, ILiquidT @Override public Map getRecipes() { - HashMap recipeList = new HashMap(); + HashMap recipeList = new HashMap<>(); for (Recipe recipe : recipes) { recipeList.put(new ItemStack[]{recipe.resource}, new ItemStack[]{recipe.product}); @@ -434,7 +434,7 @@ public class TileMoistener extends TileBase implements ISidedInventory, ILiquidT } private void rotateReservoir() { - ArrayList slotsToShift = new ArrayList(); + ArrayList slotsToShift = new ArrayList<>(); for (int i = SLOT_RESERVOIR_1; i < SLOT_RESERVOIR_1 + SLOT_RESERVOIR_COUNT; i++) { if (getStackInSlot(i) == null) { diff --git a/src/main/java/forestry/factory/tiles/TileSqueezer.java b/src/main/java/forestry/factory/tiles/TileSqueezer.java index 728db3295..a9abf7314 100644 --- a/src/main/java/forestry/factory/tiles/TileSqueezer.java +++ b/src/main/java/forestry/factory/tiles/TileSqueezer.java @@ -384,9 +384,9 @@ public class TileSqueezer extends TilePowered implements ISocketable, ISidedInve public static class RecipeManager implements ISqueezerManager { - public static final List recipes = new ArrayList(); - public static final Set recipeInputs = new HashSet(); - public static final ItemStackMap containerRecipes = new ItemStackMap(); + public static final List recipes = new ArrayList<>(); + public static final Set recipeInputs = new HashSet<>(); + public static final ItemStackMap containerRecipes = new ItemStackMap<>(); @Override public void addRecipe(int timePerItem, ItemStack[] resources, FluidStack liquid, @Nullable ItemStack remnants, int chance) { @@ -460,7 +460,7 @@ public class TileSqueezer extends TilePowered implements ISocketable, ISidedInve @Override public Map getRecipes() { - HashMap recipeList = new HashMap(); + HashMap recipeList = new HashMap<>(); for (ISqueezerRecipe recipe : recipes) { recipeList.put(recipe.getResources(), new Object[]{recipe.getRemnants(), recipe.getFluidOutput()}); diff --git a/src/main/java/forestry/factory/tiles/TileStill.java b/src/main/java/forestry/factory/tiles/TileStill.java index 2f2d4f69b..e0adf4458 100644 --- a/src/main/java/forestry/factory/tiles/TileStill.java +++ b/src/main/java/forestry/factory/tiles/TileStill.java @@ -79,9 +79,9 @@ public class TileStill extends TilePowered implements ISidedInventory, ILiquidTa public static class RecipeManager implements IStillManager { - public static final ArrayList recipes = new ArrayList(); - public static final HashSet recipeFluidInputs = new HashSet(); - public static final HashSet recipeFluidOutputs = new HashSet(); + public static final ArrayList recipes = new ArrayList<>(); + public static final HashSet recipeFluidInputs = new HashSet<>(); + public static final HashSet recipeFluidOutputs = new HashSet<>(); @Override public void addRecipe(int timePerUnit, FluidStack input, FluidStack output) { @@ -109,7 +109,7 @@ public class TileStill extends TilePowered implements ISidedInventory, ILiquidTa @Override public Map getRecipes() { - HashMap recipeList = new HashMap(); + HashMap recipeList = new HashMap<>(); for (Recipe recipe : recipes) { recipeList.put(new Object[]{recipe.input}, new Object[]{recipe.output}); diff --git a/src/main/java/forestry/factory/tiles/TileWorktable.java b/src/main/java/forestry/factory/tiles/TileWorktable.java index 145cd44ca..89bb47552 100644 --- a/src/main/java/forestry/factory/tiles/TileWorktable.java +++ b/src/main/java/forestry/factory/tiles/TileWorktable.java @@ -50,7 +50,7 @@ public class TileWorktable extends TileBase implements ICrafterWorktable { private final TileInventoryAdapter craftingInventory; public TileWorktable() { - craftingInventory = new TileInventoryAdapter(this, 10, "CraftItems"); + craftingInventory = new TileInventoryAdapter<>(this, 10, "CraftItems"); setInternalInventory(new WorktableInventoryAdapter(this)); memorized = new RecipeMemory(); diff --git a/src/main/java/forestry/farming/blocks/BlockFarm.java b/src/main/java/forestry/farming/blocks/BlockFarm.java index b97b59af9..6c96cbcd2 100644 --- a/src/main/java/forestry/farming/blocks/BlockFarm.java +++ b/src/main/java/forestry/farming/blocks/BlockFarm.java @@ -108,7 +108,7 @@ public class BlockFarm extends BlockStructure { @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList drops = new ArrayList(); + ArrayList drops = new ArrayList<>(); int meta = world.getBlockMetadata(x, y, z); TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TileFarm) { diff --git a/src/main/java/forestry/farming/blocks/BlockMushroom.java b/src/main/java/forestry/farming/blocks/BlockMushroom.java index b3f21c661..ff0b35d7a 100644 --- a/src/main/java/forestry/farming/blocks/BlockMushroom.java +++ b/src/main/java/forestry/farming/blocks/BlockMushroom.java @@ -58,7 +58,7 @@ public class BlockMushroom extends BlockSapling implements IItemTyped { // / DROPS @Override public ArrayList getDrops(World world, int X, int Y, int Z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); + ArrayList ret = new ArrayList<>(); MushroomType type = getTypeFromMeta(metadata); diff --git a/src/main/java/forestry/farming/logic/CropFruit.java b/src/main/java/forestry/farming/logic/CropFruit.java index 34396e2e1..f78afafca 100755 --- a/src/main/java/forestry/farming/logic/CropFruit.java +++ b/src/main/java/forestry/farming/logic/CropFruit.java @@ -49,7 +49,7 @@ public class CropFruit extends Crop { protected Collection harvestBlock(Vect pos) { TileEntity tile = world.getTileEntity(pos.x, pos.y, pos.z); if (!(tile instanceof IFruitBearer)) { - return new ArrayList(); + return new ArrayList<>(); } Proxies.common.sendFXSignal(PacketFXSignal.VisualFXType.BLOCK_DESTROY, PacketFXSignal.SoundFXType.LEAF, world, pos.x, pos.y, pos.z, diff --git a/src/main/java/forestry/farming/logic/CropPeat.java b/src/main/java/forestry/farming/logic/CropPeat.java index 8750f6233..aa626287b 100755 --- a/src/main/java/forestry/farming/logic/CropPeat.java +++ b/src/main/java/forestry/farming/logic/CropPeat.java @@ -44,7 +44,7 @@ public class CropPeat extends Crop { @Override protected Collection harvestBlock(Vect pos) { - List drops = new ArrayList(); + List drops = new ArrayList<>(); drops.add(ForestryItem.peat.getItemStack()); Proxies.common.addBlockDestroyEffects(world, pos.x, pos.y, pos.z, world.getBlock(pos.x, pos.y, pos.z), 0); diff --git a/src/main/java/forestry/farming/logic/CropRubber.java b/src/main/java/forestry/farming/logic/CropRubber.java index e09d67c47..348296a19 100755 --- a/src/main/java/forestry/farming/logic/CropRubber.java +++ b/src/main/java/forestry/farming/logic/CropRubber.java @@ -30,7 +30,7 @@ public class CropRubber extends CropBlock { @Override protected Collection harvestBlock(Vect pos) { - Collection harvested = new ArrayList(); + Collection harvested = new ArrayList<>(); harvested.add(PluginIC2.resin.copy()); Proxies.common.addBlockDestroyEffects(world, pos.x, pos.y, pos.z, block, 0); world.setBlock(pos.x, pos.y, pos.z, block, meta + 6, Constants.FLAG_BLOCK_SYNCH); diff --git a/src/main/java/forestry/farming/logic/FarmLogicArboreal.java b/src/main/java/forestry/farming/logic/FarmLogicArboreal.java index 98b9ca0d8..19a30fb7a 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicArboreal.java +++ b/src/main/java/forestry/farming/logic/FarmLogicArboreal.java @@ -97,7 +97,7 @@ public class FarmLogicArboreal extends FarmLogicHomogeneous { public Collection collect() { Collection products = produce; - produce = new ArrayList(); + produce = new ArrayList<>(); Vect coords = new Vect(housing.getCoords()); Vect area = new Vect(housing.getArea()); @@ -125,7 +125,7 @@ public class FarmLogicArboreal extends FarmLogicHomogeneous { return products; } - private final HashMap lastExtentsHarvest = new HashMap(); + private final HashMap lastExtentsHarvest = new HashMap<>(); @Override public Collection harvest(int x, int y, int z, FarmDirection direction, int extent) { @@ -152,8 +152,8 @@ public class FarmLogicArboreal extends FarmLogicHomogeneous { World world = getWorld(); - Set seen = new HashSet(); - Stack crops = new Stack(); + Set seen = new HashSet<>(); + Stack crops = new Stack<>(); // Determine what type we want to harvest. IFarmable germling = null; @@ -174,7 +174,7 @@ public class FarmLogicArboreal extends FarmLogicHomogeneous { } ArrayList candidates = processHarvestBlock(germling, crops, seen, position, position); - ArrayList temp = new ArrayList(); + ArrayList temp = new ArrayList<>(); while (!candidates.isEmpty()) { for (Vect candidate : candidates) { temp.addAll(processHarvestBlock(germling, crops, seen, position, candidate)); @@ -193,7 +193,7 @@ public class FarmLogicArboreal extends FarmLogicHomogeneous { World world = getWorld(); - ArrayList candidates = new ArrayList(); + ArrayList candidates = new ArrayList<>(); // Get additional candidates to return for (int i = -1; i < 2; i++) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicCocoa.java b/src/main/java/forestry/farming/logic/FarmLogicCocoa.java index 12be00de5..ad6014466 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicCocoa.java +++ b/src/main/java/forestry/farming/logic/FarmLogicCocoa.java @@ -81,7 +81,7 @@ public class FarmLogicCocoa extends FarmLogic { return null; } - private final HashMap lastExtentsCultivation = new HashMap(); + private final HashMap lastExtentsCultivation = new HashMap<>(); @Override public boolean cultivate(int x, int y, int z, FarmDirection direction, int extent) { @@ -105,7 +105,7 @@ public class FarmLogicCocoa extends FarmLogic { return result; } - private final HashMap lastExtentsHarvest = new HashMap(); + private final HashMap lastExtentsHarvest = new HashMap<>(); @Override public Collection harvest(int x, int y, int z, FarmDirection direction, int extent) { @@ -157,8 +157,8 @@ public class FarmLogicCocoa extends FarmLogic { private Collection getHarvestBlocks(Vect position) { - Set seen = new HashSet(); - Stack crops = new Stack(); + Set seen = new HashSet<>(); + Stack crops = new Stack<>(); // Determine what type we want to harvest. Block block = VectUtil.getBlock(getWorld(), position); @@ -176,7 +176,7 @@ public class FarmLogicCocoa extends FarmLogic { } ArrayList candidates = processHarvestBlock(crops, seen, position, position); - ArrayList temp = new ArrayList(); + ArrayList temp = new ArrayList<>(); while (!candidates.isEmpty() && crops.size() < 20) { for (Vect candidate : candidates) { temp.addAll(processHarvestBlock(crops, seen, position, candidate)); @@ -194,7 +194,7 @@ public class FarmLogicCocoa extends FarmLogic { World world = getWorld(); - ArrayList candidates = new ArrayList(); + ArrayList candidates = new ArrayList<>(); // Get additional candidates to return for (int i = -1; i < 2; i++) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicCrops.java b/src/main/java/forestry/farming/logic/FarmLogicCrops.java index 58c5c5d5a..74ef55eb4 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicCrops.java +++ b/src/main/java/forestry/farming/logic/FarmLogicCrops.java @@ -74,7 +74,7 @@ public abstract class FarmLogicCrops extends FarmLogicWatered { public Collection collect() { Collection products = produce; - produce = new ArrayList(); + produce = new ArrayList<>(); Vect coords = new Vect(housing.getCoords()); Vect area = new Vect(housing.getArea()); @@ -146,7 +146,7 @@ public abstract class FarmLogicCrops extends FarmLogicWatered { public Collection harvest(int x, int y, int z, FarmDirection direction, int extent) { World world = getWorld(); - Stack crops = new Stack(); + Stack crops = new Stack<>(); for (int i = 0; i < extent; i++) { Vect position = translateWithOffset(x, y + 1, z, direction, i); for (IFarmable seed : seeds) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicEnder.java b/src/main/java/forestry/farming/logic/FarmLogicEnder.java index 792d092eb..9f5b7ac90 100644 --- a/src/main/java/forestry/farming/logic/FarmLogicEnder.java +++ b/src/main/java/forestry/farming/logic/FarmLogicEnder.java @@ -67,7 +67,7 @@ public class FarmLogicEnder extends FarmLogicHomogeneous { public Collection harvest(int x, int y, int z, FarmDirection direction, int extent) { World world = getWorld(); - Stack crops = new Stack(); + Stack crops = new Stack<>(); for (int i = 0; i < extent; i++) { Vect position = translateWithOffset(x, y + 1, z, direction, i); for (IFarmable farmable : germlings) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicGourd.java b/src/main/java/forestry/farming/logic/FarmLogicGourd.java index b68434d14..0191f4f4f 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicGourd.java +++ b/src/main/java/forestry/farming/logic/FarmLogicGourd.java @@ -83,7 +83,7 @@ public class FarmLogicGourd extends FarmLogic { public Collection harvest(int x, int y, int z, FarmDirection direction, int extent) { World world = getWorld(); - Stack crops = new Stack(); + Stack crops = new Stack<>(); for (int i = 0; i < extent; i++) { Vect position = translateWithOffset(x, y + 1, z, direction, i); for (IFarmable seed : seeds) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicHomogeneous.java b/src/main/java/forestry/farming/logic/FarmLogicHomogeneous.java index e0dc25947..ed3b76bf1 100644 --- a/src/main/java/forestry/farming/logic/FarmLogicHomogeneous.java +++ b/src/main/java/forestry/farming/logic/FarmLogicHomogeneous.java @@ -31,7 +31,7 @@ public abstract class FarmLogicHomogeneous extends FarmLogic { private final ItemStack soilBlock; protected final Iterable germlings; - ArrayList produce = new ArrayList(); + ArrayList produce = new ArrayList<>(); protected FarmLogicHomogeneous(IFarmHousing housing, ItemStack resource, ItemStack soilBlock, Iterable germlings) { super(housing); diff --git a/src/main/java/forestry/farming/logic/FarmLogicInfernal.java b/src/main/java/forestry/farming/logic/FarmLogicInfernal.java index 5586c976f..34cc75760 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicInfernal.java +++ b/src/main/java/forestry/farming/logic/FarmLogicInfernal.java @@ -67,7 +67,7 @@ public class FarmLogicInfernal extends FarmLogicHomogeneous { public Collection harvest(int x, int y, int z, FarmDirection direction, int extent) { World world = getWorld(); - Stack crops = new Stack(); + Stack crops = new Stack<>(); for (int i = 0; i < extent; i++) { Vect position = translateWithOffset(x, y + 1, z, direction, i); for (IFarmable farmable : germlings) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicOrchard.java b/src/main/java/forestry/farming/logic/FarmLogicOrchard.java index 0be890456..5c235b038 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicOrchard.java +++ b/src/main/java/forestry/farming/logic/FarmLogicOrchard.java @@ -45,7 +45,7 @@ import forestry.plugins.PluginManager; public class FarmLogicOrchard extends FarmLogic { private final Collection farmables; - private final HashMap lastExtents = new HashMap(); + private final HashMap lastExtents = new HashMap<>(); private final ImmutableList traversalBlocks; public FarmLogicOrchard(IFarmHousing housing) { @@ -132,8 +132,8 @@ public class FarmLogicOrchard extends FarmLogic { private Collection getHarvestBlocks(Vect position) { - Set seen = new HashSet(); - Stack crops = new Stack(); + Set seen = new HashSet<>(); + Stack crops = new Stack<>(); World world = getWorld(); @@ -143,7 +143,7 @@ public class FarmLogicOrchard extends FarmLogic { } List candidates = processHarvestBlock(crops, seen, position, position); - List temp = new ArrayList(); + List temp = new ArrayList<>(); while (!candidates.isEmpty() && crops.size() < 20) { for (Vect candidate : candidates) { temp.addAll(processHarvestBlock(crops, seen, position, candidate)); @@ -159,7 +159,7 @@ public class FarmLogicOrchard extends FarmLogic { private List processHarvestBlock(Stack crops, Set seen, Vect start, Vect position) { World world = getWorld(); - List candidates = new ArrayList(); + List candidates = new ArrayList<>(); // Get additional candidates to return for (int i = -2; i < 3; i++) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicPeat.java b/src/main/java/forestry/farming/logic/FarmLogicPeat.java index e98dc68f7..3c76d098f 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicPeat.java +++ b/src/main/java/forestry/farming/logic/FarmLogicPeat.java @@ -74,7 +74,7 @@ public class FarmLogicPeat extends FarmLogicWatered { public Collection harvest(int x, int y, int z, FarmDirection direction, int extent) { World world = getWorld(); - Stack crops = new Stack(); + Stack crops = new Stack<>(); for (int i = 0; i < extent; i++) { Vect position = translateWithOffset(x, y, z, direction, i); ItemStack occupant = VectUtil.getAsItemStack(world, position); diff --git a/src/main/java/forestry/farming/logic/FarmLogicPoale.java b/src/main/java/forestry/farming/logic/FarmLogicPoale.java index cce92708d..a0526b456 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicPoale.java +++ b/src/main/java/forestry/farming/logic/FarmLogicPoale.java @@ -97,7 +97,7 @@ public class FarmLogicPoale extends FarmLogic { public Collection harvest(int x, int y, int z, FarmDirection direction, int extent) { World world = getWorld(); - Stack crops = new Stack(); + Stack crops = new Stack<>(); for (int i = 0; i < extent; i++) { Vect position = translateWithOffset(x, y + 1, z, direction, i); for (IFarmable seed : germlings) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicRubber.java b/src/main/java/forestry/farming/logic/FarmLogicRubber.java index 0dd64d812..79ba4000d 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicRubber.java +++ b/src/main/java/forestry/farming/logic/FarmLogicRubber.java @@ -92,7 +92,7 @@ public class FarmLogicRubber extends FarmLogic { return false; } - private final HashMap lastExtents = new HashMap(); + private final HashMap lastExtents = new HashMap<>(); @Override public Collection harvest(int x, int y, int z, FarmDirection direction, int extent) { @@ -120,8 +120,8 @@ public class FarmLogicRubber extends FarmLogic { private Collection getHarvestBlocks(Vect position) { - Set seen = new HashSet(); - Stack crops = new Stack(); + Set seen = new HashSet<>(); + Stack crops = new Stack<>(); World world = getWorld(); @@ -137,7 +137,7 @@ public class FarmLogicRubber extends FarmLogic { } ArrayList candidates = processHarvestBlock(crops, seen, position); - ArrayList temp = new ArrayList(); + ArrayList temp = new ArrayList<>(); while (!candidates.isEmpty() && crops.size() < 100) { for (Vect candidate : candidates) { temp.addAll(processHarvestBlock(crops, seen, candidate)); @@ -153,7 +153,7 @@ public class FarmLogicRubber extends FarmLogic { private ArrayList processHarvestBlock(Stack crops, Set seen, Vect position) { World world = getWorld(); - ArrayList candidates = new ArrayList(); + ArrayList candidates = new ArrayList<>(); // Get additional candidates to return for (int j = 0; j < 2; j++) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicShroom.java b/src/main/java/forestry/farming/logic/FarmLogicShroom.java index a6a136aa4..cc0ee87c8 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicShroom.java +++ b/src/main/java/forestry/farming/logic/FarmLogicShroom.java @@ -58,7 +58,7 @@ public class FarmLogicShroom extends FarmLogicArboreal { @Override public Collection collect() { Collection products = produce; - produce = new ArrayList(); + produce = new ArrayList<>(); return products; } diff --git a/src/main/java/forestry/farming/logic/FarmLogicSucculent.java b/src/main/java/forestry/farming/logic/FarmLogicSucculent.java index 0dd039ded..207149564 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicSucculent.java +++ b/src/main/java/forestry/farming/logic/FarmLogicSucculent.java @@ -97,7 +97,7 @@ public class FarmLogicSucculent extends FarmLogic { public Collection harvest(int x, int y, int z, FarmDirection direction, int extent) { World world = getWorld(); - Stack crops = new Stack(); + Stack crops = new Stack<>(); for (int i = 0; i < extent; i++) { Vect position = translateWithOffset(x, y + 1, z, direction, i); for (IFarmable seed : germlings) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicWatered.java b/src/main/java/forestry/farming/logic/FarmLogicWatered.java index e47efd1e3..47aa431dc 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicWatered.java +++ b/src/main/java/forestry/farming/logic/FarmLogicWatered.java @@ -36,7 +36,7 @@ public abstract class FarmLogicWatered extends FarmLogic { private static final FluidStack STACK_WATER = Fluids.WATER.getFluid(1000); - ArrayList produce = new ArrayList(); + ArrayList produce = new ArrayList<>(); protected FarmLogicWatered(IFarmHousing housing, ItemStack resource, ItemStack ground) { super(housing); @@ -66,7 +66,7 @@ public abstract class FarmLogicWatered extends FarmLogic { @Override public Collection collect() { Collection products = produce; - produce = new ArrayList(); + produce = new ArrayList<>(); return products; } diff --git a/src/main/java/forestry/farming/multiblock/FarmController.java b/src/main/java/forestry/farming/multiblock/FarmController.java index ee72331f8..fba969c4b 100644 --- a/src/main/java/forestry/farming/multiblock/FarmController.java +++ b/src/main/java/forestry/farming/multiblock/FarmController.java @@ -104,20 +104,20 @@ public class FarmController extends RectangularMultiblockControllerBase implemen return null; } - private final Map> targets = new EnumMap>(FarmDirection.class); + private final Map> targets = new EnumMap<>(FarmDirection.class); private int allowedExtent = 0; private IFarmLogic harvestProvider; // The farm logic which supplied the pending crops. - private final Stack pendingCrops = new Stack(); - private final Stack pendingProduce = new Stack(); + private final Stack pendingCrops = new Stack<>(); + private final Stack pendingProduce = new Stack<>(); private Stage stage = Stage.CULTIVATE; // active components are stored with a tick offset so they do not all tick together - private final Map farmActiveComponents = new HashMap(); - private final Set farmListeners = new HashSet(); + private final Map farmActiveComponents = new HashMap<>(); + private final Set farmListeners = new HashSet<>(); - private final Map farmLogics = new EnumMap(FarmDirection.class); + private final Map farmLogics = new EnumMap<>(FarmDirection.class); private final InventoryAdapter sockets; private final FarmInventory inventory; @@ -576,7 +576,7 @@ public class FarmController extends RectangularMultiblockControllerBase implemen } int groundHeight = firstGroundPosition.getY(); - List farmSideTargets = new ArrayList(); + List farmSideTargets = new ArrayList<>(); for (int i = 0; i < allowedExtent; i++) { targetLocation = targetLocation.add(farmSide); Vect groundLocation = new Vect(targetLocation.getX(), groundHeight, targetLocation.getZ()); diff --git a/src/main/java/forestry/food/items/ItemInfuser.java b/src/main/java/forestry/food/items/ItemInfuser.java index d6009abf5..4aeecee6e 100755 --- a/src/main/java/forestry/food/items/ItemInfuser.java +++ b/src/main/java/forestry/food/items/ItemInfuser.java @@ -125,7 +125,7 @@ public class ItemInfuser extends ItemForestry { */ public static class MixtureManager implements IInfuserManager { - private final ArrayList mixtures = new ArrayList(); + private final ArrayList mixtures = new ArrayList<>(); @Override public void addMixture(int meta, ItemStack ingredient, IBeverageEffect effect) { @@ -149,7 +149,7 @@ public class ItemInfuser extends ItemForestry { private Mixture[] getMatchingMixtures(ItemStack[] ingredients) { - ArrayList matches = new ArrayList(); + ArrayList matches = new ArrayList<>(); for (Mixture mixture : mixtures) { if (mixture.matches(ingredients)) { @@ -168,7 +168,7 @@ public class ItemInfuser extends ItemForestry { @Override public ItemStack[] getRequired(ItemStack[] ingredients) { Mixture[] mixtures = getMatchingMixtures(ingredients); - ArrayList required = new ArrayList(); + ArrayList required = new ArrayList<>(); for (Mixture mixture : mixtures) { required.addAll(Arrays.asList(mixture.getIngredients())); @@ -212,7 +212,7 @@ public class ItemInfuser extends ItemForestry { public static class IngredientManager implements IIngredientManager { - private final ArrayList ingredients = new ArrayList(); + private final ArrayList ingredients = new ArrayList<>(); @Override public void addIngredient(ItemStack ingredient, String description) { diff --git a/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java b/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java index 6dfea715d..5668c8198 100755 --- a/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java +++ b/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java @@ -46,8 +46,8 @@ public class AlleleButterflySpecies extends AlleleSpecies implements IAlleleButt private final EnumSet spawnBiomes = EnumSet.noneOf(BiomeDictionary.Type.class); - private final Map butterflyLoot = new HashMap(); - private final Map caterpillarLoot = new HashMap(); + private final Map butterflyLoot = new HashMap<>(); + private final Map caterpillarLoot = new HashMap<>(); public AlleleButterflySpecies(String uid, boolean isDominant, String speciesName, IClassification branch, String binomial, int serumColour) { super("forestry." + uid, getUnlocalizedName(speciesName, branch), "Sengir", "for.description." + uid, isDominant, branch, binomial, true); diff --git a/src/main/java/forestry/lepidopterology/genetics/Butterfly.java b/src/main/java/forestry/lepidopterology/genetics/Butterfly.java index 2dbe2b5b8..a3a5cc0c8 100755 --- a/src/main/java/forestry/lepidopterology/genetics/Butterfly.java +++ b/src/main/java/forestry/lepidopterology/genetics/Butterfly.java @@ -281,7 +281,7 @@ public class Butterfly extends IndividualLiving implements IButterfly { @Override public ItemStack[] getLootDrop(IEntityButterfly entity, boolean playerKill, int lootLevel) { - ArrayList drop = new ArrayList(); + ArrayList drop = new ArrayList<>(); EntityCreature creature = entity.getEntity(); float metabolism = (float) getGenome().getMetabolism() / 10; @@ -297,7 +297,7 @@ public class Butterfly extends IndividualLiving implements IButterfly { @Override public ItemStack[] getCaterpillarDrop(IButterflyNursery nursery, boolean playerKill, int lootLevel) { - ArrayList drop = new ArrayList(); + ArrayList drop = new ArrayList<>(); float metabolism = (float) getGenome().getMetabolism() / 10; for (Map.Entry entry : getGenome().getPrimary().getCaterpillarLoot().entrySet()) { diff --git a/src/main/java/forestry/lepidopterology/genetics/ButterflyHelper.java b/src/main/java/forestry/lepidopterology/genetics/ButterflyHelper.java index 9edc9a00e..08aaf66e6 100755 --- a/src/main/java/forestry/lepidopterology/genetics/ButterflyHelper.java +++ b/src/main/java/forestry/lepidopterology/genetics/ButterflyHelper.java @@ -183,7 +183,7 @@ public class ButterflyHelper extends SpeciesRoot implements IButterflyRoot { } /* TEMPLATES */ - private static final ArrayList butterflyTemplates = new ArrayList(); + private static final ArrayList butterflyTemplates = new ArrayList<>(); @Override public ArrayList getIndividualTemplates() { @@ -202,7 +202,7 @@ public class ButterflyHelper extends SpeciesRoot implements IButterflyRoot { } /* MUTATIONS */ - private static final ArrayList butterflyMutations = new ArrayList(); + private static final ArrayList butterflyMutations = new ArrayList<>(); @Override public void registerMutation(IMutation mutation) { diff --git a/src/main/java/forestry/lepidopterology/gui/GuiFlutterlyzer.java b/src/main/java/forestry/lepidopterology/gui/GuiFlutterlyzer.java index 9411b4023..67f5aefdf 100755 --- a/src/main/java/forestry/lepidopterology/gui/GuiFlutterlyzer.java +++ b/src/main/java/forestry/lepidopterology/gui/GuiFlutterlyzer.java @@ -38,7 +38,7 @@ public class GuiFlutterlyzer extends GuiAlyzer { public GuiFlutterlyzer(EntityPlayer player, FlutterlyzerInventory inventory) { super("rootButterflies", player, new ContainerAlyzer(inventory, player), inventory, "gui.flutterlyzer"); - ArrayList butterflyList = new ArrayList(); + ArrayList butterflyList = new ArrayList<>(); ((ItemButterflyGE) ForestryItem.butterflyGE.item()).addCreativeItems(butterflyList, false); for (ItemStack butterflyStack : butterflyList) { IAlleleButterflySpecies species = ButterflyGenome.getSpecies(butterflyStack); diff --git a/src/main/java/forestry/mail/PostOffice.java b/src/main/java/forestry/mail/PostOffice.java index d876e7c36..1d121811f 100755 --- a/src/main/java/forestry/mail/PostOffice.java +++ b/src/main/java/forestry/mail/PostOffice.java @@ -73,7 +73,7 @@ public class PostOffice extends WorldSavedData implements IPostOffice { } private void refreshActiveTradeStations(World world) { - activeTradeStations = new LinkedHashMap(); + activeTradeStations = new LinkedHashMap<>(); if (world == null || world.getSaveHandler() == null) { return; } diff --git a/src/main/java/forestry/mail/PostRegistry.java b/src/main/java/forestry/mail/PostRegistry.java index 894ae6516..66bdb19ce 100755 --- a/src/main/java/forestry/mail/PostRegistry.java +++ b/src/main/java/forestry/mail/PostRegistry.java @@ -38,8 +38,8 @@ import forestry.mail.network.PacketPOBoxInfo; public class PostRegistry implements IPostRegistry { public static PostOffice cachedPostOffice; - public static final Map cachedPOBoxes = new HashMap(); - public static final Map cachedTradeStations = new HashMap(); + public static final Map cachedPOBoxes = new HashMap<>(); + public static final Map cachedTradeStations = new HashMap<>(); /** * @param world the Minecraft world the PO box will be in @@ -185,7 +185,7 @@ public class PostRegistry implements IPostRegistry { } /* CARRIER */ - private final Map carriers = new EnumMap(EnumAddressee.class); + private final Map carriers = new EnumMap<>(EnumAddressee.class); @Override public Map getRegisteredCarriers() { diff --git a/src/main/java/forestry/mail/TradeStation.java b/src/main/java/forestry/mail/TradeStation.java index 99ddad8e0..30846e767 100755 --- a/src/main/java/forestry/mail/TradeStation.java +++ b/src/main/java/forestry/mail/TradeStation.java @@ -50,7 +50,7 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve @Override public int[] getAccessibleSlotsFromSide(int side) { - ArrayList slots = new ArrayList(); + ArrayList slots = new ArrayList<>(); for (int i = SLOT_LETTERS_1; i < SLOT_LETTERS_1 + SLOT_LETTERS_COUNT; i++) { slots.add(i); @@ -552,7 +552,7 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve } private ItemStack[] getSurplusAttachments(int filled, ItemStack[] attachments) { - ArrayList surplus = new ArrayList(); + ArrayList surplus = new ArrayList<>(); // Get a copy of the attachments to play with ItemStack[] pool = new ItemStack[attachments.length]; diff --git a/src/main/java/forestry/mail/gui/ContainerCatalogue.java b/src/main/java/forestry/mail/gui/ContainerCatalogue.java index 07f3b3ead..a544d2c36 100755 --- a/src/main/java/forestry/mail/gui/ContainerCatalogue.java +++ b/src/main/java/forestry/mail/gui/ContainerCatalogue.java @@ -38,7 +38,7 @@ import forestry.mail.network.PacketLetterInfo; public class ContainerCatalogue extends Container implements IGuiSelectable { private final EntityPlayer player; - private final List stations = new ArrayList(); + private final List stations = new ArrayList<>(); private TradeStationInfo currentTrade = null; @@ -51,7 +51,7 @@ public class ContainerCatalogue extends Container implements IGuiSelectable { private int currentFilter = 1; private static final String[] FILTER_NAMES = new String[]{"all", "online", "offline"}; - private static final List> FILTERS = new ArrayList>(); + private static final List> FILTERS = new ArrayList<>(); static { EnumSet all = EnumSet.allOf(EnumStationState.class); diff --git a/src/main/java/forestry/mail/gui/GuiCatalogue.java b/src/main/java/forestry/mail/gui/GuiCatalogue.java index 63444da8d..0de84b2a9 100755 --- a/src/main/java/forestry/mail/gui/GuiCatalogue.java +++ b/src/main/java/forestry/mail/gui/GuiCatalogue.java @@ -36,7 +36,7 @@ public class GuiCatalogue extends GuiForestry { private GuiButton buttonFilter; private GuiButton buttonUse; - private final List tradeInfoWidgets = new ArrayList(); + private final List tradeInfoWidgets = new ArrayList<>(); public GuiCatalogue(EntityPlayer player) { super(new ResourceLocation("textures/gui/book.png"), new ContainerCatalogue(player), null); diff --git a/src/main/java/forestry/mail/gui/GuiLetter.java b/src/main/java/forestry/mail/gui/GuiLetter.java index 7b963b06f..ee4b806a5 100755 --- a/src/main/java/forestry/mail/gui/GuiLetter.java +++ b/src/main/java/forestry/mail/gui/GuiLetter.java @@ -55,7 +55,7 @@ public class GuiLetter extends GuiForestry { this.isProcessedLetter = container.getLetter().isProcessed(); this.widgetManager.add(new AddresseeSlot(16, 12)); - this.tradeInfoWidgets = new ArrayList(); + this.tradeInfoWidgets = new ArrayList<>(); } @Override diff --git a/src/main/java/forestry/mail/tiles/TileMailbox.java b/src/main/java/forestry/mail/tiles/TileMailbox.java index f7d11a0f7..6b9ed508f 100644 --- a/src/main/java/forestry/mail/tiles/TileMailbox.java +++ b/src/main/java/forestry/mail/tiles/TileMailbox.java @@ -124,7 +124,7 @@ public class TileMailbox extends TileBase implements IMailContainer { @Optional.Method(modid = "BuildCraftAPI|statements") @Override public Collection getExternalTriggers(ForgeDirection side, TileEntity tile) { - LinkedList res = new LinkedList(); + LinkedList res = new LinkedList<>(); res.add(MailTriggers.triggerHasMail); return res; } diff --git a/src/main/java/forestry/mail/tiles/TileTrader.java b/src/main/java/forestry/mail/tiles/TileTrader.java index ad6a1d854..cd09ee3df 100644 --- a/src/main/java/forestry/mail/tiles/TileTrader.java +++ b/src/main/java/forestry/mail/tiles/TileTrader.java @@ -312,7 +312,7 @@ public class TileTrader extends TileBase { @Optional.Method(modid = "BuildCraftAPI|statements") @Override public Collection getExternalTriggers(ForgeDirection side, TileEntity tile) { - LinkedList res = new LinkedList(); + LinkedList res = new LinkedList<>(); res.add(MailTriggers.lowPaper64); res.add(MailTriggers.lowPaper32); res.add(MailTriggers.lowInput25); diff --git a/src/main/java/forestry/plugins/PluginApiculture.java b/src/main/java/forestry/plugins/PluginApiculture.java index 6d8011ddb..a07a27f19 100644 --- a/src/main/java/forestry/plugins/PluginApiculture.java +++ b/src/main/java/forestry/plugins/PluginApiculture.java @@ -175,8 +175,8 @@ public class PluginApiculture extends ForestryPlugin { private static MachineDefinition definitionBeehouse; private static MachineDefinition definitionAnalyzer; - private final Map defaultAcceptedFlowers = new HashMap(); - private final Map defaultPlantableFlowers = new HashMap(); + private final Map defaultAcceptedFlowers = new HashMap<>(); + private final Map defaultPlantableFlowers = new HashMap<>(); @Override @SuppressWarnings({"unchecked"}) @@ -188,7 +188,7 @@ public class PluginApiculture extends ForestryPlugin { FlowerManager.flowerRegistry = new FlowerRegistry(); - BeeManager.villageBees = new ArrayList[]{new ArrayList(), new ArrayList()}; + BeeManager.villageBees = new ArrayList[]{new ArrayList<>(), new ArrayList<>()}; BeeManager.beeFactory = new BeeFactory(); BeeManager.beeMutationFactory = new BeeMutationFactory(); @@ -436,8 +436,8 @@ public class PluginApiculture extends ForestryPlugin { for (String flowerType : FlowerManager.flowerRegistry.getFlowerTypes()) { Set flowers = FlowerManager.flowerRegistry.getAcceptableFlowers(flowerType); - List acceptedFlowerNames = new ArrayList(); - List plantableFlowerNames = new ArrayList(); + List acceptedFlowerNames = new ArrayList<>(); + List plantableFlowerNames = new ArrayList<>(); if (flowers != null) { for (IFlower flower : flowers) { String name = GameData.getBlockRegistry().getNameForObject(flower.getBlock()); @@ -881,7 +881,7 @@ public class PluginApiculture extends ForestryPlugin { } private static IRecipe[] createAlyzerRecipes(Block block, int meta) { - ArrayList recipes = new ArrayList(); + ArrayList recipes = new ArrayList<>(); recipes.add(ShapedRecipeCustom.createShapedRecipe(new ItemStack(block, 1, meta), "XTX", " Y ", "X X", 'Y', ForestryItem.sturdyCasing, 'T', ForestryItem.beealyzer, 'X', "ingotBronze")); recipes.add(ShapedRecipeCustom.createShapedRecipe(new ItemStack(block, 1, meta), "XTX", " Y ", "X X", 'Y', ForestryItem.sturdyCasing, 'T', ForestryItem.treealyzer, 'X', "ingotBronze")); return recipes.toArray(new IRecipe[recipes.size()]); diff --git a/src/main/java/forestry/plugins/PluginArboriculture.java b/src/main/java/forestry/plugins/PluginArboriculture.java index 485006032..2583cda1b 100644 --- a/src/main/java/forestry/plugins/PluginArboriculture.java +++ b/src/main/java/forestry/plugins/PluginArboriculture.java @@ -110,7 +110,7 @@ public class PluginArboriculture extends ForestryPlugin { public static int modelIdPods; private static MachineDefinition definitionChest; - public static final List validFences = new ArrayList(); + public static final List validFences = new ArrayList<>(); @Override protected void setupAPI() { diff --git a/src/main/java/forestry/plugins/PluginBiomesOPlenty.java b/src/main/java/forestry/plugins/PluginBiomesOPlenty.java index e7d666d30..1e7e8c590 100644 --- a/src/main/java/forestry/plugins/PluginBiomesOPlenty.java +++ b/src/main/java/forestry/plugins/PluginBiomesOPlenty.java @@ -76,7 +76,7 @@ public class PluginBiomesOPlenty extends ForestryPlugin { } private static void addFarmCrops() { - List saplingItemKeys = new ArrayList(); + List saplingItemKeys = new ArrayList<>(); if (saplings != null) { saplingItemKeys.add("saplings"); diff --git a/src/main/java/forestry/plugins/PluginFluids.java b/src/main/java/forestry/plugins/PluginFluids.java index 5733b3e83..b8607b4fd 100644 --- a/src/main/java/forestry/plugins/PluginFluids.java +++ b/src/main/java/forestry/plugins/PluginFluids.java @@ -52,7 +52,7 @@ import static forestry.core.items.ItemLiquidContainer.EnumContainerType; @Plugin(pluginID = "Fluids", name = "Fluids", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.plugin.fluids.description") public class PluginFluids extends ForestryPlugin { - private static final List forestryFluidsWithBlocks = new ArrayList(); + private static final List forestryFluidsWithBlocks = new ArrayList<>(); private static void createFluid(Fluids forestryFluid) { if (forestryFluid.getFluid() == null && Config.isFluidEnabled(forestryFluid)) { diff --git a/src/main/java/forestry/plugins/PluginManager.java b/src/main/java/forestry/plugins/PluginManager.java index 69c31896d..9dee1abc3 100644 --- a/src/main/java/forestry/plugins/PluginManager.java +++ b/src/main/java/forestry/plugins/PluginManager.java @@ -100,7 +100,7 @@ public class PluginManager { WITCHERY(new PluginWitchery()); static { - ForestryAPI.enabledPlugins = new HashSet(); + ForestryAPI.enabledPlugins = new HashSet<>(); } private final ForestryPlugin instance; diff --git a/src/main/java/forestry/plugins/PluginNatura.java b/src/main/java/forestry/plugins/PluginNatura.java index cc86534d6..a3d23b716 100755 --- a/src/main/java/forestry/plugins/PluginNatura.java +++ b/src/main/java/forestry/plugins/PluginNatura.java @@ -79,7 +79,7 @@ public class PluginNatura extends ForestryPlugin { saplingNatura = GameRegistry.findBlock(NATURA, "florasapling"); saplingNaturaRare = GameRegistry.findBlock(NATURA, "Rare Sapling"); - ArrayList saplingItemKeys = new ArrayList(); + ArrayList saplingItemKeys = new ArrayList<>(); if (saplingNatura != null) { saplingItemKeys.add("florasapling"); @@ -201,7 +201,7 @@ public class PluginNatura extends ForestryPlugin { ItemStack seedBarley = GameRegistry.findItemStack(NATURA, "seedBarley", 1); ItemStack seedCotton = GameRegistry.findItemStack(NATURA, "seedCotton", 1); - ArrayList seedList = new ArrayList(); + ArrayList seedList = new ArrayList<>(); if (seedBarley != null) { seedList.add(seedBarley); RecipeManagers.moistenerManager.addRecipe(seedBarley, new ItemStack(Blocks.mycelium), 5000); @@ -219,7 +219,7 @@ public class PluginNatura extends ForestryPlugin { Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(seedBarley, cropBlock, 3)); Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(seedCotton, cropBlock, 8)); - List berries = new ArrayList(); + List berries = new ArrayList<>(); if (berryBlight != null) { berries.add(berryBlight); } diff --git a/src/main/java/forestry/plugins/PluginStorage.java b/src/main/java/forestry/plugins/PluginStorage.java index ec47a273e..ef9f1a1c0 100755 --- a/src/main/java/forestry/plugins/PluginStorage.java +++ b/src/main/java/forestry/plugins/PluginStorage.java @@ -85,17 +85,17 @@ import forestry.storage.proxy.ProxyStorage; @Plugin(pluginID = "Storage", name = "Storage", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.storage.description") public class PluginStorage extends ForestryPlugin { - private static final List crates = new ArrayList(); + private static final List crates = new ArrayList<>(); private static final String CONFIG_CATEGORY = "backpacks"; @SidedProxy(clientSide = "forestry.storage.proxy.ProxyStorageClient", serverSide = "forestry.storage.proxy.ProxyStorage") public static ProxyStorage proxy; - private final ArrayList minerItems = new ArrayList(); - private final ArrayList diggerItems = new ArrayList(); - private final ArrayList foresterItems = new ArrayList(); - private final ArrayList hunterItems = new ArrayList(); - private final ArrayList adventurerItems = new ArrayList(); - private final ArrayList builderItems = new ArrayList(); + private final ArrayList minerItems = new ArrayList<>(); + private final ArrayList diggerItems = new ArrayList<>(); + private final ArrayList foresterItems = new ArrayList<>(); + private final ArrayList hunterItems = new ArrayList<>(); + private final ArrayList adventurerItems = new ArrayList<>(); + private final ArrayList builderItems = new ArrayList<>(); @Override @SuppressWarnings({"unchecked", "rawtypes"}) @@ -261,19 +261,19 @@ public class PluginStorage extends ForestryPlugin { final Pattern foresterOreDictPattern = Pattern.compile("(crop|seed|tree)[A-Z].*"); final Pattern builderOreDictPattern = Pattern.compile("(block|paneGlass|slabWood|stainedClay|stainedGlass)[A-Z].*"); - final List minerOreDictNames = new ArrayList(); - final List diggerOreDictNames = new ArrayList(Arrays.asList( + final List minerOreDictNames = new ArrayList<>(); + final List diggerOreDictNames = new ArrayList<>(Arrays.asList( "cobblestone", "stone", "sand" )); - final List foresterOreDictNames = new ArrayList(Arrays.asList( + final List foresterOreDictNames = new ArrayList<>(Arrays.asList( "logWood", "stickWood", "woodStick", "saplingTree" )); - final List builderOreDictNames = new ArrayList(Arrays.asList( + final List builderOreDictNames = new ArrayList<>(Arrays.asList( "stone", "plankWood", "stairWood", @@ -419,10 +419,10 @@ public class PluginStorage extends ForestryPlugin { BackpackDefinition backpackDefinition = (BackpackDefinition) BackpackManager.definitions.get(backpackName); List backpackItems; - List backpackOreDict = new ArrayList(); + List backpackOreDict = new ArrayList<>(); { - List validItems = new ArrayList(backpackDefinition.getValidItemStacks()); + List validItems = new ArrayList<>(backpackDefinition.getValidItemStacks()); Collections.sort(validItems); String[] defaultValidItems = validItems.toArray(new String[validItems.size()]); @@ -434,14 +434,14 @@ public class PluginStorage extends ForestryPlugin { } { - List oreIds = new ArrayList(backpackDefinition.getValidOreIds()); + List oreIds = new ArrayList<>(backpackDefinition.getValidOreIds()); String[] defaultOreNames = new String[oreIds.size()]; for (int i = 0; i < oreIds.size(); i++) { int oreId = oreIds.get(i); defaultOreNames[i] = OreDictionary.getOreName(oreId); } - List defaultOreNamesList = new ArrayList(); + List defaultOreNamesList = new ArrayList<>(); Collections.addAll(defaultOreNamesList, defaultOreNames); Collections.sort(defaultOreNamesList); defaultOreNames = defaultOreNamesList.toArray(new String[defaultOreNamesList.size()]); diff --git a/src/main/java/forestry/storage/BackpackDefinition.java b/src/main/java/forestry/storage/BackpackDefinition.java index 3376fc1e2..54d13b350 100755 --- a/src/main/java/forestry/storage/BackpackDefinition.java +++ b/src/main/java/forestry/storage/BackpackDefinition.java @@ -33,10 +33,10 @@ public class BackpackDefinition implements IBackpackDefinition { private final int primaryColor; // - c03384 private final int secondaryColor; - private final Set validItemStacks = new HashSet(); - private final Set validOreIds = new HashSet(); - private final Set validItemClasses = new HashSet(); - private final Set validBlockClasses = new HashSet(); + private final Set validItemStacks = new HashSet<>(); + private final Set validOreIds = new HashSet<>(); + private final Set validItemClasses = new HashSet<>(); + private final Set validBlockClasses = new HashSet<>(); public BackpackDefinition(String name, int primaryColor) { this(name, primaryColor, 0xffffff); diff --git a/src/main/java/forestry/storage/ResupplyHandler.java b/src/main/java/forestry/storage/ResupplyHandler.java index 45e1e6e8a..90890f847 100755 --- a/src/main/java/forestry/storage/ResupplyHandler.java +++ b/src/main/java/forestry/storage/ResupplyHandler.java @@ -31,7 +31,7 @@ import forestry.storage.items.ItemBackpack; public class ResupplyHandler implements IResupplyHandler { private static List backpacks(InventoryPlayer playerInventory) { - List backpacks = new ArrayList(); + List backpacks = new ArrayList<>(); for (ItemStack itemStack : playerInventory.mainInventory) { if (itemStack != null && itemStack.stackSize > 0 && (itemStack.getItem() instanceof ItemBackpack)) { backpacks.add(itemStack);