mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-26 23:12:58 +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
@@ -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());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user