Use diamond operator everywhere

This commit is contained in:
mezz committed 2016-10-20 22:41:23 -07:00
1 parent 9812ddc4ce
commit 55c58cf5d9
140 files changed
+305 -305

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ public final class Binnie {
public static final ManagerResource Resource;
static {
Managers = new ArrayList<ManagerBase>();
Managers = new ArrayList<>();
Language = new ManagerLanguage();
Genetics = new ManagerGenetics();
Configuration = new ManagerConfig();
@@ -37,7 +37,7 @@ public class CeramicColor implements IDesignMaterial {
}
static {
CeramicColor.map = new LinkedHashMap<EnumFlowerColor, CeramicColor>();
CeramicColor.map = new LinkedHashMap<>();
for (final EnumFlowerColor c : EnumFlowerColor.values()) {
CeramicColor.map.put(c, new CeramicColor(c));
}
@@ -25,7 +25,7 @@ public class CeramicTileRecipe implements IRecipe {
final Item ceramicTile = Item.getItemFromBlock(Botany.ceramicTile);
final Item ceramicBrick = Item.getItemFromBlock(Botany.ceramicBrick);
final Item mortar = Botany.misc;
final List<ItemStack> stacks = new ArrayList<ItemStack>();
final List<ItemStack> stacks = new ArrayList<>();
int ix = -1;
int iy = -1;
for (int i = 0; i < inv.getSizeInventory(); ++i) {
@@ -33,8 +33,8 @@ public class GardenLogic extends FarmLogic {
public GardenLogic(final IFarmHousing housing) {
super(housing);
this.produce = new ArrayList<ItemStack>();
(this.farmables = new ArrayList<IFarmable>()).add(new FarmableFlower());
this.produce = new ArrayList<>();
(this.farmables = new ArrayList<>()).add(new FarmableFlower());
this.farmables.add(new FarmableVanillaFlower());
}
@@ -561,7 +561,7 @@ public class TileEntityFlower extends TileEntity //implements IPollinatable, IBu
}
public Set<IErrorState> getErrorStates() {
return new HashSet<IErrorState>();
return new HashSet<>();
}
public static class RenderInfo {
@@ -25,7 +25,7 @@ public class BlockPlant extends BlockBush {
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
return new ArrayList<ItemStack>();
return new ArrayList<>();
}
// @Override
@@ -251,8 +251,8 @@ public class Gardening {
// }
static {
Gardening.fertiliserAcid = new LinkedHashMap<ItemStack, Integer>();
Gardening.fertiliserAlkaline = new LinkedHashMap<ItemStack, Integer>();
Gardening.fertiliserNutrient = new LinkedHashMap<ItemStack, Integer>();
Gardening.fertiliserAcid = new LinkedHashMap<>();
Gardening.fertiliserAlkaline = new LinkedHashMap<>();
Gardening.fertiliserNutrient = new LinkedHashMap<>();
}
}
@@ -264,8 +264,8 @@ public class ModuleGardening implements IInitializable {
}
static {
ModuleGardening.queuedAcidFertilisers = new HashMap<ItemStack, Integer>();
ModuleGardening.queuedAlkalineFertilisers = new HashMap<ItemStack, Integer>();
ModuleGardening.queuedNutrientFertilisers = new HashMap<ItemStack, Integer>();
ModuleGardening.queuedAcidFertilisers = new HashMap<>();
ModuleGardening.queuedAlkalineFertilisers = new HashMap<>();
ModuleGardening.queuedNutrientFertilisers = new HashMap<>();
}
}
@@ -21,7 +21,7 @@ public class FlowerHelper extends SpeciesRoot implements IFlowerRoot {
private static ArrayList<IColourMix> colourMixes;
public FlowerHelper() {
this.conversions = new HashMap<ItemStack, IFlower>();
this.conversions = new HashMap<>();
}
@Override
@@ -245,9 +245,9 @@ public class FlowerHelper extends SpeciesRoot implements IFlowerRoot {
static {
FlowerHelper.flowerSpeciesCount = -1;
FlowerHelper.flowerTemplates = new ArrayList<IFlower>();
FlowerHelper.flowerMutations = new ArrayList<IFlowerMutation>();
FlowerHelper.colourMixes = new ArrayList<IColourMix>();
FlowerHelper.flowerTemplates = new ArrayList<>();
FlowerHelper.flowerMutations = new ArrayList<>();
FlowerHelper.colourMixes = new ArrayList<>();
}
@@ -79,6 +79,6 @@ public class FlowerMutation implements IFlowerMutation {
@Override
public Collection<String> getSpecialConditions() {
return new ArrayList<String>();
return new ArrayList<>();
}
}
@@ -361,7 +361,7 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
this.tempTolerance = EnumTolerance.BOTH_1;
this.pHTolerance = EnumTolerance.NONE;
this.moistureTolerance = EnumTolerance.NONE;
this.variantTemplates = new ArrayList<IAllele[]>();
this.variantTemplates = new ArrayList<>();
this.name = name;
this.binomial = binomial;
this.branchName = branch;
+2 -2
View File
@@ -24,8 +24,8 @@ public abstract class AbstractMod implements IPacketProvider, IInitializable {
protected List<IInitializable> modules;
public AbstractMod() {
this.fields = new LinkedHashSet<Field>();
this.modules = new ArrayList<IInitializable>();
this.fields = new LinkedHashSet<>();
this.modules = new ArrayList<>();
BinnieCore.registerMod(this);
MinecraftForge.EVENT_BUS.register(this);
}
+2 -2
View File
@@ -148,7 +148,7 @@ public final class BinnieCore extends AbstractMod {
}
private static List<AbstractMod> getActiveMods() {
final List<AbstractMod> list = new ArrayList<AbstractMod>();
final List<AbstractMod> list = new ArrayList<>();
for (final AbstractMod mod : BinnieCore.modList) {
if (mod.isActive()) {
list.add(mod);
@@ -218,7 +218,7 @@ public final class BinnieCore extends AbstractMod {
}
static {
BinnieCore.modList = new ArrayList<AbstractMod>();
BinnieCore.modList = new ArrayList<>();
}
public static class PacketHandler extends BinniePacketHandler {
@@ -77,7 +77,7 @@ public class BlockMetadata extends BlockContainer implements IBlockMetadata {
}
public static ArrayList<ItemStack> getBlockDropped(final IBlockMetadata block, final IBlockAccess world, final BlockPos pos, final int blockMeta) {
final ArrayList<ItemStack> array = new ArrayList<ItemStack>();
final ArrayList<ItemStack> array = new ArrayList<>();
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, pos);
if (tile != null && !tile.hasDroppedBlock()) {
//final int meta = block.getDroppedMeta(world.getBlockMetadata(x, y, z), tile.getTileMetadata());
@@ -87,7 +87,7 @@ public class BlockMetadata extends BlockContainer implements IBlockMetadata {
}
public static boolean breakBlock(final IBlockMetadata block, final EntityPlayer player, final World world, final BlockPos pos) {
List<ItemStack> drops = new ArrayList<ItemStack>();
List<ItemStack> drops = new ArrayList<>();
final Block block2 = (Block) block;
final TileEntityMetadata tile = TileEntityMetadata.getTile(world, pos);
if (tile != null && !tile.hasDroppedBlock()) {
@@ -15,7 +15,7 @@ public class BinnieCircuit implements ICircuit {
private List<String> tooltips;
public BinnieCircuit(final String uid, final int limit, final ICircuitLayout layout, final ItemStack itemStack) {
this.tooltips = new ArrayList<String>();
this.tooltips = new ArrayList<>();
this.uid = "binnie.circuit." + uid;
this.limit = limit;
ChipsetManager.circuitRegistry.registerCircuit(this);
@@ -10,8 +10,8 @@ public class BeeModifierLogic {
private List<EnumBeeBooleanModifier> booleanModifiers;
public BeeModifierLogic() {
this.modifiers = new HashMap<EnumBeeModifier, Float[]>();
this.booleanModifiers = new ArrayList<EnumBeeBooleanModifier>();
this.modifiers = new HashMap<>();
this.booleanModifiers = new ArrayList<>();
}
public float getModifier(final EnumBeeModifier modifier, final float currentModifier) {
@@ -39,14 +39,14 @@ public abstract class BreedingSystem implements IItemStackRepresentitive {
String currentEpithet;
public BreedingSystem() {
this.allBranches = new ArrayList<IClassification>();
this.allActiveSpecies = new ArrayList<IAlleleSpecies>();
this.allSpecies = new ArrayList<IAlleleSpecies>();
this.allMutations = new ArrayList<IMutation>();
this.resultantMutations = new HashMap<IAlleleSpecies, List<IMutation>>();
this.furtherMutations = new HashMap<IAlleleSpecies, List<IMutation>>();
this.allResultantMutations = new HashMap<IAlleleSpecies, List<IMutation>>();
this.allFurtherMutations = new HashMap<IAlleleSpecies, List<IMutation>>();
this.allBranches = new ArrayList<>();
this.allActiveSpecies = new ArrayList<>();
this.allSpecies = new ArrayList<>();
this.allMutations = new ArrayList<>();
this.resultantMutations = new HashMap<>();
this.furtherMutations = new HashMap<>();
this.allResultantMutations = new HashMap<>();
this.allFurtherMutations = new HashMap<>();
Binnie.Genetics.registerBreedingSystem(this);
MinecraftForge.EVENT_BUS.register(this);
}
@@ -95,18 +95,18 @@ public abstract class BreedingSystem implements IItemStackRepresentitive {
public void calculateArrays() {
final Collection<IAllele> allAlleles = AlleleManager.alleleRegistry.getRegisteredAlleles().values();
this.resultantMutations = new HashMap<IAlleleSpecies, List<IMutation>>();
this.furtherMutations = new HashMap<IAlleleSpecies, List<IMutation>>();
this.allResultantMutations = new HashMap<IAlleleSpecies, List<IMutation>>();
this.allFurtherMutations = new HashMap<IAlleleSpecies, List<IMutation>>();
this.allActiveSpecies = new ArrayList<IAlleleSpecies>();
this.allSpecies = new ArrayList<IAlleleSpecies>();
this.resultantMutations = new HashMap<>();
this.furtherMutations = new HashMap<>();
this.allResultantMutations = new HashMap<>();
this.allFurtherMutations = new HashMap<>();
this.allActiveSpecies = new ArrayList<>();
this.allSpecies = new ArrayList<>();
for (final IAllele species : allAlleles) {
if (this.getSpeciesRoot().getTemplate(species.getUID()) != null) {
this.resultantMutations.put((IAlleleSpecies) species, new ArrayList<IMutation>());
this.furtherMutations.put((IAlleleSpecies) species, new ArrayList<IMutation>());
this.allResultantMutations.put((IAlleleSpecies) species, new ArrayList<IMutation>());
this.allFurtherMutations.put((IAlleleSpecies) species, new ArrayList<IMutation>());
this.resultantMutations.put((IAlleleSpecies) species, new ArrayList<>());
this.furtherMutations.put((IAlleleSpecies) species, new ArrayList<>());
this.allResultantMutations.put((IAlleleSpecies) species, new ArrayList<>());
this.allFurtherMutations.put((IAlleleSpecies) species, new ArrayList<>());
this.allSpecies.add((IAlleleSpecies) species);
if (this.isBlacklisted(species) || species.getUID().contains("speciesBotAlfheim")) {
continue;
@@ -114,9 +114,9 @@ public abstract class BreedingSystem implements IItemStackRepresentitive {
this.allActiveSpecies.add((IAlleleSpecies) species);
}
}
this.allMutations = new ArrayList<IMutation>();
this.allMutations = new ArrayList<>();
final Collection<IClassification> allRegBranches = AlleleManager.alleleRegistry.getRegisteredClassifications().values();
this.allBranches = new ArrayList<IClassification>();
this.allBranches = new ArrayList<>();
for (final IClassification branch : allRegBranches) {
if (branch.getMemberSpecies().length > 0 && this.getSpeciesRoot().getTemplate(branch.getMemberSpecies()[0].getUID()) != null) {
boolean possible = false;
@@ -132,14 +132,14 @@ public abstract class BreedingSystem implements IItemStackRepresentitive {
}
}
if (this.getSpeciesRoot().getMutations(false) != null) {
final Set<IMutation> mutations = new LinkedHashSet<IMutation>();
final Set<IMutation> mutations = new LinkedHashSet<>();
mutations.addAll(this.getSpeciesRoot().getMutations(false));
if (this == Binnie.Genetics.beeBreedingSystem) {
mutations.addAll(ExtraBeeMutation.mutations);
}
for (final IMutation mutation : mutations) {
this.allMutations.add(mutation);
final Set<IAlleleSpecies> participatingSpecies = new LinkedHashSet<IAlleleSpecies>();
final Set<IAlleleSpecies> participatingSpecies = new LinkedHashSet<>();
if (mutation.getAllele0() instanceof IAlleleSpecies) {
participatingSpecies.add(mutation.getAllele0());
}
@@ -222,7 +222,7 @@ public abstract class BreedingSystem implements IItemStackRepresentitive {
}
public final Collection<IClassification> getDiscoveredBranches(final World world, final GameProfile player) {
final List<IClassification> branches = new ArrayList<IClassification>();
final List<IClassification> branches = new ArrayList<>();
for (final IClassification branch : this.getAllBranches()) {
boolean discovered = false;
for (final IAlleleSpecies species : branch.getMemberSpecies()) {
@@ -238,7 +238,7 @@ public abstract class BreedingSystem implements IItemStackRepresentitive {
}
public final Collection<IClassification> getDiscoveredBranches(final IBreedingTracker tracker) {
final List<IClassification> branches = new ArrayList<IClassification>();
final List<IClassification> branches = new ArrayList<>();
for (final IClassification branch : this.getAllBranches()) {
boolean discovered = false;
for (final IAlleleSpecies species : branch.getMemberSpecies()) {
@@ -254,7 +254,7 @@ public abstract class BreedingSystem implements IItemStackRepresentitive {
}
public final Collection<IAlleleSpecies> getDiscoveredSpecies(final World world, final GameProfile player) {
final List<IAlleleSpecies> speciesList = new ArrayList<IAlleleSpecies>();
final List<IAlleleSpecies> speciesList = new ArrayList<>();
for (final IAlleleSpecies species : this.getAllSpecies()) {
if (this.isSpeciesDiscovered(species, world, player)) {
speciesList.add(species);
@@ -264,7 +264,7 @@ public abstract class BreedingSystem implements IItemStackRepresentitive {
}
public final Collection<IAlleleSpecies> getDiscoveredSpecies(final IBreedingTracker tracker) {
final List<IAlleleSpecies> speciesList = new ArrayList<IAlleleSpecies>();
final List<IAlleleSpecies> speciesList = new ArrayList<>();
for (final IAlleleSpecies species : this.getAllSpecies()) {
if (this.isSpeciesDiscovered(species, tracker)) {
speciesList.add(species);
@@ -274,7 +274,7 @@ public abstract class BreedingSystem implements IItemStackRepresentitive {
}
public final List<IMutation> getDiscoveredMutations(final World world, final GameProfile player) {
final List<IMutation> speciesList = new ArrayList<IMutation>();
final List<IMutation> speciesList = new ArrayList<>();
for (final IMutation species : this.getAllMutations()) {
if (this.isMutationDiscovered(species, world, player)) {
speciesList.add(species);
@@ -284,7 +284,7 @@ public abstract class BreedingSystem implements IItemStackRepresentitive {
}
public final List<IMutation> getDiscoveredMutations(final IBreedingTracker tracker) {
final List<IMutation> speciesList = new ArrayList<IMutation>();
final List<IMutation> speciesList = new ArrayList<>();
for (final IMutation species : this.getAllMutations()) {
if (this.isMutationDiscovered(species, tracker)) {
speciesList.add(species);
@@ -28,9 +28,9 @@ public class ManagerGenetics extends ManagerBase {
private Map<ISpeciesRoot, Map<IChromosomeType, List<IAllele>>> chromosomeArray;
public ManagerGenetics() {
this.BREEDING_SYSTEMS = new LinkedHashMap<ISpeciesRoot, BreedingSystem>();
this.invalidChromosomeTypes = new ArrayList<IChromosomeType>();
this.chromosomeArray = new LinkedHashMap<ISpeciesRoot, Map<IChromosomeType, List<IAllele>>>();
this.BREEDING_SYSTEMS = new LinkedHashMap<>();
this.invalidChromosomeTypes = new ArrayList<>();
this.chromosomeArray = new LinkedHashMap<>();
}
@Override
@@ -147,9 +147,9 @@ public class ManagerGenetics extends ManagerBase {
this.invalidChromosomeTypes.clear();
for (final ISpeciesRoot root : AlleleManager.alleleRegistry.getSpeciesRoot().values()) {
final BreedingSystem system = this.getSystem(root);
final Map<IChromosomeType, List<IAllele>> chromosomeMap = new LinkedHashMap<IChromosomeType, List<IAllele>>();
final Map<IChromosomeType, List<IAllele>> chromosomeMap = new LinkedHashMap<>();
for (final IChromosomeType chromosome : root.getKaryotype()) {
final TreeSet<IAllele> alleles = new TreeSet<IAllele>(new ComparatorAllele());
final TreeSet<IAllele> alleles = new TreeSet<>(new ComparatorAllele());
for (final IIndividual individual : root.getIndividualTemplates()) {
final IGenome genome = individual.getGenome();
try {
@@ -169,7 +169,7 @@ public class ManagerGenetics extends ManagerBase {
if (alleles.size() == 0) {
this.invalidChromosomeTypes.add(chromosome);
} else {
final List<IAllele> alleleList = new ArrayList<IAllele>();
final List<IAllele> alleleList = new ArrayList<>();
alleleList.addAll(alleles);
chromosomeMap.put(chromosome, alleleList);
}
@@ -136,7 +136,7 @@ public class TreeBreedingSystem extends BreedingSystem {
public Collection<IAlleleSpecies> getTreesThatBearFruit(final ItemStack fruit, final boolean nei, final World world, final GameProfile player) {
final Collection<IAlleleSpecies> set = nei ? this.getAllSpecies() : this.getDiscoveredSpecies(world, player);
final List<IAlleleSpecies> found = new ArrayList<IAlleleSpecies>();
final List<IAlleleSpecies> found = new ArrayList<>();
for (final IAlleleSpecies species : set) {
final IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies) species;
final ITreeGenome genome = (ITreeGenome) this.getSpeciesRoot().templateAsGenome(this.getSpeciesRoot().getTemplate(tSpecies.getUID()));
@@ -151,8 +151,8 @@ public class TreeBreedingSystem extends BreedingSystem {
public Collection<IAlleleSpecies> getTreesThatCanBearFruit(final ItemStack fruit, final boolean nei, final World world, final GameProfile player) {
final Collection<IAlleleSpecies> set = nei ? this.getAllSpecies() : this.getDiscoveredSpecies(world, player);
final List<IAlleleSpecies> found = new ArrayList<IAlleleSpecies>();
final Set<IFruitFamily> providers = new HashSet<IFruitFamily>();
final List<IAlleleSpecies> found = new ArrayList<>();
final Set<IFruitFamily> providers = new HashSet<>();
for (final IAlleleSpecies species : set) {
final IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies) species;
final ITreeGenome genome = (ITreeGenome) this.getSpeciesRoot().templateAsGenome(this.getSpeciesRoot().getTemplate(tSpecies.getUID()));
@@ -176,7 +176,7 @@ public class TreeBreedingSystem extends BreedingSystem {
public Collection<IAlleleSpecies> getTreesThatHaveWood(final ItemStack fruit, final boolean nei, final World world, final GameProfile player) {
final Collection<IAlleleSpecies> set = nei ? this.getAllSpecies() : this.getDiscoveredSpecies(world, player);
final List<IAlleleSpecies> found = new ArrayList<IAlleleSpecies>();
final List<IAlleleSpecies> found = new ArrayList<>();
for (final IAlleleSpecies species : set) {
IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies) species;
ITreeGenome genome = TreeManager.treeRoot.templateAsGenome(TreeManager.treeRoot.getTemplate(tSpecies.getUID()));
@@ -194,10 +194,10 @@ public class TreeBreedingSystem extends BreedingSystem {
public Collection<IAlleleSpecies> getTreesThatMakePlanks(final ItemStack fruit, final boolean nei, final World world, final GameProfile player) {
if (fruit == null) {
return new ArrayList<IAlleleSpecies>();
return new ArrayList<>();
}
final Collection<IAlleleSpecies> set = nei ? this.getAllSpecies() : this.getDiscoveredSpecies(world, player);
final List<IAlleleSpecies> found = new ArrayList<IAlleleSpecies>();
final List<IAlleleSpecies> found = new ArrayList<>();
for (final IAlleleSpecies species : set) {
final IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies) species;
ITreeGenome genome = TreeManager.treeRoot.templateAsGenome(TreeManager.treeRoot.getTemplate(tSpecies.getUID()));
@@ -14,7 +14,7 @@ import net.minecraft.world.World;
import java.util.ArrayList;
public class VirtualBeeHousing extends VirtualHousing implements IBeeHousing, IBeeModifier {
ArrayList<IBeeModifier> beeModifier = new ArrayList<IBeeModifier>();
ArrayList<IBeeModifier> beeModifier = new ArrayList<>();
private InventoryBeeHousing beeInventory;
public VirtualBeeHousing(final EntityPlayer player) {
@@ -11,7 +11,7 @@ public class ManagerLanguage extends ManagerBase {
private Map<Object, String> objNames;
public ManagerLanguage() {
this.objNames = new HashMap<Object, String>();
this.objNames = new HashMap<>();
}
public void addObjectName(final Object obj, final String name) {
@@ -174,7 +174,7 @@ public class ItemFluidContainer extends ItemFood {
ItemFluidContainer.LiquidSpirit = 512;
ItemFluidContainer.LiquidLiqueuer = 640;
ItemFluidContainer.LiquidGenetics = 768;
ItemFluidContainer.idToFluid = new HashMap<Integer, String>();
ItemFluidContainer.fluidToID = new HashMap<String, Integer>();
ItemFluidContainer.idToFluid = new HashMap<>();
ItemFluidContainer.fluidToID = new HashMap<>();
}
}
@@ -12,7 +12,7 @@ public class ManagerLiquid extends ManagerBase {
Map<String, IFluidType> fluids;
public ManagerLiquid() {
this.fluids = new LinkedHashMap<String, IFluidType>();
this.fluids = new LinkedHashMap<>();
}
public Collection<IFluidType> getFluidTypes() {
@@ -183,7 +183,7 @@ class BlockMachine extends BlockContainer implements IBlockMachine {
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
return new ArrayList<ItemStack>();
return new ArrayList<>();
}
@Override
@@ -35,8 +35,8 @@ public class Machine implements INetworkedEntity, INbtReadable, INbtWritable, IN
private GameProfile owner;
public Machine(final MachinePackage pack, final TileEntity tile) {
this.componentInterfaceMap = new LinkedHashMap<Class, List<MachineComponent>>();
this.componentMap = new LinkedHashMap<Class<? extends MachineComponent>, MachineComponent>();
this.componentInterfaceMap = new LinkedHashMap<>();
this.componentMap = new LinkedHashMap<>();
this.queuedInventoryUpdate = false;
this.nextProgressBarID = 0;
this.owner = null;
@@ -54,7 +54,7 @@ public class Machine implements INetworkedEntity, INbtReadable, INbtWritable, IN
this.componentMap.put(component.getClass(), component);
for (final Class inter : component.getComponentInterfaces()) {
if (!this.componentInterfaceMap.containsKey(inter)) {
this.componentInterfaceMap.put(inter, new ArrayList<MachineComponent>());
this.componentInterfaceMap.put(inter, new ArrayList<>());
}
this.componentInterfaceMap.get(inter).add(component);
}
@@ -86,7 +86,7 @@ public class Machine implements INetworkedEntity, INbtReadable, INbtWritable, IN
@Override
public <T> List<T> getInterfaces(final Class<T> interfaceClass) {
final ArrayList<T> interfaces = new ArrayList<T>();
final ArrayList<T> interfaces = new ArrayList<>();
if (!this.hasInterface(interfaceClass)) {
return interfaces;
}
@@ -23,8 +23,8 @@ public class MachineGroup {
private boolean renderedTileEntity;
public MachineGroup(final AbstractMod mod, final String uid, final String blockName, final IMachineType[] types) {
this.packages = new LinkedHashMap<String, MachinePackage>();
this.packagesID = new LinkedHashMap<Integer, MachinePackage>();
this.packages = new LinkedHashMap<>();
this.packagesID = new LinkedHashMap<>();
this.customRenderer = true;
this.renderedTileEntity = true;
this.mod = mod;
@@ -164,7 +164,7 @@ public class MachineUtil {
}
public List<ItemStack> getNonNullStacks(final int[] slotacclimatiser) {
final List<ItemStack> stacks = new ArrayList<ItemStack>();
final List<ItemStack> stacks = new ArrayList<>();
for (final ItemStack stack : this.getStacks(slotacclimatiser)) {
if (stack != null) {
stacks.add(stack);
@@ -21,10 +21,10 @@ public class ManagerMachine extends ManagerBase {
private int machineRenderID;
public ManagerMachine() {
this.componentInterfaceMap = new HashMap<Class<?>, Class<?>[]>();
this.machineGroups = new HashMap<String, MachineGroup>();
this.networkIDToComponent = new HashMap<Integer, Class<?>>();
this.componentToNetworkID = new HashMap<Class<?>, Integer>();
this.componentInterfaceMap = new HashMap<>();
this.machineGroups = new HashMap<>();
this.networkIDToComponent = new HashMap<>();
this.componentToNetworkID = new HashMap<>();
this.nextNetworkID = 0;
}
@@ -45,7 +45,7 @@ public class ManagerMachine extends ManagerBase {
if (this.componentInterfaceMap.containsKey(component)) {
return;
}
final Set<Class<?>> interfaces = new HashSet<Class<?>>();
final Set<Class<?>> interfaces = new HashSet<>();
for (Class<?> currentClass = component; currentClass != null; currentClass = null) {
for (final Class<?> clss : currentClass.getInterfaces()) {
interfaces.add(clss);
@@ -16,7 +16,7 @@ public class ComponentChargedSlots extends MachineComponent implements INetwork.
public ComponentChargedSlots(final Machine machine) {
super(machine);
this.charges = new HashMap<Integer, Float>();
this.charges = new HashMap<>();
}
@Override
@@ -21,7 +21,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
public ComponentInventorySlots(final IMachine machine) {
super(machine);
this.inventory = new LinkedHashMap<Integer, InventorySlot>();
this.inventory = new LinkedHashMap<>();
}
//TODO Implement
@@ -188,7 +188,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
@Override
public InventorySlot[] getSlots(final int[] indexes) {
final List<InventorySlot> list = new ArrayList<InventorySlot>();
final List<InventorySlot> list = new ArrayList<>();
for (final int i : indexes) {
if (this.getSlot(i) != null) {
list.add(this.getSlot(i));
@@ -237,7 +237,7 @@ public class ComponentInventorySlots extends ComponentInventory implements IInve
@Override
public int[] getSlotsForFace(final EnumFacing var1) {
final List<Integer> slots = new ArrayList<Integer>();
final List<Integer> slots = new ArrayList<>();
for (final InventorySlot slot : this.inventory.values()) {
if (slot.canInsert() || slot.canExtract()) {
slots.add(slot.getIndex());
@@ -14,7 +14,7 @@ public class ComponentInventoryTransfer extends MachineComponent {
public ComponentInventoryTransfer(final IMachine machine) {
super(machine);
this.transfers = new ArrayList<Transfer>();
this.transfers = new ArrayList<>();
}
public void addRestock(final int[] buffer, final int destination, final int limit) {
@@ -22,7 +22,7 @@ public class ComponentTankContainer extends MachineComponent implements ITankMac
public ComponentTankContainer(final IMachine machine) {
super(machine);
this.tanks = new LinkedHashMap<Integer, TankSlot>();
this.tanks = new LinkedHashMap<>();
}
@Override
@@ -147,7 +147,7 @@ public class ComponentTankContainer extends MachineComponent implements ITankMac
@Override
public IFluidTank[] getTanks() {
final List<IFluidTank> ltanks = new ArrayList<IFluidTank>();
final List<IFluidTank> ltanks = new ArrayList<>();
for (final TankSlot tank : this.tanks.values()) {
ltanks.add(tank.getTank());
}
@@ -26,7 +26,7 @@ public class SetList<E> extends ArrayList<E> implements Set<E> {
@Override
public boolean addAll(final int index, final Collection<? extends E> c) {
final Collection<E> copy = new ArrayList<E>(c);
final Collection<E> copy = new ArrayList<>(c);
copy.removeAll(this);
return super.addAll(index, copy);
}
@@ -11,7 +11,7 @@ class SidedAccess {
private boolean extractLocked;
public SidedAccess() {
this.accesses = new HashMap<EnumFacing, AccessDirection>();
this.accesses = new HashMap<>();
this.base = AccessDirection.Both;
this.insertLocked = false;
this.extractLocked = false;
@@ -50,7 +50,7 @@ class SidedAccess {
}
public Collection<EnumFacing> getInsertionSides() {
final List<EnumFacing> dirs = new ArrayList<EnumFacing>();
final List<EnumFacing> dirs = new ArrayList<>();
for (final EnumFacing dir : EnumFacing.VALUES) {
if (this.getAccess(dir).canInsert()) {
dirs.add(dir);
@@ -60,7 +60,7 @@ class SidedAccess {
}
public Collection<EnumFacing> getExtractionSides() {
final List<EnumFacing> dirs = new ArrayList<EnumFacing>();
final List<EnumFacing> dirs = new ArrayList<>();
for (final EnumFacing dir : EnumFacing.VALUES) {
if (this.getAccess(dir).canExtract()) {
dirs.add(dir);
@@ -12,8 +12,8 @@ public class ValidatorIcon {
private List<BinnieIcon> iconsOutput;
public ValidatorIcon(final AbstractMod mod, final String pathInput, final String pathOutput) {
this.iconsInput = new ArrayList<BinnieIcon>();
this.iconsOutput = new ArrayList<BinnieIcon>();
this.iconsInput = new ArrayList<>();
this.iconsOutput = new ArrayList<>();
this.iconsInput.add(Binnie.Resource.getItemIcon(mod, pathInput));
this.iconsOutput.add(Binnie.Resource.getItemIcon(mod, pathOutput));
}
@@ -24,7 +24,7 @@ public class ComponentPowerReceptor extends MachineComponent implements IPowered
super(machine);
this.registeredToIC2EnergyNet = false;
this.previousPower = 0.0f;
this.inputs = new LinkedList<Float>();
this.inputs = new LinkedList<>();
this.container = new PowerInterface(storage);
// if (!this.registeredToIC2EnergyNet) {
// this.addToEnergyNet();
@@ -22,7 +22,7 @@ class ComponentCompartmentInventory extends ComponentInventorySlots implements I
public ComponentCompartmentInventory(final IMachine machine, final int tabs, final int pageSize) {
super(machine);
this.tabs = new HashMap<Integer, CompartmentTab>();
this.tabs = new HashMap<>();
this.numberOfTabs = tabs;
this.slotsPerPage = pageSize;
for (int i = 0; i < this.numberOfTabs * this.slotsPerPage; ++i) {
@@ -57,7 +57,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
public WindowCompartment(final EntityPlayer player, final IInventory inventory, final Side side) {
super(320, 226, player, inventory, side);
this.panels = new HashMap<Panel, Integer>();
this.panels = new HashMap<>();
this.currentTab = 0;
}
@@ -128,7 +128,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
}
}.setOrigin(EventHandler.Origin.DirectChild, tab));
x += 24;
final ControlPages<Integer> compartmentPages = new ControlPages<Integer>(controlCompartment, 24.0f, 0.0f, compartmentPageWidth, compartmentPageHeight);
final ControlPages<Integer> compartmentPages = new ControlPages<>(controlCompartment, 24.0f, 0.0f, compartmentPageWidth, compartmentPageHeight);
final ControlPage[] page = new ControlPage[inv.getTabNumber()];
for (int p = 0; p < inv.getTabNumber(); ++p) {
page[p] = new ControlPage(compartmentPages, Integer.valueOf(p));
@@ -336,7 +336,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
}
private void updateSearch() {
Map<Integer, String> slotIds = new HashMap<Integer, String>();
Map<Integer, String> slotIds = new HashMap<>();
final IInventory inv = WindowCompartment.this.getInventory();
for (int i = 0; i < inv.getSizeInventory(); ++i) {
final ItemStack stack = inv.getStackInSlot(i);
@@ -33,8 +33,8 @@ public class TransferRequest {
this.targetTanks = new int[0];
this.transferLiquids = true;
this.ignoreReadOnly = false;
this.insertedSlots = new ArrayList<TransferSlot>();
this.insertedTanks = new ArrayList<Integer>();
this.insertedSlots = new ArrayList<>();
this.insertedTanks = new ArrayList<>();
final int[] target = new int[destination.getSizeInventory()];
for (int i = 0; i < target.length; ++i) {
target[i] = i;
@@ -13,8 +13,8 @@ public class ManagerConfig extends ManagerBase {
private Map<AbstractMod, List<BinnieItemData>> itemIDs;
public ManagerConfig() {
this.configurations = new LinkedHashMap<Class<?>, Configuration>();
this.itemIDs = new HashMap<AbstractMod, List<BinnieItemData>>();
this.configurations = new LinkedHashMap<>();
this.itemIDs = new HashMap<>();
}
public void registerConfiguration(final Class<?> cls, final AbstractMod mod) {
@@ -48,7 +48,7 @@ public class ManagerConfig extends ManagerBase {
public void addItemID(final Integer configValue, final String configKey, final BinnieConfiguration configFile) {
if (!this.itemIDs.containsKey(configFile.mod)) {
this.itemIDs.put(configFile.mod, new ArrayList<BinnieItemData>());
this.itemIDs.put(configFile.mod, new ArrayList<>());
}
this.itemIDs.get(configFile.mod).add(new BinnieItemData(configValue + 256, configFile, configKey));
}
@@ -18,7 +18,7 @@ abstract class PropertyBase<ValueType, AnnotationType extends Annotation> {
private Field field;
protected PropertyBase(final Field field, final BinnieConfiguration file, final ConfigProperty configProperty, final AnnotationType annotedProperty) throws IllegalArgumentException, IllegalAccessException {
this.comments = new ArrayList<String>();
this.comments = new ArrayList<>();
this.field = field;
this.file = file;
this.configProperty = configProperty;
@@ -45,6 +45,6 @@ public abstract class FieldParser {
}
static {
FieldParser.parsers = new ArrayList<FieldParser>();
FieldParser.parsers = new ArrayList<>();
}
}
@@ -10,9 +10,9 @@ public class MachinePayload {
private int id;
public MachinePayload(final int id) {
this.intPayload = new ArrayList<Integer>();
this.floatPayload = new ArrayList<Float>();
this.stringPayload = new ArrayList<String>();
this.intPayload = new ArrayList<>();
this.floatPayload = new ArrayList<>();
this.stringPayload = new ArrayList<>();
this.id = 0;
this.id = id;
this.intPayload.clear();
@@ -21,9 +21,9 @@ public class MachinePayload {
}
public MachinePayload() {
this.intPayload = new ArrayList<Integer>();
this.floatPayload = new ArrayList<Float>();
this.stringPayload = new ArrayList<String>();
this.intPayload = new ArrayList<>();
this.floatPayload = new ArrayList<>();
this.stringPayload = new ArrayList<>();
this.id = 0;
}
@@ -11,9 +11,9 @@ public class PacketPayload {
public List<String> stringPayload;
public PacketPayload() {
this.intPayload = new ArrayList<Integer>();
this.floatPayload = new ArrayList<Float>();
this.stringPayload = new ArrayList<String>();
this.intPayload = new ArrayList<>();
this.floatPayload = new ArrayList<>();
this.stringPayload = new ArrayList<>();
this.intPayload.clear();
this.floatPayload.clear();
this.stringPayload.clear();
@@ -10,7 +10,7 @@ public class ManagerResource {
private List<BinnieIcon> icons;
public ManagerResource() {
this.icons = new ArrayList<BinnieIcon>();
this.icons = new ArrayList<>();
}
public BinnieResource getPNG(final AbstractMod mod, final ResourceType type, final String path) {
@@ -15,6 +15,6 @@ public class TextureManager {
}
static {
TextureManager.textures = new ArrayList<Icon>();
TextureManager.textures = new ArrayList<>();
}
}
@@ -8,7 +8,7 @@ class FluidStackSet implements Set<FluidStack> {
List<FluidStack> itemStacks;
FluidStackSet() {
this.itemStacks = new ArrayList<FluidStack>();
this.itemStacks = new ArrayList<>();
}
@Override
@@ -8,7 +8,7 @@ public class ItemStackSet implements Set<ItemStack> {
List<ItemStack> itemStacks;
public ItemStackSet() {
this.itemStacks = new ArrayList<ItemStack>();
this.itemStacks = new ArrayList<>();
}
@Override
@@ -59,7 +59,7 @@ public class WindowFieldKit extends Window {
this.glassRand = new Random();
this.analyseProgress = 1.0f;
this.isAnalysing = false;
this.info = new HashMap<IChromosomeType, String>();
this.info = new HashMap<>();
this.prev = null;
}
@@ -178,7 +178,7 @@ public class WindowFieldKit extends Window {
for (final IChromosomeType type : root.getKaryotype()) {
if (!Binnie.Genetics.isInvalidChromosome(type)) {
final IAllele allele = ind.getGenome().getActiveAllele(type);
final List<String> infos = new ArrayList<String>();
final List<String> infos = new ArrayList<>();
int i = 0;
for (String pref = root.getUID() + ".fieldkit." + type.getName().toLowerCase() + "."; Binnie.Language.canLocalise(pref + i); ++i) {
infos.add(Binnie.Language.localise(pref + i));
@@ -104,7 +104,7 @@ public class WindowGenesis extends Window {
this.geneOptions = new ControlListBox<Gene>(this, two.x(), two.y(), two.w(), two.h(), 10.0f) {
@Override
public IWidget createOption(final Gene value, final int y) {
return new ControlTextOption<Gene>(this.getContent(), value, y);
return new ControlTextOption<>(this.getContent(), value, y);
}
};
tabSystems.addEventHandler(new EventValueChanged.Handler() {
@@ -119,7 +119,7 @@ public class WindowGenesis extends Window {
@Override
public void onEvent(final EventValueChanged event) {
final Map<IChromosomeType, List<IAllele>> map = Binnie.Genetics.getChromosomeMap(WindowGenesis.this.root);
final List<Gene> opts = new ArrayList<Gene>();
final List<Gene> opts = new ArrayList<>();
final IChromosomeType chromo = ((Gene) event.value) != null ? ((Gene) event.value).getChromosome() : null;
if (chromo != null)// fix NPE
for (final IAllele allele : map.get(chromo)) {
@@ -147,7 +147,7 @@ public class WindowGenesis extends Window {
}
private void refreshTemplate(final IChromosomeType selection) {
final List<Gene> genes = new ArrayList<Gene>();
final List<Gene> genes = new ArrayList<>();
final IChromosomeType[] arr$;
final IChromosomeType[] chromos = arr$ = Binnie.Genetics.getChromosomeMap(this.root).keySet().toArray(new IChromosomeType[0]);
for (final IChromosomeType type : arr$) {
@@ -162,7 +162,7 @@ public class WindowGenesis extends Window {
if (selection != null) {
this.geneList.setValue(new Gene(this.template[selection.ordinal()], selection, this.root));
} else {
this.geneOptions.setOptions(new ArrayList<Gene>());
this.geneOptions.setOptions(new ArrayList<>());
}
this.refreshPickup();
}
@@ -24,7 +24,7 @@ public class PageColourMix extends PageAbstract<IFlowerColour> {
@Override
public void onValueChanged(final IFlowerColour colour) {
final List<IColourMix> mixes = new ArrayList<IColourMix>();
final List<IColourMix> mixes = new ArrayList<>();
for (final IColourMix mix : BotanyCore.getFlowerRoot().getColourMixes(false)) {
if (mix.getColour1() == colour || mix.getColour2() == colour) {
mixes.add(mix);
@@ -24,7 +24,7 @@ public class PageColourMixResultant extends PageAbstract<IFlowerColour> {
@Override
public void onValueChanged(final IFlowerColour colour) {
final List<IColourMix> mixes = new ArrayList<IColourMix>();
final List<IColourMix> mixes = new ArrayList<>();
for (final IColourMix mix : BotanyCore.getFlowerRoot().getColourMixes(false)) {
if (mix.getResult() == colour) {
mixes.add(mix);
@@ -47,7 +47,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
return new ControlColourOption(((ControlScrollableContent<ControlList<IFlowerColour>>) this).getContent(), value, y);
}
};
final List<IFlowerColour> colors = new ArrayList<IFlowerColour>();
final List<IFlowerColour> colors = new ArrayList<>();
for (final IFlowerColour c : EnumFlowerColor.values()) {
colors.add(c);
}
@@ -40,7 +40,7 @@ public class ControlEnumButton<T> extends ControlButton implements IControlValue
public ControlEnumButton(final IWidget parent, final float x, final float y, final float width, final float height, final T[] values) {
super(parent, x, y, width, height, "");
this.enumConstants = new ArrayList<T>();
this.enumConstants = new ArrayList<>();
for (final T value : values) {
this.enumConstants.add(value);
}
@@ -15,8 +15,8 @@ public class Control extends Widget implements ITooltipHelp, ITooltip {
public Control(final IWidget parent, final float x, final float y, final float w, final float h) {
super(parent);
this.helpStrings = new ArrayList<String>();
this.tooltipStrings = new ArrayList<String>();
this.helpStrings = new ArrayList<>();
this.tooltipStrings = new ArrayList<>();
this.extraLevel = 0;
this.setPosition(new IPoint(x, y));
this.setSize(new IPoint(w, h));
@@ -22,8 +22,8 @@ public class ControlList<T> extends Control implements IControlValue<T> {
protected ControlList(final ControlListBox<T> parent, final float x, final float y, final float w, final float h) {
super(parent, x, y, w, h);
this.value = null;
this.allOptions = new LinkedHashMap<T, IWidget>();
this.optionWidgets = new LinkedHashMap<T, IWidget>();
this.allOptions = new LinkedHashMap<>();
this.optionWidgets = new LinkedHashMap<>();
this.creating = false;
this.parent = parent;
}
@@ -15,7 +15,7 @@ public class ControlListBox<T> extends ControlScrollableContent<ControlList<T>>
@Override
public void initialise() {
this.setScrollableContent(new ControlList<T>(this, 1.0f, 1.0f, this.w() - 2.0f - this.scrollBarSize, this.h() - 2.0f));
this.setScrollableContent(new ControlList<>(this, 1.0f, 1.0f, this.w() - 2.0f - this.scrollBarSize, this.h() - 2.0f));
this.addEventHandler(new EventKey.Down.Handler() {
@Override
public void onEvent(final EventKey.Down event) {
@@ -49,7 +49,7 @@ public class ControlListBox<T> extends ControlScrollableContent<ControlList<T>>
}
public IWidget createOption(final T value, final int y) {
return new ControlOption<T>(this.getContent(), value, y);
return new ControlOption<>(this.getContent(), value, y);
}
public void setValidator(final IValidator<IWidget> validator) {
@@ -42,7 +42,7 @@ public class ControlPages<T> extends Control implements IControlValues<T>, ICont
@Override
public Collection<T> getValues() {
final List<T> list = new ArrayList<T>();
final List<T> list = new ArrayList<>();
for (final IWidget child : this.getWidgets()) {
list.add((T) ((IControlValue) child).getValue());
}
@@ -49,7 +49,7 @@ public class ControlTabBar<T> extends Control implements IControlValue<T> {
}
public ControlTab<T> createTab(final float x, final float y, final float w, final float h, final T value) {
return new ControlTab<T>(this, x, y, w, h, value);
return new ControlTab<>(this, x, y, w, h, value);
}
@Override
@@ -13,7 +13,7 @@ public class Tooltip {
public int maxWidth;
public Tooltip() {
this.tooltip = new ArrayList<String>();
this.tooltip = new ArrayList<>();
this.type = Type.Standard;
this.maxWidth = 256;
}
@@ -150,7 +150,7 @@ public abstract class TopLevelWidget extends Widget implements ITopLevelWidget {
}
public Deque<IWidget> calculateMousedOverWidgets() {
final Deque<IWidget> list = new ArrayDeque<IWidget>();
final Deque<IWidget> list = new ArrayDeque<>();
for (final IWidget widget : this.getQueuedWidgets(this)) {
if (widget.calculateIsMouseOver()) {
list.addLast(widget);
@@ -160,7 +160,7 @@ public abstract class TopLevelWidget extends Widget implements ITopLevelWidget {
}
private Collection<IWidget> getQueuedWidgets(final IWidget widget) {
final List<IWidget> widgets = new ArrayList<IWidget>();
final List<IWidget> widgets = new ArrayList<>();
boolean addChildren = true;
if (widget.isCroppedWidet()) {
addChildren = widget.getCroppedZone().contains(widget.getCropWidget().getRelativeMousePosition());
@@ -28,14 +28,14 @@ public class Widget implements IWidget {
public Widget(final IWidget parent) {
this.parent = null;
this.subWidgets = new ArrayList<IWidget>();
this.attributes = new ArrayList<IWidgetAttribute>();
this.subWidgets = new ArrayList<>();
this.attributes = new ArrayList<>();
this.position = new IPoint(0.0f, 0.0f);
this.size = new IPoint(0.0f, 0.0f);
this.offset = new IPoint(0.0f, 0.0f);
this.cropped = false;
this.colour = 16777215;
this.globalEventHandlers = new ArrayList<EventHandler>();
this.globalEventHandlers = new ArrayList<>();
this.enabled = true;
this.visible = true;
this.parent = parent;
@@ -295,7 +295,7 @@ public class Widget implements IWidget {
((ITopLevelWidget) this).updateTopLevel();
}
this.onUpdateClient();
final List<IWidget> deletedWidgets = new ArrayList<IWidget>();
final List<IWidget> deletedWidgets = new ArrayList<>();
for (final IWidget widget : this.getWidgets()) {
if (widget.hasAttribute(Attribute.NeedsDeletion)) {
deletedWidgets.add(widget);
@@ -70,9 +70,9 @@ public class ControlTileSelect extends Control implements IControlValue<IDesign>
this.deleteAllChildren();
int cx = 2;
int cy = 2;
final Map<IDesignCategory, List<IDesign>> designs = new HashMap<IDesignCategory, List<IDesign>>();
final Map<IDesignCategory, List<IDesign>> designs = new HashMap<>();
for (final IDesignCategory category : CarpentryManager.carpentryInterface.getAllDesignCategories()) {
designs.put(category, new ArrayList<IDesign>());
designs.put(category, new ArrayList<>());
for (final IDesign tile : category.getDesigns()) {
if (filterText == "" || tile.getName().toLowerCase().contains(filterText)) {
designs.get(category).add(tile);
@@ -115,7 +115,7 @@ public class PageSpeciesTreeGenome extends PageSpecies {
new ControlText(contents, new IArea(0.0f, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.FERTILITY) + " : ", TextJustification.MiddleRight);
new ControlText(contents, new IArea(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MiddleLeft);
y += th;
final List<ItemStack> fruits = new ArrayList<ItemStack>();
final List<ItemStack> fruits = new ArrayList<>();
for (final ItemStack stack : genome.getFruitProvider().getProducts().keySet()) {
fruits.add(stack);
}
@@ -45,7 +45,7 @@ public class ControlGeneScroll extends Control implements IControlValue<Breeding
int y = 0;
final boolean isNEI = ((WindowGeneBank) Window.get(this)).isNei;
for (final Map.Entry<IChromosomeType, List<IAllele>> entry : genes.entrySet()) {
final List<IAllele> discovered = new ArrayList<IAllele>();
final List<IAllele> discovered = new ArrayList<>();
for (final IAllele allele : entry.getValue()) {
final Gene gene = new Gene(allele, entry.getKey(), this.system.getSpeciesRoot());
if ((isNEI || tracker.isSequenced(new Gene(allele, entry.getKey(), this.system.getSpeciesRoot()))) && gene.getName().toLowerCase().contains(this.filter)) {
@@ -133,7 +133,7 @@ public class WindowGeneBank extends WindowMachine {
tabBar.setValues(Binnie.Genetics.getActiveSystems());
tabBar.setValue(Binnie.Genetics.beeBreedingSystem);
boxX -= 8;
final ControlTabBar<String> infoTabs = new ControlTabBar<String>(this, boxX + 8, 160.0f, 16.0f, 50.0f, Position.Left);
final ControlTabBar<String> infoTabs = new ControlTabBar<>(this, boxX + 8, 160.0f, 16.0f, 50.0f, Position.Left);
infoTabs.setValues(Arrays.asList("Stats", "Ranking"));
infoTabs.setValue("Info");
final Panel panelProject = new Panel(this, boxX + 24, 160.0f, geneBoxWidth + 20, 50.0f, MinecraftGUI.PanelType.Black);
@@ -37,9 +37,9 @@ public class ContainerCraftGUI extends Container {
private final Set<EntityPlayerMP> crafters = Sets.newConcurrentHashSet();
public ContainerCraftGUI(final Window window) {
this.syncedNBT = new HashMap<String, NBTTagCompound>();
this.sentNBT = new HashMap<String, NBTTagCompound>();
this.syncedTanks = new HashMap<Integer, TankInfo>();
this.syncedNBT = new HashMap<>();
this.sentNBT = new HashMap<>();
this.syncedTanks = new HashMap<>();
this.syncedPower = new PowerInfo();
this.syncedProcess = new ProcessInfo();
this.errorType = 0;
@@ -255,7 +255,7 @@ public class ContainerCraftGUI extends Container {
if (machineSync != null) {
machineSync.sendGuiNBT(this.syncedNBT);
}
final Map<String, NBTTagCompound> sentThisTime = new HashMap<String, NBTTagCompound>();
final Map<String, NBTTagCompound> sentThisTime = new HashMap<>();
for (final Map.Entry<String, NBTTagCompound> nbt : this.syncedNBT.entrySet()) {
nbt.getValue().setString("type", nbt.getKey());
boolean shouldSend = true;
@@ -367,7 +367,7 @@ public class ContainerCraftGUI extends Container {
}
public CustomSlot[] getCustomSlots() {
final List<CustomSlot> slots = new ArrayList<CustomSlot>();
final List<CustomSlot> slots = new ArrayList<>();
for (final Object object : this.inventorySlots) {
if (object instanceof CustomSlot) {
slots.add((CustomSlot) object);
@@ -394,7 +394,7 @@ public class ContainerCraftGUI extends Container {
}
request.transfer(false);
final NBTTagCompound nbt = new NBTTagCompound();
final List<Integer> slots = new ArrayList<Integer>();
final List<Integer> slots = new ArrayList<>();
for (final TransferRequest.TransferSlot tslot : request.getInsertedSlots()) {
final Slot slot = this.getSlot(tslot.inventory, tslot.id);
if (slot != null) {
@@ -129,7 +129,7 @@ public class GuiCraftGUI extends GuiContainer {
GL11.glDisable(2896);
GL11.glDisable(2929);
int k = 0;
final List<String> strings = new ArrayList<String>();
final List<String> strings = new ArrayList<>();
for (final String string : tooltip.getList()) {
if (string != null) {
if (!string.contains("~~~")) {
@@ -6,7 +6,7 @@ class ListMap<T> implements List<T> {
private LinkedHashMap<Integer, T> map;
ListMap() {
this.map = new LinkedHashMap<Integer, T>();
this.map = new LinkedHashMap<>();
}
@Override
@@ -127,7 +127,7 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
this.setSize(new IPoint(width, height));
this.gui = new GuiCraftGUI(this);
for (final EnumHighlighting h : EnumHighlighting.values()) {
ControlSlot.highlighting.put(h, new ArrayList<Integer>());
ControlSlot.highlighting.put(h, new ArrayList<>());
}
(CraftGUI.Render = new Renderer(this.gui)).stylesheet(StyleSheetManager.getDefault());
this.titleButtonLeft = -14.0f;
@@ -20,9 +20,9 @@ public class WindowInventory implements IInventory {
private List<Integer> disabledAutoDispenses;
public WindowInventory(final Window window) {
this.inventory = new HashMap<Integer, ItemStack>();
this.validators = new HashMap<Integer, SlotValidator>();
this.disabledAutoDispenses = new ArrayList<Integer>();
this.inventory = new HashMap<>();
this.validators = new HashMap<>();
this.disabledAutoDispenses = new ArrayList<>();
this.window = window;
}
@@ -165,6 +165,6 @@ public class ControlLiquidTank extends Control implements ITooltip {
}
static {
ControlLiquidTank.tankError = new ArrayList<Integer>();
ControlLiquidTank.tankError = new ArrayList<>();
}
}
@@ -14,7 +14,7 @@ public class ControlPlayerInventory extends Control {
public ControlPlayerInventory(final IWidget parent, final boolean wide) {
super(parent, (int) (parent.getSize().x() / 2.0f) - (wide ? 110 : 81), (int) parent.getSize().y() - (wide ? 54 : 76) - 12, wide ? 220 : 162, wide ? 54 : 76);
this.slots = new ArrayList<ControlSlot>();
this.slots = new ArrayList<>();
for (int row = 0; row < 3; ++row) {
for (int column = 0; column < 9; ++column) {
final ControlSlot slot = new ControlSlot(this, (wide ? 58 : 0) + column * 18, row * 18);
@@ -41,7 +41,7 @@ public class ControlPlayerInventory extends Control {
public ControlPlayerInventory(final IWidget parent, final int x, final int y) {
super(parent, x, y, 54.0f, 220.0f);
this.slots = new ArrayList<ControlSlot>();
this.slots = new ArrayList<>();
for (int row = 0; row < 6; ++row) {
for (int column = 0; column < 6; ++column) {
final ControlSlot slot = new ControlSlot(this, column * 18, row * 18);
@@ -136,7 +136,7 @@ public class ControlSlot extends ControlSlotBase {
}
private List<ControlSlot> getControlSlots() {
final List<ControlSlot> slots = new ArrayList<ControlSlot>();
final List<ControlSlot> slots = new ArrayList<>();
if (this.getParent() instanceof ControlSlotArray || this.getParent() instanceof ControlPlayerInventory) {
for (final IWidget child : this.getParent().getWidgets()) {
slots.add((ControlSlot) child);
@@ -194,10 +194,10 @@ public class ControlSlot extends ControlSlotBase {
}
static {
ControlSlot.highlighting = new HashMap<EnumHighlighting, List<Integer>>();
ControlSlot.highlighting = new HashMap<>();
ControlSlot.shiftClickActive = false;
for (final EnumHighlighting h : EnumHighlighting.values()) {
ControlSlot.highlighting.put(h, new ArrayList<Integer>());
ControlSlot.highlighting.put(h, new ArrayList<>());
}
}
}
@@ -16,7 +16,7 @@ public class ControlSlotArray extends Control implements Iterable<ControlSlot> {
public ControlSlotArray(final IWidget parent, final int x, final int y, final int columns, final int rows) {
super(parent, x, y, columns * 18, rows * 18);
this.slots = new ArrayList<ControlSlot>();
this.slots = new ArrayList<>();
this.rows = rows;
this.columns = columns;
for (int row = 0; row < rows; ++row) {
@@ -30,7 +30,7 @@ public class ControlSpeciesBox extends ControlListBox<IAlleleSpecies> {
public void setBranch(final IClassification branch) {
if (branch != this.branch) {
this.branch = branch;
final List<IAlleleSpecies> speciesList2 = new ArrayList<IAlleleSpecies>();
final List<IAlleleSpecies> speciesList2 = new ArrayList<>();
this.movePercentage(-100.0f);
this.setOptions(speciesList2);
final EntityPlayer player = Window.get(this).getPlayer();
@@ -17,7 +17,7 @@ public class PageBranchOverview extends PageBranch {
public PageBranchOverview(final IWidget parent, final DatabaseTab tab) {
super(parent, tab);
this.pageBranchOverview_branchDescription = new ArrayList<ControlText>();
this.pageBranchOverview_branchDescription = new ArrayList<>();
this.pageBranchOverview_branchName = new ControlTextCentered(this, 8.0f, "");
this.pageBranchOverview_branchScientific = new ControlTextCentered(this, 32.0f, "");
this.pageBranchOverview_branchAuthority = new ControlTextCentered(this, 44.0f, "");
@@ -37,7 +37,7 @@ public class PageBranchOverview extends PageBranch {
desc = "No Description Provided.";
}
String line = "";
final List<String> descLines = new ArrayList<String>();
final List<String> descLines = new ArrayList<>();
for (final String str : desc.split(" ")) {
if (CraftGUI.Render.textWidth(line + " " + str) > 134) {
descLines.add("§o" + line + "§r");
@@ -15,7 +15,7 @@ public class PageSpeciesClassification extends PageSpecies {
public PageSpeciesClassification(final IWidget parent, final DatabaseTab tab) {
super(parent, tab);
this.levels = new LinkedHashMap<IClassification.EnumClassLevel, ControlText>();
this.levels = new LinkedHashMap<>();
int y = 16;
for (final IClassification.EnumClassLevel level : IClassification.EnumClassLevel.values()) {
final ControlText text = new ControlTextCentered(this, y, "");
@@ -55,7 +55,7 @@ public abstract class WindowAbstractDatabase extends Window {
public WindowAbstractDatabase(final EntityPlayer player, final Side side, final boolean nei, final BreedingSystem system, final float wid) {
super(100.0f, 192.0f, player, null, side);
this.selectionBoxWidth = 95.0f;
this.modes = new HashMap<IDatabaseMode, ModeWidgets>();
this.modes = new HashMap<>();
this.panelInformation = null;
this.panelSearch = null;
this.modePages = null;
@@ -129,7 +129,7 @@ public abstract class WindowAbstractDatabase extends Window {
new ControlHelp(this, 4.0f, 4.0f);
(this.panelInformation = new Panel(this, 24.0f, 24.0f, 144.0f, 176.0f, MinecraftGUI.PanelType.Black)).setColour(860416);
(this.panelSearch = new Panel(this, 176.0f, 24.0f, this.selectionBoxWidth, 160.0f, MinecraftGUI.PanelType.Black)).setColour(860416);
this.modePages = new ControlPages<IDatabaseMode>(this, 0.0f, 0.0f, this.getSize().x(), this.getSize().y());
this.modePages = new ControlPages<>(this, 0.0f, 0.0f, this.getSize().x(), this.getSize().y());
new ControlTextEdit(this, 176.0f, 184.0f, this.selectionBoxWidth, 16.0f);
this.createMode(Mode.Species, new ModeWidgets(Mode.Species, this) {
@Override
@@ -228,12 +228,12 @@ public abstract class WindowAbstractDatabase extends Window {
public ModeWidgets(final IDatabaseMode mode, final WindowAbstractDatabase database) {
this.database = database;
this.modePage = new ControlPage<IDatabaseMode>(database.modePages, 0.0f, 0.0f, database.getSize().x(), database.getSize().y(), mode);
this.modePage = new ControlPage<>(database.modePages, 0.0f, 0.0f, database.getSize().x(), database.getSize().y(), mode);
final IArea listBoxArea = database.panelSearch.area().inset(2);
this.createListBox(listBoxArea);
CraftGUIUtil.alignToWidget(this.listBox, database.panelSearch);
CraftGUIUtil.moveWidget(this.listBox, new IPoint(2.0f, 2.0f));
CraftGUIUtil.alignToWidget(this.infoPages = new ControlPages<DatabaseTab>(this.modePage, 0.0f, 0.0f, 144.0f, 176.0f), database.panelInformation);
CraftGUIUtil.alignToWidget(this.infoPages = new ControlPages<>(this.modePage, 0.0f, 0.0f, 144.0f, 176.0f), database.panelInformation);
}
public abstract void createListBox(final IArea p0);
@@ -7,7 +7,7 @@ public class StyleSheet implements IStyleSheet {
protected Map<Object, Texture> textures;
public StyleSheet() {
this.textures = new HashMap<Object, Texture>();
this.textures = new HashMap<>();
}
@Override
@@ -32,8 +32,8 @@ public class CraftGUIResourceManager implements IResourceManagerReloadListener {
private Map<String, Texture> textures;
public CraftGUIResourceManager() {
this.textureSheets = new HashMap<String, ParsedTextureSheet>();
this.textures = new HashMap<String, Texture>();
this.textureSheets = new HashMap<>();
this.textures = new HashMap<>();
CraftGUI.ResourceManager = this;
}
@@ -88,7 +88,7 @@ public class CraftGUIResourceManager implements IResourceManagerReloadListener {
if (split.length < 1 || split.length > 4) {
throw new RuntimeException("Parameter must have between one and four numbers");
}
final List<Float> f = new ArrayList<Float>();
final List<Float> f = new ArrayList<>();
for (final String string : split) {
f.add(Float.parseFloat(string));
}
@@ -109,7 +109,7 @@ public class CraftGUIResourceManager implements IResourceManagerReloadListener {
if (split.length < 1 || split.length > 4) {
throw new RuntimeException("Parameter must have between one and four numbers");
}
final List<Float> f = new ArrayList<Float>();
final List<Float> f = new ArrayList<>();
for (final String string : split) {
f.add(Float.parseFloat(string));
}
@@ -40,7 +40,7 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
}
public List<TileEntity> getAlvearyBlocks() {
LinkedList<TileEntity> tiles = new LinkedList<TileEntity>();
LinkedList<TileEntity> tiles = new LinkedList<>();
if (min != null && max != null) {
for (int x = min.getX(); x <= max.getX(); ++x) {
for (int z = min.getZ(); z <= max.getZ(); ++z) {
@@ -53,7 +53,7 @@ public class AlvearyMutator {
static {
AlvearyMutator.slotMutator = 0;
AlvearyMutator.mutations = new HashMap<ItemStack, Float>();
AlvearyMutator.mutations = new HashMap<>();
}
public static class PackageAlvearyMutator extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
@@ -101,7 +101,7 @@ public class AlvearyStimulator {
return new StimulatorCircuit[0];
}
final ICircuit[] circuits = board.getCircuits();
final List<IBeeModifier> mod = new ArrayList<IBeeModifier>();
final List<IBeeModifier> mod = new ArrayList<>();
for (final ICircuit circuit : circuits) {
if (circuit instanceof StimulatorCircuit) {
mod.add((IBeeModifier) circuit);
@@ -268,7 +268,7 @@ public class ExtraBeeMutation implements IBeeMutation {
@Override
public Collection<String> getSpecialConditions() {
final List<String> conditions = new ArrayList<String>();
final List<String> conditions = new ArrayList<>();
if (this.req != null) {
for (final String s : this.req.tooltip()) {
conditions.add(s);
@@ -283,7 +283,7 @@ public class ExtraBeeMutation implements IBeeMutation {
}
static {
ExtraBeeMutation.mutations = new ArrayList<IBeeMutation>();
ExtraBeeMutation.mutations = new ArrayList<>();
}
abstract static class MutationRequirement {
@@ -68,7 +68,7 @@ public enum ExtraBeesBranch implements IClassification {
private ExtraBeesBranch(final String scientific) {
this.uid = "";
this.scientific = "";
this.speciesSet = new LinkedHashSet<IAlleleBeeSpecies>();
this.speciesSet = new LinkedHashSet<>();
this.scientific = scientific;
this.uid = this.toString().toLowerCase();
}
@@ -210,7 +210,7 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
@Override
public ItemStack[] affectProducts(World world, IIndividual individual, BlockPos pos, ItemStack[] products) {
if (this == ExtraBeesFlowers.Mystical) {
final List<ItemStack> prods = new ArrayList<ItemStack>();
final List<ItemStack> prods = new ArrayList<>();
for (final ItemStack stack : products) {
prods.add(stack);
}
@@ -188,10 +188,10 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
this.uid = "";
this.achievement = null;
this.dominant = true;
this.products = new LinkedHashMap<ItemStack, Float>();
this.specialties = new LinkedHashMap<ItemStack, Float>();
this.allProducts = new LinkedHashMap<ItemStack, Float>();
this.allSpecialties = new LinkedHashMap<ItemStack, Float>();
this.products = new LinkedHashMap<>();
this.specialties = new LinkedHashMap<>();
this.allProducts = new LinkedHashMap<>();
this.allSpecialties = new LinkedHashMap<>();
this.state = State.Active;
this.nocturnal = false;
this.uid = this.toString().toLowerCase();
@@ -212,10 +212,10 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
this.uid = "";
this.achievement = null;
this.dominant = true;
this.products = new LinkedHashMap<ItemStack, Float>();
this.specialties = new LinkedHashMap<ItemStack, Float>();
this.allProducts = new LinkedHashMap<ItemStack, Float>();
this.allSpecialties = new LinkedHashMap<ItemStack, Float>();
this.products = new LinkedHashMap<>();
this.specialties = new LinkedHashMap<>();
this.allProducts = new LinkedHashMap<>();
this.allSpecialties = new LinkedHashMap<>();
this.state = State.Active;
this.nocturnal = false;
this.state = State.Deprecated;
@@ -1006,7 +1006,7 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
@Override
public ItemStack[] getResearchBounty(final World world, final GameProfile researcher, final IIndividual individual, final int bountyLevel) {
final ArrayList<ItemStack> bounty = new ArrayList<ItemStack>();
final ArrayList<ItemStack> bounty = new ArrayList<>();
ItemStack research = null;
if (world.rand.nextFloat() < 10.0f / bountyLevel) {
final Collection<? extends IMutation> combinations = this.getRoot().getCombinations(this);
@@ -1040,7 +1040,7 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
@Override
public int getComplexity() {
return 1 + this.getGeneticAdvancement(this, new ArrayList<IAllele>());
return 1 + this.getGeneticAdvancement(this, new ArrayList<>());
}
private int getGeneticAdvancement(final IAllele species, final ArrayList<IAllele> exclude) {
@@ -552,7 +552,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
}
static {
(ExtraBeesEffect.birthdays = new ArrayList<Birthday>()).add(new Birthday(3, 10, "Binnie"));
(ExtraBeesEffect.birthdays = new ArrayList<>()).add(new Birthday(3, 10, "Binnie"));
}
public static class Birthday {
@@ -25,7 +25,7 @@ public class FireworkCreator {
public Firework() {
this.flicker = false;
this.trail = false;
this.colors = new ArrayList<Integer>();
this.colors = new ArrayList<>();
this.shape = 0;
}
@@ -18,7 +18,7 @@ public class ControlBiomes extends Control implements ITooltip {
public ControlBiomes(final IWidget parent, final int x, final int y, final int width, final int height) {
super(parent, x, y, width * 16, height * 16);
this.tolerated = new ArrayList<Integer>();
this.tolerated = new ArrayList<>();
this.addAttribute(Attribute.MouseOver);
}
@@ -23,7 +23,7 @@ public class ControlClimateBar extends Control implements ITooltip {
public ControlClimateBar(final IWidget parent, final int x, final int y, final int width, final int height) {
super(parent, x, y, width, height);
this.isHumidity = false;
this.tolerated = new ArrayList<Integer>();
this.tolerated = new ArrayList<>();
this.tempColours = new int[]{65531, 7912447, 5242672, 16776960, 16753152, 16711680};
this.humidColours = new int[]{16770979, 1769216, 3177727};
this.addAttribute(Attribute.MouseOver);
@@ -32,7 +32,7 @@ public class ControlClimateBar extends Control implements ITooltip {
public ControlClimateBar(final IWidget parent, final int x, final int y, final int width, final int height, final boolean humidity) {
super(parent, x, y, width, height);
this.isHumidity = false;
this.tolerated = new ArrayList<Integer>();
this.tolerated = new ArrayList<>();
this.tempColours = new int[]{65531, 7912447, 5242672, 16776960, 16753152, 16711680};
this.humidColours = new int[]{16770979, 1769216, 3177727};
this.addAttribute(Attribute.MouseOver);
@@ -38,7 +38,7 @@ public class ControlProductsBox extends ControlListBox<ControlProductsBox.Produc
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template);
final float speed = genome.getSpeed();
final float modeSpeed = Binnie.Genetics.getBeeRoot().getBeekeepingMode(BinnieCore.proxy.getWorld()).getBeeModifier().getProductionModifier(genome, 1.0f);
final List<Product> strings = new ArrayList<Product>();
final List<Product> strings = new ArrayList<>();
if (this.type == Type.Products) {
for (final Map.Entry<ItemStack, Float> entry : species.getProductChances().entrySet()) {
strings.add(new Product(entry.getKey(), speed * modeSpeed * entry.getValue()));
@@ -44,7 +44,7 @@ public class ControlPunnett extends Control {
for (final IAllele allele1 : new IAllele[]{primary1, secondary1}) {
y = 1;
for (final IAllele allele2 : new IAllele[]{primary2, secondary2}) {
final List<IAllele> alleles = new LinkedList<IAllele>();
final List<IAllele> alleles = new LinkedList<>();
if (allele1.isDominant() && !allele2.isDominant()) {
alleles.add(allele1);
} else if (allele2.isDominant() && !allele1.isDominant()) {
@@ -110,7 +110,7 @@ public enum EnumHoneyComb implements IItemEnum {
private EnumHoneyComb(final int colour, final int colour2) {
this.colour = new int[0];
this.products = new LinkedHashMap<ItemStack, Float>();
this.products = new LinkedHashMap<>();
this.active = true;
this.deprecated = false;
this.colour = new int[]{colour, colour2};
@@ -64,7 +64,7 @@ public class BlockExtraBeeHive extends Block {
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
final ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
final ArrayList<ItemStack> ret = new ArrayList<>();
final List<IHiveDrop> dropList = state.getValue(hiveType).drops;
Collections.shuffle(dropList);
int tries = 0;
@@ -15,7 +15,7 @@ public enum EnumHiveType implements IStringSerializable {
public List<IHiveDrop> drops;
private EnumHiveType() {
this.drops = new ArrayList<IHiveDrop>();
this.drops = new ArrayList<>();
}
@Override
@@ -22,7 +22,7 @@ public class HiveDrop implements IHiveDrop {
}
public HiveDrop(IAllele[] template, final ItemStack[] bonus, final int chance) {
this.additional = new ArrayList<ItemStack>();
this.additional = new ArrayList<>();
if (template == null) {
template = Binnie.Genetics.getBeeRoot().getDefaultTemplate();
}
@@ -35,7 +35,7 @@ public class HiveDrop implements IHiveDrop {
@Override
public Collection<ItemStack> getExtraItems(IBlockAccess world, BlockPos pos, int fortune) {
final ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
final ArrayList<ItemStack> ret = new ArrayList<>();
for (final ItemStack stack : this.additional) {
ret.add(stack.copy());
}
@@ -58,7 +58,7 @@ public enum Alcohol implements IFluidType, ICocktailLiquid {
}
private Alcohol(final String ident, final int colour, final double transparency, final double abv) {
this.fermentationLiquid = new ArrayList<String>();
this.fermentationLiquid = new ArrayList<>();
this.fermentationSolid = "";
this.ident = ident;
this.colour = colour;
@@ -44,7 +44,7 @@ public enum Cocktail {
public Map<ICocktailIngredient, Integer> ingredients;
private Cocktail(final String name, final Glassware glassware, final int colour) {
this.ingredients = new HashMap<ICocktailIngredient, Integer>();
this.ingredients = new HashMap<>();
this.name = name;
this.glassware = glassware;
this.colour = colour;
@@ -83,7 +83,7 @@ public enum Cocktail {
}
static {
cocktailIngredients = new HashMap<String, ICocktailIngredient>();
cocktailIngredients = new HashMap<>();
Cocktail.Bellini.add(Alcohol.SparklingWine, 2);
Cocktail.Bellini.add(Juice.Peach, 1);
Cocktail.BlackRussian.add(Spirit.Vodka, 5);
Loaded 100 of 140 files, more files were not shown because too many files have changed in this diff. Show more