mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-28 07:56:01 +00:00
Use diamond operator everywhere
This commit is contained in:
1 parent
9812ddc4ce
commit
55c58cf5d9
140 files changed
+305
-305
No files matched your search
@@ -19,7 +19,7 @@ public class GeneArrayItem implements INbtReadable, INbtWritable, IGeneItem {
|
||||
List<IGene> genes;
|
||||
|
||||
public GeneArrayItem(final ItemStack stack) {
|
||||
this.genes = new ArrayList<IGene>();
|
||||
this.genes = new ArrayList<>();
|
||||
if (stack == null) {
|
||||
return;
|
||||
}
|
||||
@@ -27,12 +27,12 @@ public class GeneArrayItem implements INbtReadable, INbtWritable, IGeneItem {
|
||||
}
|
||||
|
||||
public GeneArrayItem(final IGene gene) {
|
||||
this.genes = new ArrayList<IGene>();
|
||||
this.genes = new ArrayList<>();
|
||||
this.addGene(gene);
|
||||
}
|
||||
|
||||
public GeneArrayItem() {
|
||||
this.genes = new ArrayList<IGene>();
|
||||
this.genes = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,7 +45,7 @@ public class GeneArrayItem implements INbtReadable, INbtWritable, IGeneItem {
|
||||
|
||||
@Override
|
||||
public void getInfo(final List list) {
|
||||
final List<Object> totalList = new ArrayList<Object>();
|
||||
final List<Object> totalList = new ArrayList<>();
|
||||
for (final IGene gene : this.genes) {
|
||||
final String chromosomeName = this.getBreedingSystem().getChromosomeName(gene.getChromosome());
|
||||
totalList.add("§6" + chromosomeName + "§7: " + gene.getName());
|
||||
|
||||
@@ -14,7 +14,7 @@ public class GeneProject {
|
||||
public GeneProject(final int id, final String name, final GameProfile leader) {
|
||||
this.id = 0;
|
||||
this.leader = null;
|
||||
this.members = new ArrayList<GameProfile>();
|
||||
this.members = new ArrayList<>();
|
||||
this.setID(id);
|
||||
this.setName(name);
|
||||
this.setLeader(leader);
|
||||
|
||||
@@ -16,8 +16,8 @@ public class GeneProjectTracker extends WorldSavedData {
|
||||
|
||||
public GeneProjectTracker(final String s) {
|
||||
super(s);
|
||||
this.projects = new HashMap<Integer, GeneProject>();
|
||||
this.TeamInvites = new HashMap<GameProfile, Set<Integer>>();
|
||||
this.projects = new HashMap<>();
|
||||
this.TeamInvites = new HashMap<>();
|
||||
}
|
||||
|
||||
public static GeneProjectTracker getTracker(final World world) {
|
||||
@@ -101,7 +101,7 @@ public class GeneProjectTracker extends WorldSavedData {
|
||||
|
||||
public void invitePlayer(final int id, final GameProfile player) {
|
||||
if (!this.TeamInvites.containsKey(player)) {
|
||||
this.TeamInvites.put(player, new LinkedHashSet<Integer>());
|
||||
this.TeamInvites.put(player, new LinkedHashSet<>());
|
||||
}
|
||||
this.TeamInvites.get(player).add(id);
|
||||
this.markDirty();
|
||||
@@ -109,7 +109,7 @@ public class GeneProjectTracker extends WorldSavedData {
|
||||
|
||||
public void revokeInvite(final int id, final GameProfile player) {
|
||||
if (!this.TeamInvites.containsKey(player)) {
|
||||
this.TeamInvites.put(player, new LinkedHashSet<Integer>());
|
||||
this.TeamInvites.put(player, new LinkedHashSet<>());
|
||||
}
|
||||
this.TeamInvites.get(player).add(id);
|
||||
this.markDirty();
|
||||
|
||||
@@ -25,13 +25,13 @@ public class GeneTracker extends WorldSavedData {
|
||||
|
||||
public GeneTracker(final String s, final GameProfile username) {
|
||||
super(s);
|
||||
this.discoveredGenes = new ArrayList<IGene>();
|
||||
this.discoveredGenes = new ArrayList<>();
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public GeneTracker(final String s) {
|
||||
super(s);
|
||||
this.discoveredGenes = new ArrayList<IGene>();
|
||||
this.discoveredGenes = new ArrayList<>();
|
||||
}
|
||||
|
||||
protected static GeneTracker getCommonTracker(final EntityPlayer player) {
|
||||
|
||||
@@ -11,12 +11,12 @@ public class GeneticEngineeringSystem {
|
||||
static List<IAllele> speciesList;
|
||||
|
||||
public GeneticEngineeringSystem(final BreedingSystem system) {
|
||||
this.chromosomeMap = new HashMap<IChromosomeType, List<IAllele>>();
|
||||
this.chromosomeMap = new HashMap<>();
|
||||
this.breedingSystem = system;
|
||||
for (final IIndividual indiv : this.breedingSystem.getSpeciesRoot().getIndividualTemplates()) {
|
||||
for (final IChromosomeType chromosome : this.breedingSystem.getSpeciesRoot().getKaryotype()) {
|
||||
if (!this.chromosomeMap.containsKey(chromosome)) {
|
||||
this.chromosomeMap.put(chromosome, new ArrayList<IAllele>());
|
||||
this.chromosomeMap.put(chromosome, new ArrayList<>());
|
||||
}
|
||||
try {
|
||||
final IAllele a1 = indiv.getGenome().getActiveAllele(chromosome);
|
||||
@@ -33,9 +33,9 @@ public class GeneticEngineeringSystem {
|
||||
}
|
||||
for (final IChromosomeType chromosome2 : this.breedingSystem.getSpeciesRoot().getKaryotype()) {
|
||||
final List<IAllele> alleles = this.getAlleles(chromosome2);
|
||||
final TreeSet<IAllele> set = new TreeSet<IAllele>(new ComparatorAllele());
|
||||
final TreeSet<IAllele> set = new TreeSet<>(new ComparatorAllele());
|
||||
set.addAll(alleles);
|
||||
final List<IAllele> list = new ArrayList<IAllele>();
|
||||
final List<IAllele> list = new ArrayList<>();
|
||||
list.addAll(set);
|
||||
this.chromosomeMap.put(chromosome2, list);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class AnalystPageClimate extends ControlAnalystPage {
|
||||
}
|
||||
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Biomes", TextJustification.MiddleCenter).setColour(this.getColour());
|
||||
y += 12;
|
||||
final List<Biome> biomes = new ArrayList<Biome>();
|
||||
final List<Biome> biomes = new ArrayList<>();
|
||||
for (final Biome biome : Biome.EXPLORATION_BIOMES_LIST) { //TODO check
|
||||
if (biome != null) {
|
||||
if (BiomeDictionary.isBiomeRegistered(biome)) {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
|
||||
new ControlTextEdit(this, 20.0f, y, this.w() - 40.0f, 16.0f) {
|
||||
@Override
|
||||
public void onTextEdit(final String value) {
|
||||
final Collection<IAlleleSpecies> options = new ArrayList<IAlleleSpecies>();
|
||||
final Collection<IAlleleSpecies> options = new ArrayList<>();
|
||||
AnalystPageDatabase.this.getSpecies(system);
|
||||
for (final IAlleleSpecies species : AnalystPageDatabase.this.getSpecies(system)) {
|
||||
if (value != null) {
|
||||
@@ -173,7 +173,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
|
||||
}
|
||||
|
||||
private Collection<IAlleleSpecies> getSpecies(final BreedingSystem system) {
|
||||
final Collection<IAlleleSpecies> species = new ArrayList<IAlleleSpecies>();
|
||||
final Collection<IAlleleSpecies> species = new ArrayList<>();
|
||||
species.addAll(this.isMaster ? system.getAllSpecies() : system.getDiscoveredSpecies(this.getWindow().getWorld(), this.getWindow().getPlayer().getGameProfile()));
|
||||
return species;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
}
|
||||
|
||||
public Collection<ItemStack> getCentrifuge(final ItemStack stack) {
|
||||
final List<ItemStack> products = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> products = new ArrayList<>();
|
||||
for (final ICentrifugeRecipe recipe : RecipeManagers.centrifugeManager.recipes()) {
|
||||
boolean isRecipe = false;
|
||||
if (recipe.getInput() instanceof ItemStack && stack.isItemEqual((ItemStack) recipe.getInput())) {
|
||||
@@ -59,7 +59,7 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
}
|
||||
|
||||
public Collection<ItemStack> getSqueezer(final ItemStack stack) {
|
||||
final List<ItemStack> products = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> products = new ArrayList<>();
|
||||
for (ISqueezerRecipe recipe : RecipeManagers.squeezerManager.recipes()) {
|
||||
boolean isRecipe = false;
|
||||
for (final Object obj : recipe.getResources()) {
|
||||
@@ -77,7 +77,7 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
}
|
||||
|
||||
public Collection<ItemStack> getCrafting(final ItemStack stack) {
|
||||
final List<ItemStack> products = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> products = new ArrayList<>();
|
||||
for (final Object recipeO : CraftingManager.getInstance().getRecipeList()) {
|
||||
if (recipeO instanceof ShapelessRecipes) {
|
||||
final ShapelessRecipes recipe = (ShapelessRecipes) recipeO;
|
||||
@@ -121,7 +121,7 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
}
|
||||
|
||||
public Collection<FluidStack> getAllFluids(final ItemStack stack) {
|
||||
final List<FluidStack> products = new ArrayList<FluidStack>();
|
||||
final List<FluidStack> products = new ArrayList<>();
|
||||
products.addAll(this.getSqueezerFluid(stack));
|
||||
if (Press.getOutput(stack) != null) {
|
||||
products.add(Press.getOutput(stack));
|
||||
@@ -130,7 +130,7 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
}
|
||||
|
||||
public Collection<FluidStack> getSqueezerFluid(final ItemStack stack) {
|
||||
final List<FluidStack> products = new ArrayList<FluidStack>();
|
||||
final List<FluidStack> products = new ArrayList<>();
|
||||
for (final ISqueezerRecipe recipe : RecipeManagers.squeezerManager.recipes()) {
|
||||
boolean isRecipe = false;
|
||||
for (final Object obj : recipe.getResources()) {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class AnalystPageProducts extends AnalystPageProduce {
|
||||
final Collection<ItemStack> refinedProducts = new UniqueItemStackSet();
|
||||
final Collection<ItemStack> productList = new UniqueItemStackSet();
|
||||
final Collection<ItemStack> specialtyList = new UniqueItemStackSet();
|
||||
Map<ItemStack, Float> products = new HashMap<ItemStack, Float>();
|
||||
Map<ItemStack, Float> products = new HashMap<>();
|
||||
products.putAll(genome.getPrimary().getProductChances());
|
||||
products.putAll(genome.getSecondary().getProductChances());
|
||||
if (!products.isEmpty()) {
|
||||
@@ -81,7 +81,7 @@ public class AnalystPageProducts extends AnalystPageProduce {
|
||||
level2Products.addAll(this.getAllProducts(stack));
|
||||
}
|
||||
refinedProducts.addAll(level2Products);
|
||||
final Collection<FluidStack> allFluids = new ArrayList<FluidStack>();
|
||||
final Collection<FluidStack> allFluids = new ArrayList<>();
|
||||
for (final ItemStack stack2 : refinedProducts) {
|
||||
for (final FluidStack addition : this.getAllFluids(stack2)) {
|
||||
boolean alreadyIn = false;
|
||||
|
||||
@@ -84,7 +84,7 @@ public class AnalystPageSoil extends ControlAnalystPage {
|
||||
y += 32;
|
||||
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Other Soils", TextJustification.MiddleCenter).setColour(this.getColour());
|
||||
y += 12;
|
||||
final List<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> stacks = new ArrayList<>();
|
||||
for (final EnumAcidity a : EnumSet.range(EnumAcidity.Acid, EnumAcidity.Alkaline)) {
|
||||
for (final EnumMoisture b : EnumSet.range(EnumMoisture.Dry, EnumMoisture.Damp)) {
|
||||
if (Tolerance.canTolerate(pH, a, pHTol) && Tolerance.canTolerate(moisture, b, moistureTol) && (a != recomPH || b != recomMoisture)) {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ControlChromoPicker extends Control implements ITooltip {
|
||||
this.addSelfEventHandler(new EventWidget.EndMouseOver.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventWidget.EndMouseOver event) {
|
||||
ControlChromoPicker.this.callEvent(new EventValueChanged<Object>(ControlChromoPicker.this.getWidget(), null));
|
||||
ControlChromoPicker.this.callEvent(new EventValueChanged<>(ControlChromoPicker.this.getWidget(), null));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class WindowAnalyst extends Window {
|
||||
super(312.0f, 230.0f, player, inventory, side);
|
||||
this.baseWidget = null;
|
||||
this.tabBar = null;
|
||||
this.analystPages = new ArrayList<ControlAnalystPage>();
|
||||
this.analystPages = new ArrayList<>();
|
||||
this.analystPageSize = null;
|
||||
this.isDatabase = false;
|
||||
this.isMaster = false;
|
||||
|
||||
@@ -169,9 +169,9 @@ public class Acclimatiser {
|
||||
slotReserve = new int[]{0, 1, 2, 3};
|
||||
slotAcclimatiser = new int[]{5, 6, 7};
|
||||
slotDone = new int[]{8, 9, 10, 11};
|
||||
Acclimatiser.toleranceSystems = new ArrayList<ToleranceSystem>();
|
||||
Acclimatiser.temperatureItems = new HashMap<ItemStack, Float>();
|
||||
Acclimatiser.humidityItems = new HashMap<ItemStack, Float>();
|
||||
Acclimatiser.toleranceSystems = new ArrayList<>();
|
||||
Acclimatiser.temperatureItems = new HashMap<>();
|
||||
Acclimatiser.humidityItems = new HashMap<>();
|
||||
}
|
||||
|
||||
public static class PackageAcclimatiser extends GeneticMachine.PackageGeneticBase implements IMachineInformation {
|
||||
@@ -258,7 +258,7 @@ public class Acclimatiser {
|
||||
}
|
||||
|
||||
protected void attemptAcclimatisation() {
|
||||
final List<ItemStack> acclms = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> acclms = new ArrayList<>();
|
||||
for (final ItemStack s : this.getUtil().getNonNullStacks(Acclimatiser.slotAcclimatiser)) {
|
||||
if (Acclimatiser.canAcclimatise(this.getUtil().getStack(4), s)) {
|
||||
acclms.add(s);
|
||||
|
||||
@@ -30,8 +30,8 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
super(machine);
|
||||
this.indexerSize = -1;
|
||||
this.guiRefreshCounter = 0;
|
||||
this.indexerInventory = new SetList<ItemStack>();
|
||||
this.sortedInventory = new SetList<Integer>();
|
||||
this.indexerInventory = new SetList<>();
|
||||
this.sortedInventory = new SetList<>();
|
||||
this.needsSorting = true;
|
||||
}
|
||||
|
||||
@@ -173,17 +173,17 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
public List<ItemStack> bees;
|
||||
|
||||
SpeciesList() {
|
||||
this.drones = new ArrayList<Integer>();
|
||||
this.queens = new ArrayList<Integer>();
|
||||
this.princesses = new ArrayList<Integer>();
|
||||
this.bees = new ArrayList<ItemStack>();
|
||||
this.drones = new ArrayList<>();
|
||||
this.queens = new ArrayList<>();
|
||||
this.princesses = new ArrayList<>();
|
||||
this.bees = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void add(final ItemStack stack) {
|
||||
this.bees.add(stack);
|
||||
}
|
||||
}
|
||||
final Map<Integer, SpeciesList> speciesList = new HashMap<Integer, SpeciesList>();
|
||||
final Map<Integer, SpeciesList> speciesList = new HashMap<>();
|
||||
for (final ItemStack itemStack : this.indexerInventory) {
|
||||
final int species = itemStack.getItemDamage();
|
||||
if (!speciesList.containsKey(species)) {
|
||||
@@ -202,7 +202,7 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
}
|
||||
}
|
||||
}
|
||||
this.sortedInventory = new SetList<Integer>();
|
||||
this.sortedInventory = new SetList<>();
|
||||
switch (this.sortingMode) {
|
||||
case Species: {
|
||||
for (int j = 0; j < 1024; ++j) {
|
||||
|
||||
@@ -107,7 +107,7 @@ public class Incubator {
|
||||
static {
|
||||
slotQueue = new int[]{0, 1, 2};
|
||||
slotOutput = new int[]{4, 5, 6};
|
||||
Incubator.RECIPES = new ArrayList<IIncubatorRecipe>();
|
||||
Incubator.RECIPES = new ArrayList<>();
|
||||
}
|
||||
|
||||
public static class PackageIncubator extends GeneticMachine.PackageGeneticBase implements IMachineInformation {
|
||||
|
||||
Reference in new issue
Block a user