Java 7 and 8 cleanup

Diamond operator <>
Lambdas and method references
This commit is contained in:
Tom Elfring committed 2017-08-05 17:50:38 +02:00
1 parent 3db03edbc9
commit b72d6efab3
234 files changed
+1614 -2253

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ import net.minecraftforge.oredict.OreDictionary;
public class MekanismAPI
{
//Add a BlockInfo value here if you don't want a certain block to be picked up by cardboard boxes
private static Set<BlockInfo> cardboardBoxIgnore = new HashSet<BlockInfo>();
private static Set<BlockInfo> cardboardBoxIgnore = new HashSet<>();
/** Mekanism debug mode */
public static boolean debug = false;
+1 -1
View File
@@ -83,7 +83,7 @@ public class Range4D
public Set<Chunk3D> getIntersectingChunks()
{
Set<Chunk3D> set = new HashSet<Chunk3D>();
Set<Chunk3D> set = new HashSet<>();
for(int chunkX = xMin >> 4; chunkX <= xMax-1 >> 4; chunkX++)
{
@@ -7,7 +7,7 @@ import net.minecraftforge.fluids.Fluid;
public class GasRegistry
{
private static ArrayList<Gas> registeredGasses = new ArrayList<Gas>();
private static ArrayList<Gas> registeredGasses = new ArrayList<>();
/**
* Register a new gas into GasRegistry.
@@ -13,10 +13,10 @@ import net.minecraft.item.ItemStack;
public class InfuseRegistry
{
/** The (private) map of ItemStacks and their related InfuseObjects. */
private static Map<ItemStack, InfuseObject> infuseObjects = new HashMap<ItemStack, InfuseObject>();
private static Map<ItemStack, InfuseObject> infuseObjects = new HashMap<>();
/** The (private) map of infuse names and their corresponding InfuseTypes. */
private static Map<String, InfuseType> infuseTypes = new HashMap<String, InfuseType>();
private static Map<String, InfuseType> infuseTypes = new HashMap<>();
/**
* Registers an InfuseType into the registry. Call this in PreInit!
@@ -31,11 +31,11 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
public LinkedHashSet<IGridTransmitter<A, N>> transmittersToAdd = Sets.newLinkedHashSet();
public LinkedHashSet<IGridTransmitter<A, N>> transmittersAdded = Sets.newLinkedHashSet();
public HashMap<Coord4D, A> possibleAcceptors = new HashMap<Coord4D, A>();
public HashMap<Coord4D, EnumSet<EnumFacing>> acceptorDirections = new HashMap<Coord4D, EnumSet<EnumFacing>>();
public HashMap<Coord4D, A> possibleAcceptors = new HashMap<>();
public HashMap<Coord4D, EnumSet<EnumFacing>> acceptorDirections = new HashMap<>();
public HashMap<IGridTransmitter<A, N>, EnumSet<EnumFacing>> changedAcceptors = Maps.newHashMap();
private Set<DelayQueue> updateQueue = new LinkedHashSet<DelayQueue>();
private Set<DelayQueue> updateQueue = new LinkedHashSet<>();
protected Range4D packetRange = null;
@@ -148,15 +148,7 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
public void invalidate()
{
//Remove invalid transmitters first for share calculations
for(Iterator<IGridTransmitter<A, N>> iter = transmitters.iterator(); iter.hasNext();)
{
IGridTransmitter<A, N> transmitter = iter.next();
if(!transmitter.isValid())
{
iter.remove();
}
}
transmitters.removeIf(transmitter -> !transmitter.isValid());
//Clamp the new buffer
clampBuffer();
@@ -160,7 +160,7 @@ public class TransmitterNetworkRegistry
{
if(startOrphan.isValid() && startOrphan.isOrphan())
{
OrphanPathFinder<A, N> finder = new OrphanPathFinder<A, N>(startOrphan);
OrphanPathFinder<A, N> finder = new OrphanPathFinder<>(startOrphan);
finder.start();
N network;
+161 -230
View File
@@ -250,9 +250,9 @@ import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ClientProxy extends CommonProxy
{
public static Map<String, ModelResourceLocation> machineResources = new HashMap<String, ModelResourceLocation>();
public static Map<String, ModelResourceLocation> basicResources = new HashMap<String, ModelResourceLocation>();
public static Map<String, ModelResourceLocation> transmitterResources = new HashMap<String, ModelResourceLocation>();
public static Map<String, ModelResourceLocation> machineResources = new HashMap<>();
public static Map<String, ModelResourceLocation> basicResources = new HashMap<>();
public static Map<String, ModelResourceLocation> transmitterResources = new HashMap<>();
public static final String[] CUSTOM_RENDERS = new String[] {"fluid_tank", "bin_basic", "bin_advanced", "bin_elite", "bin_ultimate",
"Jetpack", "FreeRunners", "AtomicDisassembler", "ScubaTank", "GasMask", "ArmoredJetpack", "Flamethrower", "personal_chest",
@@ -317,16 +317,16 @@ public class ClientProxy extends CommonProxy
@Override
public void registerSpecialTileEntities()
{
ClientRegistry.registerTileEntity(TileEntityEnrichmentChamber.class, "EnrichmentChamber", new RenderConfigurableMachine<TileEntityEnrichmentChamber>());
ClientRegistry.registerTileEntity(TileEntityOsmiumCompressor.class, "OsmiumCompressor", new RenderConfigurableMachine<TileEntityOsmiumCompressor>());
ClientRegistry.registerTileEntity(TileEntityCombiner.class, "Combiner", new RenderConfigurableMachine<TileEntityCombiner>());
ClientRegistry.registerTileEntity(TileEntityCrusher.class, "Crusher", new RenderConfigurableMachine<TileEntityCrusher>());
ClientRegistry.registerTileEntity(TileEntityFactory.class, "SmeltingFactory", new RenderConfigurableMachine<TileEntityFactory>());
ClientRegistry.registerTileEntity(TileEntityAdvancedFactory.class, "AdvancedSmeltingFactory", new RenderConfigurableMachine<TileEntityAdvancedFactory>());
ClientRegistry.registerTileEntity(TileEntityEliteFactory.class, "UltimateSmeltingFactory", new RenderConfigurableMachine<TileEntityEliteFactory>());
ClientRegistry.registerTileEntity(TileEntityPurificationChamber.class, "PurificationChamber", new RenderConfigurableMachine<TileEntityPurificationChamber>());
ClientRegistry.registerTileEntity(TileEntityEnergizedSmelter.class, "EnergizedSmelter", new RenderConfigurableMachine<TileEntityEnergizedSmelter>());
ClientRegistry.registerTileEntity(TileEntityMetallurgicInfuser.class, "MetallurgicInfuser", new RenderConfigurableMachine<TileEntityMetallurgicInfuser>());
ClientRegistry.registerTileEntity(TileEntityEnrichmentChamber.class, "EnrichmentChamber", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityOsmiumCompressor.class, "OsmiumCompressor", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityCombiner.class, "Combiner", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityCrusher.class, "Crusher", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityFactory.class, "SmeltingFactory", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityAdvancedFactory.class, "AdvancedSmeltingFactory", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityEliteFactory.class, "UltimateSmeltingFactory", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityPurificationChamber.class, "PurificationChamber", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityEnergizedSmelter.class, "EnergizedSmelter", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityMetallurgicInfuser.class, "MetallurgicInfuser", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityGasTank.class, "GasTank", new RenderGasTank());
ClientRegistry.registerTileEntity(TileEntityEnergyCube.class, "EnergyCube", new RenderEnergyCube());
ClientRegistry.registerTileEntity(TileEntityPersonalChest.class, "PersonalChest", new RenderPersonalChest());
@@ -337,15 +337,15 @@ public class ClientProxy extends CommonProxy
ClientRegistry.registerTileEntity(TileEntityBin.class, "Bin", new RenderBin());
ClientRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner", new RenderDigitalMiner());
ClientRegistry.registerTileEntity(TileEntityTeleporter.class, "MekanismTeleporter", new RenderTeleporter());
ClientRegistry.registerTileEntity(TileEntityChemicalInjectionChamber.class, "ChemicalInjectionChamber", new RenderConfigurableMachine<TileEntityChemicalInjectionChamber>());
ClientRegistry.registerTileEntity(TileEntityChemicalInjectionChamber.class, "ChemicalInjectionChamber", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityThermalEvaporationController.class, "ThermalEvaporationController", new RenderThermalEvaporationController());
ClientRegistry.registerTileEntity(TileEntityPrecisionSawmill.class, "PrecisionSawmill", new RenderConfigurableMachine<TileEntityPrecisionSawmill>());
ClientRegistry.registerTileEntity(TileEntityPrecisionSawmill.class, "PrecisionSawmill", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityChemicalCrystallizer.class, "ChemicalCrystallizer", new RenderChemicalCrystallizer());
ClientRegistry.registerTileEntity(TileEntitySeismicVibrator.class, "SeismicVibrator", new RenderSeismicVibrator());
ClientRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber", new RenderConfigurableMachine<TileEntityPRC>());
ClientRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityFluidTank.class, "FluidTank", new RenderFluidTank());
ClientRegistry.registerTileEntity(TileEntitySolarNeutronActivator.class, "SolarNeutronActivator", new RenderSolarNeutronActivator());
ClientRegistry.registerTileEntity(TileEntityFormulaicAssemblicator.class, "FormulaicAssemblicator", new RenderConfigurableMachine<TileEntityFormulaicAssemblicator>());
ClientRegistry.registerTileEntity(TileEntityFormulaicAssemblicator.class, "FormulaicAssemblicator", new RenderConfigurableMachine<>());
ClientRegistry.registerTileEntity(TileEntityResistiveHeater.class, "ResistiveHeater", new RenderResistiveHeater());
ClientRegistry.registerTileEntity(TileEntityBoilerCasing.class, "BoilerCasing", new RenderThermoelectricBoiler());
ClientRegistry.registerTileEntity(TileEntityBoilerValve.class, "BoilerValve", new RenderThermoelectricBoiler());
@@ -461,7 +461,7 @@ public class ClientProxy extends CommonProxy
continue;
}
List<ModelResourceLocation> modelsToAdd = new ArrayList<ModelResourceLocation>();
List<ModelResourceLocation> modelsToAdd = new ArrayList<>();
String resource = "mekanism:" + type.getName();
RecipeType recipePointer = null;
@@ -475,7 +475,7 @@ public class ClientProxy extends CommonProxy
{
if(machineResources.get(resource) == null)
{
List<String> entries = new ArrayList<String>();
List<String> entries = new ArrayList<>();
if(type.hasActiveTexture())
{
@@ -529,7 +529,7 @@ public class ClientProxy extends CommonProxy
for(BasicBlockType type : BasicBlockType.values())
{
List<ModelResourceLocation> modelsToAdd = new ArrayList<ModelResourceLocation>();
List<ModelResourceLocation> modelsToAdd = new ArrayList<>();
String resource = "mekanism:" + type.getName();
BaseTier tierPointer = null;
@@ -543,7 +543,7 @@ public class ClientProxy extends CommonProxy
{
if(basicResources.get(resource) == null)
{
List<String> entries = new ArrayList<String>();
List<String> entries = new ArrayList<>();
if(type.hasActiveTexture())
{
@@ -601,7 +601,7 @@ public class ClientProxy extends CommonProxy
for(TransmitterType type : TransmitterType.values())
{
List<ModelResourceLocation> modelsToAdd = new ArrayList<ModelResourceLocation>();
List<ModelResourceLocation> modelsToAdd = new ArrayList<>();
String resource = "mekanism:" + type.getName();
BaseTier tierPointer = null;
@@ -658,135 +658,117 @@ public class ClientProxy extends CommonProxy
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(MekanismBlocks.OreBlock), ore.ordinal(), new ModelResourceLocation("mekanism:OreBlock", "type=" + ore.getName()));
}
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(MekanismBlocks.GasTank), new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack)
{
GasTankTier tier = GasTankTier.values()[((ItemBlockGasTank)stack.getItem()).getBaseTier(stack).ordinal()];
ResourceLocation baseLocation = new ResourceLocation("mekanism", "GasTank");
return new ModelResourceLocation(baseLocation, "facing=north,tier="+tier);
}
});
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(MekanismBlocks.GasTank), stack ->
{
GasTankTier tier = GasTankTier.values()[((ItemBlockGasTank)stack.getItem()).getBaseTier(stack).ordinal()];
ResourceLocation baseLocation = new ResourceLocation("mekanism", "GasTank");
return new ModelResourceLocation(baseLocation, "facing=north,tier="+tier);
});
ItemMeshDefinition machineMesher = new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack)
{
MachineType type = MachineType.get(stack);
if(type != null)
{
String resource = "mekanism:" + type.getName();
if(type == MachineType.BASIC_FACTORY || type == MachineType.ADVANCED_FACTORY || type == MachineType.ELITE_FACTORY)
{
RecipeType recipe = RecipeType.values()[((ItemBlockMachine)stack.getItem()).getRecipeType(stack)];
resource = "mekanism:" + type.getName() + "_" + recipe.getName();
}
return machineResources.get(resource);
}
return null;
}
};
ItemMeshDefinition machineMesher = stack ->
{
MachineType type = MachineType.get(stack);
if(type != null)
{
String resource = "mekanism:" + type.getName();
if(type == MachineType.BASIC_FACTORY || type == MachineType.ADVANCED_FACTORY || type == MachineType.ELITE_FACTORY)
{
RecipeType recipe = RecipeType.values()[((ItemBlockMachine)stack.getItem()).getRecipeType(stack)];
resource = "mekanism:" + type.getName() + "_" + recipe.getName();
}
return machineResources.get(resource);
}
return null;
};
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(MekanismBlocks.MachineBlock), machineMesher);
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(MekanismBlocks.MachineBlock2), machineMesher);
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(MekanismBlocks.MachineBlock3), machineMesher);
ItemMeshDefinition basicMesher = new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack)
{
BasicBlockType type = BasicBlockType.get(stack);
if(type != null)
{
String resource = "mekanism:" + type.getName();
if(type.tiers)
{
BaseTier tier = ((ItemBlockBasic)stack.getItem()).getBaseTier(stack);
resource = "mekanism:" + type.getName() + "_" + tier.getName();
}
return basicResources.get(resource);
}
return null;
}
};
ItemMeshDefinition basicMesher = stack ->
{
BasicBlockType type = BasicBlockType.get(stack);
if(type != null)
{
String resource = "mekanism:" + type.getName();
if(type.tiers)
{
BaseTier tier = ((ItemBlockBasic)stack.getItem()).getBaseTier(stack);
resource = "mekanism:" + type.getName() + "_" + tier.getName();
}
return basicResources.get(resource);
}
return null;
};
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(MekanismBlocks.BasicBlock), basicMesher);
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(MekanismBlocks.BasicBlock2), basicMesher);
ItemMeshDefinition transmitterMesher = new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack)
{
TransmitterType type = TransmitterType.get(stack.getItemDamage());
if(type != null)
{
String resource = "mekanism:" + type.getName();
if(type.hasTiers())
{
BaseTier tier = ((ItemBlockTransmitter)stack.getItem()).getBaseTier(stack);
resource = "mekanism:" + type.getName() + "_" + tier.getName();
}
return transmitterResources.get(resource);
}
return null;
}
};
ItemMeshDefinition transmitterMesher = stack ->
{
TransmitterType type = TransmitterType.get(stack.getItemDamage());
if(type != null)
{
String resource = "mekanism:" + type.getName();
if(type.hasTiers())
{
BaseTier tier = ((ItemBlockTransmitter)stack.getItem()).getBaseTier(stack);
resource = "mekanism:" + type.getName() + "_" + tier.getName();
}
return transmitterResources.get(resource);
}
return null;
};
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(MekanismBlocks.Transmitter), transmitterMesher);
//Walkie Talkie dynamic texture
ModelLoader.setCustomMeshDefinition(MekanismItems.WalkieTalkie, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack)
{
if(!stack.isEmpty() && stack.getItem() instanceof ItemWalkieTalkie)
{
ItemWalkieTalkie item = (ItemWalkieTalkie)stack.getItem();
ModelLoader.setCustomMeshDefinition(MekanismItems.WalkieTalkie, stack ->
{
if(!stack.isEmpty() && stack.getItem() instanceof ItemWalkieTalkie)
{
ItemWalkieTalkie item = (ItemWalkieTalkie)stack.getItem();
if(item.getOn(stack))
{
return ItemWalkieTalkie.CHANNEL_MODELS.get(item.getChannel(stack));
}
}
if(item.getOn(stack))
{
return ItemWalkieTalkie.CHANNEL_MODELS.get(item.getChannel(stack));
}
}
return ItemWalkieTalkie.OFF_MODEL;
}
});
return ItemWalkieTalkie.OFF_MODEL;
});
//Crafting Formula dynamic texture
ModelLoader.setCustomMeshDefinition(MekanismItems.CraftingFormula, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack)
{
if(!stack.isEmpty() && stack.getItem() instanceof ItemCraftingFormula)
{
ItemCraftingFormula item = (ItemCraftingFormula)stack.getItem();
ModelLoader.setCustomMeshDefinition(MekanismItems.CraftingFormula, stack ->
{
if(!stack.isEmpty() && stack.getItem() instanceof ItemCraftingFormula)
{
ItemCraftingFormula item = (ItemCraftingFormula)stack.getItem();
if(item.getInventory(stack) == null)
{
return ItemCraftingFormula.MODEL;
}
else {
return item.isInvalid(stack) ? ItemCraftingFormula.INVALID_MODEL : ItemCraftingFormula.ENCODED_MODEL;
}
}
if(item.getInventory(stack) == null)
{
return ItemCraftingFormula.MODEL;
}
else {
return item.isInvalid(stack) ? ItemCraftingFormula.INVALID_MODEL : ItemCraftingFormula.ENCODED_MODEL;
}
}
return ItemCraftingFormula.MODEL;
}
});
return ItemCraftingFormula.MODEL;
});
OBJLoader.INSTANCE.addDomain("mekanism");
}
@@ -1002,13 +984,7 @@ public class ClientProxy extends CommonProxy
@Override
public void doMultiblockSparkle(final TileEntityMultiblock<?> tileEntity)
{
new SparkleAnimation(tileEntity, new INodeChecker() {
@Override
public boolean isNode(TileEntity tile)
{
return MultiblockManager.areEqual(tile, tileEntity);
}
}).run();
new SparkleAnimation(tileEntity, tile -> MultiblockManager.areEqual(tile, tileEntity)).run();
}
@Override
@@ -1016,67 +992,52 @@ public class ClientProxy extends CommonProxy
{
super.init();
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(new IBlockColor() {
@Override
public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex)
{
BlockMachine machine = (BlockMachine)state.getBlock();
if(state.getValue(machine.getMachineBlock().getProperty()) == MachineType.FLUID_TANK)
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler((state, worldIn, pos, tintIndex) ->
{
BlockMachine machine = (BlockMachine)state.getBlock();
if(state.getValue(machine.getMachineBlock().getProperty()) == MachineType.FLUID_TANK)
{
EnumColor color = state.getValue(BlockStateMachine.tierProperty).getColor();
return (int)(color.getColor(0)*255) << 16 | (int)(color.getColor(1)*255) << 8 | (int)(color.getColor(2)*255);
}
return -1;
}, MekanismBlocks.MachineBlock, MekanismBlocks.MachineBlock2, MekanismBlocks.MachineBlock3);
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler((state, worldIn, pos, tintIndex) ->
{
EnumColor color = state.getValue(BlockStateMachine.tierProperty).getColor();
return (int)(color.getColor(0)*255) << 16 | (int)(color.getColor(1)*255) << 8 | (int)(color.getColor(2)*255);
}
return -1;
}
}, MekanismBlocks.MachineBlock, MekanismBlocks.MachineBlock2, MekanismBlocks.MachineBlock3);
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(new IBlockColor() {
@Override
public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex)
{
EnumDyeColor color = state.getValue(colorProperty);
EnumColor dye = EnumColor.DYES[color.getDyeDamage()];
return (int)(dye.getColor(0)*255) << 16 | (int)(dye.getColor(1)*255) << 8 | (int)(dye.getColor(2)*255);
}
}, MekanismBlocks.PlasticBlock, MekanismBlocks.GlowPlasticBlock, MekanismBlocks.RoadPlasticBlock, MekanismBlocks.ReinforcedPlasticBlock,
EnumDyeColor color = state.getValue(colorProperty);
EnumColor dye = EnumColor.DYES[color.getDyeDamage()];
return (int)(dye.getColor(0)*255) << 16 | (int)(dye.getColor(1)*255) << 8 | (int)(dye.getColor(2)*255);
}, MekanismBlocks.PlasticBlock, MekanismBlocks.GlowPlasticBlock, MekanismBlocks.RoadPlasticBlock, MekanismBlocks.ReinforcedPlasticBlock,
MekanismBlocks.SlickPlasticBlock, MekanismBlocks.PlasticFence);
Minecraft.getMinecraft().getItemColors().registerItemColorHandler(new IItemColor() {
@Override
public int getColorFromItemstack(ItemStack stack, int tintIndex)
{
if(MachineType.get(stack) == MachineType.FLUID_TANK)
Minecraft.getMinecraft().getItemColors().registerItemColorHandler((stack, tintIndex) ->
{
if(MachineType.get(stack) == MachineType.FLUID_TANK)
{
EnumColor color = ((ItemBlockMachine)stack.getItem()).getBaseTier(stack).getColor();
return (int)(color.getColor(0)*255) << 16 | (int)(color.getColor(1)*255) << 8 | (int)(color.getColor(2)*255);
}
return -1;
}, MekanismBlocks.MachineBlock, MekanismBlocks.MachineBlock2, MekanismBlocks.MachineBlock3);
Minecraft.getMinecraft().getItemColors().registerItemColorHandler((stack, tintIndex) ->
{
EnumColor color = ((ItemBlockMachine)stack.getItem()).getBaseTier(stack).getColor();
return (int)(color.getColor(0)*255) << 16 | (int)(color.getColor(1)*255) << 8 | (int)(color.getColor(2)*255);
}
return -1;
}
}, MekanismBlocks.MachineBlock, MekanismBlocks.MachineBlock2, MekanismBlocks.MachineBlock3);
Minecraft.getMinecraft().getItemColors().registerItemColorHandler(new IItemColor() {
@Override
public int getColorFromItemstack(ItemStack stack, int tintIndex)
{
EnumDyeColor dyeColor = EnumDyeColor.byDyeDamage(stack.getItemDamage()&15);
EnumColor dye = EnumColor.DYES[dyeColor.getDyeDamage()];
return (int)(dye.getColor(0)*255) << 16 | (int)(dye.getColor(1)*255) << 8 | (int)(dye.getColor(2)*255);
}
}, MekanismBlocks.PlasticBlock, MekanismBlocks.GlowPlasticBlock, MekanismBlocks.RoadPlasticBlock, MekanismBlocks.ReinforcedPlasticBlock,
EnumDyeColor dyeColor = EnumDyeColor.byDyeDamage(stack.getItemDamage()&15);
EnumColor dye = EnumColor.DYES[dyeColor.getDyeDamage()];
return (int)(dye.getColor(0)*255) << 16 | (int)(dye.getColor(1)*255) << 8 | (int)(dye.getColor(2)*255);
}, MekanismBlocks.PlasticBlock, MekanismBlocks.GlowPlasticBlock, MekanismBlocks.RoadPlasticBlock, MekanismBlocks.ReinforcedPlasticBlock,
MekanismBlocks.SlickPlasticBlock, MekanismBlocks.PlasticFence);
Minecraft.getMinecraft().getItemColors().registerItemColorHandler(new IItemColor() {
@Override
public int getColorFromItemstack(ItemStack stack, int tintIndex)
{
EnumColor dye = EnumColor.DYES[stack.getItemDamage()];
return (int)(dye.getColor(0)*255) << 16 | (int)(dye.getColor(1)*255) << 8 | (int)(dye.getColor(2)*255);
}
}, MekanismItems.Balloon);
Minecraft.getMinecraft().getItemColors().registerItemColorHandler((stack, tintIndex) ->
{
EnumColor dye = EnumColor.DYES[stack.getItemDamage()];
return (int)(dye.getColor(0)*255) << 16 | (int)(dye.getColor(1)*255) << 8 | (int)(dye.getColor(2)*255);
}, MekanismItems.Balloon);
MinecraftForge.EVENT_BUS.register(new ClientConnectionHandler());
MinecraftForge.EVENT_BUS.register(new ClientPlayerTracker());
@@ -1114,41 +1075,11 @@ public class ClientProxy extends CommonProxy
MinecraftForge.EVENT_BUS.register(MekanismOBJLoader.INSTANCE);
//Register entity rendering handlers
RenderingRegistry.registerEntityRenderingHandler(EntityObsidianTNT.class, new IRenderFactory<EntityObsidianTNT>() {
@Override
public Render<EntityObsidianTNT> createRenderFor(RenderManager manager)
{
return new RenderObsidianTNTPrimed(manager);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityRobit.class, new IRenderFactory<EntityRobit>() {
@Override
public Render<EntityRobit> createRenderFor(RenderManager manager)
{
return new RenderRobit(manager);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityBalloon.class, new IRenderFactory<EntityBalloon>() {
@Override
public Render<EntityBalloon> createRenderFor(RenderManager manager)
{
return new RenderBalloon(manager);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityBabySkeleton.class, new IRenderFactory<EntityBabySkeleton>() {
@Override
public Render<AbstractSkeleton> createRenderFor(RenderManager manager)
{
return new RenderSkeleton(manager);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityFlame.class, new IRenderFactory<EntityFlame>() {
@Override
public Render<? super EntityFlame> createRenderFor(RenderManager manager)
{
return new RenderFlame(manager);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityObsidianTNT.class, RenderObsidianTNTPrimed::new);
RenderingRegistry.registerEntityRenderingHandler(EntityRobit.class, RenderRobit::new);
RenderingRegistry.registerEntityRenderingHandler(EntityBalloon.class, RenderBalloon::new);
RenderingRegistry.registerEntityRenderingHandler(EntityBabySkeleton.class, RenderSkeleton::new);
RenderingRegistry.registerEntityRenderingHandler(EntityFlame.class, RenderFlame::new);
}
@Override
@@ -91,11 +91,11 @@ public class ClientTickHandler
public static final String DONATE_CAPE = "https://dl.dropboxusercontent.com/u/90411166/donate.png";
public static final String AIDAN_CAPE = "https://dl.dropboxusercontent.com/u/90411166/aidan.png";
private Map<String, CapeBufferDownload> mikeDownload = new HashMap<String, CapeBufferDownload>();
private Map<String, CapeBufferDownload> donateDownload = new HashMap<String, CapeBufferDownload>();
private Map<String, CapeBufferDownload> aidanDownload = new HashMap<String, CapeBufferDownload>();
private Map<String, CapeBufferDownload> mikeDownload = new HashMap<>();
private Map<String, CapeBufferDownload> donateDownload = new HashMap<>();
private Map<String, CapeBufferDownload> aidanDownload = new HashMap<>();
public static Set<IClientTicker> tickingSet = new HashSet<IClientTicker>();
public static Set<IClientTicker> tickingSet = new HashSet<>();
public static Map<EntityPlayer, TeleportData> portableTeleports = new HashMap<>();
public static int wheelStatus = 0;
@@ -499,13 +499,7 @@ public class ClientTickHandler
public static void killDeadNetworks()
{
for(Iterator<IClientTicker> iter = tickingSet.iterator(); iter.hasNext();)
{
if(!iter.next().needsTicks())
{
iter.remove();
}
}
tickingSet.removeIf(iClientTicker -> !iClientTicker.needsTicks());
}
public static boolean isJetpackOn(EntityPlayer player)
@@ -17,8 +17,8 @@ public final class HolidayManager
private static Calendar calendar = Calendar.getInstance();
private static Minecraft mc = Minecraft.getMinecraft();
public static List<Holiday> holidays = new ArrayList<Holiday>();
private static List<Holiday> holidaysNotified = new ArrayList<Holiday>();
public static List<Holiday> holidays = new ArrayList<>();
private static List<Holiday> holidaysNotified = new ArrayList<>();
public static void init()
{
@@ -21,8 +21,8 @@ import net.minecraftforge.common.MinecraftForge;
public class MekanismClient extends Mekanism
{
public static Map<UUID, SecurityData> clientSecurityMap = new HashMap<UUID, SecurityData>();
public static Map<UUID, String> clientUUIDMap = new HashMap<UUID, String>();
public static Map<UUID, SecurityData> clientSecurityMap = new HashMap<>();
public static Map<UUID, String> clientUUIDMap = new HashMap<>();
public static VoiceClient voiceClient;
@@ -22,7 +22,7 @@ public class SparkleAnimation
public Random random = new Random();
public Set<Coord4D> iteratedNodes = new HashSet<Coord4D>();
public Set<Coord4D> iteratedNodes = new HashSet<>();
public INodeChecker nodeChecker;
@@ -44,26 +44,23 @@ public class SparkleAnimation
} catch(Exception e) {}
try {
new Thread() {
@Override
public void run()
{
World world = pointer.getWorld();
for(Coord4D coord : iteratedNodes)
{
for(int i = 0; i < 6; i++)
{
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + random.nextDouble(), coord.y + -.01, coord.z + random.nextDouble(), 0, 0, 0);
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + random.nextDouble(), coord.y + 1.01, coord.z + random.nextDouble(), 0, 0, 0);
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + random.nextDouble(), coord.y + random.nextDouble(), coord.z + -.01, 0, 0, 0);
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + random.nextDouble(), coord.y + random.nextDouble(), coord.z + 1.01, 0, 0, 0);
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + -.01, coord.y + random.nextDouble(), coord.z + random.nextDouble(), 0, 0, 0);
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + 1.01, coord.y + random.nextDouble(), coord.z + random.nextDouble(), 0, 0, 0);
}
}
}
}.start();
new Thread(() ->
{
World world = pointer.getWorld();
for(Coord4D coord : iteratedNodes)
{
for(int i = 0; i < 6; i++)
{
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + random.nextDouble(), coord.y + -.01, coord.z + random.nextDouble(), 0, 0, 0);
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + random.nextDouble(), coord.y + 1.01, coord.z + random.nextDouble(), 0, 0, 0);
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + random.nextDouble(), coord.y + random.nextDouble(), coord.z + -.01, 0, 0, 0);
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + random.nextDouble(), coord.y + random.nextDouble(), coord.z + 1.01, 0, 0, 0);
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + -.01, coord.y + random.nextDouble(), coord.z + random.nextDouble(), 0, 0, 0);
world.spawnParticle(EnumParticleTypes.REDSTONE, coord.x + 1.01, coord.y + random.nextDouble(), coord.z + random.nextDouble(), 0, 0, 0);
}
}
}).start();
} catch(Exception e) {}
}
@@ -45,14 +45,11 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, tileEntity.guiLocation));
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, tileEntity.guiLocation));
guiElements.add(new GuiPowerBar(this, tileEntity, tileEntity.guiLocation, 164, 15));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity.guiLocation));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, tileEntity.guiLocation));
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16));
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 30, 34).with(SlotOverlay.POWER));
@@ -124,4 +121,4 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, gas.getGas().getSprite(), sizeX, sizeY);
}
}
}
@@ -22,13 +22,7 @@ public class GuiAmbientAccumulator extends GuiMekanism
super(tile, new ContainerNull(player, tile));
tileEntity = tile;
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.collectedGas;
}
}, Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 26, 16));
guiElements.add(new GuiGasGauge(() -> tileEntity.collectedGas, Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 26, 16));
}
@Override
@@ -37,29 +37,14 @@ public class GuiBoilerStats extends GuiMekanism
super(tentity, new ContainerNull(inventory.player, tentity));
tileEntity = tentity;
guiElements.add(new GuiBoilerTab(this, tileEntity, BoilerTab.MAIN, 6, MekanismUtils.getResource(ResourceType.GUI, "GuiBoilerStats.png")));
guiElements.add(new GuiHeatInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.structure.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBoilerStats.png")));
guiElements.add(boilGraph = new GuiGraph(this, MekanismUtils.getResource(ResourceType.GUI, "GuiBoilerStats.png"), 8, 83, 160, 36, new GraphDataHandler() {
@Override
public String getDataDisplay(int data)
{
return LangUtils.localize("gui.boilRate") + ": " + data + " mB/t";
}
}));
guiElements.add(maxGraph = new GuiGraph(this, MekanismUtils.getResource(ResourceType.GUI, "GuiBoilerStats.png"), 8, 122, 160, 36, new GraphDataHandler() {
@Override
public String getDataDisplay(int data)
{
return LangUtils.localize("gui.maxBoil") + ": " + data + " mB/t";
}
}));
guiElements.add(new GuiHeatInfo(() ->
{
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.structure.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBoilerStats.png")));
guiElements.add(boilGraph = new GuiGraph(this, MekanismUtils.getResource(ResourceType.GUI, "GuiBoilerStats.png"), 8, 83, 160, 36, data -> LangUtils.localize("gui.boilRate") + ": " + data + " mB/t"));
guiElements.add(maxGraph = new GuiGraph(this, MekanismUtils.getResource(ResourceType.GUI, "GuiBoilerStats.png"), 8, 122, 160, 36, data -> LangUtils.localize("gui.maxBoil") + ": " + data + " mB/t"));
maxGraph.enableFixedScale((int)((tentity.structure.superheatingElements*general.superheatingHeatTransfer)/SynchronizedBoilerData.getHeatEnthalpy()));
}
@@ -43,14 +43,11 @@ public class GuiChanceMachine extends GuiMekanism
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, tileEntity.guiLocation));
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, tileEntity.guiLocation));
guiElements.add(new GuiPowerBar(this, tileEntity, tileEntity.guiLocation, 164, 15));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity.guiLocation));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, tileEntity.guiLocation));
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16));
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER));
@@ -54,7 +54,7 @@ public class GuiChemicalCrystallizer extends GuiMekanism
public int stackIndex = 0;
public List<ItemStack> iterStacks = new ArrayList<ItemStack>();
public List<ItemStack> iterStacks = new ArrayList<>();
public GuiChemicalCrystallizer(InventoryPlayer inventory, TileEntityChemicalCrystallizer tentity)
{
@@ -67,21 +67,12 @@ public class GuiChemicalCrystallizer extends GuiMekanism
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 160, 23));
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png")));
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png")));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png")));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.inputTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 5, 4));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png")));
guiElements.add(new GuiGasGauge(() -> tileEntity.inputTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 5, 4));
guiElements.add(new GuiSlot(SlotType.EXTRA, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 5, 64).with(SlotOverlay.PLUS));
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 130, 56));
@@ -220,13 +211,13 @@ public class GuiChemicalCrystallizer extends GuiMekanism
{
if(iterStacks == null)
{
iterStacks = new ArrayList<ItemStack>();
iterStacks = new ArrayList<>();
}
else {
iterStacks.clear();
}
List<String> keys = new ArrayList<String>();
List<String> keys = new ArrayList<>();
for(String s : OreDictionary.getOreNames())
{
@@ -42,28 +42,13 @@ public class GuiChemicalDissolutionChamber extends GuiMekanism
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png")));
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png")));
guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png")));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png")));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.injectTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 5, 4));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.outputTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 133, 13));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png")));
guiElements.add(new GuiGasGauge(() -> tileEntity.injectTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 5, 4));
guiElements.add(new GuiGasGauge(() -> tileEntity.outputTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 133, 13));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 25, 35));
@@ -42,35 +42,14 @@ public class GuiChemicalInfuser extends GuiMekanism
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png")));
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png")));
guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png")));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String usage = MekanismUtils.getEnergyDisplay(tileEntity.clientEnergyUsed);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + usage + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png")));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.leftTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 25, 13));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.centerTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 79, 4));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.rightTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 133, 13));
guiElements.add(new GuiEnergyInfo(() ->
{
String usage = MekanismUtils.getEnergyDisplay(tileEntity.clientEnergyUsed);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + usage + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png")));
guiElements.add(new GuiGasGauge(() -> tileEntity.leftTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 25, 13));
guiElements.add(new GuiGasGauge(() -> tileEntity.centerTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 79, 4));
guiElements.add(new GuiGasGauge(() -> tileEntity.rightTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 133, 13));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 154, 55).with(SlotOverlay.MINUS));
@@ -42,21 +42,12 @@ public class GuiChemicalOxidizer extends GuiMekanism
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png")));
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png")));
guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png")));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png")));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.gasTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 133, 13));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png")));
guiElements.add(new GuiGasGauge(() -> tileEntity.gasTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 133, 13));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 25, 35));
@@ -48,36 +48,14 @@ public class GuiChemicalWasher extends GuiMekanism
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png")));
guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png")));
guiElements.add(new GuiBucketIO(this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png")));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String usage = MekanismUtils.getEnergyDisplay(tileEntity.clientEnergyUsed);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + usage + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png")));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler()
{
@Override
public FluidTank getTank()
{
return tileEntity.fluidTank;
}
}, Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 5, 4));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.inputTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 26, 13));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.outputTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 133, 13));
guiElements.add(new GuiEnergyInfo(() ->
{
String usage = MekanismUtils.getEnergyDisplay(tileEntity.clientEnergyUsed);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + usage + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png")));
guiElements.add(new GuiFluidGauge(() -> tileEntity.fluidTank, Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 5, 4));
guiElements.add(new GuiGasGauge(() -> tileEntity.inputTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 26, 13));
guiElements.add(new GuiGasGauge(() -> tileEntity.outputTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 133, 13));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 154, 55).with(SlotOverlay.MINUS));
@@ -59,14 +59,11 @@ public class GuiDigitalMiner extends GuiMekanism
guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png")));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 163, 23));
guiElements.add(new GuiVisualsTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png")));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.getPerTick());
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png")));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.getPerTick());
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png")));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 151, 5).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 143, 26));
@@ -116,14 +113,14 @@ public class GuiDigitalMiner extends GuiMekanism
if(guibutton.id == 0)
{
ArrayList<Object> data = new ArrayList<Object>();
ArrayList<Object> data = new ArrayList<>();
data.add(3);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
}
else if(guibutton.id == 1)
{
ArrayList<Object> data = new ArrayList<Object>();
ArrayList<Object> data = new ArrayList<>();
data.add(4);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
@@ -308,7 +305,7 @@ public class GuiDigitalMiner extends GuiMekanism
{
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList<Object> data = new ArrayList<Object>();
ArrayList<Object> data = new ArrayList<>();
data.add(0);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
@@ -318,7 +315,7 @@ public class GuiDigitalMiner extends GuiMekanism
{
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList<Object> data = new ArrayList<Object>();
ArrayList<Object> data = new ArrayList<>();
data.add(1);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
@@ -328,7 +325,7 @@ public class GuiDigitalMiner extends GuiMekanism
{
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList<Object> data = new ArrayList<Object>();
ArrayList<Object> data = new ArrayList<>();
data.add(5);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
@@ -338,7 +335,7 @@ public class GuiDigitalMiner extends GuiMekanism
{
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList<Object> data = new ArrayList<Object>();
ArrayList<Object> data = new ArrayList<>();
data.add(9);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
@@ -66,8 +66,8 @@ public class GuiDigitalMinerConfig extends GuiMekanism
public int stackSwitch = 0;
public Map<MOreDictFilter, StackData> oreDictStacks = new HashMap<MOreDictFilter, StackData>();
public Map<MModIDFilter, StackData> modIDStacks = new HashMap<MModIDFilter, StackData>();
public Map<MOreDictFilter, StackData> oreDictStacks = new HashMap<>();
public Map<MModIDFilter, StackData> modIDStacks = new HashMap<>();
public float scroll;
@@ -167,8 +167,8 @@ public class GuiDigitalMinerConfig extends GuiMekanism
}
}
Set<MOreDictFilter> oreDictFilters = new HashSet<MOreDictFilter>();
Set<MModIDFilter> modIDFilters = new HashSet<MModIDFilter>();
Set<MOreDictFilter> oreDictFilters = new HashSet<>();
Set<MModIDFilter> modIDFilters = new HashSet<>();
for(int i = 0; i < 4; i++)
{
@@ -43,14 +43,11 @@ public class GuiElectricMachine extends GuiMekanism
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, tileEntity.guiLocation));
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, tileEntity.guiLocation));
guiElements.add(new GuiPowerBar(this, tileEntity, tileEntity.guiLocation, 164, 15));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity.guiLocation));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, tileEntity.guiLocation));
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16));
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER));
@@ -91,4 +88,4 @@ public class GuiElectricMachine extends GuiMekanism
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
}
}
}
@@ -44,21 +44,12 @@ public class GuiElectricPump extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 50));
guiElements.add(new GuiSlot(SlotType.POWER, this, guiLocation, 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiPowerBar(this, tileEntity, guiLocation, 164, 15));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
@Override
public FluidTank getTank()
{
return tileEntity.fluidTank;
}
}, GuiGauge.Type.STANDARD, this, guiLocation, 6, 13));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, guiLocation));
guiElements.add(new GuiFluidGauge(() -> tileEntity.fluidTank, GuiGauge.Type.STANDARD, this, guiLocation, 6, 13));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, guiLocation));
guiElements.add(new GuiSecurityTab(this, tileEntity, guiLocation));
guiElements.add(new GuiRedstoneControl(this, tileEntity, guiLocation));
guiElements.add(new GuiUpgradeTab(this, tileEntity, guiLocation));
@@ -54,35 +54,14 @@ public class GuiElectrolyticSeparator extends GuiMekanism
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png")));
guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png")));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String usage = MekanismUtils.getEnergyDisplay(tileEntity.clientEnergyUsed);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + usage + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png")));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
@Override
public FluidTank getTank()
{
return tileEntity.fluidTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 5, 10));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.leftTank;
}
}, GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 18));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.rightTank;
}
}, GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 18));
guiElements.add(new GuiEnergyInfo(() ->
{
String usage = MekanismUtils.getEnergyDisplay(tileEntity.clientEnergyUsed);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + usage + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png")));
guiElements.add(new GuiFluidGauge(() -> tileEntity.fluidTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 5, 10));
guiElements.add(new GuiGasGauge(() -> tileEntity.leftTank, GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 18));
guiElements.add(new GuiGasGauge(() -> tileEntity.rightTank, GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 18));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 164, 15));
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png")));
@@ -39,24 +39,10 @@ public class GuiEnergyCube extends GuiMekanism
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png")));
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png")));
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png")));
guiElements.add(new GuiEnergyGauge(new IEnergyInfoHandler()
{
@Override
public IStrictEnergyStorage getEnergyStorage()
{
return tileEntity;
}
}, GuiEnergyGauge.Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 55, 18));
guiElements.add(new GuiEnergyInfo(new IInfoHandler()
{
@Override
public List<String> getInfo()
{
return ListUtils.asList(
LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy(), tileEntity.getMaxEnergy()),
LangUtils.localize("gui.maxOutput") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t");
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png")));
guiElements.add(new GuiEnergyGauge(() -> tileEntity, GuiEnergyGauge.Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 55, 18));
guiElements.add(new GuiEnergyInfo(() -> ListUtils.asList(
LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy(), tileEntity.getMaxEnergy()),
LangUtils.localize("gui.maxOutput") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t"), this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png")));
guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 16, 34).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.OUTPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 142, 34).with(SlotOverlay.PLUS));
}
@@ -55,14 +55,11 @@ public class GuiFactory extends GuiMekanism
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, tileEntity.tier.guiLocation));
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, tileEntity.tier.guiLocation));
guiElements.add(new GuiSortingTab(this, tileEntity, tileEntity.tier.guiLocation));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.lastUsage);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity.tier.guiLocation));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.lastUsage);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, tileEntity.tier.guiLocation));
}
@Override
@@ -30,14 +30,7 @@ public class GuiFluidTank extends GuiMekanism
tileEntity = tentity;
guiElements.add(new GuiContainerEditMode(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler()
{
@Override
public FluidTank getTank()
{
return tileEntity.fluidTank;
}
}, GuiFluidGauge.Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 48, 18));
guiElements.add(new GuiFluidGauge(() -> tileEntity.fluidTank, GuiFluidGauge.Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 48, 18));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 145, 18).with(SlotOverlay.INPUT));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 145, 50).with(SlotOverlay.OUTPUT));
}
@@ -44,21 +44,12 @@ public class GuiFluidicPlenisher extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 50));
guiElements.add(new GuiSlot(SlotType.POWER, this, guiLocation, 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiPowerBar(this, tileEntity, guiLocation, 164, 15));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
@Override
public FluidTank getTank()
{
return tileEntity.fluidTank;
}
}, GuiGauge.Type.STANDARD, this, guiLocation, 6, 13));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, guiLocation));
guiElements.add(new GuiFluidGauge(() -> tileEntity.fluidTank, GuiGauge.Type.STANDARD, this, guiLocation, 6, 13));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, guiLocation));
guiElements.add(new GuiSecurityTab(this, tileEntity, guiLocation));
guiElements.add(new GuiRedstoneControl(this, tileEntity, guiLocation));
guiElements.add(new GuiUpgradeTab(this, tileEntity, guiLocation));
@@ -56,14 +56,11 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, guiLocation));
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, guiLocation));
guiElements.add(new GuiPowerBar(this, tileEntity, guiLocation, 159, 15));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, guiLocation));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, guiLocation));
guiElements.add(new GuiSlot(SlotType.POWER, this, guiLocation, 151, 75).with(SlotOverlay.POWER));
ySize+=64;
@@ -34,15 +34,12 @@ public class GuiFuelwoodHeater extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiFuelwoodHeater.png"), 14, 28));
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiFuelwoodHeater.png")));
guiElements.add(new GuiHeatInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiFuelwoodHeater.png")));
guiElements.add(new GuiHeatInfo(() ->
{
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiFuelwoodHeater.png")));
}
@Override
@@ -29,17 +29,10 @@ public class GuiInductionMatrix extends GuiMekanism
super(tentity, new ContainerInductionMatrix(inventory, tentity));
tileEntity = tentity;
guiElements.add(new GuiMatrixTab(this, tileEntity, MatrixTab.STAT, 6, MekanismUtils.getResource(ResourceType.GUI, "GuiInductionMatrix.png")));
guiElements.add(new GuiEnergyInfo(new IInfoHandler()
{
@Override
public List<String> getInfo()
{
return ListUtils.asList(
LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy(), tileEntity.getMaxEnergy()),
LangUtils.localize("gui.input") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.structure.lastInput) + "/t",
LangUtils.localize("gui.output") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.structure.lastOutput) + "/t");
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiInductionMatrix.png")));
guiElements.add(new GuiEnergyInfo(() -> ListUtils.asList(
LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy(), tileEntity.getMaxEnergy()),
LangUtils.localize("gui.input") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.structure.lastInput) + "/t",
LangUtils.localize("gui.output") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.structure.lastOutput) + "/t"), this, MekanismUtils.getResource(ResourceType.GUI, "GuiInductionMatrix.png")));
}
@Override
@@ -82,9 +82,9 @@ public class GuiLogisticalSorter extends GuiMekanism
public int stackSwitch = 0;
public Map<TOreDictFilter, StackData> oreDictStacks = new HashMap<TOreDictFilter, StackData>();
public Map<TOreDictFilter, StackData> oreDictStacks = new HashMap<>();
public Map<TModIDFilter, StackData> modIDStacks = new HashMap<TModIDFilter, StackData>();
public Map<TModIDFilter, StackData> modIDStacks = new HashMap<>();
public GuiLogisticalSorter(EntityPlayer player, TileEntityLogisticalSorter entity)
{
@@ -186,8 +186,8 @@ public class GuiLogisticalSorter extends GuiMekanism
}
}
final Set<TOreDictFilter> oreDictFilters = new HashSet<TOreDictFilter>();
final Set<TModIDFilter> modIDFilters = new HashSet<TModIDFilter>();
final Set<TOreDictFilter> oreDictFilters = new HashSet<>();
final Set<TModIDFilter> modIDFilters = new HashSet<>();
for(int i = 0; i < 4; i++)
{
@@ -736,4 +736,4 @@ public class GuiLogisticalSorter extends GuiMekanism
{
return tileEntity.filters.size() > 4;
}
}
}
@@ -33,14 +33,7 @@ public class GuiMatrixStats extends GuiMekanism
super(tentity, new ContainerNull(inventory.player, tentity));
tileEntity = tentity;
guiElements.add(new GuiMatrixTab(this, tileEntity, MatrixTab.MAIN, 6, MekanismUtils.getResource(ResourceType.GUI, "GuiNull.png")));
guiElements.add(new GuiEnergyGauge(new IEnergyInfoHandler()
{
@Override
public IStrictEnergyStorage getEnergyStorage()
{
return tileEntity;
}
}, GuiEnergyGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiNull.png"), 6, 13));
guiElements.add(new GuiEnergyGauge(() -> tileEntity, GuiEnergyGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiNull.png"), 6, 13));
guiElements.add(new GuiRateBar(this, new IRateInfoHandler()
{
@Override
@@ -69,17 +62,10 @@ public class GuiMatrixStats extends GuiMekanism
return tileEntity.structure.lastOutput/tileEntity.structure.transferCap;
}
}, MekanismUtils.getResource(ResourceType.GUI, "GuiNull.png"), 38, 13));
guiElements.add(new GuiEnergyInfo(new IInfoHandler()
{
@Override
public List<String> getInfo()
{
return ListUtils.asList(
LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy(), tileEntity.getMaxEnergy()),
LangUtils.localize("gui.input") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.structure.lastInput) + "/t",
LangUtils.localize("gui.output") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.structure.lastOutput) + "/t");
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiNull.png")));
guiElements.add(new GuiEnergyInfo(() -> ListUtils.asList(
LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy(), tileEntity.getMaxEnergy()),
LangUtils.localize("gui.input") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.structure.lastInput) + "/t",
LangUtils.localize("gui.output") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.structure.lastOutput) + "/t"), this, MekanismUtils.getResource(ResourceType.GUI, "GuiNull.png")));
}
@Override
@@ -25,7 +25,7 @@ import org.lwjgl.input.Mouse;
public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
{
public Set<GuiElement> guiElements = new HashSet<GuiElement>();
public Set<GuiElement> guiElements = new HashSet<>();
private TileEntityContainerBlock tileEntity;
@@ -23,7 +23,7 @@ public class GuiMekanismConfig extends GuiConfig
private static List<IConfigElement> getConfigElements()
{
List<IConfigElement> list = new ArrayList<IConfigElement>();
List<IConfigElement> list = new ArrayList<>();
list.add(new DummyCategoryElement(LangUtils.localize("mekanism.configgui.ctgy.general"), "mekanism.configgui.ctgy.general", GeneralEntry.class));
list.add(new DummyCategoryElement(LangUtils.localize("mekanism.configgui.ctgy.machines"), "mekanism.configgui.ctgy.machines", MachinesEntry.class));
list.add(new DummyCategoryElement(LangUtils.localize("mekanism.configgui.ctgy.tier"), "mekanism.configgui.ctgy.tier", TierEntry.class));
@@ -52,14 +52,11 @@ public class GuiMetallurgicInfuser extends GuiMekanism
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png")));
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png")));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 164, 15));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png")));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyPerTick);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png")));
guiElements.add(new GuiSlot(SlotType.EXTRA, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 16, 34));
guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 50, 42));
@@ -42,7 +42,7 @@ public class GuiOredictionificator extends GuiMekanism
{
public TileEntityOredictionificator tileEntity;
public Map<OredictionificatorFilter, ItemStack> renderStacks = new HashMap<OredictionificatorFilter, ItemStack>();
public Map<OredictionificatorFilter, ItemStack> renderStacks = new HashMap<>();
public boolean isDragging = false;
+9 -30
View File
@@ -50,36 +50,15 @@ public class GuiPRC extends GuiMekanism
guiElements.add(new GuiSideConfigurationTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiTransporterConfigTab(this, 34, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
double extra = tileEntity.getRecipe() != null ? tileEntity.getRecipe().extraEnergy : 0;
String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity, tileEntity.BASE_ENERGY_PER_TICK + extra));
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
@Override
public FluidTank getTank()
{
return tileEntity.inputFluidTank;
}
}, GuiGauge.Type.STANDARD_YELLOW, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 5, 10));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.inputGasTank;
}
}, GuiGauge.Type.STANDARD_RED, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 28, 10));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.outputGasTank;
}
}, GuiGauge.Type.SMALL_BLUE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 140, 40));
guiElements.add(new GuiEnergyInfo(() ->
{
double extra = tileEntity.getRecipe() != null ? tileEntity.getRecipe().extraEnergy : 0;
String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity, tileEntity.BASE_ENERGY_PER_TICK + extra));
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiFluidGauge(() -> tileEntity.inputFluidTank, GuiGauge.Type.STANDARD_YELLOW, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 5, 10));
guiElements.add(new GuiGasGauge(() -> tileEntity.inputGasTank, GuiGauge.Type.STANDARD_RED, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 28, 10));
guiElements.add(new GuiGasGauge(() -> tileEntity.outputGasTank, GuiGauge.Type.SMALL_BLUE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 140, 40));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 164, 15));
guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 53, 34));
@@ -126,7 +126,7 @@ public class GuiQuantumEntangloporter extends GuiMekanism
return;
}
List<String> text = new ArrayList<String>();
List<String> text = new ArrayList<>();
if(privateMode)
{
@@ -51,23 +51,17 @@ public class GuiResistiveHeater extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, "GuiResistiveHeater.png"), 14, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiResistiveHeater.png")));
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiResistiveHeater.png")));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyUsage);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiResistiveHeater.png")));
guiElements.add(new GuiHeatInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiResistiveHeater.png")));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.energyUsage);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiResistiveHeater.png")));
guiElements.add(new GuiHeatInfo(() ->
{
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiResistiveHeater.png")));
}
@Override
@@ -60,28 +60,13 @@ public class GuiRotaryCondensentrator extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String usage = MekanismUtils.getEnergyDisplay(tileEntity.clientEnergyUsed);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + usage + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png")));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
@Override
public FluidTank getTank()
{
return tileEntity.fluidTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 133, 13));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.gasTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 25, 13));
guiElements.add(new GuiEnergyInfo(() ->
{
String usage = MekanismUtils.getEnergyDisplay(tileEntity.clientEnergyUsed);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + usage + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png")));
guiElements.add(new GuiFluidGauge(() -> tileEntity.fluidTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 133, 13));
guiElements.add(new GuiGasGauge(() -> tileEntity.gasTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 25, 13));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@@ -87,7 +87,7 @@ public class GuiSecurityDesk extends GuiMekanism
return;
}
ArrayList<Object> data = new ArrayList<Object>();
ArrayList<Object> data = new ArrayList<>();
data.add(0);
data.add(trusted);
@@ -101,7 +101,7 @@ public class GuiSecurityDesk extends GuiMekanism
return;
}
List<String> text = new ArrayList<String>();
List<String> text = new ArrayList<>();
if(tileEntity.frequency != null)
{
@@ -155,7 +155,7 @@ public class GuiSecurityDesk extends GuiMekanism
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
ArrayList<Object> data = new ArrayList<Object>();
ArrayList<Object> data = new ArrayList<>();
if(xAxis >= 146 && xAxis <= 162 && yAxis >= 59 && yAxis <= 75)
{
@@ -235,7 +235,7 @@ public class GuiSecurityDesk extends GuiMekanism
{
if(tileEntity != null)
{
ArrayList<Object> data = new ArrayList<Object>();
ArrayList<Object> data = new ArrayList<>();
data.add(1);
data.add(tileEntity.frequency.trusted.get(selection));
@@ -30,7 +30,7 @@ public class GuiSeismicReader extends GuiScreen
public ItemStack itemStack;
private ArrayList<Pair<Integer, Block>> blockList = new ArrayList<Pair<Integer, Block>>();
private ArrayList<Pair<Integer, Block>> blockList = new ArrayList<>();
public Coord4D pos;
@@ -36,14 +36,11 @@ public class GuiSeismicVibrator extends GuiMekanism
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png")));
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png")));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png"), 164, 15));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
String multiplier = MekanismUtils.getEnergyDisplay(usage.seismicVibratorUsage);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png")));
guiElements.add(new GuiEnergyInfo(() ->
{
String multiplier = MekanismUtils.getEnergyDisplay(usage.seismicVibratorUsage);
return ListUtils.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t", LangUtils.localize("gui.needed") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png")));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png"), 142, 34).with(SlotOverlay.POWER));
}
@@ -37,13 +37,13 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GuiSideConfiguration extends GuiMekanism
{
public Map<Integer, GuiPos> slotPosMap = new HashMap<Integer, GuiPos>();
public Map<Integer, GuiPos> slotPosMap = new HashMap<>();
public ISideConfiguration configurable;
public TransmissionType currentType;
public List<GuiConfigTypeTab> configTabs = new ArrayList<GuiConfigTypeTab>();
public List<GuiConfigTypeTab> configTabs = new ArrayList<>();
public GuiSideConfiguration(EntityPlayer player, ISideConfiguration tile)
{
@@ -40,20 +40,8 @@ public class GuiSolarNeutronActivator extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 4, 55).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 154, 55).with(SlotOverlay.PLUS));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.inputTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 25, 13));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.outputTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 133, 13));
guiElements.add(new GuiGasGauge(() -> tileEntity.inputTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 25, 13));
guiElements.add(new GuiGasGauge(() -> tileEntity.outputTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 133, 13));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@@ -75,8 +75,8 @@ public class GuiTeleporter extends GuiMekanism
public Frequency clientFreq;
public byte clientStatus;
public List<Frequency> clientPublicCache = new ArrayList<Frequency>();
public List<Frequency> clientPrivateCache = new ArrayList<Frequency>();
public List<Frequency> clientPublicCache = new ArrayList<>();
public List<Frequency> clientPrivateCache = new ArrayList<>();
public boolean isInit = true;
@@ -231,7 +231,7 @@ public class GuiTeleporter extends GuiMekanism
return;
}
List<String> text = new ArrayList<String>();
List<String> text = new ArrayList<>();
if(privateMode)
{
@@ -33,29 +33,14 @@ public class GuiThermalEvaporationController extends GuiMekanism
super(tentity, new ContainerThermalEvaporationController(inventory, tentity));
tileEntity = tentity;
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
@Override
public FluidTank getTank()
{
return tileEntity.inputTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermalEvaporationController.png"), 6, 13));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
@Override
public FluidTank getTank()
{
return tileEntity.outputTank;
}
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermalEvaporationController.png"), 152, 13));
guiElements.add(new GuiHeatInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.totalLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermalEvaporationController.png")));
guiElements.add(new GuiFluidGauge(() -> tileEntity.inputTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermalEvaporationController.png"), 6, 13));
guiElements.add(new GuiFluidGauge(() -> tileEntity.outputTank, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermalEvaporationController.png"), 152, 13));
guiElements.add(new GuiHeatInfo(() ->
{
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.totalLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermalEvaporationController.png")));
}
@Override
@@ -66,15 +66,12 @@ public class GuiThermoelectricBoiler extends GuiMekanism
return (double)tileEntity.structure.lastMaxBoil/cap;
}
}, MekanismUtils.getResource(ResourceType.GUI, "GuiThermoelectricBoiler.png"), 144, 13));
guiElements.add(new GuiHeatInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
{
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.structure.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
}
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermoelectricBoiler.png")));
guiElements.add(new GuiHeatInfo(() ->
{
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.structure.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermoelectricBoiler.png")));
}
@Override
@@ -36,7 +36,7 @@ import org.lwjgl.opengl.GL12;
@SideOnly(Side.CLIENT)
public class GuiTransporterConfig extends GuiMekanism
{
public Map<Integer, GuiPos> slotPosMap = new HashMap<Integer, GuiPos>();
public Map<Integer, GuiPos> slotPosMap = new HashMap<>();
public ISideConfiguration configurable;
@@ -47,7 +47,7 @@ public class GuiEnergyInfo extends GuiElement
{
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 142 && yAxis <= 160)
{
List<String> info = new ArrayList<String>();
List<String> info = new ArrayList<>();
for(String s : infoHandler.getInfo())
{
@@ -25,7 +25,7 @@ public class GuiGraph extends GuiElement
public int currentScale = 10;
public boolean fixedScale = false;
public List<Integer> graphData = new ArrayList<Integer>();
public List<Integer> graphData = new ArrayList<>();
public GraphDataHandler dataHandler;
@@ -46,7 +46,7 @@ public class GuiHeatInfo extends GuiElement
{
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 116 && yAxis <= 134)
{
List<String> info = new ArrayList<String>();
List<String> info = new ArrayList<>();
for(String s : infoHandler.getInfo())
{
@@ -21,7 +21,7 @@ public class GuiScrollList extends GuiElement
public int xPosition;
public int yPosition;
public List<String> textEntries = new ArrayList<String>();
public List<String> textEntries = new ArrayList<>();
public int dragOffset = 0;
@@ -171,7 +171,7 @@ public abstract class BaseRecipeCategory implements IRecipeCategory, IGuiWrapper
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
}
public Set<GuiElement> guiElements = new HashSet<GuiElement>();
public Set<GuiElement> guiElements = new HashSet<>();
public void addGuiElements() {}
@@ -206,7 +206,7 @@ public class MekanismJEI implements IModPlugin
registry.addRecipeHandlers(new BaseRecipeHandler(prcCategory, PRCRecipeWrapper.class));
addRecipes(registry, Recipe.PRESSURIZED_REACTION_CHAMBER, prcCategory, PressurizedRecipe.class, PRCRecipeCategory.class, PRCRecipeWrapper.class);
List<RotaryCondensentratorRecipeWrapper> condensentratorRecipes = new ArrayList<RotaryCondensentratorRecipeWrapper>();
List<RotaryCondensentratorRecipeWrapper> condensentratorRecipes = new ArrayList<>();
RotaryCondensentratorRecipeCategory rotaryCondensentratorCategory = new RotaryCondensentratorRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(rotaryCondensentratorCategory);
@@ -34,7 +34,7 @@ public abstract class AdvancedMachineRecipeWrapper extends BaseRecipeWrapper
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
List<String> currenttip = new ArrayList<>();
if(mouseX >= 33 && mouseX <= 39 && mouseY >= 22 && mouseY <= 34)
{
@@ -26,7 +26,7 @@ public class ChemicalInjectionChamberRecipeWrapper extends AdvancedMachineRecipe
{
if(gasType == MekanismFluids.SulfuricAcid)
{
List<ItemStack> fuels = new ArrayList<ItemStack>();
List<ItemStack> fuels = new ArrayList<>();
fuels.addAll(OreDictionary.getOres("dustSulfur"));
fuels.add(MekanismUtils.getFullGasTank(GasTankTier.BASIC, MekanismFluids.SulfuricAcid));
@@ -38,13 +38,13 @@ public class ChemicalInjectionChamberRecipeWrapper extends AdvancedMachineRecipe
}
else if(gasType == MekanismFluids.HydrogenChloride)
{
List<ItemStack> fuels = new ArrayList<ItemStack>();
List<ItemStack> fuels = new ArrayList<>();
fuels.addAll(OreDictionary.getOres("dustSalt"));
fuels.add(MekanismUtils.getFullGasTank(GasTankTier.BASIC, MekanismFluids.HydrogenChloride));
return fuels;
}
return new ArrayList<ItemStack>();
return new ArrayList<>();
}
}
@@ -29,6 +29,6 @@ public class PurificationChamberRecipeWrapper extends AdvancedMachineRecipeWrapp
return ListUtils.asList(new ItemStack(Items.FLINT), MekanismUtils.getFullGasTank(GasTankTier.BASIC, MekanismFluids.Oxygen));
}
return new ArrayList<ItemStack>();
return new ArrayList<>();
}
}
@@ -34,7 +34,7 @@ public class ChemicalCrystallizerRecipeWrapper extends BaseRecipeWrapper
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
List<String> currenttip = new ArrayList<>();
if(mouseX >= 1 && mouseX <= 17 && mouseY >= 5-3 && mouseY <= 63-3)
{
@@ -36,7 +36,7 @@ public class ChemicalDissolutionChamberRecipeWrapper extends BaseRecipeWrapper
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
List<String> currenttip = new ArrayList<>();
if(mouseX >= 6-3 && mouseX <= 22-3 && mouseY >= 5-3 && mouseY <= 63-3)
{
@@ -34,7 +34,7 @@ public class ChemicalInfuserRecipeWrapper extends BaseRecipeWrapper
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
List<String> currenttip = new ArrayList<>();
if(mouseX >= 26-3 && mouseX <= 42-3 && mouseY >= 14-3 && mouseY <= 72-3)
{
@@ -34,7 +34,7 @@ public class ChemicalOxidizerRecipeWrapper extends BaseRecipeWrapper
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
List<String> currenttip = new ArrayList<>();
if(mouseX >= 134-20 && mouseX <= 150-20 && mouseY >= 14-12 && mouseY <= 72-12)
{
@@ -78,13 +78,6 @@ public class ChemicalWasherRecipeCategory extends BaseRecipeCategory
fluidStacks.init(0, true, 6-xOffset, 5-yOffset, 16, 58, 1000, false, fluidOverlay);
fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0));
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
@Override
public void onTooltip(int slotIndex, boolean input, FluidStack ingredient, List<String> tooltip)
{
tooltip.remove(1);
}
});
fluidStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> tooltip.remove(1));
}
}
@@ -36,7 +36,7 @@ public class ChemicalWasherRecipeWrapper extends BaseRecipeWrapper
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
List<String> currenttip = new ArrayList<>();
if(mouseX >= 27-3 && mouseX <= 43-3 && mouseY >= 14-3 && mouseY <= 72-3)
{
@@ -125,13 +125,6 @@ public class ElectrolyticSeparatorRecipeCategory extends BaseRecipeCategory
fluidStacks.init(0, true, 2, 2, 16, 58, tempRecipe.getInput().ingredient.amount, false, fluidOverlay);
fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0));
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
@Override
public void onTooltip(int slotIndex, boolean input, FluidStack ingredient, List<String> tooltip)
{
tooltip.remove(1);
}
});
fluidStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> tooltip.remove(1));
}
}
@@ -34,7 +34,7 @@ public class ElectrolyticSeparatorRecipeWrapper extends BaseRecipeWrapper
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
List<String> currenttip = new ArrayList<>();
if(mouseX >= 59-4 && mouseX <= 75-4 && mouseY >= 19-9 && mouseY <= 47-9)
{
@@ -81,7 +81,7 @@ public class MetallurgicInfuserRecipeCategory extends BaseRecipeCategory
public static List<ItemStack> getInfuseStacks(InfuseType type)
{
List<ItemStack> ret = new ArrayList<ItemStack>();
List<ItemStack> ret = new ArrayList<>();
for(Map.Entry<ItemStack, InfuseObject> obj : InfuseRegistry.getObjectMap().entrySet())
{
@@ -131,12 +131,6 @@ public class PRCRecipeCategory extends BaseRecipeCategory
fluidStacks.init(0, true, 3, 0, 16, 58, tempRecipe.getInput().getFluid().amount, false, fluidOverlay);
fluidStacks.set(0, tempRecipe.recipeInput.getFluid());
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
@Override
public void onTooltip(int slotIndex, boolean input, FluidStack ingredient, List<String> tooltip)
{
tooltip.remove(1);
}
});
fluidStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> tooltip.remove(1));
}
}
@@ -38,7 +38,7 @@ public class PRCRecipeWrapper extends BaseRecipeWrapper
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
List<String> currenttip = new ArrayList<>();
if(mouseX >= 29-3 && mouseX <= 45-3 && mouseY >= 11-12 && mouseY <= 69-12)
{
@@ -58,7 +58,7 @@ public class RotaryCondensentratorRecipeWrapper extends BaseRecipeWrapper
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
List<String> currenttip = new ArrayList<>();
if(mouseX >= 26-3 && mouseX <= 42-3 && mouseY >= 14-12 && mouseY <= 72-12)
{
@@ -33,7 +33,7 @@ public class SolarNeutronRecipeWrapper extends BaseRecipeWrapper
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
List<String> currenttip = new ArrayList<>();
if(mouseX >= 26-3 && mouseX <= 42-3 && mouseY >= 14-12 && mouseY <= 72-12)
{
@@ -72,12 +72,6 @@ public class ThermalEvaporationRecipeCategory extends BaseRecipeCategory
fluidStacks.set(0, tempRecipe.recipeInput.ingredient);
fluidStacks.set(1, tempRecipe.recipeOutput.output);
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
@Override
public void onTooltip(int slotIndex, boolean input, FluidStack ingredient, List<String> tooltip)
{
tooltip.remove(1);
}
});
fluidStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> tooltip.remove(1));
}
}
@@ -7,7 +7,7 @@ import mekanism.common.ColourRGBA;
public class ColourTemperature extends ColourRGBA
{
public static HashMap<Integer, ColourTemperature> cache = new HashMap<Integer, ColourTemperature>();
public static HashMap<Integer, ColourTemperature> cache = new HashMap<>();
public double temp;
@@ -20,8 +20,8 @@ public final class FluidRenderer
{
private static final int BLOCK_STAGES = 1000;
private static Map<RenderData, DisplayInteger[]> cachedCenterFluids = new HashMap<RenderData, DisplayInteger[]>();
private static Map<ValveRenderData, DisplayInteger> cachedValveFluids = new HashMap<ValveRenderData, DisplayInteger>();
private static Map<RenderData, DisplayInteger[]> cachedCenterFluids = new HashMap<>();
private static Map<ValveRenderData, DisplayInteger> cachedValveFluids = new HashMap<>();
public static void translateToOrigin(Coord4D origin)
{
@@ -68,7 +68,7 @@ public class MekanismRenderer
public static float GAS_RENDER_BASE = 0.2F;
public static Map<TransmissionType, TextureAtlasSprite> overlays = new HashMap<TransmissionType, TextureAtlasSprite>();
public static Map<TransmissionType, TextureAtlasSprite> overlays = new HashMap<>();
private static float lightmapLastX;
private static float lightmapLastY;
@@ -87,7 +87,7 @@ public class MekanismRenderer
public static TextureAtlasSprite missingIcon;
public static Map<FluidType, Map<Fluid, TextureAtlasSprite>> textureMap = new HashMap<FluidType, Map<Fluid, TextureAtlasSprite>>();
public static Map<FluidType, Map<Fluid, TextureAtlasSprite>> textureMap = new HashMap<>();
@SubscribeEvent
public void onStitch(TextureStitchEvent.Pre event)
@@ -144,7 +144,7 @@ public class MekanismRenderer
if(item instanceof IMetaItem)
{
IMetaItem metaItem = (IMetaItem)item;
List<ModelResourceLocation> variants = new ArrayList<ModelResourceLocation>();
List<ModelResourceLocation> variants = new ArrayList<>();
for(int i = 0; i < metaItem.getVariants(); i++)
{
@@ -174,7 +174,7 @@ public class MekanismRenderer
for(FluidType type : FluidType.values())
{
textureMap.put(type, new HashMap<Fluid, TextureAtlasSprite>());
textureMap.put(type, new HashMap<>());
}
for(Fluid fluid : FluidRegistry.getRegisteredFluids().values())
@@ -222,7 +222,7 @@ public class MekanismRenderer
Map<Fluid, TextureAtlasSprite> map = textureMap.get(type);
return map.containsKey(fluid) ? map.get(fluid) : missingIcon;
return map.getOrDefault(fluid, missingIcon);
}
private static VertexFormat prevFormat = null;
@@ -21,7 +21,7 @@ public final class MinerVisualRenderer
{
private static Minecraft mc = Minecraft.getMinecraft();
private static Map<MinerRenderData, DisplayInteger> cachedVisuals = new HashMap<MinerRenderData, DisplayInteger>();
private static Map<MinerRenderData, DisplayInteger> cachedVisuals = new HashMap<>();
private static final double offset = 0.01;
@@ -51,7 +51,7 @@ public final class MinerVisualRenderer
DisplayInteger display = DisplayInteger.createAndStart();
cachedVisuals.put(data, display);
List<Model3D> models = new ArrayList<Model3D>();
List<Model3D> models = new ArrayList<>();
for(int x = -data.radius; x <= data.radius; x++)
{
@@ -406,7 +406,7 @@ public class BakedCustomItemModel implements IBakedModel
{
if(side != null)
{
List<BakedQuad> faceQuads = new LinkedList<BakedQuad>();
List<BakedQuad> faceQuads = new LinkedList<>();
if(Block.getBlockFromItem(stack.getItem()) != null)
{
@@ -425,7 +425,7 @@ public class BakedCustomItemModel implements IBakedModel
}
Tessellator tessellator = Tessellator.getInstance();
List<BakedQuad> generalQuads = new LinkedList<BakedQuad>();
List<BakedQuad> generalQuads = new LinkedList<>();
//Test if the current thread has a Context loaded (we don't use it so no need to import its type)
Object contextCapabilities;
@@ -36,7 +36,7 @@ public class MekanismOBJLoader implements ICustomModelLoader
{
public static final MekanismOBJLoader INSTANCE = new MekanismOBJLoader();
private final Map<ResourceLocation, MekanismOBJModel> modelCache = new HashMap<ResourceLocation, MekanismOBJModel>();
private final Map<ResourceLocation, MekanismOBJModel> modelCache = new HashMap<>();
public static final ImmutableMap<String, String> flipData = ImmutableMap.of("flip-v", String.valueOf(true));
@@ -62,13 +62,7 @@ public class MekanismOBJLoader implements ICustomModelLoader
public OBJBakedModel createBakedObjItemModel(IBakedModel existingModel, String name, IModelState state, VertexFormat format)
{
try {
Function<ResourceLocation, TextureAtlasSprite> textureGetter = new Function<ResourceLocation, TextureAtlasSprite>() {
@Override
public TextureAtlasSprite apply(ResourceLocation location)
{
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
}
};
Function<ResourceLocation, TextureAtlasSprite> textureGetter = location -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
ResourceLocation modelLocation = new ResourceLocation(name);
OBJModel objModel = (OBJModel)OBJLoader.INSTANCE.loadModel(modelLocation);
@@ -91,7 +85,7 @@ public class MekanismOBJLoader implements ICustomModelLoader
builder.put("missingno", missing);
return new GlowPanelModel(existingModel, objModel, state, format, builder.build(), new HashMap<TransformType, Matrix4f>());
return new GlowPanelModel(existingModel, objModel, state, format, builder.build(), new HashMap<>());
} catch(Exception e) {
e.printStackTrace();
}
@@ -49,7 +49,7 @@ public abstract class OBJBakedModelBase extends OBJBakedModel
protected ImmutableMap<String, TextureAtlasSprite> textureMap;
protected HashMap<TransformType, Matrix4f> transformationMap = new HashMap<TransformType, Matrix4f>();
protected HashMap<TransformType, Matrix4f> transformationMap = new HashMap<>();
public OBJBakedModelBase(IBakedModel base, OBJModel model, IModelState state, VertexFormat format, ImmutableMap<String, TextureAtlasSprite> textures, HashMap<TransformType, Matrix4f> transform)
{
@@ -73,11 +73,11 @@ public abstract class OBJBakedModelBase extends OBJBakedModel
return ImmutableList.of();
}
List<BakedQuad> bakedQuads = new ArrayList<BakedQuad>();
List<BakedQuad> bakedQuads = new ArrayList<>();
Set<Face> faces = Collections.synchronizedSet(new LinkedHashSet<Face>());
Optional<TRSRTransformation> transform = Optional.empty();
Map<Face, String> groupNameMap = new HashMap<Face, String>();
Map<Face, String> groupNameMap = new HashMap<>();
for(Group g : getModel().getMatLib().getGroups().values())
{
@@ -32,7 +32,7 @@ public class RenderConfigurableMachine<S extends TileEntity & ISideConfiguration
{
private Minecraft mc = FMLClientHandler.instance().getClient();
private HashMap<EnumFacing, HashMap<TransmissionType, DisplayInteger>> cachedOverlays = new HashMap<EnumFacing, HashMap<TransmissionType, DisplayInteger>>();
private HashMap<EnumFacing, HashMap<TransmissionType, DisplayInteger>> cachedOverlays = new HashMap<>();
public RenderConfigurableMachine()
{
@@ -119,7 +119,7 @@ public class RenderConfigurableMachine<S extends TileEntity & ISideConfiguration
cachedOverlays.get(side).put(type, display);
}
else {
HashMap<TransmissionType, DisplayInteger> map = new HashMap<TransmissionType, DisplayInteger>();
HashMap<TransmissionType, DisplayInteger> map = new HashMap<>();
map.put(type, display);
cachedOverlays.put(side, map);
}
@@ -30,7 +30,7 @@ public class RenderEnergyCube extends TileEntitySpecialRenderer<TileEntityEnergy
private ModelEnergyCube model = new ModelEnergyCube();
private ModelEnergyCore core = new ModelEnergyCore();
public static Map<EnergyCubeTier, ResourceLocation> resources = new HashMap<EnergyCubeTier, ResourceLocation>();
public static Map<EnergyCubeTier, ResourceLocation> resources = new HashMap<>();
public static ResourceLocation baseTexture = MekanismUtils.getResource(ResourceType.RENDER, "EnergyCube.png");
public static ResourceLocation coreTexture = MekanismUtils.getResource(ResourceType.RENDER, "EnergyCore.png");
@@ -21,8 +21,8 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderFluidTank extends TileEntitySpecialRenderer<TileEntityFluidTank>
{
private static Map<Fluid, DisplayInteger[]> cachedCenterFluids = new HashMap<Fluid, DisplayInteger[]>();
private static Map<Fluid, DisplayInteger[]> cachedValveFluids = new HashMap<Fluid, DisplayInteger[]>();
private static Map<Fluid, DisplayInteger[]> cachedCenterFluids = new HashMap<>();
private static Map<Fluid, DisplayInteger[]> cachedValveFluids = new HashMap<>();
private static int stages = 1400;
@@ -20,7 +20,7 @@ import org.lwjgl.opengl.GL11;
public class RenderTeleporter extends TileEntitySpecialRenderer<TileEntityTeleporter>
{
private HashMap<Integer, DisplayInteger> cachedOverlays = new HashMap<Integer, DisplayInteger>();
private HashMap<Integer, DisplayInteger> cachedOverlays = new HashMap<>();
@Override
public void render(TileEntityTeleporter tileEntity, double x, double y, double z, float partialTick, int destroyStage, float alpha)
@@ -24,7 +24,7 @@ import java.util.Arrays;
@SideOnly(Side.CLIENT)
public class RenderThermalEvaporationController extends TileEntitySpecialRenderer<TileEntityThermalEvaporationController>
{
private static HashMap<Fluid, DisplayInteger[]> cachedCenterFluids = new HashMap<Fluid, DisplayInteger[]>();
private static HashMap<Fluid, DisplayInteger[]> cachedCenterFluids = new HashMap<>();
private static final int LEVELS = 16;
private static final int ALL_LEVELS = LEVELS + 2;
private static final int RING_INDEX = ALL_LEVELS-2;
@@ -167,4 +167,4 @@ public class RenderThermalEvaporationController extends TileEntitySpecialRendere
{
cachedCenterFluids.clear();
}
}
}
@@ -22,9 +22,9 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderThermoelectricBoiler extends TileEntitySpecialRenderer<TileEntityBoilerCasing>
{
private static Map<RenderData, DisplayInteger[]> cachedLowerFluids = new HashMap<RenderData, DisplayInteger[]>();
private static Map<RenderData, DisplayInteger> cachedUpperFluids = new HashMap<RenderData, DisplayInteger>();
private static Map<ValveRenderData, DisplayInteger> cachedValveFluids = new HashMap<ValveRenderData, DisplayInteger>();
private static Map<RenderData, DisplayInteger[]> cachedLowerFluids = new HashMap<>();
private static Map<RenderData, DisplayInteger> cachedUpperFluids = new HashMap<>();
private static Map<ValveRenderData, DisplayInteger> cachedValveFluids = new HashMap<>();
private Fluid STEAM = FluidRegistry.getFluid("steam");
private Fluid WATER = FluidRegistry.WATER;
@@ -38,7 +38,7 @@ public class RenderLogisticalTransporter extends RenderTransmitterBase<TileEntit
private Render<Entity> renderer = (Render<Entity>)Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityItem.class);
private static HashMap<EnumFacing, HashMap<Integer, DisplayInteger>> cachedOverlays = new HashMap<EnumFacing, HashMap<Integer, DisplayInteger>>();
private static HashMap<EnumFacing, HashMap<Integer, DisplayInteger>> cachedOverlays = new HashMap<>();
private static TextureAtlasSprite gunpowderIcon;
private static TextureAtlasSprite torchOffIcon;
@@ -163,7 +163,7 @@ public class RenderLogisticalTransporter extends RenderTransmitterBase<TileEntit
cachedOverlays.get(side).put(mode, display);
}
else {
HashMap<Integer, DisplayInteger> map = new HashMap<Integer, DisplayInteger>();
HashMap<Integer, DisplayInteger> map = new HashMap<>();
map.put(mode, display);
cachedOverlays.put(side, map);
}
@@ -21,7 +21,7 @@ import org.lwjgl.opengl.GL11;
public class RenderMechanicalPipe extends RenderTransmitterBase<TileEntityMechanicalPipe>
{
private static HashMap<Integer, HashMap<Fluid, DisplayInteger[]>> cachedLiquids = new HashMap<Integer, HashMap<Fluid, DisplayInteger[]>>();
private static HashMap<Integer, HashMap<Fluid, DisplayInteger[]>> cachedLiquids = new HashMap<>();
private static final int stages = 100;
private static final double height = 0.45;
@@ -167,7 +167,7 @@ public class RenderMechanicalPipe extends RenderTransmitterBase<TileEntityMechan
cachedLiquids.get(sideOrdinal).put(fluid, displays);
}
else {
HashMap<Fluid, DisplayInteger[]> map = new HashMap<Fluid, DisplayInteger[]>();
HashMap<Fluid, DisplayInteger[]> map = new HashMap<>();
map.put(fluid, displays);
cachedLiquids.put(sideOrdinal, map);
}
@@ -30,7 +30,7 @@ import com.google.common.collect.ImmutableList;
public abstract class RenderTransmitterBase<T extends TileEntityTransmitter> extends TileEntitySpecialRenderer<T>
{
private static OBJModel contentsModel;
private static Map<String, IBakedModel> contentsMap = new HashMap<String, IBakedModel>();
private static Map<String, IBakedModel> contentsMap = new HashMap<>();
protected Minecraft mc = Minecraft.getMinecraft();
@@ -88,7 +88,7 @@ public abstract class RenderTransmitterBase<T extends TileEntityTransmitter> ext
public static HashMap<String, IBakedModel> buildModelMap(OBJModel objModel)
{
HashMap<String, IBakedModel> modelParts = new HashMap<String, IBakedModel>();
HashMap<String, IBakedModel> modelParts = new HashMap<>();
if(!objModel.getMatLib().getGroups().keySet().isEmpty())
{
@@ -116,14 +116,7 @@ public abstract class RenderTransmitterBase<T extends TileEntityTransmitter> ext
}
/* Credit to Eternal Energy */
public static Function<ResourceLocation, TextureAtlasSprite> textureGetterFlipV = new Function<ResourceLocation, TextureAtlasSprite>()
{
@Override
public TextureAtlasSprite apply(ResourceLocation location)
{
return DummyAtlasTextureFlipV.instance;
}
};
public static Function<ResourceLocation, TextureAtlasSprite> textureGetterFlipV = location -> DummyAtlasTextureFlipV.instance;
private static class DummyAtlasTextureFlipV extends TextureAtlasSprite
{
@@ -25,7 +25,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class SoundHandler
{
public static Map<String, Map<String, IResettableSound>> soundMaps = new HashMap<String, Map<String, IResettableSound>>();
public static Map<String, Map<String, IResettableSound>> soundMaps = new HashMap<>();
public static Map<ISound, String> invPlayingSounds;
@@ -105,13 +105,7 @@ public class SoundHandler
public static Map<String, IResettableSound> getMap(String name)
{
Map<String, IResettableSound> map = soundMaps.get(name);
if(map == null)
{
map = new HashMap<String, IResettableSound>();
soundMaps.put(name, map);
}
Map<String, IResettableSound> map = soundMaps.computeIfAbsent(name, k -> new HashMap<>());
return map;
}
@@ -147,7 +147,7 @@ import net.minecraftforge.fml.relauncher.FMLInjectionData;
*/
public class CommonProxy implements IGuiProvider
{
protected static WeakReference<EntityPlayer> dummyPlayer = new WeakReference<EntityPlayer>(null);
protected static WeakReference<EntityPlayer> dummyPlayer = new WeakReference<>(null);
/**
* Register tile entities that have special models. Overwritten in client to register TESRs.
@@ -623,7 +623,7 @@ public class CommonProxy implements IGuiProvider
{
EntityPlayer player = FakePlayerFactory.get(world, Mekanism.gameProfile);
return new WeakReference<EntityPlayer>(player);
return new WeakReference<>(player);
}
private WeakReference<EntityPlayer> createNewPlayer(WorldServer world, double x, double y, double z)
@@ -634,7 +634,7 @@ public class CommonProxy implements IGuiProvider
player.posY = y;
player.posZ = z;
return new WeakReference<EntityPlayer>(player);
return new WeakReference<>(player);
}
public final WeakReference<EntityPlayer> getDummyPlayer(WorldServer world)
@@ -25,12 +25,12 @@ public class CommonWorldTickHandler
{
if(chunkRegenMap == null)
{
chunkRegenMap = new HashMap<Integer, Queue<ChunkPos>>();
chunkRegenMap = new HashMap<>();
}
if(!chunkRegenMap.containsKey(dimensionId))
{
LinkedList<ChunkPos> list = new LinkedList<ChunkPos>();
LinkedList<ChunkPos> list = new LinkedList<>();
list.add(chunkCoord);
chunkRegenMap.put(dimensionId, list);
}
@@ -14,7 +14,7 @@ import buildcraft.api.fuels.IFuel;
public class FuelHandler
{
public static HashMap<String, FuelGas> fuels = new HashMap<String, FuelGas>();
public static HashMap<String, FuelGas> fuels = new HashMap<>();
public static void addGas(Gas gas, int burnTicks, double energyPerMilliBucket)
{
+1 -1
View File
@@ -5,7 +5,7 @@ import java.util.Iterator;
public class HashList<T> implements Iterable<T>
{
private ArrayList<T> list = new ArrayList<T>(256);
private ArrayList<T> list = new ArrayList<>(256);
private HashList(ArrayList<T> newList)
{
+2 -2
View File
@@ -12,11 +12,11 @@ public class KeySync
public static int ASCEND = 0;
public static int DESCEND = 1;
public Map<EntityPlayer, KeySet> keys = new HashMap<EntityPlayer, KeySet>();
public Map<EntityPlayer, KeySet> keys = new HashMap<>();
public static class KeySet
{
public Set<Integer> keysActive = new HashSet<Integer>();
public Set<Integer> keysActive = new HashSet<>();
public KeySet(int key)
{
+16 -19
View File
@@ -189,16 +189,16 @@ public class Mekanism
public static Version versionNumber = new Version(9, 3, 4);
/** MultiblockManagers for various structrures */
public static MultiblockManager<SynchronizedTankData> tankManager = new MultiblockManager<SynchronizedTankData>("dynamicTank");
public static MultiblockManager<SynchronizedMatrixData> matrixManager = new MultiblockManager<SynchronizedMatrixData>("inductionMatrix");
public static MultiblockManager<SynchronizedBoilerData> boilerManager = new MultiblockManager<SynchronizedBoilerData>("thermoelectricBoiler");
public static MultiblockManager<SynchronizedTankData> tankManager = new MultiblockManager<>("dynamicTank");
public static MultiblockManager<SynchronizedMatrixData> matrixManager = new MultiblockManager<>("inductionMatrix");
public static MultiblockManager<SynchronizedBoilerData> boilerManager = new MultiblockManager<>("thermoelectricBoiler");
/** FrequencyManagers for various networks */
public static FrequencyManager publicTeleporters = new FrequencyManager(Frequency.class, Frequency.TELEPORTER);
public static Map<UUID, FrequencyManager> privateTeleporters = new HashMap<UUID, FrequencyManager>();
public static Map<UUID, FrequencyManager> privateTeleporters = new HashMap<>();
public static FrequencyManager publicEntangloporters = new FrequencyManager(InventoryFrequency.class, InventoryFrequency.ENTANGLOPORTER);
public static Map<UUID, FrequencyManager> privateEntangloporters = new HashMap<UUID, FrequencyManager>();
public static Map<UUID, FrequencyManager> privateEntangloporters = new HashMap<>();
public static FrequencyManager securityFrequencies = new FrequencyManager(SecurityFrequency.class, SecurityFrequency.SECURITY);
@@ -206,7 +206,7 @@ public class Mekanism
public static CreativeTabMekanism tabMekanism = new CreativeTabMekanism();
/** List of Mekanism modules loaded */
public static List<IModule> modulesLoaded = new ArrayList<IModule>();
public static List<IModule> modulesLoaded = new ArrayList<>();
/** The latest version number which is received from the Mekanism server */
public static String latestVersionNumber;
@@ -218,7 +218,7 @@ public class Mekanism
public static VoiceServerManager voiceManager;
/** A list of the usernames of players who have donated to Mekanism. */
public static List<String> donators = new ArrayList<String>();
public static List<String> donators = new ArrayList<>();
/** The server's world tick handler. */
public static CommonWorldTickHandler worldTickHandler = new CommonWorldTickHandler();
@@ -496,18 +496,15 @@ public class Mekanism
InfuseRegistry.registerInfuseObject(new ItemStack(MekanismItems.CompressedObsidian), new InfuseObject(InfuseRegistry.get("OBSIDIAN"), 80));
//Fuels
GameRegistry.registerFuelHandler(new IFuelHandler() {
@Override
public int getBurnTime(ItemStack fuel)
{
if(fuel.isItemEqual(new ItemStack(MekanismBlocks.BasicBlock, 1, 3)))
{
return 200*8*9;
}
return 0;
}
});
GameRegistry.registerFuelHandler(fuel ->
{
if(fuel.isItemEqual(new ItemStack(MekanismBlocks.BasicBlock, 1, 3)))
{
return 200*8*9;
}
return 0;
});
//Fuel Gases
FuelHandler.addGas(MekanismFluids.Hydrogen, 1, general.FROM_H2);
@@ -12,15 +12,15 @@ import net.minecraftforge.oredict.OreDictionary;
public final class OreDictCache
{
public static HashMap<ItemInfo, List<String>> cachedKeys = new HashMap<ItemInfo, List<String>>();
public static HashMap<String, List<ItemStack>> oreDictStacks = new HashMap<String, List<ItemStack>>();
public static HashMap<String, List<ItemStack>> modIDStacks = new HashMap<String, List<ItemStack>>();
public static HashMap<ItemInfo, List<String>> cachedKeys = new HashMap<>();
public static HashMap<String, List<ItemStack>> oreDictStacks = new HashMap<>();
public static HashMap<String, List<ItemStack>> modIDStacks = new HashMap<>();
public static List<String> getOreDictName(ItemStack check)
{
if(check.isEmpty())
{
return new ArrayList<String>();
return new ArrayList<>();
}
ItemInfo info = ItemInfo.get(check);
@@ -33,7 +33,7 @@ public final class OreDictCache
int[] idsFound = OreDictionary.getOreIDs(check);
List<String> ret = new ArrayList<String>();
List<String> ret = new ArrayList<>();
for(Integer id : idsFound)
{
@@ -52,7 +52,7 @@ public final class OreDictCache
return oreDictStacks.get(oreName);
}
List<String> keys = new ArrayList<String>();
List<String> keys = new ArrayList<>();
for(String s : OreDictionary.getOreNames())
{
@@ -88,7 +88,7 @@ public final class OreDictCache
}
}
List<ItemStack> stacks = new ArrayList<ItemStack>();
List<ItemStack> stacks = new ArrayList<>();
for(String key : keys)
{
@@ -115,7 +115,7 @@ public final class OreDictCache
return modIDStacks.get(modName);
}
List<ItemStack> stacks = new ArrayList<ItemStack>();
List<ItemStack> stacks = new ArrayList<>();
for(String key : OreDictionary.getOreNames())
{
+1 -1
View File
@@ -62,7 +62,7 @@ public class SideData
public FluidTankInfo[] getFluidTankInfo(ITankManager manager)
{
Object[] tanks = manager.getTanks();
List<FluidTankInfo> infos = new ArrayList<FluidTankInfo>();
List<FluidTankInfo> infos = new ArrayList<>();
if(tanks == null)
{
+1 -1
View File
@@ -18,7 +18,7 @@ import net.minecraft.util.ResourceLocation;
*/
public final class Tier
{
private static List<ITier> tierTypes = new ArrayList<ITier>();
private static List<ITier> tierTypes = new ArrayList<>();
private static boolean initiated = false;
Loaded 100 of 234 files, more files were not shown because too many files have changed in this diff. Show more