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

@@ -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);
@@ -59,7 +59,7 @@ public class ModuleAlcohol implements IInitializable {
public void postInit() {
for (final Juice juice : Juice.values()) {
final String oreDict = juice.squeezing;
final List<ItemStack> ores = new ArrayList<ItemStack>();
final List<ItemStack> ores = new ArrayList<>();
ores.addAll(OreDictionary.getOres(oreDict));
for (final Food food : Food.values()) {
if (food.getOres().contains(oreDict)) {
@@ -27,6 +27,6 @@ public class DrinkManager {
}
static {
DrinkManager.drinkLiquids = new HashMap<String, IDrinkLiquid>();
DrinkManager.drinkLiquids = new HashMap<>();
}
}
@@ -71,7 +71,7 @@ public class ModuleBlocks implements IInitializable {
}
};
GameRegistry.register(block);
Item wood = GameRegistry.register(new BlockETLog.LogItemBlock<BlockETLog>(block));
Item wood = GameRegistry.register(new BlockETLog.LogItemBlock<>(block));
WoodAccess.registerWithVariants(block,WoodBlockKind.LOG, woodTypes[finalI]);
ExtraTrees.proxy.setCustomStateMapper("log", block);
@@ -85,7 +85,7 @@ public class ModuleBlocks implements IInitializable {
};
GameRegistry.register(block2);
ExtraTrees.proxy.setCustomStateMapper("log", block2);
Item woodFireproof = GameRegistry.register(new BlockETLog.LogItemBlock<BlockETLog>(block2));
Item woodFireproof = GameRegistry.register(new BlockETLog.LogItemBlock<>(block2));
for(EnumExtraTreeLog l : woodTypes[finalI].getAllowedValues()) {
BinnieCore.proxy.registermodel(wood, l.getMetadata() % BlockETLog.VARIANTS_PER_BLOCK, new ModelResourceLocation("extratrees:log","axis=y,wood_type="+l.getName()));
BinnieCore.proxy.registermodel(woodFireproof, l.getMetadata() % BlockETLog.VARIANTS_PER_BLOCK, new ModelResourceLocation("extratrees:log","axis=y,wood_type="+l.getName()));
@@ -91,7 +91,7 @@ public class WoodManager {
}
public static List<IPlankType> getAllPlankTypes() {
final List<IPlankType> list = new ArrayList<IPlankType>();
final List<IPlankType> list = new ArrayList<>();
for (final IPlankType type : PlankType.ExtraTreePlanks.values()) {
list.add(type);
}
@@ -30,7 +30,7 @@ public class FenceType {
}
public static Collection<FenceType> values() {
final List<FenceType> list = new ArrayList<FenceType>();
final List<FenceType> list = new ArrayList<>();
for (int size = 0; size < 3; ++size) {
for (final boolean solid : new boolean[]{false, true}) {
for (final boolean embedded : new boolean[]{false, true}) {
@@ -17,7 +17,7 @@ public class MultiFenceRecipeSize implements IRecipe {
@Override
public boolean matches(final InventoryCrafting inv, final World world) {
String pattern = "";
final List<IPlankType> types = new ArrayList<IPlankType>();
final List<IPlankType> types = new ArrayList<>();
for (int i = 0; i < inv.getSizeInventory(); ++i) {
final ItemStack stack = inv.getStackInSlot(i);
final IPlankType type = (stack == null) ? null : WoodManager.get(stack);
@@ -52,6 +52,6 @@ public class NBTShapedRecipes implements IRecipe {
}
static {
NBTShapedRecipes.recipes = new ArrayList<NBTShapedRecipe>();
NBTShapedRecipes.recipes = new ArrayList<>();
}
}
@@ -67,7 +67,7 @@ public class CarpentryInterface implements ICarpentryInterface {
@Override
public Collection<IDesignCategory> getAllDesignCategories() {
final List<IDesignCategory> categories = new ArrayList<IDesignCategory>();
final List<IDesignCategory> categories = new ArrayList<>();
for (final IDesignCategory category : CarpentryInterface.designCategories.values()) {
if (category.getDesigns().size() > 0) {
categories.add(category);
@@ -78,7 +78,7 @@ public class CarpentryInterface implements ICarpentryInterface {
@Override
public List<IDesign> getSortedDesigns() {
final List<IDesign> designs = new ArrayList<IDesign>();
final List<IDesign> designs = new ArrayList<>();
for (final IDesignCategory category : this.getAllDesignCategories()) {
designs.addAll(category.getDesigns());
}
@@ -103,8 +103,8 @@ public class CarpentryInterface implements ICarpentryInterface {
}
static {
CarpentryInterface.woodMap = new LinkedHashMap<Integer, IDesignMaterial>();
CarpentryInterface.designMap = new LinkedHashMap<Integer, IDesign>();
CarpentryInterface.designCategories = new HashMap<String, IDesignCategory>();
CarpentryInterface.woodMap = new LinkedHashMap<>();
CarpentryInterface.designMap = new LinkedHashMap<>();
CarpentryInterface.designCategories = new HashMap<>();
}
}
@@ -11,7 +11,7 @@ public class DesignerManager {
List<IDesignSystem> systems;
public DesignerManager() {
this.systems = new ArrayList<IDesignSystem>();
this.systems = new ArrayList<>();
}
public void registerDesignSystem(final IDesignSystem system) {
@@ -488,7 +488,7 @@ public enum EnumDesign implements IDesign {
List<IDesign> designs;
private Category(final String name) {
this.designs = new ArrayList<IDesign>();
this.designs = new ArrayList<>();
this.name = name;
CarpentryManager.carpentryInterface.registerDesignCategory(this);
}
@@ -66,7 +66,7 @@ public class GlassType implements IDesignMaterial {
}
static {
GlassType.types = new LinkedHashMap<Integer, GlassType>();
GlassType.types = new LinkedHashMap<>();
for (final StandardColor c : StandardColor.values()) {
GlassType.types.put(c.ordinal(), new GlassType(c.ordinal(), c.name, c.colour));
}
@@ -37,23 +37,23 @@ public class ModuleCore implements IInitializable {
final PrintWriter outputPlanks = new PrintWriter(new FileWriter("data/planks.html"));
final PrintWriter outputFruit = new PrintWriter(new FileWriter("data/fruit.html"));
final PrintWriter outputDesigns = new PrintWriter(new FileWriter("data/designs.html"));
final Queue<IAlleleTreeSpecies> speciesQueue = new LinkedList<IAlleleTreeSpecies>();
final Queue<IAlleleTreeSpecies> speciesQueue = new LinkedList<>();
for (final IAlleleTreeSpecies s : ExtraTreeSpecies.values()) {
speciesQueue.add(s);
}
final Queue<IWoodType> logQueue = new LinkedList<IWoodType>();
final Queue<IWoodType> logQueue = new LinkedList<>();
for (final IWoodType wood : EnumExtraTreeLog.values()) {
logQueue.add(wood);
}
final Queue<IDesignMaterial> plankQueue = new LinkedList<IDesignMaterial>();
final Queue<IDesignMaterial> plankQueue = new LinkedList<>();
for (final IDesignMaterial wood2 : PlankType.ExtraTreePlanks.values()) {
plankQueue.add(wood2);
}
final Queue<ExtraTreeFruitGene> fruitQueue = new LinkedList<ExtraTreeFruitGene>();
final Queue<ExtraTreeFruitGene> fruitQueue = new LinkedList<>();
for (final ExtraTreeFruitGene wood3 : ExtraTreeFruitGene.values()) {
fruitQueue.add(wood3);
}
final Queue<IDesign> designQueue = new LinkedList<IDesign>();
final Queue<IDesign> designQueue = new LinkedList<>();
for (final IDesign wood4 : CarpentryManager.carpentryInterface.getSortedDesigns()) {
designQueue.add(wood4);
}
@@ -58,8 +58,8 @@ public enum ButterflySpecies implements IAlleleButterflySpecies {
private Map<ItemStack, Float> caterpillarLoot;
private ButterflySpecies(final String name, final String scientific, final int colour) {
this.butterflyLoot = new HashMap<ItemStack, Float>();
this.caterpillarLoot = new HashMap<ItemStack, Float>();
this.butterflyLoot = new HashMap<>();
this.caterpillarLoot = new HashMap<>();
this.name = name;
this.branchName = scientific.split(" ")[0].toLowerCase();
this.scientific = scientific.split(" ")[1];
@@ -185,12 +185,12 @@ public enum ButterflySpecies implements IAlleleButterflySpecies {
@Override
public Map<ItemStack, Float> getButterflyLoot() {
return new HashMap<ItemStack, Float>();
return new HashMap<>();
}
@Override
public Map<ItemStack, Float> getCaterpillarLoot() {
return new HashMap<ItemStack, Float>();
return new HashMap<>();
}
@Override
@@ -280,7 +280,7 @@ public class ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
this.diffB = 0;
this.pod = null;
this.ripeningPeriod = 0;
this.products = new HashMap<ItemStack, Float>();
this.products = new HashMap<>();
this.colour = colour;
this.index = index;
this.setRipening(time, unripe);
@@ -292,7 +292,7 @@ public class ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
this.diffB = 0;
this.pod = null;
this.ripeningPeriod = 0;
this.products = new HashMap<ItemStack, Float>();
this.products = new HashMap<>();
this.pod = pod;
this.ripeningPeriod = 2;
this.uuid = uuid;
@@ -224,7 +224,7 @@ public class ExtraTreeMutation implements ITreeMutation {
@Override
public Collection<String> getSpecialConditions() {
final List<String> conditions = new ArrayList<String>();
final List<String> conditions = new ArrayList<>();
if (this.height > 0.0f) {
conditions.add("Minimum height from bedrock of " + this.height);
}
@@ -584,7 +584,7 @@ public class ExtraTreeSpecies implements IAlleleTreeSpecies//, IIconProvider, IG
private ExtraTreeSpecies(final String branch, final String binomial, final int color, final int polColor, final int woodColor, final IWoodType wood, final IAlleleFruit fruit, SaplingType saplingType, final Class<? extends WorldGenerator> gen) {
this.leafType = LeafType.Normal;
this.saplingType = saplingType;
this.families = new ArrayList<IFruitFamily>();
this.families = new ArrayList<>();
this.girth = 1;
this.fruit = null;
this.color = color;
@@ -962,7 +962,7 @@ public class ExtraTreeSpecies implements IAlleleTreeSpecies//, IIconProvider, IG
@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);
@@ -996,7 +996,7 @@ public class ExtraTreeSpecies implements IAlleleTreeSpecies//, IIconProvider, IG
@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) {
@@ -16,7 +16,7 @@ public class ModuleGenetics implements IInitializable {
public ModuleGenetics() {
this.branches = new String[]{"Malus Maleae Amygdaloideae Rosaceae", "Musa Musaceae Zingiberales Commelinids Angiosperms", "Sorbus Maleae", "Tsuga Pinaceae", "Fraxinus Oleeae Oleaceae Lamiales Asterids Angiospems"};
this.classifications = new ArrayList<List<String>>();
this.classifications = new ArrayList<>();
}
@Override
@@ -55,7 +55,7 @@ public class ModuleGenetics implements IInitializable {
private void generateBranches() {
for (final String hierarchy : this.branches) {
final List<String> set = new ArrayList<String>();
final List<String> set = new ArrayList<>();
for (final String string : hierarchy.split(" ", 0)) {
set.add(string.toLowerCase());
}
@@ -84,7 +84,7 @@ public enum Food implements IItemMisc {
}
private Food(final int hunger) {
this.ores = new ArrayList<String>();
this.ores = new ArrayList<>();
this.hunger = hunger;
}
@@ -134,7 +134,7 @@ public class Brewery {
Brewery.slotInventory = new int[]{5, 6, 7, 8, 9, 10, 11, 12, 13};
Brewery.tankInput = 0;
Brewery.tankOutput = 1;
Brewery.recipes = new ArrayList<IBreweryRecipe>();
Brewery.recipes = new ArrayList<>();
}
public static class PackageBrewery extends ExtraTreeMachine.PackageExtraTreeMachine implements IMachineInformation {
@@ -458,8 +458,8 @@ public class Brewery {
ItemStack hops;
public BeerRecipe() {
this.grainCrops = new HashMap<ItemStack, String>();
this.outputs = new ArrayList<FluidStack>();
this.grainCrops = new HashMap<>();
this.outputs = new ArrayList<>();
this.grains = new String[]{BeerRecipe.barley, BeerRecipe.wheat, BeerRecipe.rye, BeerRecipe.corn, BeerRecipe.roasted};
for (final String grainType : this.grains) {
for (final ItemStack stack : OreDictionary.getOres(grainType)) {
@@ -65,9 +65,9 @@ public class Distillery {
static {
Distillery.tankInput = 0;
Distillery.tankOutput = 1;
(Distillery.recipes = new ArrayList<Map<Fluid, FluidStack>>()).add(new HashMap<Fluid, FluidStack>());
Distillery.recipes.add(new HashMap<Fluid, FluidStack>());
Distillery.recipes.add(new HashMap<Fluid, FluidStack>());
(Distillery.recipes = new ArrayList<>()).add(new HashMap<>());
Distillery.recipes.add(new HashMap<>());
Distillery.recipes.add(new HashMap<>());
}
public static class PackageDistillery extends ExtraTreeMachine.PackageExtraTreeMachine implements IMachineInformation {
@@ -53,7 +53,7 @@ public class Infuser {
static {
Infuser.tankInput = 0;
Infuser.tankOutput = 1;
Infuser.recipes = new HashMap<Fluid, FluidStack>();
Infuser.recipes = new HashMap<>();
}
public static class PackageInfuser extends ExtraTreeMachine.PackageExtraTreeMachine implements IMachineInformation {
@@ -60,7 +60,7 @@ public class Lumbermill {
}
private static Collection<ItemStack> getRecipeResult(final ItemStack output) {
final List<ItemStack> list = new ArrayList<ItemStack>();
final List<ItemStack> list = new ArrayList<>();
for (final Object recipeO : CraftingManager.getInstance().getRecipeList()) {
if (recipeO instanceof ShapelessRecipes) {
final ShapelessRecipes recipe = (ShapelessRecipes) recipeO;
@@ -109,7 +109,7 @@ public class Lumbermill {
Lumbermill.slotBark = 2;
Lumbermill.slotSawdust = 3;
Lumbermill.tankWater = 0;
Lumbermill.recipes = new HashMap<ItemStack, ItemStack>();
Lumbermill.recipes = new HashMap<>();
}
public static class PackageLumbermill extends ExtraTreeMachine.PackageExtraTreeMachine implements IMachineInformation {
@@ -35,6 +35,6 @@ public class MachineRendererForestry {
}
static {
MachineRendererForestry.instances = new HashMap<String, Object>();
MachineRendererForestry.instances = new HashMap<>();
}
}
@@ -53,7 +53,7 @@ public class Press {
Press.slotFruit = 0;
Press.slotCurrent = 1;
Press.tankWater = 0;
Press.pressRecipes = new HashMap<ItemStack, FluidStack>();
Press.pressRecipes = new HashMap<>();
}
public static class PackagePress extends ExtraTreeMachine.PackageExtraTreeMachine implements IMachineInformation {
@@ -83,7 +83,7 @@ public class TileEntityNursery extends TileEntityMachine implements IButterflyNu
}
public Set<IErrorState> getErrorStates() {
return new HashSet<IErrorState>();
return new HashSet<>();
}
public int getBiomeId() {