mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-25 22:44:23 +00:00
quick fix : Explicit type can be replaced with <>
This commit is contained in:
1 parent
7abe2f5182
commit
60f7add07f
55 files changed
+132
-132
No files matched your search
@@ -21,7 +21,7 @@ public class SlimeBounceHandler {
|
||||
private static final double[] ASINE_TAB;
|
||||
private static final double[] COS_TAB;
|
||||
public static final IdentityHashMap<EntityLivingBase, BounceInfo> BOUNCING_ENTITIES =
|
||||
new IdentityHashMap<EntityLivingBase, BounceInfo>();
|
||||
new IdentityHashMap<>();
|
||||
|
||||
static {
|
||||
for (int i = 0; i < 65536; ++i) {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class TConstructRegistry {
|
||||
* chiselHead scytheBlade, broadAxeHead, excavatorHead, largeSwordBlade,
|
||||
* hammerHead bowstring, fletching, arrowhead
|
||||
*/
|
||||
public static HashMap<String, Item> itemDirectory = new HashMap<String, Item>();
|
||||
public static HashMap<String, Item> itemDirectory = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Adds an item to the directory
|
||||
@@ -95,7 +95,7 @@ public class TConstructRegistry {
|
||||
* scytheHead, excavatorHead, largeBlade, hammerHead, fullGuard, bowString,
|
||||
* fletching, arrowHead
|
||||
*/
|
||||
static HashMap<String, ItemStack> itemstackDirectory = new HashMap<String, ItemStack>();
|
||||
static HashMap<String, ItemStack> itemstackDirectory = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Adds an itemstack to the directory
|
||||
@@ -126,7 +126,7 @@ public class TConstructRegistry {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static ArrayList<ToolCore> tools = new ArrayList<ToolCore>(20);
|
||||
public static ArrayList<ToolCore> tools = new ArrayList<>(20);
|
||||
|
||||
// Parts
|
||||
|
||||
@@ -134,7 +134,7 @@ public class TConstructRegistry {
|
||||
* List: Item ID, metadata, material ID ItemStack: Output. Ex: Cactus
|
||||
* Binding
|
||||
*/
|
||||
public static HashMap<List, ItemStack> patternPartMapping = new HashMap<List, ItemStack>();
|
||||
public static HashMap<List, ItemStack> patternPartMapping = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Maps an item and a material ID to an output part
|
||||
@@ -197,10 +197,10 @@ public class TConstructRegistry {
|
||||
}
|
||||
|
||||
// Materials
|
||||
public static HashMap<Integer, ToolMaterial> toolMaterials = new HashMap<Integer, ToolMaterial>(40);
|
||||
public static HashMap<String, ToolMaterial> toolMaterialStrings = new HashMap<String, ToolMaterial>(40);
|
||||
public static List<Integer> defaultToolPartMaterials = new LinkedList<Integer>();
|
||||
public static List<Integer> defaultShardMaterials = new LinkedList<Integer>();
|
||||
public static HashMap<Integer, ToolMaterial> toolMaterials = new HashMap<>(40);
|
||||
public static HashMap<String, ToolMaterial> toolMaterialStrings = new HashMap<>(40);
|
||||
public static List<Integer> defaultToolPartMaterials = new LinkedList<>();
|
||||
public static List<Integer> defaultShardMaterials = new LinkedList<>();
|
||||
|
||||
public static void addDefaultToolPartMaterial(int materialID) {
|
||||
if (!toolMaterials.containsKey(materialID))
|
||||
@@ -465,7 +465,7 @@ public class TConstructRegistry {
|
||||
}
|
||||
|
||||
// Bow materials
|
||||
public static HashMap<Integer, BowMaterial> bowMaterials = new HashMap<Integer, BowMaterial>(40);
|
||||
public static HashMap<Integer, BowMaterial> bowMaterials = new HashMap<>(40);
|
||||
|
||||
@Deprecated
|
||||
public static void addBowMaterial(int materialID, int durability, int drawSpeed, float speedMax) {
|
||||
@@ -488,7 +488,7 @@ public class TConstructRegistry {
|
||||
return bowMaterials.get(materialID);
|
||||
}
|
||||
|
||||
public static HashMap<Integer, ArrowMaterial> arrowMaterials = new HashMap<Integer, ArrowMaterial>(40);
|
||||
public static HashMap<Integer, ArrowMaterial> arrowMaterials = new HashMap<>(40);
|
||||
|
||||
@Deprecated
|
||||
public static void addArrowMaterial(int materialID, float mass, float breakChance, float accuracy) {
|
||||
@@ -513,7 +513,7 @@ public class TConstructRegistry {
|
||||
}
|
||||
|
||||
// Custom materials - bowstrings, fletching, etc
|
||||
public static ArrayList<CustomMaterial> customMaterials = new ArrayList<CustomMaterial>();
|
||||
public static ArrayList<CustomMaterial> customMaterials = new ArrayList<>();
|
||||
|
||||
public static void addCustomMaterial(CustomMaterial mat) {
|
||||
if (mat != null) customMaterials.add(mat);
|
||||
@@ -658,8 +658,8 @@ public class TConstructRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
public static ArrayList<ActiveToolMod> activeModifiers = new ArrayList<ActiveToolMod>();
|
||||
public static LinkedList<ActiveArmorMod> activeArmorModifiers = new LinkedList<ActiveArmorMod>();
|
||||
public static ArrayList<ActiveToolMod> activeModifiers = new ArrayList<>();
|
||||
public static LinkedList<ActiveArmorMod> activeArmorModifiers = new LinkedList<>();
|
||||
|
||||
public static void registerActiveToolMod(ActiveToolMod mod) {
|
||||
activeModifiers.add(mod);
|
||||
|
||||
@@ -11,7 +11,7 @@ public abstract class ArmorModTypeFilter extends ArmorMod {
|
||||
super(effect, dataKey, armorTypes, items);
|
||||
assert items.length == values.length
|
||||
: "Itemstacks and their values for armor modifiers must be the same length";
|
||||
this.increase = new ArrayList<Integer>();
|
||||
this.increase = new ArrayList<>();
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
increase.add(values[i]);
|
||||
}
|
||||
|
||||
@@ -9,11 +9,11 @@ import tconstruct.library.crafting.ModifyBuilder;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
|
||||
public class TConstructClientRegistry {
|
||||
public static ArrayList<StencilGuiElement> stencilButtons = new ArrayList<StencilGuiElement>();
|
||||
public static ArrayList<StencilGuiElement> stencilButtons2 = new ArrayList<StencilGuiElement>();
|
||||
public static ArrayList<ToolGuiElement> toolButtons = new ArrayList<ToolGuiElement>(20);
|
||||
public static ArrayList<ToolGuiElement> tierTwoButtons = new ArrayList<ToolGuiElement>();
|
||||
public static Map<String, ItemStack> manualIcons = new HashMap<String, ItemStack>();
|
||||
public static ArrayList<StencilGuiElement> stencilButtons = new ArrayList<>();
|
||||
public static ArrayList<StencilGuiElement> stencilButtons2 = new ArrayList<>();
|
||||
public static ArrayList<ToolGuiElement> toolButtons = new ArrayList<>(20);
|
||||
public static ArrayList<ToolGuiElement> tierTwoButtons = new ArrayList<>();
|
||||
public static Map<String, ItemStack> manualIcons = new HashMap<>();
|
||||
public static ItemStack defaultStack = new ItemStack(Items.iron_ingot);
|
||||
|
||||
public static void addMaterialRenderMapping(
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraftforge.fluids.*;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
|
||||
public class MultiFluidTank extends LogicComponent implements IFluidTank {
|
||||
public ArrayList<FluidStack> fluidlist = new ArrayList<FluidStack>();
|
||||
public ArrayList<FluidStack> fluidlist = new ArrayList<>();
|
||||
protected int maxLiquid;
|
||||
protected int currentLiquid;
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@ public class TankLayerScan extends LogicComponent {
|
||||
protected int bricks = 0;
|
||||
protected int airBlocks = 0;
|
||||
protected int structureTop = 0;
|
||||
protected HashSet<CoordTuple> layerBlockCoords = new HashSet<CoordTuple>();
|
||||
protected HashSet<CoordTuple> layerAirCoords = new HashSet<CoordTuple>();
|
||||
protected HashSet<CoordTuple> layerBlockCoords = new HashSet<>();
|
||||
protected HashSet<CoordTuple> layerAirCoords = new HashSet<>();
|
||||
|
||||
public ArrayList<CoordTuple> blockCoords = new ArrayList<CoordTuple>();
|
||||
public ArrayList<CoordTuple> airCoords = new ArrayList<CoordTuple>();
|
||||
protected ArrayList<int[]> validAirCoords = new ArrayList<int[]>();
|
||||
public ArrayList<CoordTuple> blockCoords = new ArrayList<>();
|
||||
public ArrayList<CoordTuple> airCoords = new ArrayList<>();
|
||||
protected ArrayList<int[]> validAirCoords = new ArrayList<>();
|
||||
protected CoordTuple returnStone;
|
||||
|
||||
private static boolean debug = System.getenv("DBG_MANTLE_TankLayerScan") != null;
|
||||
@@ -110,8 +110,8 @@ public class TankLayerScan extends LogicComponent {
|
||||
|
||||
if (sealed) {
|
||||
blockCoords.add(new CoordTuple(master.xCoord, master.yCoord, master.zCoord)); // Don't forget me!
|
||||
layerAirCoords = new HashSet<CoordTuple>(airCoords);
|
||||
layerBlockCoords = new HashSet<CoordTuple>(blockCoords);
|
||||
layerAirCoords = new HashSet<>(airCoords);
|
||||
layerBlockCoords = new HashSet<>(blockCoords);
|
||||
|
||||
int lowY = recurseStructureDown(master.yCoord - 1);
|
||||
if (lowY != -1) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
|
||||
public class Detailing {
|
||||
public List<DetailInput> detailing = new ArrayList<DetailInput>();
|
||||
public List<DetailInput> detailing = new ArrayList<>();
|
||||
|
||||
public void addDetailing(Object input, int inputMeta, Object output, int outputMeta, ToolCore tool) {
|
||||
ItemStack iID, oID;
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.*;
|
||||
|
||||
public class DryingRackRecipes {
|
||||
public static ArrayList<DryingRecipe> recipes = new ArrayList<DryingRecipe>();
|
||||
public static ArrayList<DryingRecipe> recipes = new ArrayList<>();
|
||||
|
||||
public static void addDryingRecipe(Object input, int time, Object output) {
|
||||
ItemStack inputItem = null;
|
||||
|
||||
@@ -11,7 +11,7 @@ public class FluidType {
|
||||
public final Fluid fluid;
|
||||
public final boolean isToolpart;
|
||||
|
||||
public static HashMap<String, FluidType> fluidTypes = new HashMap<String, FluidType>();
|
||||
public static HashMap<String, FluidType> fluidTypes = new HashMap<>();
|
||||
|
||||
public FluidType(Block block, int meta, int baseTemperature, Fluid fluid, boolean isToolpart) {
|
||||
this.renderBlock = block;
|
||||
|
||||
@@ -8,7 +8,7 @@ import tconstruct.library.client.FluidRenderProperties;
|
||||
/* Melting becomes hardened */
|
||||
public class LiquidCasting {
|
||||
// public static LiquidCasting instance = new LiquidCasting();
|
||||
private final ArrayList<CastingRecipe> casts = new ArrayList<CastingRecipe>();
|
||||
private final ArrayList<CastingRecipe> casts = new ArrayList<>();
|
||||
|
||||
private boolean contains(CastingRecipe recipe) {
|
||||
for (CastingRecipe c : casts) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import tconstruct.library.modifier.*;
|
||||
|
||||
public class ModifyBuilder {
|
||||
public static ModifyBuilder instance = new ModifyBuilder();
|
||||
public List<ItemModifier> itemModifiers = new ArrayList<ItemModifier>();
|
||||
public List<ItemModifier> itemModifiers = new ArrayList<>();
|
||||
|
||||
public ItemStack modifyItem(ItemStack input, ItemStack[] modifiers) {
|
||||
ItemStack copy = input.copy(); // Prevent modifying the original
|
||||
|
||||
@@ -14,11 +14,11 @@ import tconstruct.library.util.IPattern;
|
||||
public class PatternBuilder {
|
||||
public static PatternBuilder instance = new PatternBuilder();
|
||||
// Map items to their parts with a hashmap
|
||||
public List<ItemKey> materials = new ArrayList<ItemKey>();
|
||||
public HashMap<String, MaterialSet> materialSets = new HashMap<String, MaterialSet>();
|
||||
public List<ItemKey> materials = new ArrayList<>();
|
||||
public HashMap<String, MaterialSet> materialSets = new HashMap<>();
|
||||
|
||||
// We could use IRecipe if it wasn't tied to InventoryCrafting
|
||||
public List<IPattern> toolPatterns = new ArrayList<IPattern>();
|
||||
public List<IPattern> toolPatterns = new ArrayList<>();
|
||||
|
||||
/* Register methods */
|
||||
public void registerMaterial(ItemStack material, int value, String key) {
|
||||
|
||||
@@ -11,11 +11,11 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
public class Smeltery {
|
||||
public static Smeltery instance = new Smeltery();
|
||||
|
||||
private final Map<ItemMetaWrapper, FluidStack> smeltingList = new HashMap<ItemMetaWrapper, FluidStack>();
|
||||
private final Map<ItemMetaWrapper, Integer> temperatureList = new HashMap<ItemMetaWrapper, Integer>();
|
||||
private final Map<ItemMetaWrapper, ItemStack> renderIndex = new HashMap<ItemMetaWrapper, ItemStack>();
|
||||
private final List<AlloyMix> alloys = new ArrayList<AlloyMix>();
|
||||
private final Map<Fluid, Integer[]> smelteryFuels = new HashMap<Fluid, Integer[]>(); // fluid -> [power, duration]
|
||||
private final Map<ItemMetaWrapper, FluidStack> smeltingList = new HashMap<>();
|
||||
private final Map<ItemMetaWrapper, Integer> temperatureList = new HashMap<>();
|
||||
private final Map<ItemMetaWrapper, ItemStack> renderIndex = new HashMap<>();
|
||||
private final List<AlloyMix> alloys = new ArrayList<>();
|
||||
private final Map<Fluid, Integer[]> smelteryFuels = new HashMap<>(); // fluid -> [power, duration]
|
||||
|
||||
/**
|
||||
* Add a new fluid as a valid Smeltery fuel.
|
||||
|
||||
@@ -8,8 +8,8 @@ public class StencilBuilder {
|
||||
public static StencilBuilder instance = new StencilBuilder();
|
||||
|
||||
public List<ItemStack> blanks =
|
||||
new LinkedList<ItemStack>(); // i wish ItemStack would support equals so i could use a Set here...
|
||||
public Map<Integer, ItemStack> stencils = new TreeMap<Integer, ItemStack>();
|
||||
new LinkedList<>(); // i wish ItemStack would support equals so i could use a Set here...
|
||||
public Map<Integer, ItemStack> stencils = new TreeMap<>();
|
||||
|
||||
/**
|
||||
* Returns whether the given ItemStack is a blank pattern and therefore usable for stencil crafting.
|
||||
|
||||
@@ -16,9 +16,9 @@ import tconstruct.library.util.IToolPart;
|
||||
public class ToolBuilder {
|
||||
public static ToolBuilder instance = new ToolBuilder();
|
||||
|
||||
public HashMap<String, ToolRecipe> recipeList = new HashMap<String, ToolRecipe>();
|
||||
public List<ToolRecipe> combos = new ArrayList<ToolRecipe>();
|
||||
public HashMap<String, String> modifiers = new HashMap<String, String>();
|
||||
public HashMap<String, ToolRecipe> recipeList = new HashMap<>();
|
||||
public List<ToolRecipe> combos = new ArrayList<>();
|
||||
public HashMap<String, String> modifiers = new HashMap<>();
|
||||
|
||||
/* Build tools */
|
||||
public static void addNormalToolRecipe(ToolCore output, Item head, Item handle) {
|
||||
|
||||
@@ -11,10 +11,10 @@ import tconstruct.library.tools.ToolCore;
|
||||
*/
|
||||
|
||||
public class ToolRecipe {
|
||||
protected LinkedList<Item> headList = new LinkedList<Item>();
|
||||
protected LinkedList<Item> handleList = new LinkedList<Item>();
|
||||
protected LinkedList<Item> accessoryList = new LinkedList<Item>();
|
||||
protected LinkedList<Item> extraList = new LinkedList<Item>();
|
||||
protected LinkedList<Item> headList = new LinkedList<>();
|
||||
protected LinkedList<Item> handleList = new LinkedList<>();
|
||||
protected LinkedList<Item> accessoryList = new LinkedList<>();
|
||||
protected LinkedList<Item> extraList = new LinkedList<>();
|
||||
protected ToolCore result;
|
||||
protected Item toolRod = TConstructRegistry.getItem("toolRod");
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public abstract class HarvestTool extends ToolCore {
|
||||
|
||||
@Override
|
||||
public Set<String> getToolClasses(ItemStack stack) {
|
||||
Set<String> set = new HashSet<String>();
|
||||
Set<String> set = new HashSet<>();
|
||||
|
||||
if (stack != null && stack.getItem() instanceof HarvestTool) {
|
||||
set.add(((HarvestTool) stack.getItem()).getHarvestType());
|
||||
|
||||
@@ -110,20 +110,20 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IEq
|
||||
|
||||
/* Rendering */
|
||||
|
||||
public HashMap<Integer, IIcon> headIcons = new HashMap<Integer, IIcon>();
|
||||
public HashMap<Integer, IIcon> brokenIcons = new HashMap<Integer, IIcon>();
|
||||
public HashMap<Integer, IIcon> handleIcons = new HashMap<Integer, IIcon>();
|
||||
public HashMap<Integer, IIcon> accessoryIcons = new HashMap<Integer, IIcon>();
|
||||
public HashMap<Integer, IIcon> effectIcons = new HashMap<Integer, IIcon>();
|
||||
public HashMap<Integer, IIcon> extraIcons = new HashMap<Integer, IIcon>();
|
||||
public HashMap<Integer, IIcon> headIcons = new HashMap<>();
|
||||
public HashMap<Integer, IIcon> brokenIcons = new HashMap<>();
|
||||
public HashMap<Integer, IIcon> handleIcons = new HashMap<>();
|
||||
public HashMap<Integer, IIcon> accessoryIcons = new HashMap<>();
|
||||
public HashMap<Integer, IIcon> effectIcons = new HashMap<>();
|
||||
public HashMap<Integer, IIcon> extraIcons = new HashMap<>();
|
||||
|
||||
// Not liking this
|
||||
public HashMap<Integer, String> headStrings = new HashMap<Integer, String>();
|
||||
public HashMap<Integer, String> brokenPartStrings = new HashMap<Integer, String>();
|
||||
public HashMap<Integer, String> handleStrings = new HashMap<Integer, String>();
|
||||
public HashMap<Integer, String> accessoryStrings = new HashMap<Integer, String>();
|
||||
public HashMap<Integer, String> effectStrings = new HashMap<Integer, String>();
|
||||
public HashMap<Integer, String> extraStrings = new HashMap<Integer, String>();
|
||||
public HashMap<Integer, String> headStrings = new HashMap<>();
|
||||
public HashMap<Integer, String> brokenPartStrings = new HashMap<>();
|
||||
public HashMap<Integer, String> handleStrings = new HashMap<>();
|
||||
public HashMap<Integer, String> accessoryStrings = new HashMap<>();
|
||||
public HashMap<Integer, String> effectStrings = new HashMap<>();
|
||||
public HashMap<Integer, String> extraStrings = new HashMap<>();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
|
||||
@@ -9,7 +9,7 @@ import net.minecraft.util.StatCollector;
|
||||
public final class HarvestLevels {
|
||||
private HarvestLevels() {} // non-instantiable
|
||||
|
||||
public static final Map<Integer, String> harvestLevelNames = new HashMap<Integer, String>();
|
||||
public static final Map<Integer, String> harvestLevelNames = new HashMap<>();
|
||||
|
||||
public static String getHarvestLevelName(int num) {
|
||||
return harvestLevelNames.containsKey(num) ? harvestLevelNames.get(num) : String.valueOf(num);
|
||||
|
||||
@@ -207,11 +207,11 @@ public abstract class ProjectileWeapon extends ToolCore implements IBattlegearWe
|
||||
public abstract void playFiringSound(
|
||||
World world, EntityPlayer player, ItemStack weapon, ItemStack ammo, float speed, float accuracy);
|
||||
|
||||
public HashMap<Integer, IIcon[]> animationHeadIcons = new HashMap<Integer, IIcon[]>();
|
||||
public HashMap<Integer, IIcon[]> animationHandleIcons = new HashMap<Integer, IIcon[]>();
|
||||
public HashMap<Integer, IIcon[]> animationAccessoryIcons = new HashMap<Integer, IIcon[]>();
|
||||
public HashMap<Integer, IIcon[]> animationExtraIcons = new HashMap<Integer, IIcon[]>();
|
||||
public HashMap<Integer, IIcon[]> animationEffectIcons = new HashMap<Integer, IIcon[]>();
|
||||
public HashMap<Integer, IIcon[]> animationHeadIcons = new HashMap<>();
|
||||
public HashMap<Integer, IIcon[]> animationHandleIcons = new HashMap<>();
|
||||
public HashMap<Integer, IIcon[]> animationAccessoryIcons = new HashMap<>();
|
||||
public HashMap<Integer, IIcon[]> animationExtraIcons = new HashMap<>();
|
||||
public HashMap<Integer, IIcon[]> animationEffectIcons = new HashMap<>();
|
||||
|
||||
/**
|
||||
* return true if the current renderpass should use animations.
|
||||
|
||||
Reference in new issue
Block a user