summaryrefslogtreecommitdiff
path: root/ihl
diff options
context:
space:
mode:
authorFoghrye4 <foghrye4@gmail.com>2017-01-27 11:32:28 +0300
committerFoghrye4 <foghrye4@gmail.com>2017-01-27 11:32:28 +0300
commit2db8e30b1d2151fdde5d08a6c06aef55f0c397d2 (patch)
treee8cd0022f3a30a5c952092e0ea4c7ffdafcdf7bb /ihl
parentffe23313fb7421b0a1849b420baf708999023f7b (diff)
License, readme and stuff
Diffstat (limited to 'ihl')
-rw-r--r--ihl/ClientProxy.java113
-rw-r--r--ihl/IHL3dPathFinder.java6
-rw-r--r--ihl/IHLMod.java370
-rw-r--r--ihl/IHLModConfig.java173
-rw-r--r--ihl/IHLModInfo.java2
-rw-r--r--ihl/IHLModInfo.java~2
-rw-r--r--ihl/ServerProxy.java102
-rw-r--r--ihl/collector/ChargerEjectorContainer.java5
-rw-r--r--ihl/collector/ChargerEjectorGui.java4
-rw-r--r--ihl/collector/ChargerEjectorTileEntity.java7
-rw-r--r--ihl/collector/CollectorEntity.java61
-rw-r--r--ihl/collector/CollectorItem.java6
-rw-r--r--ihl/collector/GlassBoxContainer.java2
-rw-r--r--ihl/collector/GlassBoxGui.java11
-rw-r--r--ihl/collector/GlassBoxRender.java2
-rw-r--r--ihl/collector/GlassBoxTileEntity.java7
-rw-r--r--ihl/crop_harvestors/BlowerBlock.java1
-rw-r--r--ihl/crop_harvestors/BlowerContainer.java2
-rw-r--r--ihl/crop_harvestors/BlowerGui.java8
-rw-r--r--ihl/crop_harvestors/BlowerTileEntity.java17
-rw-r--r--ihl/crop_harvestors/RubberTreeBlock.java2
-rw-r--r--ihl/crop_harvestors/SackBlock.java1
-rw-r--r--ihl/crop_harvestors/SackTileEntity.java4
-rw-r--r--ihl/datanet/Contact.java2
-rw-r--r--ihl/datanet/DataCableItem.java22
-rw-r--r--ihl/datanet/DataGrid.java11
-rw-r--r--ihl/datanet/DataNet.java2
-rw-r--r--ihl/datanet/GuiInvisibleButton.java1
-rw-r--r--ihl/datanet/RedstoneSignalConverterContainer.java3
-rw-r--r--ihl/datanet/RedstoneSignalConverterGui.java10
-rw-r--r--ihl/datanet/RedstoneSignalConverterTileEntity.java9
-rw-r--r--ihl/enviroment/LightBulbBlock.java4
-rw-r--r--ihl/enviroment/LightBulbModel.java8
-rw-r--r--ihl/enviroment/LightBulbTileEntity.java6
-rw-r--r--ihl/enviroment/MirrorBlock.java24
-rw-r--r--ihl/enviroment/MirrorRender.java10
-rw-r--r--ihl/enviroment/MirrorTileEntity.java29
-rw-r--r--ihl/enviroment/SpotlightTileEntity.java5
-rw-r--r--ihl/explosion/ChunkAndWorldLoadEventHandler.java (renamed from ihl/utils/ChunkAndWorldLoadEventHandler.java)35
-rw-r--r--ihl/explosion/DetonatorMiniGUI.java83
-rw-r--r--ihl/explosion/ExplosionEntityFX.java177
-rw-r--r--ihl/explosion/ExplosionRenderFX.java51
-rw-r--r--ihl/explosion/ExplosionVectorBlockV2.java552
-rw-r--r--ihl/explosion/ExplosiveBlock.java (renamed from ihl/items_blocks/ExplosiveBlock.java)145
-rw-r--r--ihl/explosion/ExplosiveTileEntity.java85
-rw-r--r--ihl/explosion/GroundRemoverItem.java (renamed from ihl/items_blocks/GroundRemoverItem.java)32
-rw-r--r--ihl/explosion/IHLEntityFallingPile.java152
-rw-r--r--ihl/explosion/IHLEntityFallingPileRender.java52
-rw-r--r--ihl/explosion/PileBlock.java125
-rw-r--r--ihl/explosion/PileBlockRender.java342
-rw-r--r--ihl/explosion/PileTileEntity.java91
-rw-r--r--ihl/explosion/PileTileEntityRender.java160
-rw-r--r--ihl/explosion/WorldSavedDataBlastWave.java108
-rw-r--r--ihl/flexible_cable/AnchorBlock.java11
-rw-r--r--ihl/flexible_cable/AnchorTileEntity.java7
-rw-r--r--ihl/flexible_cable/BatterySwitchUnitTileEntity.java7
-rw-r--r--ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java20
-rw-r--r--ihl/flexible_cable/IHLENet.java4
-rw-r--r--ihl/flexible_cable/IHLGrid.java21
-rw-r--r--ihl/flexible_cable/InvSlotOutputInProgress.java2
-rw-r--r--ihl/flexible_cable/InvSlotProcessableIronWorkbench.java27
-rw-r--r--ihl/flexible_cable/InvSlotTool.java76
-rw-r--r--ihl/flexible_cable/InvSlotWorkspaceElement.java16
-rw-r--r--ihl/flexible_cable/IronWorkbenchContainer.java8
-rw-r--r--ihl/flexible_cable/IronWorkbenchGui.java11
-rw-r--r--ihl/flexible_cable/IronWorkbenchInvSlot.java2
-rw-r--r--ihl/flexible_cable/IronWorkbenchRender.java4
-rw-r--r--ihl/flexible_cable/IronWorkbenchRender.java~40
-rw-r--r--ihl/flexible_cable/IronWorkbenchTileEntity.java71
-rw-r--r--ihl/flexible_cable/IronWorkbenchTileEntity.java~367
-rw-r--r--ihl/flexible_cable/NodeEntity.java27
-rw-r--r--ihl/flexible_cable/NodeRender.java9
-rw-r--r--ihl/flexible_cable/PowerCableNodeEntity.java16
-rw-r--r--ihl/flexible_cable/RectifierTransformerUnitTileEntity.java7
-rw-r--r--ihl/flexible_cable/SetOfDiesMiniGUI.java4
-rw-r--r--ihl/flexible_cable/SubAnchorEnergyNetNode.java8
-rw-r--r--ihl/flexible_cable/SubRTUEnergyNetNode.java6
-rw-r--r--ihl/guidebook/IHLGuidebookGui.java16
-rw-r--r--ihl/handpump/AdvancedHandPump.java2
-rw-r--r--ihl/handpump/IHLHandPump.java6
-rw-r--r--ihl/i_hate_liquids/BlockDynamicLiquidPlus.java1
-rw-r--r--ihl/i_hate_liquids/InvisibleMagicanEntity.java120
-rw-r--r--ihl/interfaces/IDataCableHolder.java6
-rw-r--r--ihl/interfaces/IItemHasMiniGUI.java1
-rw-r--r--ihl/interfaces/INetworkListener.java1
-rw-r--r--ihl/interfaces/ItemMiniGUI.java3
-rw-r--r--ihl/items_blocks/FiberItem.java4
-rw-r--r--ihl/items_blocks/FlexibleCableItem.java22
-rw-r--r--ihl/items_blocks/FlexiblePipeItem.java10
-rw-r--r--ihl/items_blocks/IHLItemBlock.java20
-rw-r--r--ihl/items_blocks/IHLTool.java16
-rw-r--r--ihl/items_blocks/ItemSubstance.java51
-rw-r--r--ihl/items_blocks/MachineBaseBlock.java19
-rw-r--r--ihl/metallurgy/constants/Details.java12
-rw-r--r--ihl/model/CableHolderSelectionBoxSpecialRenderer.java9
-rw-r--r--ihl/model/FlexibleCableItemRender.java9
-rw-r--r--ihl/model/IHLModelRenderer.java14
-rw-r--r--ihl/model/IHLToolRenderer.java1
-rw-r--r--ihl/model/IronWorkbenchBlockRender.java7
-rw-r--r--ihl/model/ModelTube.java4
-rw-r--r--ihl/model/MultiMetaBlockRender.java1
-rw-r--r--ihl/model/RectifierTransformerUnitBlockRender.java1
-rw-r--r--ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java16
-rw-r--r--ihl/model/RenderGameOverlayEventHandler.java1
-rw-r--r--ihl/model/SwitchBoxBlockRender.java2
-rw-r--r--ihl/nei_integration/AchesonFurnaceRecipeHandler.java2
-rw-r--r--ihl/nei_integration/ChemicalReactorRecipeHandler.java10
-rw-r--r--ihl/nei_integration/CrucibleRecipeHandler.java2
-rw-r--r--ihl/nei_integration/CryogenicDistillerRecipeHandler.java3
-rw-r--r--ihl/nei_integration/ElectricEvaporatorRecipeHandler.java1
-rw-r--r--ihl/nei_integration/IHLBlockHighlightHandler.java5
-rw-r--r--ihl/nei_integration/IHLRecipeHandler.java26
-rw-r--r--ihl/nei_integration/IronWorkbenchRecipeHandler.java30
-rw-r--r--ihl/nei_integration/LabElectrolyzerRecipeHandler.java10
-rw-r--r--ihl/nei_integration/MachineRecipeHandler.java55
-rw-r--r--ihl/nei_integration/NEIIHLConfig.java1
-rw-r--r--ihl/processing/chemistry/ApparatusProcessableInvSlot.java2
-rw-r--r--ihl/processing/chemistry/BatteryItem.java16
-rw-r--r--ihl/processing/chemistry/ChemicalReactorContainer.java4
-rw-r--r--ihl/processing/chemistry/ChemicalReactorGui.java5
-rw-r--r--ihl/processing/chemistry/ChemicalReactorTileEntity.java67
-rw-r--r--ihl/processing/chemistry/CryogenicDistillerContainer.java4
-rw-r--r--ihl/processing/chemistry/CryogenicDistillerGui.java5
-rw-r--r--ihl/processing/chemistry/CryogenicDistillerTileEntity.java17
-rw-r--r--ihl/processing/chemistry/ElectricEvaporatorBlock.java1
-rw-r--r--ihl/processing/chemistry/ElectricEvaporatorContainer.java2
-rw-r--r--ihl/processing/chemistry/ElectricEvaporatorTileEntity.java21
-rw-r--r--ihl/processing/chemistry/ElectrolysisBathContainer.java2
-rw-r--r--ihl/processing/chemistry/ElectrolysisBathGui.java2
-rw-r--r--ihl/processing/chemistry/ElectrolysisBathTileEntity.java13
-rw-r--r--ihl/processing/chemistry/EvaporatorBlock.java1
-rw-r--r--ihl/processing/chemistry/EvaporatorContainer.java2
-rw-r--r--ihl/processing/chemistry/EvaporatorTileEntity.java12
-rw-r--r--ihl/processing/chemistry/ExplosiveTileEntity.java49
-rw-r--r--ihl/processing/chemistry/FluidizedBedReactorContainer.java4
-rw-r--r--ihl/processing/chemistry/FluidizedBedReactorGui.java53
-rw-r--r--ihl/processing/chemistry/FluidizedBedReactorTileEntity.java83
-rw-r--r--ihl/processing/chemistry/FractionatorBottomTileEntity.java5
-rw-r--r--ihl/processing/chemistry/FractionatorCoverTileEntity.java3
-rw-r--r--ihl/processing/chemistry/FractionatorSectionTileEntity.java3
-rw-r--r--ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java4
-rw-r--r--ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java9
-rw-r--r--ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java2
-rw-r--r--ihl/processing/chemistry/GoldChimneyKneeTileEntity.java6
-rw-r--r--ihl/processing/chemistry/LabElectrolyzerContainer.java4
-rw-r--r--ihl/processing/chemistry/LabElectrolyzerGui.java6
-rw-r--r--ihl/processing/chemistry/LabElectrolyzerTileEntity.java25
-rw-r--r--ihl/processing/chemistry/LeadOvenContainer.java2
-rw-r--r--ihl/processing/chemistry/LeadOvenGui.java9
-rw-r--r--ihl/processing/chemistry/LeadOvenTileEntity.java22
-rw-r--r--ihl/processing/chemistry/LoomContainer.java2
-rw-r--r--ihl/processing/chemistry/LoomGui.java1
-rw-r--r--ihl/processing/chemistry/LoomTileEntity.java8
-rw-r--r--ihl/processing/chemistry/PaperMachineContainer.java4
-rw-r--r--ihl/processing/chemistry/PaperMachineGui.java5
-rw-r--r--ihl/processing/chemistry/PaperMachineTileEntity.java65
-rw-r--r--ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java3
-rw-r--r--ihl/processing/chemistry/RefluxCondenserTileEntity.java3
-rw-r--r--ihl/processing/invslots/IHLInvSlotOutput.java6
-rw-r--r--ihl/processing/invslots/InvSlotConsumableLiquidIHL.java8
-rw-r--r--ihl/processing/invslots/InvSlotSignalProcessor.java2
-rw-r--r--ihl/processing/invslots/SlotInvSlotIronWorkbench.java31
-rw-r--r--ihl/processing/metallurgy/AchesonFurnaceGui.java2
-rw-r--r--ihl/processing/metallurgy/AchesonFurnanceTileEntity.java9
-rw-r--r--ihl/processing/metallurgy/BasicElectricMotorTileEntity.java43
-rw-r--r--ihl/processing/metallurgy/CoilerContainer.java4
-rw-r--r--ihl/processing/metallurgy/CoilerGui.java4
-rw-r--r--ihl/processing/metallurgy/CoilerRender.java7
-rw-r--r--ihl/processing/metallurgy/CoilerTileEntity.java22
-rw-r--r--ihl/processing/metallurgy/Crucible.java32
-rw-r--r--ihl/processing/metallurgy/CrucibleContainer.java3
-rw-r--r--ihl/processing/metallurgy/CrucibleGui.java2
-rw-r--r--ihl/processing/metallurgy/DetonationSprayingMachineContainer.java2
-rw-r--r--ihl/processing/metallurgy/DetonationSprayingMachineGui.java11
-rw-r--r--ihl/processing/metallurgy/DetonationSprayingMachineModel.java8
-rw-r--r--ihl/processing/metallurgy/DetonationSprayingMachineRender.java2
-rw-r--r--ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java65
-rw-r--r--ihl/processing/metallurgy/DrawingDeskContainer.java36
-rw-r--r--ihl/processing/metallurgy/DrawingDeskGui.java59
-rw-r--r--ihl/processing/metallurgy/DrawingDeskModel.java66
-rw-r--r--ihl/processing/metallurgy/DrawingDeskTileEntity.java173
-rw-r--r--ihl/processing/metallurgy/ElectricEngineItem.java4
-rw-r--r--ihl/processing/metallurgy/ExtruderContainer.java4
-rw-r--r--ihl/processing/metallurgy/ExtruderGui.java9
-rw-r--r--ihl/processing/metallurgy/ExtruderTileEntity.java23
-rw-r--r--ihl/processing/metallurgy/GasWeldingStationContainer.java2
-rw-r--r--ihl/processing/metallurgy/GasWeldingStationGui.java1
-rw-r--r--ihl/processing/metallurgy/GasWeldingStationTileEntity.java55
-rw-r--r--ihl/processing/metallurgy/ImpregnatingMachineContainer.java2
-rw-r--r--ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java57
-rw-r--r--ihl/processing/metallurgy/InjectionMoldBlock.java40
-rw-r--r--ihl/processing/metallurgy/InjectionMoldTileEntity.java34
-rw-r--r--ihl/processing/metallurgy/LatheContainer.java4
-rw-r--r--ihl/processing/metallurgy/LatheGui.java9
-rw-r--r--ihl/processing/metallurgy/LathePart1TileEntity.java2
-rw-r--r--ihl/processing/metallurgy/LathePart2TileEntity.java1
-rw-r--r--ihl/processing/metallurgy/MachineBaseTileEntity.java6
-rw-r--r--ihl/processing/metallurgy/MuffleFurnanceTileEntity.java4
-rw-r--r--ihl/processing/metallurgy/RollingMachineContainer.java4
-rw-r--r--ihl/processing/metallurgy/RollingMachineGui.java9
-rw-r--r--ihl/processing/metallurgy/RollingMachinePart1TileEntity.java20
-rw-r--r--ihl/processing/metallurgy/RollingMachinePart2TileEntity.java1
-rw-r--r--ihl/processing/metallurgy/RollingMachineRender.java7
-rw-r--r--ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java4
-rw-r--r--ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java70
-rw-r--r--ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java3
-rw-r--r--ihl/processing/metallurgy/WireMillContainer.java4
-rw-r--r--ihl/processing/metallurgy/WireMillGui.java4
-rw-r--r--ihl/processing/metallurgy/WireMillTileEntity.java13
-rw-r--r--ihl/processing/metallurgy/WoodenRollingMachineContainer.java4
-rw-r--r--ihl/processing/metallurgy/WoodenRollingMachineGui.java9
-rw-r--r--ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java23
-rw-r--r--ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java1
-rw-r--r--ihl/processing/metallurgy/WoodenRollingMachineRender.java11
-rw-r--r--ihl/recipes/IRecipeInputFluid.java2
-rw-r--r--ihl/recipes/IronWorkbenchRecipe.java34
-rw-r--r--ihl/recipes/RecipeInputDetonator.java73
-rw-r--r--ihl/recipes/RecipeInputDie.java5
-rw-r--r--ihl/recipes/RecipeInputFluidDictionary.java11
-rw-r--r--ihl/recipes/RecipeInputFluidStack.java8
-rw-r--r--ihl/recipes/RecipeInputObjectInstance.java2
-rw-r--r--ihl/recipes/RecipeInputOreDictionaryList.java24
-rw-r--r--ihl/recipes/UniversalRecipeInput.java37
-rw-r--r--ihl/recipes/UniversalRecipeManager.java93
-rw-r--r--ihl/recipes/UniversalRecipeOutput.java48
-rw-r--r--ihl/servitor/BoneBlock.java1
-rw-r--r--ihl/servitor/FlameRenderFX.java1
-rw-r--r--ihl/servitor/LostHeadEntity.java8
-rw-r--r--ihl/trans_dimensional_item_teleporter/TDITContainer.java2
-rw-r--r--ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java2
-rw-r--r--ihl/trans_dimensional_item_teleporter/TDITGui.java10
-rw-r--r--ihl/trans_dimensional_item_teleporter/TDITTileEntity.java5
-rw-r--r--ihl/tunneling_shield/DriverContainer.java2
-rw-r--r--ihl/tunneling_shield/DriverGui.java4
-rw-r--r--ihl/tunneling_shield/DriverRenderEntity.java3
-rw-r--r--ihl/tunneling_shield/DriverTileEntity.java18
-rw-r--r--ihl/tunneling_shield/HorizontalMiningPipe.java2
-rw-r--r--ihl/tunneling_shield/HydrotransportPulpRegeneratorContainer.java5
-rw-r--r--ihl/tunneling_shield/HydrotransportPulpRegeneratorGui.java4
-rw-r--r--ihl/tunneling_shield/HydrotransportPulpRegeneratorTileEntity.java4
-rw-r--r--ihl/tunneling_shield/MultiBlockSpacerBlock.java17
-rw-r--r--ihl/utils/EntityIHLExplosion.java187
-rw-r--r--ihl/utils/ExplosionVector.java453
-rw-r--r--ihl/utils/FluidDictionary.java6
-rw-r--r--ihl/utils/IHLFluidTank.java8
-rw-r--r--ihl/utils/IHLItemRenderer.java4
-rw-r--r--ihl/utils/IHLMathUtils.java108
-rw-r--r--ihl/utils/IHLRenderUtils.java40
-rw-r--r--ihl/utils/IHLUtils.java172
-rw-r--r--ihl/utils/IHLXMLParser.java51
-rw-r--r--ihl/utils/WorldSavedDataBlastWave.java92
-rw-r--r--ihl/worldgen/IHLWorldGenerator.java12
-rw-r--r--ihl/worldgen/WorldGenMinableMeta.java6
-rw-r--r--ihl/worldgen/ores/BlockOre.java4
-rw-r--r--ihl/worldgen/ores/DebugScannerContainer.java2
-rw-r--r--ihl/worldgen/ores/DebugScannerGui.java2
-rw-r--r--ihl/worldgen/ores/DebugScannerTileEntity.java8
-rw-r--r--ihl/worldgen/ores/IHLFluid.java28
258 files changed, 3934 insertions, 3806 deletions
diff --git a/ihl/ClientProxy.java b/ihl/ClientProxy.java
index de2758c..1a55e27 100644
--- a/ihl/ClientProxy.java
+++ b/ihl/ClientProxy.java
@@ -2,15 +2,12 @@ package ihl;
import java.io.File;
import java.io.IOException;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import javax.xml.parsers.ParserConfigurationException;
-import org.lwjgl.opengl.ARBFramebufferObject;
-import org.lwjgl.opengl.EXTFramebufferObject;
-import org.lwjgl.opengl.GL30;
-
import ihl.collector.ChargerEjectorModel;
import ihl.collector.ChargerEjectorRender;
import ihl.collector.ChargerEjectorTileEntity;
@@ -34,11 +31,16 @@ import ihl.enviroment.MirrorTileEntity;
import ihl.enviroment.SpotlightModel;
import ihl.enviroment.SpotlightRender;
import ihl.enviroment.SpotlightTileEntity;
+import ihl.explosion.ExplosionEntityFX;
+import ihl.explosion.ExplosionRenderFX;
+import ihl.explosion.IHLEntityFallingPile;
+import ihl.explosion.IHLEntityFallingPileRender;
+import ihl.explosion.PileBlockRender;
+import ihl.explosion.PileTileEntity;
import ihl.flexible_cable.AnchorTileEntity;
import ihl.flexible_cable.BatterySwitchUnitModel;
import ihl.flexible_cable.BatterySwitchUnitTileEntity;
import ihl.flexible_cable.BlastEntityFX;
-import ihl.flexible_cable.IronWorkbenchModel;
import ihl.flexible_cable.IronWorkbenchTileEntity;
import ihl.flexible_cable.IronWorkbenchRender;
import ihl.flexible_cable.NodeEntity;
@@ -108,7 +110,6 @@ import ihl.tunneling_shield.DriverModel;
import ihl.tunneling_shield.DriverRender;
import ihl.tunneling_shield.DriverRenderEntity;
import ihl.tunneling_shield.DriverTileEntity;
-import ihl.utils.EntityDropEventHandler;
import ihl.utils.IHLRenderUtils;
import ihl.utils.IHLUtils;
import ihl.worldgen.ores.IHLFluid;
@@ -117,6 +118,8 @@ import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.ByteBufOutputStream;
import io.netty.buffer.Unpooled;
import net.minecraft.client.Minecraft;
+import net.minecraft.client.entity.EntityClientPlayerMP;
+import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
@@ -124,11 +127,11 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
+import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.MinecraftForge;
@@ -136,10 +139,8 @@ import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.network.FMLEventChannel;
import cpw.mods.fml.common.network.FMLNetworkEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
-import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -148,18 +149,17 @@ public class ClientProxy extends ServerProxy {
public boolean loadMirrorRender=true;
public IHLRenderUtils renderUtils;
- public Map<MachineType,Integer> sharedBlockRenders = new HashMap();
- public Map<Class<? extends TileEntity>,ISelectionBoxSpecialRenderer> selectionBoxSpecialRendererRegistry = new HashMap();
-
+ public Map<MachineType,Integer> sharedBlockRenders = new HashMap<MachineType,Integer>();
+ public Map<Class<? extends TileEntity>,ISelectionBoxSpecialRenderer> selectionBoxSpecialRendererRegistry = new HashMap<Class<? extends TileEntity>,ISelectionBoxSpecialRenderer>();
public ClientProxy() {}
@Override
public void load() throws ParserConfigurationException
{
- if(this.channel==null)
+ if(channel==null)
{
- this.channel = NetworkRegistry.INSTANCE.newEventDrivenChannel(IHLModInfo.MODID);
- this.channel.register(this);
+ channel = NetworkRegistry.INSTANCE.newEventDrivenChannel(IHLModInfo.MODID);
+ channel.register(this);
}
this.renderUtils=new IHLRenderUtils();
MinecraftForge.EVENT_BUS.register(this.renderUtils);
@@ -169,12 +169,16 @@ public class ClientProxy extends ServerProxy {
registerBlockHandler(new SwitchBoxBlockRender(), MachineType.RedstoneSignalConverter);
registerBlockHandler(new RectifierTransformerUnitBlockRender(), MachineType.RectifierTransformerUnit);
registerBlockHandler(new IronWorkbenchBlockRender(), MachineType.IronWorkbench);
-
+ PileBlockRender pileBlockRender = new PileBlockRender();
+ RenderingRegistry.registerBlockHandler(pileBlockRender);
+ ClientRegistry.bindTileEntitySpecialRenderer(PileTileEntity.class, pileBlockRender.pileTileEntityRender);
+
RenderingRegistry.registerEntityRenderingHandler(CollectorEntity.class, new CollectorRender(false));
MinecraftForgeClient.registerItemRenderer(IHLMod.collectorItem, new CollectorItemRender(false));
RenderingRegistry.registerEntityRenderingHandler(CollectorHeavyEntity.class, new CollectorRender(true));
MinecraftForgeClient.registerItemRenderer(IHLMod.collectorHeavyItem, new CollectorItemRender(true));
RenderingRegistry.registerEntityRenderingHandler(DriverEntity.class, new DriverRenderEntity());
+ RenderingRegistry.registerEntityRenderingHandler(IHLEntityFallingPile.class, new IHLEntityFallingPileRender());
ClientRegistry.bindTileEntitySpecialRenderer(ChargerEjectorTileEntity.class, new ChargerEjectorRender());
ClientRegistry.bindTileEntitySpecialRenderer(DriverTileEntity.class, new DriverRender());
ClientRegistry.bindTileEntitySpecialRenderer(SackTileEntity.class, new SackRender());
@@ -243,6 +247,7 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(FlameEntityFX.class, new FlameRenderFX(IHLModInfo.MODID+":textures/particles/flameTongue.png"));
RenderingRegistry.registerEntityRenderingHandler(BlastEntityFX.class, new FlameRenderFX(IHLModInfo.MODID+":textures/particles/blast.png"));
RenderingRegistry.registerEntityRenderingHandler(BlobEntityFX.class, new BlobRenderFX());
+ RenderingRegistry.registerEntityRenderingHandler(ExplosionEntityFX.class, new ExplosionRenderFX(IHLModInfo.MODID+":textures/particles/explosion.png"));
RenderingRegistry.registerEntityRenderingHandler(NodeEntity.class, new NodeRender());
MinecraftForge.EVENT_BUS.register(new RenderGameOverlayEventHandler());
@@ -269,6 +274,9 @@ public class ClientProxy extends ServerProxy {
BlastEntityFX blast = new BlastEntityFX(world,x,y,z,mx,my,mz,particleScale);
world.spawnEntityInWorld(blast);
break;
+ case 4:
+ world.spawnParticle("smoke",x,y,z,mx,my,mz);
+ break;
default:
FlameEntityFX flamePEFX2 = new FlameEntityFX(world,x,y,z,mx,my,mz,particleScale);
world.spawnEntityInWorld(flamePEFX2);
@@ -277,6 +285,15 @@ public class ClientProxy extends ServerProxy {
}
@Override
+ public void createExplosionEffect(World world, int x, int y, int z, float radius)
+ {
+ world.playSound(x, y, z, IHLModInfo.MODID+":explosion", 100f, 1f, false);
+ ExplosionEntityFX explosionFX = new ExplosionEntityFX(world, x, y, z, radius);
+ world.spawnEntityInWorld(explosionFX);
+ }
+
+
+ @Override
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void registerIcons(TextureStitchEvent.Pre event)
@@ -329,6 +346,7 @@ public class ClientProxy extends ServerProxy {
@SubscribeEvent
public void onPacketFromServerToClient(FMLNetworkEvent.ClientCustomPacketEvent event) throws IOException
{
+ World world = Minecraft.getMinecraft().theWorld;
ByteBuf data = event.packet.payload();
ByteBufInputStream byteBufInputStream = new ByteBufInputStream(data);
switch(byteBufInputStream.read())
@@ -342,11 +360,11 @@ public class ClientProxy extends ServerProxy {
float my=byteBufInputStream.readFloat();
float mz=byteBufInputStream.readFloat();
float particleScale=byteBufInputStream.readFloat();
- this.spawnParticle(particleId, Minecraft.getMinecraft().theWorld, x, y, z, mx, my, mz, particleScale);
+ this.spawnParticle(particleId, world, x, y, z, mx, my, mz, particleScale);
break;
case 1:
int entityId = byteBufInputStream.readInt();
- INetworkListener listener = (INetworkListener) Minecraft.getMinecraft().theWorld.getEntityByID(entityId);
+ INetworkListener listener = (INetworkListener) world.getEntityByID(entityId);
if(listener!=null)
{
listener.recieveData(byteBufInputStream);
@@ -358,11 +376,44 @@ public class ClientProxy extends ServerProxy {
IHLMod.log.debug("Data delayed. Entity ID="+entityId);
}
break;
+ case 2:
+ int posX=byteBufInputStream.readInt();
+ int posY=byteBufInputStream.readInt();
+ int posZ=byteBufInputStream.readInt();
+ float radius=byteBufInputStream.readFloat();
+ this.createExplosionEffect(world, posX, posY, posZ, radius);
+ break;
+ case 3:
+ int soundId = byteBufInputStream.read();
+ x=byteBufInputStream.readFloat();
+ y=byteBufInputStream.readFloat();
+ z=byteBufInputStream.readFloat();
+ float volume=byteBufInputStream.readFloat();
+ float pitch=byteBufInputStream.readFloat();
+ this.playSound(Minecraft.getMinecraft().theWorld, soundId, x, y, z, volume, pitch);
+ break;
+ case 4:
+ int chunkNum = byteBufInputStream.read();
+ for(int i=0;i<chunkNum;i++)
+ {
+ long chunkXZKey = byteBufInputStream.readLong();
+ int chunkX = (int)(chunkXZKey & 0xFFFFFFFF);
+ int chunkZ = (int)((chunkXZKey>>32) & 0xFFFFFFFF);
+ Chunk chunk = world.getChunkProvider().provideChunk(chunkX, chunkZ);
+ chunk.generateSkylightMap();
+ Arrays.fill(chunk.updateSkylightColumns, true);
+ chunk.func_150804_b(true);
+ }
+ break;
}
byteBufInputStream.close();
}
- @Override
+ private void playSound(WorldClient world, int soundId, float x, float y, float z, float volume, float pitch) {
+ world.playSound(x, y, z, IHLModInfo.MODID+":fuse", 1f, 1f, false);
+ }
+
+ @Override
public boolean renderTESpecialSelectionBox(TileEntity te, EntityPlayer player, ItemStack currentItem, MovingObjectPosition target, float partialTicks)
{
ISelectionBoxSpecialRenderer ssbr = selectionBoxSpecialRendererRegistry.get(te.getClass());
@@ -397,7 +448,29 @@ public class ClientProxy extends ServerProxy {
{
e.printStackTrace();
}
-
+ }
+
+ @Override
+ public void requestTileEntityInitdataFromClientToServer(int x, int y, int z)
+ {
+ EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
+ ByteBuf bb = Unpooled.buffer(36);
+ ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb);
+ try
+ {
+ byteBufOutputStream.write(1);
+ byteBufOutputStream.writeInt(player.getEntityId());
+ byteBufOutputStream.writeInt(player.worldObj.provider.dimensionId);
+ byteBufOutputStream.writeInt(x);
+ byteBufOutputStream.writeInt(y);
+ byteBufOutputStream.writeInt(z);
+ channel.sendToServer(new FMLProxyPacket(byteBufOutputStream.buffer(),IHLModInfo.MODID));
+ byteBufOutputStream.close();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
}
}
diff --git a/ihl/IHL3dPathFinder.java b/ihl/IHL3dPathFinder.java
index cfb71d1..3f0605b 100644
--- a/ihl/IHL3dPathFinder.java
+++ b/ihl/IHL3dPathFinder.java
@@ -1,7 +1,7 @@
package ihl;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
@@ -70,7 +70,7 @@ public class IHL3dPathFinder {
int y=Math.round((float)toY);
int z=Math.round((float)toZ);
int xyz[] = {0,0,1,0,0,-1,0,0};
- List list = new ArrayList();
+ Set<Long> list = new HashSet<Long>();
for(int thread=0;thread<=256;thread++)
{
if(this.isCourseTraversable(x+0.5D, y+0.5D, z+0.5D, this.entity.posX, this.entity.posY, this.entity.posZ))
diff --git a/ihl/IHLMod.java b/ihl/IHLMod.java
index c92e0ff..ed66a5f 100644
--- a/ihl/IHLMod.java
+++ b/ihl/IHLMod.java
@@ -3,8 +3,10 @@ package ihl;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.xml.parsers.ParserConfigurationException;
@@ -36,6 +38,12 @@ import ihl.datanet.DataNet;
import ihl.enviroment.LaserHitMirrorEventHandler;
import ihl.enviroment.LightBulbBlock;
import ihl.enviroment.MirrorBlock;
+import ihl.explosion.ChunkAndWorldLoadEventHandler;
+import ihl.explosion.ExplosionVectorBlockV2;
+import ihl.explosion.ExplosiveBlock;
+import ihl.explosion.GroundRemoverItem;
+import ihl.explosion.IHLEntityFallingPile;
+import ihl.explosion.PileBlock;
import ihl.flexible_cable.AnchorBlock;
import ihl.flexible_cable.AnchorTileEntity;
import ihl.flexible_cable.IHLENet;
@@ -51,7 +59,6 @@ import ihl.i_hate_liquids.IHLEventHandler;
import ihl.items_blocks.FiberItem;
import ihl.items_blocks.FlexibleCableItem;
import ihl.items_blocks.FlexiblePipeItem;
-import ihl.items_blocks.GroundRemoverItem;
import ihl.items_blocks.IHLItemBlock;
import ihl.items_blocks.IHLTool;
import ihl.items_blocks.ItemSubstance;
@@ -101,6 +108,7 @@ import ihl.crop_harvestors.RubberTreeBlock;
import ihl.crop_harvestors.SackBlock;
import ihl.crop_harvestors.SackTileEntity;
import ihl.recipes.IronWorkbenchRecipe;
+import ihl.recipes.RecipeInputDetonator;
import ihl.recipes.RecipeInputDie;
import ihl.recipes.RecipeInputWire;
import ihl.recipes.RecipeOutputItemStack;
@@ -115,13 +123,10 @@ import ihl.tunneling_shield.DriverBlock;
import ihl.tunneling_shield.DriverTileEntity;
import ihl.tunneling_shield.HorizontalMiningPipe;
import ihl.tunneling_shield.MultiBlockSpacerBlock;
-import ihl.utils.ChunkAndWorldLoadEventHandler;
import ihl.utils.EntityDropEventHandler;
-import ihl.utils.ExplosionVector;
import ihl.utils.FluidDictionary;
import ihl.utils.IHLUtils;
import ihl.utils.IHLXMLParser;
-import ihl.utils.PlayerWakeUpEventHandler;
import ihl.worldgen.IHLWorldGenerator;
import ihl.worldgen.ores.BlockOre;
import ihl.worldgen.ores.DebugScannerBlock;
@@ -140,7 +145,6 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeDictionary.Type;
import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
@@ -152,8 +156,6 @@ import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -203,9 +205,10 @@ public class IHLMod implements IFuelHandler{
public static DataNet datanet;
private ItemStack pfaalimestone;
private ItemStack pfaacobblelimestone;
- public static ExplosionVector explosionHandler;
public static IHLXMLParser xmlparser;
public static FluidDictionary fluidDictionary;
+ public static Map<String,Integer> moltenAmounts = new HashMap<String,Integer>();
+ public static ExplosionVectorBlockV2 explosionHandler;
@EventHandler
public void preInit(FMLPreInitializationEvent evt) throws IOException, ParserConfigurationException
@@ -237,12 +240,7 @@ public class IHLMod implements IFuelHandler{
{
MinecraftForge.EVENT_BUS.register(new IHLEventHandler());
}
- MinecraftForge.EVENT_BUS.register(new ChunkAndWorldLoadEventHandler());
MinecraftForge.EVENT_BUS.register(new EntityDropEventHandler());
- if(config.giveIHLManualOnPlayerWakeUpEvent)
- {
- MinecraftForge.EVENT_BUS.register(new PlayerWakeUpEventHandler());
- }
MinecraftForge.EVENT_BUS.register(new LaserHitMirrorEventHandler());
MinecraftForge.EVENT_BUS.register(new IHLBucketHandler());
MinecraftForge.EVENT_BUS.register(proxy);
@@ -250,13 +248,14 @@ public class IHLMod implements IFuelHandler{
GameRegistry.registerBlock(ds, "debugScanner");
GameRegistry.registerTileEntity(DebugScannerTileEntity.class,"DebugScanner");
cableAnchorBlock = new AnchorBlock("cableAnchor");
- List<String> info1 = new ArrayList();
+ List<String> info1 = new ArrayList<String>();
info1.add("non vulcanized rubber insulated");
DataCableItem.init();
GroundRemoverItem.init();
FlexibleCableItem.init();
IHLGuidebookItem.init();
- //ExplosiveBlock.init();
+ ExplosiveBlock.init();
+ PileBlock.init();
GameRegistry.registerTileEntity(AnchorTileEntity.class, "anchorTileEntity");
crucible=new Crucible();
@@ -315,18 +314,17 @@ public class IHLMod implements IFuelHandler{
GameRegistry.registerItem(tditft, "tditftItem");
proxy.load();
registerEntities();
- if(!IHLUtils.hasOreDictionaryEntry("ingotBrick"))
- {
- OreDictionary.registerOre("ingotBrick", Items.brick);
- }
- if(!IHLUtils.hasOreDictionaryEntry("dustGunpowder"))
- {
- OreDictionary.registerOre("dustGunpowder", Items.gunpowder);
- }
-
+ OreDictionary.registerOre("ingotBrick", Items.brick);
+ OreDictionary.registerOre("dustGunpowder", Items.gunpowder);
+ OreDictionary.registerOre("blockDirt", new ItemStack(Blocks.dirt, 1, OreDictionary.WILDCARD_VALUE));
+ OreDictionary.registerOre("blockDirt", new ItemStack(Blocks.grass, 1, OreDictionary.WILDCARD_VALUE));
+ OreDictionary.registerOre("platePaper", new ItemStack(Items.paper, 1, OreDictionary.WILDCARD_VALUE));
+ OreDictionary.registerOre("dustGunpowder", new ItemStack(Items.gunpowder, 1, OreDictionary.WILDCARD_VALUE));
+ OreDictionary.registerOre("blockExplosive", IHLUtils.getThisModItemStack("ihlExplosive"));
+ MinecraftForge.EVENT_BUS.register(new ChunkAndWorldLoadEventHandler());
IHLMod.log.info("IHL precalculating explosion.");
- explosionHandler = new ExplosionVector();
- IHLMod.log.info("Explosion calculated. Amount of start vectors is "+explosionHandler.startVectors.size());
+ IHLMod.explosionHandler = new ExplosionVectorBlockV2();
+ IHLMod.log.info("Explosion calculated.");
}
@EventHandler
@@ -349,8 +347,8 @@ public class IHLMod implements IFuelHandler{
ConfigTag tweaks = codechicken.core.asm.CodeChickenCoreModContainer.config.getTag("tweaks");
cccFiniteWater = tweaks.getTag("finiteWater").setComment("If set to true two adjacent water source blocks will not generate a third.").getBooleanValue(true);
}
- if(!IHLMod.config.skipRecipeLoad)
- {
+ if(!IHLMod.config.skipRecipeLoad)
+ {
if(IHLMod.config.enableRubberTreeSack)
{
GameRegistry.addRecipe(new ItemStack(sackBlock, 1), new Object[]{ "STS", "L L", "LLL", 'S', Items.string, 'T', Items.stick, 'L', Items.leather});
@@ -370,8 +368,8 @@ public class IHLMod implements IFuelHandler{
ItemStack nuggetTarPitch = OreDictionary.getOres("nuggetTarPitch").get(0).copy();
GameRegistry.addShapelessRecipe(OreDictionary.getOres("ingotTarPitch").get(0).copy(), new Object[]{nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch,nuggetTarPitch});
if(IHLUtils.hasOreDictionaryEntry("brickPeat") && GameRegistry.findItem("Forestry", "bituminousPeat")!=null)GameRegistry.addRecipe(new ItemStack(GameRegistry.findItem("Forestry", "bituminousPeat"), 5), new Object[] { "BBB", "BPB", "BBB", 'B', IHLUtils.getOreDictItemStack("brickPeat"), 'P', OreDictionary.getOres("ingotTarPitch").get(0)});
- pfaalimestone = IHLUtils.getOtherModItemStackWithDamage("PFAAGeologica", "mediumStone",0);
- pfaacobblelimestone = IHLUtils.getOtherModItemStackWithDamage("PFAAGeologica", "mediumCobble",0);
+ pfaalimestone = IHLUtils.getOtherModItemStackWithDamage("PFAAGeologica", "mediumStone",0,1);
+ pfaacobblelimestone = IHLUtils.getOtherModItemStackWithDamage("PFAAGeologica", "mediumCobble",0,1);
isGregTechModLoaded=Loader.isModLoaded("gregtech");
if(isGregTechModLoaded)
{
@@ -402,6 +400,7 @@ public class IHLMod implements IFuelHandler{
IHLUtils.addIC2CentrifugeRecipe("crushedBauxite", IHLUtils.getThisModItemStack("crushedPurifiedBauxite"),IHLUtils.getOreDictItemStack("dustClay"));
IHLUtils.addIC2CentrifugeRecipe("crushedStibnite", IHLUtils.getThisModItemStack("crushedPurifiedStibnite"),IHLUtils.getOreDictItemStack("dustTinyGold"));
IHLUtils.addIC2MaceratorRecipe("logWood", IHLUtils.getThisModItemStack("dustWood"));
+ IHLUtils.addIC2MaceratorRecipe("ingotPotassium", IHLUtils.getThisModItemStack("dustPotassiumOxide"));
if(IHLUtils.hasOreDictionaryEntry("blockLimestone"))IHLUtils.addIC2MaceratorRecipe("blockLimestone", IHLUtils.getOreDictItemStackWithSize("dustCalcite",4));
if(pfaalimestone!=null)IHLUtils.addIC2MaceratorRecipe(pfaalimestone, IHLUtils.getOreDictItemStackWithSize("dustCalcite",4));
if(pfaacobblelimestone!=null)IHLUtils.addIC2MaceratorRecipe(pfaacobblelimestone, IHLUtils.getOreDictItemStackWithSize("dustCalcite",4));
@@ -423,6 +422,7 @@ public class IHLMod implements IFuelHandler{
IHLUtils.addIC2MaceratorRecipe("oreDatolite", IHLUtils.getThisModItemStackWithSize("dustDatolite",4));
IHLUtils.addIC2MaceratorRecipe("oreBischofite", IHLUtils.getThisModItemStackWithSize("dustBischofite",4));
IHLUtils.addIC2MaceratorRecipe("ingotBrick", IHLUtils.getOreDictItemStackWithSize("dustBrick",1));
+ IHLUtils.addIC2ExtrudingRecipe(IHLUtils.getThisModItemStack("dustIronOxideCatalystMix"), IHLUtils.getThisModItemStack("catalystRawIronOxide"));
Recipes.advRecipes.addShapelessRecipe(IHLUtils.getThisModItemStackWithSize("dustIrongraphite",2), new Object[] {new RecipeInputOreDict("dustIron"), new RecipeInputOreDict("dustGraphite")});
Recipes.advRecipes.addShapelessRecipe(IHLUtils.getOreDictItemStackWithSize("dustPorcelain",4), new Object[] {new RecipeInputOreDict("dustClay"),new RecipeInputOreDict("dustClay"), new RecipeInputOreDict("dustSiliconDioxide"), new RecipeInputOreDict("dustPotassiumFeldspar")});
Recipes.advRecipes.addShapelessRecipe(IHLUtils.getThisModItemStack("chisel"), new Object[] {IHLUtils.getThisModItemStack("grindstone"),IHLUtils.getThisModItemStack("blankChiselSteel")});
@@ -460,6 +460,15 @@ public class IHLMod implements IFuelHandler{
Character.valueOf('D'), new RecipeInputOreDict("craftingToolHardHammer"),
Character.valueOf('R'), new RecipeInputItemStack(IHLUtils.getThisModItemStack("diceM10x1SteelHardened")),
Character.valueOf('W'), new RecipeInputOreDict("craftingToolSaw")});
+
+ Recipes.advRecipes.addRecipe(IHLUtils.getThisModItemStackWithSize("drillSteel",2), new Object[] {
+ "VFS", "DR ", " ",
+ Character.valueOf('V'), new RecipeInputOreDict("craftingToolHardHammer"),
+ Character.valueOf('F'), new RecipeInputItemStack(IHLUtils.getThisModItemStack("viseSteel")),
+ Character.valueOf('S'), new RecipeInputOreDict("craftingToolFile"),
+ Character.valueOf('D'), new RecipeInputOreDict("craftingToolChisel"),
+ Character.valueOf('R'), new RecipeInputItemStack(IHLUtils.getThisModItemStack("barD10SteelHot"))});
+
ItemStack crystal = IC2Items.getItem("lapotronCrystal").copy();
ItemStack advBattery = IC2Items.getItem("advBattery").copy();
ItemStack chargedReBattery = IC2Items.getItem("chargedReBattery").copy();
@@ -485,10 +494,10 @@ public class IHLMod implements IFuelHandler{
Recipes.advRecipes.addRecipe(((AdvancedHandPump) ic2_advanced_handpump).getItemStack(0), new Object[] { "TK ", "KCA", " RP", Character.valueOf('T'), IC2Items.getItem("treetap"), Character.valueOf('K'), IC2Items.getItem("advancedAlloy"), Character.valueOf('C'), IC2Items.getItem("cell"), Character.valueOf('A'), IC2Items.getItem("advancedCircuit"), Character.valueOf('R'), IC2Items.getItem("energyCrystal"), Character.valueOf('P'), IC2Items.getItem("powerunitsmall")});
}
- ItemStack forestryWaxCapsule = IHLUtils.getOtherModItemStackWithDamage("Forestry", "waxCapsule", 0);
- ItemStack forestryWaxCast = IHLUtils.getOtherModItemStackWithDamage("Forestry", "waxCast", 0);
- ItemStack forestryCandle = IHLUtils.getOtherModItemStackWithDamage("Forestry", "candle", 0);
- ItemStack forestryBeesWax = IHLUtils.getOtherModItemStackWithDamage("Forestry", "beeswax", 0);
+ ItemStack forestryWaxCapsule = IHLUtils.getOtherModItemStackWithDamage("Forestry", "waxCapsule", 0,1);
+ ItemStack forestryWaxCast = IHLUtils.getOtherModItemStackWithDamage("Forestry", "waxCast", 0,1);
+ ItemStack forestryCandle = IHLUtils.getOtherModItemStackWithDamage("Forestry", "candle", 0,1);
+ ItemStack forestryBeesWax = IHLUtils.getOtherModItemStackWithDamage("Forestry", "beeswax", 0,1);
if(forestryWaxCapsule!=null)
{
Recipes.advRecipes.addRecipe(forestryWaxCapsule, new Object[] { "SBS", " ", " ", Character.valueOf('S'), IHLUtils.getThisModItemStack("ingotStearin"),Character.valueOf('B'),forestryBeesWax});
@@ -523,14 +532,15 @@ public class IHLMod implements IFuelHandler{
FurnaceRecipes.smelting().func_151394_a(IHLUtils.getThisModItemStack("stickCoalElectrodePremix"), IHLUtils.getOreDictItemStack("stickCoal"), 20F);
FurnaceRecipes.smelting().func_151394_a(IHLUtils.getThisModItemStack("plateRawCoal"), IHLUtils.getOreDictItemStack("plateCoal"), 20F);
FurnaceRecipes.smelting().func_151394_a(IHLUtils.getOreDictItemStackWithSize("dustCalcite",3), IHLUtils.getOreDictItemStack("dustQuicklime"), 2F);
+ FurnaceRecipes.smelting().func_151394_a(IHLUtils.getThisModItemStack("catalystRawIronOxide"), IHLUtils.getThisModItemStack("catalystIronOxide"), 2F);
ItemSubstance.postInit();
ItemStack lathingTool = Ic2Items.LathingTool.copy();
lathingTool.setItemDamage(OreDictionary.WILDCARD_VALUE);
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new IRecipeInput[] {new RecipeInputDie("setOfDies1_5sqmm",240)}),Arrays.asList(new ItemStack[] {Ic2Items.copperCableItem}),Arrays.asList(new ItemStack[] {IHLUtils.getUninsulatedWire("Copper",1,240)})));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new IRecipeInput[] {new RecipeInputDie("setOfDies1_5sqmm",240)}),Arrays.asList(new ItemStack[] {Ic2Items.ironCableItem}),Arrays.asList(new ItemStack[] {IHLUtils.getUninsulatedWire("Steel",1,240)})));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("bucket_tarPitch"),new ItemStack(Items.stick)}),Arrays.asList(new ItemStack[] {new ItemStack(Items.bucket),IHLUtils.getOreDictItemStackWithSize("nuggetTarPitch",4),new ItemStack(Blocks.torch)})));
- List<IRecipeInput> materialList3 = new ArrayList();
- materialList3.add(new RecipeInputItemStack(new ItemStack(Blocks.sand,1 , OreDictionary.WILDCARD_VALUE)));
+ List<IRecipeInput> materialList3 = new ArrayList<IRecipeInput>();
+ materialList3.add(new RecipeInputItemStack(new ItemStack(Blocks.sand, 1 , OreDictionary.WILDCARD_VALUE)));
materialList3.add(new RecipeInputOreDict("dustClay"));
materialList3.add(new RecipeInputFluidContainer(FluidRegistry.WATER,1));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,materialList3,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getSandInjectionMoldForResult("ingot")})));
@@ -547,6 +557,7 @@ public class IHLMod implements IFuelHandler{
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,materialList3,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getSandInjectionMoldForResult("handDrillSetOfMoldedParts")})));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,materialList3,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getSandInjectionMoldForResult("detonationSprayingMachineSetOfMoldedParts")})));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,materialList3,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getSandInjectionMoldForResult("viseSetOfMoldedParts")})));
+ IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,materialList3,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getSandInjectionMoldForResult("nozzle")})));
//Sand molds recipe section end
List<ItemStack> materialsForPrecisionMold = Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("ingotStearin"), IHLUtils.getOreDictItemStack("cellLiquidGlass"), IHLUtils.getOreDictItemStack("dustSiliconDioxide"), new ItemStack(Blocks.sand)});
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),materialsForPrecisionMold,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getGypsumInjectionMoldForResult("rollingMachineSetOfMoldedParts"), Ic2Items.cell.copy()})));
@@ -554,8 +565,14 @@ public class IHLMod implements IFuelHandler{
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),materialsForPrecisionMold,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getGypsumInjectionMoldForResult("turboCompressorSetOfMoldedParts"), Ic2Items.cell.copy()})));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),materialsForPrecisionMold,Arrays.asList(new ItemStack[]{InjectionMoldBlock.instance.getGypsumInjectionMoldForResult("extruderSetOfMoldedParts"), Ic2Items.cell.copy()})));
//Precision molds recipe section end
- IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("hammer"),IHLUtils.getThisModItemStack("viseSteel"),IHLUtils.getThisModItemStack("setOfFilesSteel"),IHLUtils.getThisModItemStack("chisel")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("barD10SteelHot")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStackWithSize("drillSteel",2)})));
- IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("hammer"),IHLUtils.getThisModItemStack("chisel"),IHLUtils.getThisModItemStack("needleFile")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("barD10SteelHot")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStackWithSize("sawBladeSteel",2)})));
+ IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(
+ Arrays.asList(new ItemStack[] {
+ IHLUtils.getThisModItemStack("hammer"),
+ IHLUtils.getThisModItemStack("chisel"),
+ IHLUtils.getThisModItemStack("needleFile")}),
+ Arrays.asList(new ItemStack[]{
+ IHLUtils.getThisModItemStack("barD10SteelHot")}),
+ Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStackWithSize("sawBladeSteel",2)})));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("hammer"),IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze"),IHLUtils.getThisModItemStack("needleFile")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("barD10Steel"),IHLUtils.getThisModItemStack("sawBladeSteelHardened"),new ItemStack(Items.stick)}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("hackSawSteel")})));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("needleFile"),IHLUtils.getThisModItemStack("hackSawSteel")}),Arrays.asList(new ItemStack[]{IHLUtils.getOreDictItemStack("plateSteel")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStackWithSize("blankSetOfFilesSteel",4)})));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("setOfFilesSteel")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("viseSetOfMoldedPartsSteel")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("viseSteel")})));
@@ -795,7 +812,14 @@ public class IHLMod implements IFuelHandler{
new RecipeInputOreDict("foilCopper"),
new RecipeInputWire("Copper",8,15,"Rubber",100,10000)}),
Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("redstoneSignalConverter")}),Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("gasWeldingStation")})));
-
+ IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(null,
+ Arrays.asList(new IRecipeInput[]{
+ new RecipeInputOreDict("dustIronOxide",8),
+ new RecipeInputOreDict("dustBauxite"),
+ new RecipeInputOreDict("dustPotassiumOxide"),
+ }),
+ Arrays.asList(new ItemStack[]{
+ IHLUtils.getThisModItemStackWithSize("dustIronOxideCatalystMix",10)})));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("hackSawSteel"),IHLUtils.getThisModItemStack("viseSteel"),IHLUtils.getThisModItemStack("setOfFilesSteel"),IHLUtils.getThisModItemStack("drillSteelHardened"),IHLUtils.getThisModItemStack("handDrillBronze")}),Arrays.asList(new ItemStack[]{IHLUtils.getOreDictItemStack("plateSteel")}),Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStackWithSize("incisorSteel",4)})));
if(IHLMod.isGregTechModLoaded && IHLMod.isGT_API_Version_5)
{
@@ -825,24 +849,67 @@ public class IHLMod implements IFuelHandler{
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),Arrays.asList(new ItemStack[]{IHLUtils.getInsulatedWire("Copper", 1,240,"Rubber",100)}),Arrays.asList(new ItemStack[]{IHLUtils.getUninsulatedWire("Copper", 1,240)})));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),Arrays.asList(new ItemStack[]{IHLUtils.getInsulatedWire("Steel", 1,15,"Rubber",100)}),Arrays.asList(new ItemStack[]{IHLUtils.getUninsulatedWire("Steel", 1,15)})));
IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(new ItemStack[]{IHLUtils.getThisModItemStack("sharpenedCarvingKnifeBronze")}),Arrays.asList(new ItemStack[]{IHLUtils.getInsulatedWire("Steel", 1,240,"Rubber",100)}),Arrays.asList(new ItemStack[]{IHLUtils.getUninsulatedWire("Steel", 1,240)})));
+ IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(Arrays.asList(
+ new ItemStack[] {IHLUtils.getThisModItemStack("tinSnipsSteel")}),
+ Arrays.asList(new IRecipeInput[]{
+ new RecipeInputOreDict("plateGraphite",2),
+ new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("highVoltageCapacitor",3),3),
+ new RecipeInputFluidContainer(IHLFluid.IHLFluidType.MineralOil.fluid, 144),
+ new RecipeInputOreDict("dustSolderingAlloy"),
+ new RecipeInputOreDict("foilMica"),
+ new RecipeInputWire(IHLUtils.getUninsulatedWire("copper", 5, 15)),
+ new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("gu-81m",4)),
+ new RecipeInputOreDict("foilCopper"),
+ new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("valveTube1C21P",6))}),
+ Arrays.asList(new ItemStack[]{
+ IHLUtils.getThisModItemStack("vacuumInductionMeltingFurnace")
+ }),
+ Arrays.asList(new ItemStack[] {
+ IHLUtils.getThisModItemStack("gasWeldingStation")})));
+ ItemStack detonator = IHLUtils.getItemStackWithTag("detonator","detonator_delay",5);
+ detonator.stackSize=16;
+ IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(
+ null,
+ Arrays.asList(new IRecipeInput[]{
+ new RecipeInputOreDict("platePaper",2),
+ new RecipeInputItemStack(new ItemStack(Items.string)),
+ new RecipeInputOreDict("dustGunpowder",1),
+ new RecipeInputOreDict("dustPentaerythritolTetranitrate",1),
+ new RecipeInputOreDict("ingotTarPitch",1)
+ }),
+ Arrays.asList(new ItemStack[]{detonator}),
+ null
+ ));
+ IronWorkbenchTileEntity.addRecipe(new IronWorkbenchRecipe(
+ null,
+ Arrays.asList(new IRecipeInput[]{
+ new RecipeInputOreDict("platePaper",2),
+ new RecipeInputOreDict("dustPentaerythritolTetranitrate",8),
+ new RecipeInputOreDict("ingotTarPitch",1),
+ new RecipeInputDetonator(detonator)
+ }),
+ Arrays.asList(new ItemStack[]{
+ IHLUtils.getItemStackWithTag("ihlExplosive","explosionPower",1000)
+ }),null
+ ));
AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("dustSiliconDioxide",2), new RecipeInputOreDict("dustCoal",4), "dustCarborundum");
AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("dustQuicklime"), new RecipeInputOreDict("dustCoal",4), "dustCalciumCarbide");
AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("stickCoal"), new RecipeInputOreDict("dustCoal"), "stickGraphite");
AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("dustTungsten"), new RecipeInputOreDict("dustCoal"), "ingotTungsten");
AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("dustBoricAcid",4), new RecipeInputOreDict("dustCoal",8), "dustBoronCarbide");
AchesonFurnanceTileEntity.addRecipe(new RecipeInputOreDict("plateCoal"), new RecipeInputOreDict("dustCoal",1), "plateGraphite");
- GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("ic2steam", 1),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 1)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 1));
- if(FluidRegistry.isFluidRegistered("steam"))GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("steam", 1),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 1)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 1));
- GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("ic2superheatedsteam", 15),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 4)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 4));
- LeadOvenTileEntity.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSulfur"), IHLUtils.getOreDictItemStack("dustSaltpeter")})), IHLUtils.getFluidStackWithSize("sulfuricanhydride", 23000));
- LeadOvenTileEntity.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("crushedPurifiedCinnabar")})), IHLUtils.getFluidStackWithSize("vapour.mercury", 3600));
+ GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("ic2steam", 1),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 1)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 1));
+ if(FluidRegistry.isFluidRegistered("steam"))GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("steam", 1),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 1)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 1));
+ GoldChimneyKneeTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("ic2superheatedsteam", 15),IHLUtils.getFluidStackWithSize("sulfuricanhydride", 4)}),null), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 4));
+ LeadOvenTileEntity.addRecipe(new UniversalRecipeInput(null,(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSulfur"), IHLUtils.getOreDictItemStack("dustSaltpeter")})), IHLUtils.getFluidStackWithSize("sulfuricanhydride", 23000));
+ LeadOvenTileEntity.addRecipe(new UniversalRecipeInput(null,(new ItemStack[] {IHLUtils.getOreDictItemStack("crushedPurifiedCinnabar")})), IHLUtils.getFluidStackWithSize("vapour.mercury", 3600));
LeadOvenTileEntity.addRecipe(IHLUtils.getThisModItemStack("dustStibnite"), IHLUtils.getThisModItemStack("dustAntimonyOxide"));
LeadOvenTileEntity.addRecipe(IHLUtils.getOreDictItemStackWithSize("dustSodiumHydrogenSulfate",2), IHLUtils.getFluidStackWithSize("vapour.sulfuricacid", 20000), IHLUtils.getOreDictItemStack("dustSodiumSulfate"));
LeadOvenTileEntity.addRecipe(IHLUtils.getThisModItemStackWithSize("dustSodiumZeoliteCoked",2), IHLUtils.getThisModItemStack("dustSodiumZeolite"));
- ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {new FluidStack(FluidRegistry.WATER, 1500)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustQuicklime", 1)})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 2500)}),null,20));
- ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {new FluidStack(FluidRegistry.WATER, 130),IHLUtils.getFluidStackWithSize("limemilk", 142)}), Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStackWithSize("muttonLard", 6)})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("glyceryl", 130)}),Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStackWithSize("ingotCalciumSoap", 5)}),200));
- ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {new FluidStack(FluidRegistry.WATER, 600),IHLUtils.getFluidStackWithSize("sulfuricacid", 284)}), Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStackWithSize("ingotCalciumSoap", 6)})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("oleicacid", 280)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getThisModItemStackWithSize("ingotStearin", 4)),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustGypsum"),0.48f)}),200));
- ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 1000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustTrona")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 1000)}),Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalcite")}),200));
+ ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput((new FluidStack[] {new FluidStack(FluidRegistry.WATER, 1500)}), (new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustQuicklime", 1)})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 2500)}),null,20));
+ ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput((new FluidStack[] {new FluidStack(FluidRegistry.WATER, 130),IHLUtils.getFluidStackWithSize("limemilk", 142)}), (new ItemStack[] {IHLUtils.getThisModItemStackWithSize("muttonLard", 6)})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("glyceryl", 130)}),(new ItemStack[] {IHLUtils.getThisModItemStackWithSize("ingotCalciumSoap", 5)}),200));
+ ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput((new FluidStack[] {new FluidStack(FluidRegistry.WATER, 600),IHLUtils.getFluidStackWithSize("sulfuricacid", 284)}), (new ItemStack[] {IHLUtils.getThisModItemStackWithSize("ingotCalciumSoap", 6)})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("oleicacid", 280)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getThisModItemStackWithSize("ingotStearin", 4)),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustGypsum"),0.48f)}),200));
+ ImpregnatingMachineTileEntity.addChemicalRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 1000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustTrona")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 1000)}),(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalcite")}),200));
DetonationSprayingMachineTileEntity.addRecipe(IHLUtils.getThisModItemStack("blankNeedleFileSteel"), IHLUtils.getThisModItemStack("needleFile"));
DetonationSprayingMachineTileEntity.addRecipe(IHLUtils.getThisModItemStack("blankSetOfFilesSteel"), IHLUtils.getThisModItemStack("setOfFilesSteel"));
DetonationSprayingMachineTileEntity.addRecipe(IHLUtils.getThisModItemStack("incisorSteel"), IHLUtils.getThisModItemStack("incisorSteelDiamondCoated"));
@@ -858,9 +925,9 @@ public class IHLMod implements IFuelHandler{
MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("sawBladeSteel"),IHLUtils.getThisModItemStack("sawBladeSteelHot"));
MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("barD10Steel"),IHLUtils.getThisModItemStack("barD10SteelHot"));
MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("linerIronGraphite"),IHLUtils.getThisModItemStack("linerIronGraphiteHot"));
- MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustIronOxide"), IHLUtils.getOreDictItemStack("dustLithiumOxide")})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustFerrite",2)}),200));
- MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustSiliconDioxide",3), IHLUtils.getOreDictItemStackWithSize("dustMagnesium",2)})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSilicon"), IHLUtils.getOreDictItemStackWithSize("dustMagnesiumOxide",4)}),200));
- MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustBauxite"), IHLUtils.getOreDictItemStack("dustSodiumHydroxide")})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSodiumAluminate")}),200));
+ MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {IHLUtils.getOreDictItemStack("dustIronOxide"), IHLUtils.getOreDictItemStack("dustLithiumOxide")})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustFerrite",2)}),200));
+ MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustSiliconDioxide",3), IHLUtils.getOreDictItemStackWithSize("dustMagnesium",2)})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getOreDictItemStack("dustSilicon"), IHLUtils.getOreDictItemStackWithSize("dustMagnesiumOxide",4)}),200));
+ MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {IHLUtils.getOreDictItemStack("dustBauxite"), IHLUtils.getOreDictItemStack("dustSodiumHydroxide")})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getOreDictItemStack("dustSodiumAluminate")}),200));
MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("drillSteel"),IHLUtils.getThisModItemStack("drillSteelHot"));
MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("tapM10x1Steel"),IHLUtils.getThisModItemStack("tapM10x1SteelHot"));
MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("diceM10x1Steel"),IHLUtils.getThisModItemStack("diceM10x1SteelHot"));
@@ -875,39 +942,39 @@ public class IHLMod implements IFuelHandler{
ImpregnatingMachineTileEntity.addQuenchingRecipe("tapM10x1SteelHot","tapM10x1SteelHardened");
ImpregnatingMachineTileEntity.addQuenchingRecipe("drillSteelHot","drillSteelHardened");
ImpregnatingMachineTileEntity.addQuenchingRecipe("sawBladeSteelHot","sawBladeSteelHardened");
- ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("oleicacid", 1)}), Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2));
- ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("seedoil", 1)}), Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2));
- ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("mineraloil", 1)}), Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2));
+ ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("oleicacid", 1)}), (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2));
+ ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("seedoil", 1)}), (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2));
+ ImpregnatingMachineTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("mineraloil", 1)}), (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteHot")})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getThisModItemStack("linerIronGraphiteGreased")}),2));
MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("foilRubberWithSulfur"),IHLUtils.getThisModItemStack("foilRubber"));
- MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new IRecipeInput[] {new RecipeInputItemStack(IHLUtils.getThisModItemStack("pipeRubberWithSulfur"))})),new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack("pipeVulcanizedRubber")}), 20));
+ MuffleFurnanceTileEntity.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] {new RecipeInputItemStack(IHLUtils.getThisModItemStack("pipeRubberWithSulfur"))})),new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getThisModItemStack("pipeVulcanizedRubber")}), 20));
GasWeldingStationTileEntity.addGasRecipe(IHLUtils.getOreDictItemStack("dustCalciumCarbide"),IHLUtils.getFluidStackWithSize("water", 666), IHLUtils.getFluidStackWithSize("acetylene", 1333), IHLUtils.getFluidStackWithSize("limemilk", 333));
CryogenicDistillerTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("air", 1000), IHLUtils.getFluidStackWithSize("nitrogen", 781), IHLUtils.getFluidStackWithSize("oxygen", 209), false);
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 500)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSiliconDioxide")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("liquidglass", 500)}),null,200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 500)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustSiliconDioxide")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("liquidglass", 500)}),null,200));
PrecipitatorCondenserTileEntity.addRecipe("vapour.sulfuricacid", "sulfuricacid", 50);
PrecipitatorCondenserTileEntity.addRecipe("vapour.mercury", "mercury", 50);
PrecipitatorCondenserTileEntity.addRecipe("ic2steam", "ic2distilledwater", 100);
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("glyceryl", 50),IHLUtils.getFluidStackWithSize("spruceresin", 1000)}),null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("cablingcolophony", 600)}),null,200,true));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("glyceryl", 50),IHLUtils.getFluidStackWithSize("spruceresin", 1000)}),null), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("cablingcolophony", 600)}),null,200,true));
CryogenicDistillerTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("spruceresin", 1000), IHLUtils.getFluidStackWithSize("ic2distilledwater", 150), IHLUtils.getFluidStackWithSize("turpentine", 300), true);
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("fueloil", 2000)}),null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.tarpitch", 144)}),null,200,true));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("fueloil", 2000)}),null), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.tarpitch", 144)}),null,200,true));
CryogenicDistillerTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("fueloil", 2000), IHLUtils.getFluidStackWithSize("mineraloil", 1000), null, true);
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 4000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("crushedPurifiedGyubnera")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumtungstate", 4000)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinyManganeseOxide"),3.75f),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinyIronOxide"),9f/12f)}),200));
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 1750)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustRockSalt",1)})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 1000)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustPotassiumSulphate"),1.75f)}),200));
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 3500)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSalt")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 1000)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustSodiumHydrogenSulfate"),3.5f)}),200));
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 7000/9),new FluidStack(FluidRegistry.WATER,6000/9+1000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustDatolite")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("boricacid", 1777)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustGypsum"),12f/9f),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinySiliconDioxide"),3f)}),200));
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 1667),IHLUtils.getFluidStackWithSize("hydrogenchloride", 1334)}), null), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumChloride")}),200));
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumtungstate", 6667)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumChloride")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("saltwater", 6000)}),Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumTungstate")}),200));
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 2000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustWood"),IHLUtils.getOreDictItemStack("dustSodiumSulfide")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.cellulose", 1500),IHLUtils.getFluidStackWithSize("ic2biomass", 500)}),null,200));
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("cablingcolophony", 50),new FluidStack(FluidRegistry.WATER,2000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustMica")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.mica", 2000)}),null,200));
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 500),new FluidStack(FluidRegistry.WATER,7500)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustMagnesiumOxide")})), new UniversalRecipeOutput(null,Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustBischofite"),8.75f)}),200));
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("liquidglass", 1000),new FluidStack(FluidRegistry.WATER,2000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustSodiumAluminate")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.sodiumzeolite", 4000)}),null,200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 4000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("crushedPurifiedGyubnera")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumtungstate", 4000)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinyManganeseOxide"),3.75f),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinyIronOxide"),9f/12f)}),200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 1750)}), (new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustRockSalt",1)})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 1000)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustPotassiumSulphate"),1.75f)}),200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 3500)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustSalt")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 1000)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustSodiumHydrogenSulfate"),3.5f)}),200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("sulfuricacid", 7000/9),new FluidStack(FluidRegistry.WATER,6000/9+1000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustDatolite")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("boricacid", 1777)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustGypsum"),12f/9f),new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTinySiliconDioxide"),3f)}),200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("limemilk", 1667),IHLUtils.getFluidStackWithSize("hydrogenchloride", 1334)}), null), new UniversalRecipeOutput(null,(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumChloride")}),200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumtungstate", 6667)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumChloride")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("saltwater", 6000)}),(new ItemStack[] {IHLUtils.getOreDictItemStack("dustCalciumTungstate")}),200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 2000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustWood"),IHLUtils.getOreDictItemStack("dustSodiumSulfide")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.cellulose", 1500),IHLUtils.getFluidStackWithSize("ic2biomass", 500)}),null,200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("cablingcolophony", 50),new FluidStack(FluidRegistry.WATER,2000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustMica")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.mica", 2000)}),null,200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("hydrogenchloride", 500),new FluidStack(FluidRegistry.WATER,7500)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustMagnesiumOxide")})), new UniversalRecipeOutput(null,(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustBischofite"),8.75f)}),200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("liquidglass", 1000),new FluidStack(FluidRegistry.WATER,2000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustSodiumAluminate")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("pulp.sodiumzeolite", 4000)}),null,200));
EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("saltwater", 4000), IHLUtils.getOreDictItemStack("dustSalt"));
EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("boricacid", 2288), IHLUtils.getOreDictItemStack("dustBoricAcid"));
EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 2000), IHLUtils.getOreDictItemStack("dustSodiumHydroxide"));
EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("pulp.sodiumzeolite", 4000), IHLUtils.getOreDictItemStack("dustSodiumZeolite"));
EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("solution.lithiumchloride", 4000), IHLUtils.getOreDictItemStack("dustLithiumChloride"));
EvaporatorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("solution.calciumchloride", 4000), IHLUtils.getOreDictItemStack("dustCalciumChloride"));
- ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("water", 2000),IHLUtils.getFluidStackWithSize("hydrogenchloride", 667)}), Arrays.asList(new IRecipeInput[] {new RecipeInputOreDict("dustCalciumTungstate")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("solution.calciumchloride", 2000)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTungsticAcid"),1.16f)}),200));
- if(IHLUtils.hasOreDictionaryEntry("dustTungstate"))ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("water", 1000),IHLUtils.getFluidStackWithSize("hydrogenchloride",140)}), Arrays.asList(new IRecipeInput[] {new RecipeInputOreDict("dustTungstate")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("solution.lithiumchloride", 560)}),Arrays.asList(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTungsticAcid"),1.0f)}),200));
+ ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("water", 2000),IHLUtils.getFluidStackWithSize("hydrogenchloride", 667)}), (new IRecipeInput[] {new RecipeInputOreDict("dustCalciumTungstate")})), new UniversalRecipeOutput((new FluidStack [] {IHLUtils.getFluidStackWithSize("solution.calciumchloride", 2000)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTungsticAcid"),1.16f)}),200));
+ if(IHLUtils.hasOreDictionaryEntry("dustTungstate"))ChemicalReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("water", 1000),IHLUtils.getFluidStackWithSize("hydrogenchloride",140)}), (new IRecipeInput[] {new RecipeInputOreDict("dustTungstate")})), new UniversalRecipeOutput((new FluidStack [] {IHLUtils.getFluidStackWithSize("solution.lithiumchloride", 560)}),(new RecipeOutputItemStack[] {new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustTungsticAcid"),1.0f)}),200));
MuffleFurnanceTileEntity.addRecipe(IHLUtils.getOreDictItemStackWithSize("dustTungsticAcid",2), IHLUtils.getOreDictItemStack("dustTungstenOxide"),1.14f);
MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("electrolysisBathRawPorcelain"), IHLUtils.getThisModItemStack("electrolysisBathPorcelain"));
MuffleFurnanceTileEntity.addRecipe(IHLUtils.getThisModItemStack("ovenRawPorcelain"), IHLUtils.getThisModItemStack("leadOven"));
@@ -929,8 +996,108 @@ public class IHLMod implements IFuelHandler{
FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("oxygen", 500), IHLUtils.getOreDictItemStack("dustLithium"), null, new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustLithiumOxide"),1.5f));
FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("oxygen", 1333), IHLUtils.getOreDictItemStack("dustLead"), null, new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustLeadPlumbate"),2.333f));
FluidizedBedReactorTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("chlorine", 2000), IHLUtils.getOreDictItemStack("dustCarborundum"), IHLUtils.getFluidStackWithSize("silicontetrachloride", 2500), new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustCoal"),0.5f));
- FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("hydrogen", 445),IHLUtils.getFluidStackWithSize("silicontetrachloride", 1667)}),Arrays.asList(new ItemStack [] {IHLUtils.getOreDictItemStackWithSize("dustIridium", 0),IHLUtils.getOreDictItemStack("dustTinySilicon")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("trichlorosilane", 2112)}),null,200));
- FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("fueloil", 6000)}), Arrays.asList(new ItemStack [] {IHLUtils.getOreDictItemStack("dustSodiumZeolite")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {IHLUtils.getFluidStackWithSize("fuel", 4500),IHLUtils.getFluidStackWithSize("crackinggas", 500)}),Arrays.asList(new RecipeOutputItemStack [] { new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustSodiumZeoliteCoked"),1.9f)}), 2000));
+ FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack [] {IHLUtils.getFluidStackWithSize("hydrogen", 445),IHLUtils.getFluidStackWithSize("silicontetrachloride", 1667)}),(new ItemStack [] {IHLUtils.getOreDictItemStackWithSize("dustIridium", 0),IHLUtils.getOreDictItemStack("dustTinySilicon")})), new UniversalRecipeOutput((new FluidStack [] {IHLUtils.getFluidStackWithSize("trichlorosilane", 2112)}),null,200));
+ FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack [] {IHLUtils.getFluidStackWithSize("fueloil", 6000)}), (new ItemStack [] {IHLUtils.getOreDictItemStack("dustSodiumZeolite")})), new UniversalRecipeOutput((new FluidStack [] {IHLUtils.getFluidStackWithSize("fuel", 4500),IHLUtils.getFluidStackWithSize("crackinggas", 500)}),(new RecipeOutputItemStack [] { new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustSodiumZeoliteCoked"),1.9f)}), 2000));
+ FluidizedBedReactorTileEntity.addRecipe(
+ new UniversalRecipeInput(null,
+ (new IRecipeInput [] {new RecipeInputOreDict("dustWood")})),
+ new UniversalRecipeOutput((new FluidStack [] {
+ IHLUtils.getFluidStackWithSize("molten.tarpitch", 8),
+ IHLUtils.getFluidStackWithSize("tarwater", 39),
+ IHLUtils.getFluidStackWithSize("crackinggas", 31)}),
+ (new RecipeOutputItemStack [] {
+ new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustCoal"),0.25f)}), 2000));
+ ChemicalReactorTileEntity.addRecipe(
+ new UniversalRecipeInput((new FluidStack[] {
+ IHLUtils.getFluidStackWithSize("tarwater", 50)}),
+ (new IRecipeInput[] {
+ new RecipeInputOreDict("dustQuicklime")})),
+ new UniversalRecipeOutput((new FluidStack[] {
+ IHLUtils.getFluidStackWithSize("water", 10)}),
+ (new RecipeOutputItemStack [] {
+ new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustCalciumAcetate"),1f)}),200,true));
+ CryogenicDistillerTileEntity.addRecipe(
+ IHLUtils.getFluidStackWithSize("tarwater", 50),
+ IHLUtils.getFluidStackWithSize("ic2distilledwater", 30),
+ IHLUtils.getFluidStackWithSize("methanol", 10), true);
+ FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput(
+ new FluidStack [] {IHLUtils.getFluidStackWithSize("methanol", 200),IHLUtils.getFluidStackWithSize("oxygen", 100)},
+ new IRecipeInput [] {new RecipeInputOreDict("dustSilver", 0)}),
+ new UniversalRecipeOutput(
+ new FluidStack [] {IHLUtils.getFluidStackWithSize("formaldehyde", 300)},null,200));
+ FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput(
+ new FluidStack [] {IHLUtils.getFluidStackWithSize("chlorine", 110),
+ IHLUtils.getFluidStackWithSize("mercury", 50)},
+ null),
+ new UniversalRecipeOutput(
+ null,new RecipeOutputItemStack [] {
+ new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustMercuryChloride"),1f)},200));
+ FluidizedBedReactorTileEntity.addRecipe(
+ new UniversalRecipeInput(
+ new FluidStack [] {
+ IHLUtils.getFluidStackWithSize("acetylene", 100),
+ IHLUtils.getFluidStackWithSize("ic2distilledwater", 100),
+ IHLUtils.getFluidStackWithSize("hydrogenchloride", 2)},
+ new IRecipeInput [] {new RecipeInputOreDict("dustMercuryChloride", 0)}),
+ new UniversalRecipeOutput(
+ new FluidStack [] {IHLUtils.getFluidStackWithSize("acetaldehyde", 200)},null,200));
+ ChemicalReactorTileEntity.addRecipe(
+ new UniversalRecipeInput(new FluidStack[] {
+ IHLUtils.getFluidStackWithSize("acetaldehyde", 100),
+ IHLUtils.getFluidStackWithSize("formaldehyde", 400),
+ IHLUtils.getFluidStackWithSize("solution.natriumhydroxide", 100)},
+ null),
+ new UniversalRecipeOutput(null,
+ new RecipeOutputItemStack [] {
+ new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustSodiumFormate"),1f),
+ new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustPentaerythritol"),1f)
+ },200,false));
+ ChemicalReactorTileEntity.addRecipe(
+ new UniversalRecipeInput(
+ new FluidStack[] {
+ IHLUtils.getFluidStackWithSize("sulfuricacid", 288)},
+ new IRecipeInput[] {
+ new RecipeInputOreDict("dustSaltpeter")}),
+ new UniversalRecipeOutput(null,
+ new RecipeOutputItemStack [] {
+ new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustPotassiumSulphate"),2f)},200,true));
+ CryogenicDistillerTileEntity.addRecipe(
+ IHLUtils.getFluidStackWithSize("sulfuricacid", 288),
+ IHLUtils.getFluidStackWithSize("nitricacid", 120), null, true);
+ FluidizedBedReactorTileEntity.addRecipe(new UniversalRecipeInput(
+ new FluidStack [] {IHLUtils.getFluidStackWithSize("hydrogen", 90)},
+ new IRecipeInput[] {new RecipeInputItemStack(IHLUtils.getThisModItemStack("catalystIronOxide"))}),
+ new UniversalRecipeOutput(
+ null,new RecipeOutputItemStack [] {
+ new RecipeOutputItemStack(IHLUtils.getThisModItemStack("catalystIron"),1f)},200));
+ FluidizedBedReactorTileEntity.addRecipe(
+ new UniversalRecipeInput(
+ new FluidStack [] {
+ IHLUtils.getFluidStackWithSize("nitrogen", 100),
+ IHLUtils.getFluidStackWithSize("hydrogen", 300)},
+ new IRecipeInput[] {new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize("catalystIron",0),0)}),
+ new UniversalRecipeOutput(
+ new FluidStack [] {IHLUtils.getFluidStackWithSize("ammonia", 400)},null,200));
+ FluidizedBedReactorTileEntity.addRecipe(
+ new UniversalRecipeInput(
+ new FluidStack [] {
+ IHLUtils.getFluidStackWithSize("ammonia", 100),
+ IHLUtils.getFluidStackWithSize("oxygen", 150)},
+ new IRecipeInput[] {new RecipeInputOreDict("dustIridium",0)}),
+ new UniversalRecipeOutput(
+ new FluidStack [] {IHLUtils.getFluidStackWithSize("nitricacid", 250)},null,200));
+ ChemicalReactorTileEntity.addRecipe(
+ new UniversalRecipeInput(
+ new FluidStack[] {
+ IHLUtils.getFluidStackWithSize("nitricacid", 50),
+ IHLUtils.getFluidStackWithSize("sulfuricacid", 50)},
+ new IRecipeInput[] {
+ new RecipeInputOreDict("dustPentaerythritol"),
+ new RecipeInputItemStack(new ItemStack(Items.snowball,8))}),
+ new UniversalRecipeOutput(null,
+ new RecipeOutputItemStack [] {
+ new RecipeOutputItemStack(IHLUtils.getOreDictItemStack("dustPentaerythritolTetranitrate"),1f)},200,false));
+
Crucible.addRecipe("ingotSteel", IHLUtils.getFluidStackWithSize("molten.steel", 144));
Crucible.addRecipe("ingotBronze", IHLUtils.getFluidStackWithSize("molten.bronze", 144));
Crucible.addRecipe("ingotGold", IHLUtils.getFluidStackWithSize("molten.gold", 144));
@@ -938,6 +1105,7 @@ public class IHLMod implements IFuelHandler{
Crucible.addRecipe("dustGold", IHLUtils.getFluidStackWithSize("molten.gold", 144));
Crucible.addRecipe("dustSalt", IHLUtils.getFluidStackWithSize("molten.sodiumchloride", 144));
Crucible.addRecipe("dustGlass", IHLUtils.getFluidStackWithSize("molten.glass", 144));
+ Crucible.addRecipe("dustRockSalt", IHLUtils.getFluidStackWithSize("molten.potassiumchloride", 144));
PaperMachineTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("pulp.cellulose", 1500), new ItemStack(Items.paper));
PaperMachineTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("pulp.mica", 500), IHLUtils.getThisModItemStack("foilMica"));
FractionatorBottomTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("oil", 100), IHLUtils.getFluidStackWithSize("fueloil", 60), IHLUtils.getFluidStackWithSize("fuel", 40));
@@ -945,8 +1113,9 @@ public class IHLMod implements IFuelHandler{
if(FluidRegistry.isFluidRegistered("liquid_medium_oil"))FractionatorBottomTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("liquid_medium_oil", 100), IHLUtils.getFluidStackWithSize("fueloil", 60), IHLUtils.getFluidStackWithSize("fuel", 40));
if(FluidRegistry.isFluidRegistered("liquid_heavy_oil"))FractionatorBottomTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("liquid_heavy_oil", 100), IHLUtils.getFluidStackWithSize("fueloil", 70), IHLUtils.getFluidStackWithSize("fuel", 30));
if(FluidRegistry.isFluidRegistered("liquid_extra_heavy_oil"))FractionatorBottomTileEntity.addRecipe(IHLUtils.getFluidStackWithSize("liquid_extra_heavy_oil", 100), IHLUtils.getFluidStackWithSize("fueloil", 80), IHLUtils.getFluidStackWithSize("fuel", 20));
- ElectrolysisBathTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.sodiumchloride", 1000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustBischofite")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.magnesium", 6)}),null,200));
- ElectrolysisBathTileEntity.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.sodiumchloride", 1000)}), Arrays.asList(new ItemStack[] {IHLUtils.getOreDictItemStack("dustLithiumChloride")})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.lithium", 72)}),null,200));
+ ElectrolysisBathTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.sodiumchloride", 1000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustBischofite")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.magnesium", 6)}),null,200));
+ ElectrolysisBathTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.sodiumchloride", 1000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustLithiumChloride")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.lithium", 72)}),null,200));
+ ElectrolysisBathTileEntity.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.potassiumchloride", 1000)}), (new ItemStack[] {IHLUtils.getOreDictItemStack("dustRockSalt")})), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize("molten.potassium", 72)}),null,200));
// 1 mb of molten metal per 1 m of cable with transverse section equals to 1.5 sq. mm.
fluidDictionary.registerFluidStack("water", IHLUtils.getFluidStackWithSize("water", 1000));
fluidDictionary.registerFluidStack("water", IHLUtils.getFluidStackWithSize("ic2distilledwater", 1000));
@@ -976,7 +1145,7 @@ public class IHLMod implements IFuelHandler{
{
NEIModContainer.plugins.add(new NEIIHLConfig());
}
- IHLMod.config.CheckLists();
+ IHLMod.config.checkLists();
IHLMod.proxy.initBlockRenderer();
IHLMod.log.info("IHL loaded.");
}
@@ -987,6 +1156,7 @@ public class IHLMod implements IFuelHandler{
EntityRegistry.registerModEntity(CollectorHeavyEntity.class, "CollectorHeavyEntity", 1, this, 80, 3, true);
EntityRegistry.registerModEntity(PowerCableNodeEntity.class, "PowerCableNodeEntity", 2, this, 80, 3, true);
EntityRegistry.registerModEntity(NodeEntity.class, "NodeEntity", 3, this, 80, 3, true);
+ EntityRegistry.registerModEntity(IHLEntityFallingPile.class, "IHLEntityFallingPile", 4, this, 80, 3, true);
EntityRegistry.registerGlobalEntityID(LostHeadEntity.class, "LostHead", EntityRegistry.findGlobalUniqueEntityId(), 0x0033FF, 0x00CCFF);
if(IHLMod.config.enableWailers)
{
@@ -1023,33 +1193,19 @@ public class IHLMod implements IFuelHandler{
return 0;
}
+ @SuppressWarnings("deprecation")
private void loadGT5Recipes()
{
- ItemStack odi = ItemList.Circuit_Basic.get(1L, new Object[] {null});
- ItemStack crystal = ItemList.Circuit_Primitive.get(1L, new Object[] {null});
ItemStack advBattery = ItemList.Hull_MV.get(1L, new Object[] {null});
- ItemStack chargedReBattery = ItemList.Hull_LV.get(1L, new Object[] {null});
- ItemStack gypsumOreList = GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L);
ItemStack oreListIterator = GT_OreDictUnificator.get(OrePrefixes.cableGt08, Materials.Gold, 1L);
ItemStack sc = GT_OreDictUnificator.get(OrePrefixes.cableGt08, Materials.Silver, 1L);
ItemStack ec = GT_OreDictUnificator.get(OrePrefixes.cableGt08, Materials.Electrum, 1L);
ItemStack lp = GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L);
ItemStack sp = GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Steel, 1L);
- ItemStack sr = GT_OreDictUnificator.get(OrePrefixes.rod, Materials.Steel, 1L);
- ItemStack ip = GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L);
- ItemStack ir = GT_OreDictUnificator.get(OrePrefixes.rod, Materials.Iron, 1L);
- ItemStack is = GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Iron, 1L);
- ItemStack cs = GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Copper, 1L);
- ItemStack cr = GT_OreDictUnificator.get(OrePrefixes.rod, Materials.Copper, 1L);
- ItemStack pp = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Plastic, 1L);
- ItemStack copper_plate = GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Copper, 1L);
- ItemStack copper_framebox = GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Copper, 1L);
ItemStack rotor_lv = ItemList.Rotor_LV.get(1L, new Object[] {null});
ItemStack rotor_mv = ItemList.Rotor_MV.get(1L, new Object[] {null});
ItemStack motor_lv = ItemList.Electric_Motor_LV.get(1L, new Object[] {null});
ItemStack motor_mv = ItemList.Electric_Motor_MV.get(1L, new Object[] {null});
- ItemStack piston_lv = ItemList.Electric_Piston_LV.get(1L, new Object[] {null});
- ItemStack roboarm_lv = ItemList.Robot_Arm_LV.get(1L, new Object[] {null});
ItemStack sensor_lv = ItemList.Sensor_LV.get(1L, new Object[] {null});
ItemStack sensor_mv = ItemList.Sensor_MV.get(1L, new Object[] {null});
ItemStack battery_lv_c = ItemList.Battery_RE_LV_Cadmium.get(1L, new Object[] {null});
@@ -1119,11 +1275,11 @@ public class IHLMod implements IFuelHandler{
{
GregTech_API.sRecipeAdder.addPulveriserRecipe(pfaacobblelimestone, new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustCalcite", 4)}, new int[] {10000}, 600, 30);
}
- List gypsumOreList3 = IHLUtils.getEntryListForOre("oreGypsum");
- Iterator oreListIterator3 = gypsumOreList3.iterator();
+ List<ItemStack> gypsumOreList3 = IHLUtils.getEntryListForOre("oreGypsum");
+ Iterator<ItemStack> oreListIterator3 = gypsumOreList3.iterator();
while (oreListIterator3.hasNext())
{
- GregTech_API.sRecipeAdder.addPulveriserRecipe(((ItemStack)oreListIterator3.next()), new ItemStack[] {IHLUtils.getOreDictItemStack("dustGypsum")}, new int[] {10000}, 600, 30);
+ GregTech_API.sRecipeAdder.addPulveriserRecipe((oreListIterator3.next()), new ItemStack[] {IHLUtils.getOreDictItemStack("dustGypsum")}, new int[] {10000}, 600, 30);
}
GregTech_API.sRecipeAdder.addPulveriserRecipe(IHLUtils.getThisModItemStack("orePotassiumFeldspar"), new ItemStack[] {IHLUtils.getOreDictItemStack("dustPotassiumFeldspar")}, new int[] {10000}, 600, 30);
GregTech_API.sRecipeAdder.addPulveriserRecipe(IHLUtils.getThisModItemStack("oreLimestone"), new ItemStack[] {IHLUtils.getOreDictItemStackWithSize("dustCalcite", 4)}, new int[] {10000}, 600, 30);
@@ -1148,31 +1304,16 @@ public class IHLMod implements IFuelHandler{
private void loadGT6Recipes()
{
- ItemStack ac = IL.Circuit_Basic.get(1,(Object) null);
- ItemStack cp = IL.Circuit_Primitive.get(1,(Object) null);
ItemStack hull_mv = Ic2Items.advancedMachine;
- ItemStack hull_lv = Ic2Items.advancedMachine;
- ItemStack tc = OreDictManager.INSTANCE.getStack(OP.cableGt01,MT.Tin, 1);
ItemStack gc = OreDictManager.INSTANCE.getStack(OP.cableGt08,MT.Gold, 1);
ItemStack sc = OreDictManager.INSTANCE.getStack(OP.cableGt08,MT.Silver, 1);
ItemStack ec = OreDictManager.INSTANCE.getStack(OP.cableGt08,MT.Electrum, 1);
ItemStack lp = OreDictManager.INSTANCE.getStack(OP.plate,MT.Lazurite, 1);
ItemStack sp = OreDictManager.INSTANCE.getStack(OP.plate,MT.Steel, 1);
- ItemStack sr = OreDictManager.INSTANCE.getStack(OP.rod,MT.Steel, 1);
- ItemStack ip = OreDictManager.INSTANCE.getStack(OP.plate,MT.Iron, 1);
- ItemStack ir = OreDictManager.INSTANCE.getStack(OP.rod,MT.Iron, 1);
- ItemStack is = OreDictManager.INSTANCE.getStack(OP.screw,MT.Iron, 1);
- ItemStack cs = OreDictManager.INSTANCE.getStack(OP.screw,MT.Copper, 1);
- ItemStack cr = OreDictManager.INSTANCE.getStack(OP.rod,MT.Copper, 1);
- ItemStack pp = OreDictManager.INSTANCE.getStack(OP.ingot,MT.Plastic, 1);
- ItemStack copper_plate = OreDictManager.INSTANCE.getStack(OP.plate,MT.Copper, 1);
- ItemStack copper_framebox = OreDictManager.INSTANCE.getStack(OP.frameGt,MT.Copper, 1);
ItemStack rotor_lv = OreDictManager.INSTANCE.getStack(OP.rotor,MT.Iron, 1);
ItemStack rotor_mv = OreDictManager.INSTANCE.getStack(OP.rotor,MT.Aluminium, 1);
ItemStack motor_lv = IL.Electric_Motor_LV.get(1,(Object) null);
ItemStack motor_mv = IL.Electric_Motor_MV.get(1,(Object) null);
- ItemStack piston_lv = IL.Electric_Piston_LV.get(1,(Object) null);
- ItemStack roboarm_lv = IL.Robot_Arm_LV.get(1,(Object) null);
ItemStack sensor_lv = IL.Sensor_LV.get(1,(Object) null);
ItemStack sensor_mv = IL.Sensor_MV.get(1,(Object) null);
ItemStack battery_lv_c = IL.Battery_RE_LV_Cadmium.get(1,(Object) null);
@@ -1185,17 +1326,16 @@ public class IHLMod implements IFuelHandler{
ItemStack pump = IL.Electric_Pump_MV.get(1,(Object) null);
ItemStack pump_hv = IL.Electric_Pump_HV.get(1,(Object) null);
- List<IRecipeInput> dsmInputs1 = new ArrayList();
- ItemStack gregtechfile = IHLUtils.getOtherModItemStackWithDamage("gregtech", "gt.metatool.01", 18);
- dsmInputs1.add(new RecipeInputItemStack(gregtechfile));
- dsmInputs1.add(new RecipeInputOreDict("dustDiamond"));
- dsmInputs1.add(new RecipeInputOreDict("dustGunpowder"));
- DetonationSprayingMachineTileEntity.addRecipe((new UniversalRecipeInput(null,dsmInputs1)), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {gregtechfile.copy()}),2));
+ IRecipeInput[] dsmInputs1 = new IRecipeInput[3];
+ ItemStack gregtechfile = IHLUtils.getOtherModItemStackWithDamage("gregtech", "gt.metatool.01", 18,1);
+ dsmInputs1[0] = new RecipeInputItemStack(gregtechfile);
+ dsmInputs1[1] = new RecipeInputOreDict("dustDiamond");
+ dsmInputs1[2] = new RecipeInputOreDict("dustGunpowder");
+ DetonationSprayingMachineTileEntity.addRecipe((new UniversalRecipeInput(null,dsmInputs1)), new UniversalRecipeOutput(null, new ItemStack[] {gregtechfile.copy()},2));
if(IHLMod.config.enableRubberTreeSack)
{
long[] chances={10000,2000,2000,1000,100,0};
- long[] chances2={10000,10000,10000,5000,500,10000};
Recipe.RecipeMap.sCoagulatorRecipes.addRecipe(
true,
new ItemStack[] {},
diff --git a/ihl/IHLModConfig.java b/ihl/IHLModConfig.java
index c22b580..c48acba 100644
--- a/ihl/IHLModConfig.java
+++ b/ihl/IHLModConfig.java
@@ -2,6 +2,7 @@ package ihl;
import ic2.api.item.IC2Items;
import ic2.api.recipe.IRecipeInput;
+import ic2.api.recipe.RecipeInputFluidContainer;
import ic2.api.recipe.RecipeInputItemStack;
import ic2.api.recipe.RecipeInputOreDict;
import ic2.core.util.StackUtil;
@@ -33,8 +34,10 @@ import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
+import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import net.minecraft.nbt.NBTTagCompound;
public class IHLModConfig
{
@@ -287,12 +290,12 @@ public class IHLModConfig
recipeOutput=parameter;
}
}
- List<IRecipeInput> recipeInputsItems = new ArrayList();
- List<IRecipeInput> recipeInputsTools = new ArrayList();
- List<ItemStack> recipeInputsMachines = new ArrayList();
+ List<IRecipeInput> recipeInputsItems = new ArrayList<IRecipeInput>();
+ List<IRecipeInput> recipeInputsTools = new ArrayList<IRecipeInput>();
+ List<ItemStack> recipeInputsMachines = new ArrayList<ItemStack>();
if(recipeInput!=null)
{
- List<FluidStack> recipeInputsFluids = new ArrayList();
+ List<FluidStack> recipeInputsFluids = new ArrayList<FluidStack>();
String[] rifunctionAndParameters = extractFunctionAndParameters(recipeInput);
List<String> riparameters = splitParameters(rifunctionAndParameters[1]);
Iterator<String> riparametersi=riparameters.iterator();
@@ -304,9 +307,18 @@ public class IHLModConfig
{
List<String> riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]);
String[] modAndItemName = riItemStackparameters.get(0).split(":");
- ItemStack stack = IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], Integer.parseInt(riItemStackparameters.get(2)));
- stack.stackSize = Integer.parseInt(riItemStackparameters.get(1));
- recipeInputsItems.add(new RecipeInputItemStack(stack,stack.stackSize));
+ int iDamage = 0;
+ int iQuantity = Integer.parseInt(riItemStackparameters.get(1));
+ String sDamage = riItemStackparameters.get(2);
+ if(sDamage.startsWith("hash"))
+ {
+ iDamage=extractFunctionAndParameters(sDamage)[1].hashCode() & Integer.MAX_VALUE;
+ }
+ else
+ {
+ iDamage=Integer.parseInt(sDamage);
+ }
+ recipeInputsItems.add(new RecipeInputItemStack(IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], iDamage, iQuantity),iQuantity));
}
else if(riItemFunctionAndParameters[0].startsWith("die"))
{
@@ -334,18 +346,27 @@ public class IHLModConfig
List<String> riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]);
recipeInputsItems.add(new RecipeInputOreDict(riItemStackparameters.get(0),Integer.parseInt(riItemStackparameters.get(1))));
}
+ else if(riItemFunctionAndParameters[0].startsWith("fluidcontainer"))
+ {
+ List<String> riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]);
+ recipeInputsItems.add(new RecipeInputFluidContainer(FluidRegistry.getFluid(riItemStackparameters.get(0)),Integer.parseInt(riItemStackparameters.get(1))));
+ }
else if(riItemFunctionAndParameters[0].startsWith("toolitemstack"))
{
List<String> riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]);
String[] modAndItemName = riItemStackparameters.get(0).split(":");
- ItemStack stack = IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], Integer.parseInt(riItemStackparameters.get(2)));
- stack.stackSize = Integer.parseInt(riItemStackparameters.get(1));
+ ItemStack stack = IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], Integer.parseInt(riItemStackparameters.get(2)), Integer.parseInt(riItemStackparameters.get(1)));
+ stack.stackTagCompound = new NBTTagCompound();
+ NBTTagCompound gtTagCompound = new NBTTagCompound();
+ gtTagCompound.setInteger("Damage",0);
+ gtTagCompound.setInteger("MaxDamage",2000);
+ stack.stackTagCompound.setTag("GT.ToolStats", gtTagCompound);
recipeInputsTools.add(new RecipeInputItemStack(stack,stack.stackSize));
}
else if(riItemFunctionAndParameters[0].startsWith("tooloredict"))
{
- List<String> riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]);
- recipeInputsTools.add(new RecipeInputOreDict(riItemStackparameters.get(0),Integer.parseInt(riItemStackparameters.get(1))));
+ recipeInputsTools.add(new RecipeInputOreDict(splitParameters(riItemFunctionAndParameters[1]).get(0)));
+
}
else if(riItemFunctionAndParameters[0].startsWith("machine"))
{
@@ -359,13 +380,13 @@ public class IHLModConfig
recipeInputsFluids.add(IHLUtils.getFluidStackWithSize(riFluidStackparameters.get(0),Integer.parseInt(riFluidStackparameters.get(1))));
}
}
- uRecipeInput = new UniversalRecipeInput(recipeInputsFluids,recipeInputsItems);
+ uRecipeInput = new UniversalRecipeInput(recipeInputsFluids.toArray(),recipeInputsItems.toArray());
}
- List<ItemStack> recipeOutputsItems = new ArrayList();
- List<RecipeOutputItemStack> recipeOutputsRecipeOut = new ArrayList();
+ List<ItemStack> recipeOutputsItems = new ArrayList<ItemStack>();
+ List<RecipeOutputItemStack> recipeOutputsRecipeOut = new ArrayList<RecipeOutputItemStack>();
if(recipeOutput!=null)
{
- List<FluidStack> recipeOutputsFluids = new ArrayList();
+ List<FluidStack> recipeOutputsFluids = new ArrayList<FluidStack>();
String[] rifunctionAndParameters = extractFunctionAndParameters(recipeOutput);
List<String> riparameters = splitParameters(rifunctionAndParameters[1]);
Iterator<String> riparametersi=riparameters.iterator();
@@ -377,31 +398,49 @@ public class IHLModConfig
{
List<String> riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]);
String[] modAndItemName = riItemStackparameters.get(0).split(":");
- ItemStack stack = IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], Integer.parseInt(riItemStackparameters.get(2)));
- stack.stackSize = Integer.parseInt(riItemStackparameters.get(1));
+ String sDamage = riItemStackparameters.get(2);
+ int iDamage = 0;
+ if(sDamage.startsWith("hash"))
+ {
+ iDamage=extractFunctionAndParameters(sDamage)[1].hashCode() & Integer.MAX_VALUE;
+ }
+ else
+ {
+ iDamage=Integer.parseInt(sDamage);
+ }
+ ItemStack stack = IHLUtils.getOtherModItemStackWithDamage(modAndItemName[0], modAndItemName[1], iDamage,Integer.parseInt(riItemStackparameters.get(1)));
+ if(stack==null)
+ {
+ throw new java.lang.IllegalArgumentException("Item not found: "+parameter);
+ }
+ if(riItemStackparameters.size()>3){
+ stack.stackTagCompound = new NBTTagCompound();
+ String[] fp = extractFunctionAndParameters(riItemStackparameters.get(3));
+ Iterator<String> iparams2 = splitParameters(fp[1]).iterator();
+ while(iparams2.hasNext()){
+ decodeNBT(iparams2.next(), stack.stackTagCompound);
+ }
+ }
recipeOutputsItems.add(stack);
- recipeOutputsRecipeOut.add(new RecipeOutputItemStack(stack,Float.parseFloat(riItemStackparameters.get(1))));
+ recipeOutputsRecipeOut.add(new RecipeOutputItemStack(stack.copy(),Float.parseFloat(riItemStackparameters.get(1))));
}
else if(riItemFunctionAndParameters[0].startsWith("fiber"))
{
List<String> riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]);
- ItemStack stack = IHLUtils.getThisModWireItemStackWithLength(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)));
- recipeOutputsItems.add(stack);
- recipeOutputsRecipeOut.add(new RecipeOutputItemStack(stack,1));
+ recipeOutputsItems.add(IHLUtils.getThisModWireItemStackWithLength(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1))));
+ recipeOutputsRecipeOut.add(new RecipeOutputItemStack(IHLUtils.getThisModWireItemStackWithLength(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1))),1));
}
else if(riItemFunctionAndParameters[0].startsWith("wire"))
{
List<String> riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]);
- ItemStack stack = IHLUtils.getUninsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2)));
- recipeOutputsItems.add(stack);
- recipeOutputsRecipeOut.add(new RecipeOutputItemStack(stack,1));
+ recipeOutputsItems.add(IHLUtils.getUninsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2))));
+ recipeOutputsRecipeOut.add(new RecipeOutputItemStack(IHLUtils.getUninsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2))),1));
}
else if(riItemFunctionAndParameters[0].startsWith("cable"))
{
List<String> riItemStackparameters = splitParameters(riItemFunctionAndParameters[1]);
- ItemStack stack = IHLUtils.getInsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2)),riItemStackparameters.get(3),Integer.parseInt(riItemStackparameters.get(4)));
- recipeOutputsItems.add(stack);
- recipeOutputsRecipeOut.add(new RecipeOutputItemStack(stack,1));
+ recipeOutputsItems.add(IHLUtils.getInsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2)),riItemStackparameters.get(3),Integer.parseInt(riItemStackparameters.get(4))));
+ recipeOutputsRecipeOut.add(new RecipeOutputItemStack(IHLUtils.getInsulatedWire(riItemStackparameters.get(0), Integer.parseInt(riItemStackparameters.get(1)), Integer.parseInt(riItemStackparameters.get(2)),riItemStackparameters.get(3),Integer.parseInt(riItemStackparameters.get(4))),1));
}
else if(riItemFunctionAndParameters[0].startsWith("fluidstack"))
{
@@ -422,6 +461,10 @@ public class IHLModConfig
UniversalRecipeManager.machineRecipeManagers.get(machineName).addRecipe(uRecipeInput, uRecipeOutput);
}
}
+ else if(action.equalsIgnoreCase("addcasting"))
+ {
+ IHLMod.moltenAmounts.put(parameters.get(0),Integer.parseInt(parameters.get(1)));
+ }
else if(action.equalsIgnoreCase("removerecipe"))
{
if(machineName.equalsIgnoreCase("ironworkbench"))
@@ -449,48 +492,70 @@ public class IHLModConfig
}
}
- private List<String> splitParameters(String string) {
- ArrayList result = new ArrayList();
+ private void decodeNBT(String string, NBTTagCompound out) {
+ String[] fp = extractFunctionAndParameters(string);
+ List<String> params = splitParameters(fp[1]);
+ if(fp[0].equalsIgnoreCase("string")){
+ out.setString(params.get(0), params.get(1));
+ }
+ else if(fp[0].equalsIgnoreCase("boolean")){
+ out.setBoolean(params.get(0), Boolean.getBoolean(params.get(1)));
+ }
+ else if(fp[0].equalsIgnoreCase("float")){
+ out.setFloat(params.get(0), Float.parseFloat(params.get(1)));
+ }
+ else if(fp[0].equalsIgnoreCase("double")){
+ out.setDouble(params.get(0), Double.parseDouble(params.get(1)));
+ }
+ else if(fp[0].equalsIgnoreCase("integer")){
+ out.setInteger(params.get(0), Integer.parseInt(params.get(1)));
+ }
+ else if(fp[0].equalsIgnoreCase("long")){
+ out.setLong(params.get(0), Long.parseLong(params.get(1)));
+ }
+ else if(fp[0].equalsIgnoreCase("nbt")){
+ NBTTagCompound out2 = new NBTTagCompound();
+ for(int i = 1; i < params.size(); i++){
+ decodeNBT(params.get(i), out2);
+ }
+ out.setTag(params.get(0), out2);
+ }
+ }
+
+
+
+ private List<String> splitParameters(String string) {
+ ArrayList<String> result = new ArrayList<String>();
int bracketCounter=0;
boolean modificatorStart=false;
- String function = null;
- String parameters = null;
StringBuffer currentModificator = new StringBuffer("");
for(int i=0;i<string.length();i++)
{
char c = string.charAt(i);
if(c==',')
{
- if(!modificatorStart)
- {
- result.add(currentModificator.toString());
- currentModificator.delete(0, currentModificator.length());
- }
- }
- else if(c=='(')
- {
- bracketCounter++;
+ if(!modificatorStart) {
+ result.add(currentModificator.toString());
+ currentModificator.delete(0, currentModificator.length());
+ }
+ } else if(c=='(') {
+ bracketCounter++;
modificatorStart=true;
+ } else if(c==')') {
+ bracketCounter--;
}
- else if(c==')')
- {
- bracketCounter--;
- }
- if(bracketCounter==0 && modificatorStart)
- {
+ if(bracketCounter==0 && modificatorStart) {
modificatorStart=false;
}
- if(c!=',' || modificatorStart)
- {
- currentModificator.append(c);
- }
+ if(c!=',' || modificatorStart) {
+ currentModificator.append(c);
+ }
}
result.add(currentModificator.toString());
return result;
- }
+ }
- private String[] extractFunctionAndParameters(String string)
- {
+ private String[] extractFunctionAndParameters(String string) {
int bracketCounter=0;
boolean modificatorStart=false;
String function = null;
@@ -530,7 +595,7 @@ public class IHLModConfig
loadRecipeConfig(is, false);
}
- public void CheckLists()
+ public void checkLists()
{
for(int i6=0;i6<this.ts02BlockBlackListString.length;i6++)
{
diff --git a/ihl/IHLModInfo.java b/ihl/IHLModInfo.java
index 33608d3..4fc82a8 100644
--- a/ihl/IHLModInfo.java
+++ b/ihl/IHLModInfo.java
@@ -3,5 +3,5 @@ package ihl;
public class IHLModInfo {
public static final String MODID = "ihl";
public static final String MODNAME = "IHL Tools & Machines for IC2V2";
- public static final String MODVERSION = "0.601";
+ public static final String MODVERSION = "0.612";
}
diff --git a/ihl/IHLModInfo.java~ b/ihl/IHLModInfo.java~
index b6e7f36..7b7dda9 100644
--- a/ihl/IHLModInfo.java~
+++ b/ihl/IHLModInfo.java~
@@ -3,5 +3,5 @@ package ihl;
public class IHLModInfo {
public static final String MODID = "ihl";
public static final String MODNAME = "IHL Tools & Machines for IC2V2";
- public static final String MODVERSION = "0.600";
+ public static final String MODVERSION = "0.603";
}
diff --git a/ihl/ServerProxy.java b/ihl/ServerProxy.java
index 6aefab0..3af8fbd 100644
--- a/ihl/ServerProxy.java
+++ b/ihl/ServerProxy.java
@@ -10,9 +10,7 @@ import java.util.Set;
import javax.xml.parsers.ParserConfigurationException;
-import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import cpw.mods.fml.common.network.FMLEventChannel;
@@ -28,31 +26,27 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.ByteBufOutputStream;
import io.netty.buffer.Unpooled;
-import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
-import net.minecraft.world.WorldServer;
import net.minecraftforge.client.event.TextureStitchEvent.Pre;
-import net.minecraftforge.event.entity.living.LivingDeathEvent;
public class ServerProxy {
protected static FMLEventChannel channel;
public static final int updatePeriod = 1;
- private static final int maxPacketDataLength = 128;
- protected Map<Integer, INetworkListener> entityList = new HashMap();
- protected Set<INetworkListener> entityServerList = new HashSet();
- protected Map<Integer, ByteBuf> delayedEntityDataPacket = new HashMap();
- public Map<Integer,Set<NodeEntity>> nodeEntityRegistry = new HashMap();
+ protected Map<Integer, INetworkListener> entityList = new HashMap<Integer, INetworkListener>();
+ protected Set<INetworkListener> entityServerList = new HashSet<INetworkListener>();
+ protected Map<Integer, ByteBuf> delayedEntityDataPacket = new HashMap<Integer, ByteBuf>();
+ public Map<Integer,Set<NodeEntity>> nodeEntityRegistry = new HashMap<Integer,Set<NodeEntity>>();
public ServerProxy() {}
@@ -90,6 +84,48 @@ public class ServerProxy {
}
}
+ public void playSoundEffectFromServer(int soundId, World world, double x, double y, double z, float volume, float pitch)
+ {
+ ByteBuf bb = Unpooled.buffer(36);
+ ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb);
+ try
+ {
+ byteBufOutputStream.write(3);
+ byteBufOutputStream.write(soundId);
+ byteBufOutputStream.writeFloat((float) x);
+ byteBufOutputStream.writeFloat((float) y);
+ byteBufOutputStream.writeFloat((float) z);
+ byteBufOutputStream.writeFloat(volume);
+ byteBufOutputStream.writeFloat(pitch);
+ channel.sendToAllAround(new FMLProxyPacket(byteBufOutputStream.buffer(),IHLModInfo.MODID), new TargetPoint(world.provider.dimensionId, x, y, z, volume+32d));
+ byteBufOutputStream.close();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void createExplosionEffectFromServer(World world, int x, int y, int z, float radius)
+ {
+ ByteBuf bb = Unpooled.buffer(36);
+ ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb);
+ try
+ {
+ byteBufOutputStream.write(2);
+ byteBufOutputStream.writeInt(x);
+ byteBufOutputStream.writeInt(y);
+ byteBufOutputStream.writeInt(z);
+ byteBufOutputStream.writeFloat(radius);
+ channel.sendToAllAround(new FMLProxyPacket(byteBufOutputStream.buffer(),IHLModInfo.MODID), new TargetPoint(world.provider.dimensionId, x, y, z, radius+32d));
+ byteBufOutputStream.close();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
public void registerIcons(Pre event) {}
public void initBlockRenderer(){}
public Object getRenderForEntityClass(Class<? extends Entity> entityClass)
@@ -163,7 +199,22 @@ public class ServerProxy {
ItemStack stack = ((Slot)player.openContainer.inventorySlots.get(containerSlotNumber)).getStack();
stack.stackTagCompound.setInteger(fieldName, fieldValue);
player.openContainer.detectAndSendChanges();
- System.out.println("Field now "+stack.stackTagCompound.getInteger(fieldName));
+ break;
+ case 1:
+ playerEntityId = byteBufInputStream.readInt();
+ worldDimensionId = byteBufInputStream.readInt();
+ int x = byteBufInputStream.readInt();
+ int y = byteBufInputStream.readInt();
+ int z = byteBufInputStream.readInt();
+ World world = MinecraftServer.getServer().worldServerForDimension(worldDimensionId);
+ TileEntity te = world.getTileEntity(x, y, z);
+ if(te!=null && !te.isInvalid())
+ {
+ NBTTagCompound nbt = new NBTTagCompound();
+ te.writeToNBT(nbt);
+ player = (EntityPlayerMP) world.getEntityByID(playerEntityId);
+ player.playerNetServerHandler.sendPacket(new S35PacketUpdateTileEntity(x,y,z,6,nbt));
+ }
break;
}
@@ -219,4 +270,31 @@ public class ServerProxy {
}
public void sendItemStackNBTTagFromClientToServerPlayer(EntityPlayer player, int slotNumber, String fieldName, int fieldValue){}
+
+ public void createExplosionEffect(World world, int x, int y, int z, float radius){}
+
+ public void requestTileEntityInitdataFromClientToServer(int x, int y, int z){}
+
+ public void sendChunksLightUpdateQuery(World world, int x, int y, int z, Set<Long> clientSideChunkXZKeySet)
+ {
+ int chunkNum = clientSideChunkXZKeySet.size();
+ ByteBuf bb = Unpooled.buffer(8+(chunkNum<<3));
+ ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb);
+ try
+ {
+ byteBufOutputStream.write(4);
+ byteBufOutputStream.write(chunkNum);
+ Iterator<Long> cluI = clientSideChunkXZKeySet.iterator();
+ while(cluI.hasNext())
+ {
+ byteBufOutputStream.writeLong(cluI.next());
+ }
+ channel.sendToAllAround(new FMLProxyPacket(byteBufOutputStream.buffer(),IHLModInfo.MODID), new TargetPoint(world.provider.dimensionId, x, y, z, 256d));
+ byteBufOutputStream.close();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
}
diff --git a/ihl/collector/ChargerEjectorContainer.java b/ihl/collector/ChargerEjectorContainer.java
index 8d18998..372f4c5 100644
--- a/ihl/collector/ChargerEjectorContainer.java
+++ b/ihl/collector/ChargerEjectorContainer.java
@@ -7,13 +7,13 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class ChargerEjectorContainer extends ContainerBase {
+public class ChargerEjectorContainer extends ContainerBase<ChargerEjectorTileEntity> {
protected ChargerEjectorTileEntity tileEntity;
public int lastStorage = -1;
private final static int height=166;
- public ChargerEjectorContainer(EntityPlayer entityPlayer, ChargerEjectorTileEntity tileEntity1){
+ public ChargerEjectorContainer(EntityPlayer entityPlayer, ChargerEjectorTileEntity tileEntity1){
super(tileEntity1);
this.tileEntity = tileEntity1;
int col;
@@ -55,7 +55,6 @@ public class ChargerEjectorContainer extends ContainerBase {
icrafting.sendProgressBarUpdate(this, 0, (this.tileEntity.getStored()>>15) & Short.MAX_VALUE);
icrafting.sendProgressBarUpdate(this, 1, (short)(this.tileEntity.getStored() & Short.MAX_VALUE));
}
- short st = Short.MAX_VALUE;
}
this.lastStorage = this.tileEntity.getStored();
diff --git a/ihl/collector/ChargerEjectorGui.java b/ihl/collector/ChargerEjectorGui.java
index 79a0c0c..1836dc9 100644
--- a/ihl/collector/ChargerEjectorGui.java
+++ b/ihl/collector/ChargerEjectorGui.java
@@ -10,7 +10,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
-import ic2.core.network.NetworkManager;
import ic2.core.util.GuiTooltipHelper;
@SideOnly(Side.CLIENT)
@@ -30,7 +29,8 @@ public class ChargerEjectorGui extends GuiContainer {
this.container=container1;
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void initGui()
{
super.initGui();
diff --git a/ihl/collector/ChargerEjectorTileEntity.java b/ihl/collector/ChargerEjectorTileEntity.java
index fdb18ed..cda75f4 100644
--- a/ihl/collector/ChargerEjectorTileEntity.java
+++ b/ihl/collector/ChargerEjectorTileEntity.java
@@ -26,7 +26,6 @@ import ic2.core.IHasGui;
import ic2.core.block.TileEntityInventory;
import ic2.core.block.invslot.InvSlot;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
import ihl.IHLMod;
import ihl.utils.IHLInvSlotDischarge;
@@ -184,7 +183,7 @@ public class ChargerEjectorTileEntity extends TileEntityInventory implements IEn
List<EntityItem> eItemsList = this.getEItemsList();
if(eItemsList!=null && eItemsList.size()>0)
{
- Iterator ei = eItemsList.iterator();
+ Iterator<EntityItem> ei = eItemsList.iterator();
while(ei.hasNext())
{
EntityItem entity=(EntityItem) ei.next();
@@ -413,7 +412,8 @@ public class ChargerEjectorTileEntity extends TileEntityInventory implements IEn
}
}
- protected List<EntityItem> getEItemsList()
+ @SuppressWarnings("unchecked")
+ protected List<EntityItem> getEItemsList()
{
double range = 0.2D;
AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.xCoord-range,this.yCoord,this.zCoord-range,this.xCoord+1.0D+range,this.yCoord+1.0D+range,this.zCoord+1.0D+range);
@@ -477,6 +477,7 @@ public class ChargerEjectorTileEntity extends TileEntityInventory implements IEn
}
}
+ @SuppressWarnings("unchecked")
private void callCollectors()
{
double range = 64D;
diff --git a/ihl/collector/CollectorEntity.java b/ihl/collector/CollectorEntity.java
index ed0a163..55e89c8 100644
--- a/ihl/collector/CollectorEntity.java
+++ b/ihl/collector/CollectorEntity.java
@@ -44,14 +44,13 @@ public class CollectorEntity extends EntityFlying {
public double waypointY;
public double waypointZ;
private IHL3dPathFinder pathFinder3D;
- private int stuckCooldown=0;
private boolean clientSideNeedEnergyUpdate = true;
public int hopperx;
public int hoppery;
public int hopperz;
protected int energyConsume=1;
protected Item thisItem=IHLMod.collectorItem;
- protected List<EntityItem> eItemIgnoreList = new ArrayList();
+ protected List<EntityItem> eItemIgnoreList = new ArrayList<EntityItem>();
public Tasks currentTask=Tasks.IDLE;
private int teUpdateTimer = 0;
private double[] last5TickPosX = new double[5];
@@ -145,7 +144,8 @@ public class CollectorEntity extends EntityFlying {
return !this.isDead;
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void onUpdate()
{
super.onUpdate();
@@ -186,7 +186,7 @@ public class CollectorEntity extends EntityFlying {
if(this.charger==null && teUpdateTimer==20)
{
List<TileEntity> teList = this.worldObj.loadedTileEntityList;
- Iterator teIterator=teList.iterator();
+ Iterator<TileEntity> teIterator=teList.iterator();
while(teIterator.hasNext())
{
TileEntity te = (TileEntity) teIterator.next();
@@ -283,7 +283,7 @@ public class CollectorEntity extends EntityFlying {
if(this.hopper==null && teUpdateTimer==10)
{
List<TileEntity> teList = this.worldObj.loadedTileEntityList;
- Iterator teIterator=teList.iterator();
+ Iterator<TileEntity> teIterator=teList.iterator();
while(teIterator.hasNext())
{
TileEntity te = (TileEntity) teIterator.next();
@@ -450,7 +450,7 @@ public class CollectorEntity extends EntityFlying {
}
else
{
- Iterator ei = eItemsList.iterator();
+ Iterator<EntityItem> ei = eItemsList.iterator();
while(ei.hasNext())
{
EntityItem newTarget=(EntityItem) ei.next();
@@ -583,30 +583,6 @@ public class CollectorEntity extends EntityFlying {
return false;
}
- /**
- * True if the ghast has an unobstructed line of travel to the waypoint.
- */
- private boolean isCourseTraversable(double par1, double par3, double par5, double par7)
- {
- double var9 = (par1 - this.posX) / par7;
- double var11 = (par3 - this.posY) / par7;
- double var13 = (par5 - this.posZ) / par7;
- AxisAlignedBB var15 = this.boundingBox.copy();
-
- for (int var16 = 1; var16 < par7; ++var16)
- {
- var15.offset(var9, var11, var13);
-
- if (!this.worldObj.getCollidingBoundingBoxes(this, var15).isEmpty())
- {
- return false;
- }
- }
-
- return true;
- }
-
-
public int getStored()
{
return this.energy;
@@ -616,37 +592,21 @@ public class CollectorEntity extends EntityFlying {
{
this.energy=value;
}
-
- private double mov(double motion)
- {
- double max=0.1D;
- if(motion>max)
- {
- return max;
- }
- else if(motion<-max)
- {
- return -max;
- }
- else
- {
- return 0D;
- }
- }
public ItemStack getVisibleItemStack()
{
return this.dataWatcher.getWatchableObjectItemStack(18);
}
- private void harvest()
+ @SuppressWarnings("unchecked")
+ private void harvest()
{
double range = 1D;
AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.posX-range,this.posY-range-1D,this.posZ-range,this.posX+range,this.posY+range,this.posZ+range);
List<EntityItem> eItemsList = this.worldObj.getEntitiesWithinAABB(EntityItem.class, searchArea);
if(eItemsList!=null && eItemsList.size()>0)
{
- Iterator itemIterator = eItemsList.iterator();
+ Iterator<EntityItem> itemIterator = eItemsList.iterator();
while(itemIterator.hasNext())
{
EntityItem eItem = (EntityItem) itemIterator.next();
@@ -937,7 +897,8 @@ public class CollectorEntity extends EntityFlying {
this.setDead();
}
- protected List<EntityItem> getEItemsList()
+ @SuppressWarnings("unchecked")
+ protected List<EntityItem> getEItemsList()
{
double range = 32D;
AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.lastItemX-range,this.lastItemY-range,this.lastItemZ-range,this.lastItemX+range,this.lastItemY+range,this.lastItemZ+range);
diff --git a/ihl/collector/CollectorItem.java b/ihl/collector/CollectorItem.java
index 67d7914..b4496fa 100644
--- a/ihl/collector/CollectorItem.java
+++ b/ihl/collector/CollectorItem.java
@@ -163,13 +163,14 @@ public class CollectorItem extends Item implements IElectricItem, IItemHudInfo {
@Override
public List<String> getHudInfo(ItemStack itemStack) {
- LinkedList info = new LinkedList();
+ LinkedList<String> info = new LinkedList<String>();
info.add(ElectricItem.manager.getToolTip(itemStack));
info.add("Power Tier: " + this.tier);
return info;
}
- @Override
+ @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b)
{
info.add("PowerTier: " + this.tier);
@@ -177,6 +178,7 @@ public class CollectorItem extends Item implements IElectricItem, IItemHudInfo {
@Override
@SideOnly(Side.CLIENT)
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
itemList.add(this.getItemStack(this.maxCharge));
diff --git a/ihl/collector/GlassBoxContainer.java b/ihl/collector/GlassBoxContainer.java
index 1ad7be7..8f6e52a 100644
--- a/ihl/collector/GlassBoxContainer.java
+++ b/ihl/collector/GlassBoxContainer.java
@@ -5,7 +5,7 @@ import ic2.core.slot.SlotInvSlot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
-public class GlassBoxContainer extends ContainerBase {
+public class GlassBoxContainer extends ContainerBase<GlassBoxTileEntity> {
protected GlassBoxTileEntity tileEntity;
public int lastStorage = -1;
diff --git a/ihl/collector/GlassBoxGui.java b/ihl/collector/GlassBoxGui.java
index 4e09187..2210d06 100644
--- a/ihl/collector/GlassBoxGui.java
+++ b/ihl/collector/GlassBoxGui.java
@@ -5,15 +5,12 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
-import net.minecraft.util.StatCollector;
-
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GlassBoxGui extends GuiContainer {
private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIGlassBox.png");
private GlassBoxContainer container;
- private String title = StatCollector.translateToLocal("ihl.gui.charger_ejector");
public GlassBoxGui (GlassBoxContainer container1) {
//the container is instanciated and passed to the superclass for handling
@@ -22,14 +19,6 @@ public class GlassBoxGui extends GuiContainer {
}
@Override
- public void initGui()
- {
- super.initGui();
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- }
-
- @Override
protected void drawGuiContainerForegroundLayer(int param1, int param2) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(background);
diff --git a/ihl/collector/GlassBoxRender.java b/ihl/collector/GlassBoxRender.java
index 764314d..305c6bd 100644
--- a/ihl/collector/GlassBoxRender.java
+++ b/ihl/collector/GlassBoxRender.java
@@ -24,12 +24,10 @@ public class GlassBoxRender extends TileEntitySpecialRenderer {
double x, double y, double z, float par8) {
GL11.glPushMatrix();
GL11.glTranslatef((float)x + 0.5F, (float)y+0.5F, (float)z + 0.5F);
- float rotation=0F;
for(int i=0;i<te.invSlot.size();i++)
{
if(te.invSlot.get(i)!=null)
{
- rotation+=(randomPosMatrix[i*3]-0.5F)*90F;
GL11.glRotatef((randomPosMatrix[i*3]-0.5F)*90F, 0F, 1F, 0F);
if(te.invSlot.get(i).getItem().isFull3D())
{
diff --git a/ihl/collector/GlassBoxTileEntity.java b/ihl/collector/GlassBoxTileEntity.java
index 7692dc2..a05e283 100644
--- a/ihl/collector/GlassBoxTileEntity.java
+++ b/ihl/collector/GlassBoxTileEntity.java
@@ -17,14 +17,12 @@ import ic2.core.IC2;
import ic2.core.IHasGui;
import ic2.core.block.TileEntityInventory;
import ic2.core.block.invslot.InvSlot;
-import ic2.core.network.NetworkManager;
import ihl.utils.IHLUtils;
public class GlassBoxTileEntity extends TileEntityInventory implements IHasGui {
public final InvSlot invSlot;
public boolean isGuiScreenOpened=false;
- private int bigTimer=0;
public GlassBoxTileEntity()
{
@@ -59,7 +57,7 @@ public class GlassBoxTileEntity extends TileEntityInventory implements IHasGui {
public void updateEntityServer()
{
boolean needInvUpdate=false;
- List<EntityItem> eItemList = new ArrayList();
+ List<EntityItem> eItemList = new ArrayList<EntityItem>();
for(int i=0;i<this.invSlot.size();i++)
{
if(this.invSlot.get(i)==null)
@@ -163,7 +161,8 @@ public class GlassBoxTileEntity extends TileEntityInventory implements IHasGui {
return this.isGuiScreenOpened;
}
- protected List<EntityItem> getEItemsList()
+ @SuppressWarnings("unchecked")
+ protected List<EntityItem> getEItemsList()
{
double range = 0.2D;
AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox(this.xCoord,this.yCoord,this.zCoord,this.xCoord+1.0D,this.yCoord+1.0D+range,this.zCoord+1.0D);
diff --git a/ihl/crop_harvestors/BlowerBlock.java b/ihl/crop_harvestors/BlowerBlock.java
index 9d4c782..3ec49b7 100644
--- a/ihl/crop_harvestors/BlowerBlock.java
+++ b/ihl/crop_harvestors/BlowerBlock.java
@@ -147,7 +147,6 @@ public class BlowerBlock extends Block implements ITileEntityProvider{
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
- IIcon sideIcon = this.blockIcon;
switch (side)
{
case 0:
diff --git a/ihl/crop_harvestors/BlowerContainer.java b/ihl/crop_harvestors/BlowerContainer.java
index 65393bf..2a64488 100644
--- a/ihl/crop_harvestors/BlowerContainer.java
+++ b/ihl/crop_harvestors/BlowerContainer.java
@@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class BlowerContainer extends ContainerBase {
+public class BlowerContainer extends ContainerBase<BlowerTileEntity> {
protected BlowerTileEntity tileEntity;
public int lastStorage = -1;
diff --git a/ihl/crop_harvestors/BlowerGui.java b/ihl/crop_harvestors/BlowerGui.java
index f74ac51..bedee1f 100644
--- a/ihl/crop_harvestors/BlowerGui.java
+++ b/ihl/crop_harvestors/BlowerGui.java
@@ -21,14 +21,6 @@ public class BlowerGui extends GuiContainer {
}
@Override
- public void initGui()
- {
- super.initGui();
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- }
-
- @Override
protected void drawGuiContainerForegroundLayer(int param1, int param2) {
//the parameters for drawString are: string, x, y, color
String title = StatCollector.translateToLocal("tile.blowerBlock.name");
diff --git a/ihl/crop_harvestors/BlowerTileEntity.java b/ihl/crop_harvestors/BlowerTileEntity.java
index 1c06f6c..e26632b 100644
--- a/ihl/crop_harvestors/BlowerTileEntity.java
+++ b/ihl/crop_harvestors/BlowerTileEntity.java
@@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import java.util.Random;
import java.util.Set;
import cpw.mods.fml.relauncher.Side;
@@ -34,7 +33,6 @@ import ic2.core.block.TileEntityInventory;
import ic2.core.block.invslot.InvSlot;
import ic2.core.block.invslot.InvSlotUpgrade;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
import ic2.core.upgrade.IUpgradableBlock;
import ic2.core.upgrade.UpgradableProperty;
import ihl.IHLMod;
@@ -52,16 +50,13 @@ public class BlowerTileEntity extends TileEntityInventory implements IEnergySink
private double energyConsume=5D;
private int defaultAirSpeedBase=100;
public int airSpeedBase=100;
- private boolean shouldCalculateAirFlow=true;
private int sCAFCount=0;
public boolean addedToEnergyNet = false;
- private boolean hasEntityInFlow=false;
- private ArrayList<AirSpeedZone> aszlist = new ArrayList();
+ private ArrayList<AirSpeedZone> aszlist = new ArrayList<AirSpeedZone>();
public final InvSlotUpgrade upgradeSlot;
public final IHLInvSlotDischarge dischargeSlot;
public int updateChecksum=-1;
private final float lambda=0.00001F;
- private Random rand = new Random();
public int operationRange=-1;
public int lastOperationRange=0;
@@ -254,7 +249,8 @@ public class BlowerTileEntity extends TileEntityInventory implements IEnergySink
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void updateEntityServer()
{
@@ -650,12 +646,7 @@ public class BlowerTileEntity extends TileEntityInventory implements IEnergySink
return false;
}
}
-
- private boolean isCNE(int x,int y,int z,int x1,int y1,int z1)
- {
- return x!=x1||y!=y1||z!=z1;
- }
-
+
private boolean isAirPassable(int x,int y,int z)
{
Block block = worldObj.getBlock(x,y,z);
diff --git a/ihl/crop_harvestors/RubberTreeBlock.java b/ihl/crop_harvestors/RubberTreeBlock.java
index bb2128b..9cfdea1 100644
--- a/ihl/crop_harvestors/RubberTreeBlock.java
+++ b/ihl/crop_harvestors/RubberTreeBlock.java
@@ -69,7 +69,6 @@ public class RubberTreeBlock extends Block{
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister)
{
- ItemStack result;
switch(type)
{
case RUBBERTREE:
@@ -120,7 +119,6 @@ public class RubberTreeBlock extends Block{
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
- IIcon sideIcon = this.blockIcon;
switch (side)
{
case 0:
diff --git a/ihl/crop_harvestors/SackBlock.java b/ihl/crop_harvestors/SackBlock.java
index 78a5735..abf8c46 100644
--- a/ihl/crop_harvestors/SackBlock.java
+++ b/ihl/crop_harvestors/SackBlock.java
@@ -43,6 +43,7 @@ public class SackBlock extends Block implements ITileEntityProvider{
this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":sackItem");
}
+ @SuppressWarnings("rawtypes")
@Override
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity)
{
diff --git a/ihl/crop_harvestors/SackTileEntity.java b/ihl/crop_harvestors/SackTileEntity.java
index 9704b7f..69418d8 100644
--- a/ihl/crop_harvestors/SackTileEntity.java
+++ b/ihl/crop_harvestors/SackTileEntity.java
@@ -17,9 +17,9 @@ import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import ic2.core.IC2;
import ic2.core.block.TileEntityInventory;
-import ic2.core.network.NetworkManager;
import ihl.IHLMod;
import ihl.utils.IHLFluidTank;
+import ihl.utils.IHLUtils;
public class SackTileEntity extends TileEntityInventory implements IFluidHandler
{
@@ -307,7 +307,7 @@ public class SackTileEntity extends TileEntityInventory implements IFluidHandler
meta=worldObj.getBlockMetadata(xCoord+mX(), yCoord-h, zCoord+mZ());
if(!isLogBlock(block, meta))
{
- if(block==Blocks.dirt)
+ if(IHLUtils.isBlockRegisteredInOreDictionaryAs(block, "blockDirt"))
{
return true;
}
diff --git a/ihl/datanet/Contact.java b/ihl/datanet/Contact.java
index 3d5b6af..5dce365 100644
--- a/ihl/datanet/Contact.java
+++ b/ihl/datanet/Contact.java
@@ -20,7 +20,7 @@ public class Contact implements IDataNode
{
public final int innerId;
private int dataGridID=-1;
- private Set<IDataNode> connectedContacts = new HashSet();
+ private Set<IDataNode> connectedContacts = new HashSet<IDataNode>(8);
public final InvSlotSignalProcessor attachedSlot;
public final int attachedSlotNumber;
public final int type; //Free:-1; A1:0; A2:1; C:2; NO:3; NC:4;
diff --git a/ihl/datanet/DataCableItem.java b/ihl/datanet/DataCableItem.java
index d8bce25..c8349ca 100644
--- a/ihl/datanet/DataCableItem.java
+++ b/ihl/datanet/DataCableItem.java
@@ -1,7 +1,6 @@
package ihl.datanet;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -10,35 +9,24 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
-import net.minecraft.util.MathHelper;
-import net.minecraft.util.MovingObjectPosition;
-import net.minecraft.util.Vec3;
import net.minecraft.world.World;
-import ihl.IHLCreativeTab;
-import ihl.IHLMod;
import ihl.IHLModInfo;
import ihl.flexible_cable.NodeEntity;
-import ihl.flexible_cable.PowerCableNodeEntity;
import ihl.interfaces.IDataCableHolder;
-import ihl.interfaces.IEnergyNetNode;
-import ihl.interfaces.IWire;
import ihl.items_blocks.FlexibleCableItem;
import ihl.utils.IHLUtils;
public class DataCableItem extends FlexibleCableItem {
- private static Map<Integer, IIcon> iconMap = new HashMap();
- private static Map<Integer, String> nameMap = new HashMap();
- private static Map<Integer, String> descriptionMap = new HashMap();
+ private static Map<Integer, IIcon> iconMap = new HashMap<Integer, IIcon>();
+ private static Map<Integer, String> nameMap = new HashMap<Integer, String>();
+ private static Map<Integer, String> descriptionMap = new HashMap<Integer, String>();
public static DataCableItem dataCableInstance;
public DataCableItem()
@@ -49,6 +37,7 @@ public class DataCableItem extends FlexibleCableItem {
dataCableInstance=this;
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
@@ -121,7 +110,8 @@ public class DataCableItem extends FlexibleCableItem {
}
- @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
{
if(itemStack.stackTagCompound!=null)
diff --git a/ihl/datanet/DataGrid.java b/ihl/datanet/DataGrid.java
index 2c577b0..0f4f9f9 100644
--- a/ihl/datanet/DataGrid.java
+++ b/ihl/datanet/DataGrid.java
@@ -8,20 +8,13 @@ import java.util.Set;
public class DataGrid
{
- public final Set<IDataNode> telist = new HashSet();
+ public final Set<IDataNode> telist = new HashSet<IDataNode>();
public double energy=0D;
- private IDataNode sink;
- private IDataNode source;
- private double voltage;
- private short frequency=0;
- private double lastVoltage;
public boolean isGridValid=true;
- private double total20TicksEU;
- private int lastTickCounter=0;
public Set<IDataNode> getListOfExcludedNodes()
{
- Set<IDataNode> excludedNodes = new HashSet();
+ Set<IDataNode> excludedNodes = new HashSet<IDataNode>();
if(this.telist.isEmpty())
{
return excludedNodes;
diff --git a/ihl/datanet/DataNet.java b/ihl/datanet/DataNet.java
index 3f88c55..a241517 100644
--- a/ihl/datanet/DataNet.java
+++ b/ihl/datanet/DataNet.java
@@ -13,7 +13,7 @@ import net.minecraft.nbt.NBTTagCompound;
public class DataNet {
- public Map<Integer, DataGrid> grids = new HashMap();
+ public Map<Integer, DataGrid> grids = new HashMap<Integer, DataGrid>();
private int griduid=0;
public DataNet()
diff --git a/ihl/datanet/GuiInvisibleButton.java b/ihl/datanet/GuiInvisibleButton.java
index 2222859..31e8b3f 100644
--- a/ihl/datanet/GuiInvisibleButton.java
+++ b/ihl/datanet/GuiInvisibleButton.java
@@ -8,6 +8,7 @@ import net.minecraft.client.gui.GuiButton;
public class GuiInvisibleButton extends GuiButton {
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public GuiInvisibleButton(int id1, int x, int y, int w, int h, Map<Integer, Integer[]> linksCoordinatesMap, List buttonList)
{
super(id1, x, y, w, h, "");
diff --git a/ihl/datanet/RedstoneSignalConverterContainer.java b/ihl/datanet/RedstoneSignalConverterContainer.java
index c075b38..261c9d5 100644
--- a/ihl/datanet/RedstoneSignalConverterContainer.java
+++ b/ihl/datanet/RedstoneSignalConverterContainer.java
@@ -5,12 +5,11 @@ import java.util.List;
import ic2.core.ContainerBase;
import ic2.core.IC2;
import ic2.core.slot.SlotInvSlot;
-import ihl.processing.invslots.SlotRedstoneConverterCableInvSlot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class RedstoneSignalConverterContainer extends ContainerBase {
+public class RedstoneSignalConverterContainer extends ContainerBase<RedstoneSignalConverterTileEntity> {
protected RedstoneSignalConverterTileEntity tileEntity;
private int lastLinksAmount = -1;
diff --git a/ihl/datanet/RedstoneSignalConverterGui.java b/ihl/datanet/RedstoneSignalConverterGui.java
index b823f9f..ce7e2d4 100644
--- a/ihl/datanet/RedstoneSignalConverterGui.java
+++ b/ihl/datanet/RedstoneSignalConverterGui.java
@@ -12,15 +12,12 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
-import ic2.core.network.NetworkManager;
import ihl.collector.GuiMultiTextureButton;
@SideOnly(Side.CLIENT)
public class RedstoneSignalConverterGui extends GuiContainer {
private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIRedstoneSignalConverter.png");
private RedstoneSignalConverterContainer container;
- private GuiInvisibleButton batterySlotPlus;
- private GuiInvisibleButton batterySlotMinus;
private GuiInvisibleButton[] sensorsEmittersPlus = new GuiInvisibleButton[6];
private GuiInvisibleButton[] sensorsEmittersMinus = new GuiInvisibleButton[6];
private GuiInvisibleButton[][] cableContacts = new GuiInvisibleButton[4][8];
@@ -37,15 +34,16 @@ public class RedstoneSignalConverterGui extends GuiContainer {
this.xSize=RedstoneSignalConverterContainer.width;
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void initGui()
{
super.initGui();
int x = (width - xSize) / 2;
int y = (height - ySize) / 2;
int i,i1;
- batterySlotPlus = new GuiInvisibleButton(0, x+24, y+121, 3, 3, linksCoordinatesMap, buttonList);
- batterySlotMinus = new GuiInvisibleButton(1, x+24, y+124, 3, 3, linksCoordinatesMap, buttonList);
+ new GuiInvisibleButton(0, x+24, y+121, 3, 3, linksCoordinatesMap, buttonList); //battery plus
+ new GuiInvisibleButton(1, x+24, y+124, 3, 3, linksCoordinatesMap, buttonList); //battery minus
for(i=0;i<sensorsEmittersPlus.length;i++)
{
sensorsEmittersPlus[i]=new GuiInvisibleButton(i+2, x+24, y+13+18*i, 3, 3, linksCoordinatesMap, buttonList);
diff --git a/ihl/datanet/RedstoneSignalConverterTileEntity.java b/ihl/datanet/RedstoneSignalConverterTileEntity.java
index de1a4f7..6d36cb2 100644
--- a/ihl/datanet/RedstoneSignalConverterTileEntity.java
+++ b/ihl/datanet/RedstoneSignalConverterTileEntity.java
@@ -17,7 +17,6 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
import ic2.api.network.INetworkClientTileEntityEventListener;
import ic2.core.ContainerBase;
@@ -26,9 +25,7 @@ import ic2.core.IHasGui;
import ic2.core.Ic2Items;
import ic2.core.block.TileEntityInventory;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
import ihl.IHLMod;
-import ihl.flexible_cable.NodeEntity;
import ihl.interfaces.IDataCableHolder;
import ihl.interfaces.IDataNode;
import ihl.processing.invslots.InvSlotSignalProcessor;
@@ -63,7 +60,7 @@ public class RedstoneSignalConverterTileEntity extends TileEntityInventory imple
public RedstoneSignalConverterTileEntity()
{
sensorEmitterSlots = new InvSlotSignalProcessor(this, "sensorEmitterSlots", 0, Access.IO, 6, 2);
- cableList = new ArrayList();
+ cableList = new ArrayList<NBTTagCompound>();
dischargeSlot = new IHLInvSlotDischarge(this, 2, Access.IO, 4);
contacts[0]=new Contact(this,0,null,-1,0);
contacts[1]=new Contact(this,1,null,-1,1);
@@ -163,8 +160,8 @@ public class RedstoneSignalConverterTileEntity extends TileEntityInventory imple
super.updateEntityServer();
if(this.linksOrInventoryChanged && this.energy>0)
{
- Set<Integer> checkedGrids = new HashSet();
- Set<Integer> unCheckedGrids = new HashSet();
+ Set<Integer> checkedGrids = new HashSet<Integer>();
+ Set<Integer> unCheckedGrids = new HashSet<Integer>();
InvSlotSignalProcessor slots = this.sensorEmitterSlots;
for(int i=0;i<slots.size();i++)
{
diff --git a/ihl/enviroment/LightBulbBlock.java b/ihl/enviroment/LightBulbBlock.java
index 7175949..d78b667 100644
--- a/ihl/enviroment/LightBulbBlock.java
+++ b/ihl/enviroment/LightBulbBlock.java
@@ -38,10 +38,10 @@ public class LightBulbBlock extends Block implements ITileEntityProvider
public static void init()
{
glowningAir = new GlowningAirBlock();
+ new LightBulbBlock("lightBulb");
+ new SpotlightBlock("spotlight");
GameRegistry.registerBlock(glowningAir, "glowningAir");
- LightBulbBlock mblock = new LightBulbBlock("lightBulb");
GameRegistry.registerTileEntity(LightBulbTileEntity.class, "lightBulb");
- SpotlightBlock sblock = new SpotlightBlock("spotlight");
GameRegistry.registerTileEntity(SpotlightTileEntity.class, "spotlight");
SpotlightTileEntity.createLightSphereVectors();
}
diff --git a/ihl/enviroment/LightBulbModel.java b/ihl/enviroment/LightBulbModel.java
index 710d7fb..bca6305 100644
--- a/ihl/enviroment/LightBulbModel.java
+++ b/ihl/enviroment/LightBulbModel.java
@@ -48,12 +48,4 @@ public class LightBulbModel extends ModelBase
BaseON.drawFromInside = false;
BaseON.addTube("SpyralNorth", -0.5F, -0.5F, 0.5F, 1, 1, 7, 0f, 1f, ForgeDirection.NORTH);
}
-
- private void setRotation(IHLModelRenderer model, float x, float y, float z)
- {
- model.rotateAngleX = x;
- model.rotateAngleY = y;
- model.rotateAngleZ = z;
- }
-
}
diff --git a/ihl/enviroment/LightBulbTileEntity.java b/ihl/enviroment/LightBulbTileEntity.java
index 0d8f399..c82bc57 100644
--- a/ihl/enviroment/LightBulbTileEntity.java
+++ b/ihl/enviroment/LightBulbTileEntity.java
@@ -18,7 +18,6 @@ import ic2.api.network.INetworkDataProvider;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
import ic2.core.ITickCallback;
-import ic2.core.network.NetworkManager;
import ihl.utils.IHLUtils;
public class LightBulbTileEntity extends TileEntity implements IEnergySink, IWrenchable, INetworkDataProvider
@@ -58,7 +57,8 @@ public class LightBulbTileEntity extends TileEntity implements IEnergySink, IWre
super.validate();
IC2.tickHandler.addSingleTickCallback(this.worldObj, new ITickCallback()
{
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void tickCallback(World world)
{
if (!LightBulbTileEntity.this.isInvalid() && world.blockExists(LightBulbTileEntity.this.xCoord, LightBulbTileEntity.this.yCoord, LightBulbTileEntity.this.zCoord))
@@ -238,7 +238,7 @@ public class LightBulbTileEntity extends TileEntity implements IEnergySink, IWre
@Override
public List<String> getNetworkedFields()
{
- Vector ret = new Vector(2);
+ Vector<String> ret = new Vector<String>(2);
ret.add("active");
ret.add("facing");
return ret;
diff --git a/ihl/enviroment/MirrorBlock.java b/ihl/enviroment/MirrorBlock.java
index fd1418e..d7d7473 100644
--- a/ihl/enviroment/MirrorBlock.java
+++ b/ihl/enviroment/MirrorBlock.java
@@ -13,16 +13,12 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class MirrorBlock extends Block implements ITileEntityProvider {
- private String unlocalizedName;
- private IIcon blockIconSide;
-
public MirrorBlock(String unlocalizedName1)
{
super(Material.glass);
@@ -36,7 +32,7 @@ public class MirrorBlock extends Block implements ITileEntityProvider {
public static void init()
{
- MirrorBlock mblock = new MirrorBlock("mirror");
+ new MirrorBlock("mirror");
GameRegistry.registerTileEntity(MirrorTileEntity.class, "mirror");
}
@@ -76,8 +72,6 @@ public class MirrorBlock extends Block implements ITileEntityProvider {
{
MirrorTileEntity ate = (MirrorTileEntity) te;
int var2 = ate.getFacing() & 7;
- float var4 = 0.375F;
- float var5 = 0.625F;
float var6 = 0.5F;
float var7 = 0.09F;
if (var2 == 0)
@@ -111,8 +105,6 @@ public class MirrorBlock extends Block implements ITileEntityProvider {
private void setBlockBoundsBasedOnFacing(int facing)
{
int var2 = facing & 7;
- float var4 = 0.375F;
- float var5 = 0.625F;
float var6 = 0.5F;
float var7 = 0.09F;
if (var2 == 0)
@@ -205,18 +197,4 @@ public class MirrorBlock extends Block implements ITileEntityProvider {
{
this.dropBlockAsItem(world, x, y, z, IHLUtils.getThisModItemStack("dustGlass"));
}
- /* @Override
- public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int i,float pos_x,float pos_y,float pos_z){
- TileEntity te = world.getTileEntity(x,y,z);
- if(IC2.platform.isRendering())
- {
- MirrorTileEntity rtu = (MirrorTileEntity)te;
- if(player.getCurrentEquippedItem()==null)
- {
- IC2.platform.messagePlayer(player, "ic2.tooltip.mode", new Object[] {"Facing " + rtu.getFacing()});
- }
- }
- return false;
- }
- */
}
diff --git a/ihl/enviroment/MirrorRender.java b/ihl/enviroment/MirrorRender.java
index 9e06f90..2166e7b 100644
--- a/ihl/enviroment/MirrorRender.java
+++ b/ihl/enviroment/MirrorRender.java
@@ -15,12 +15,8 @@ import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.BufferUtils;
-import org.lwjgl.opengl.ARBFramebufferObject;
import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.EXTFramebufferObject;
import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL14;
-import org.lwjgl.opengl.GL20;
import org.lwjgl.opengl.GL30;
import org.lwjgl.util.glu.GLU;
import org.lwjgl.util.glu.Project;
@@ -42,7 +38,6 @@ private final int[] ydepth;
private final int[] textureU;
private final int[] textureV;
private final Minecraft mc;
-private static final boolean useARB = true;
public MirrorRender()
{
@@ -54,7 +49,6 @@ public MirrorRender()
}
public void renderAModelAt(MirrorTileEntity tile, double x, double y, double z, float f) {
- Tessellator tessellator=Tessellator.instance;
float[] mAxis = tile.getMirrorAxis();
if(texture==-1)
{
@@ -73,10 +67,6 @@ public void renderAModelAt(MirrorTileEntity tile, double x, double y, double z,
GL30.glRenderbufferStorage(GL30.GL_RENDERBUFFER, GL11.GL_DEPTH_COMPONENT, textureWidth, textureHeight);
GL30.glFramebufferRenderbuffer(GL30.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, GL30.GL_RENDERBUFFER, depthBuffer);
GL30.glFramebufferTexture2D(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL11.GL_TEXTURE_2D, texture, 0);
- IntBuffer drawBuffs = BufferUtils.createIntBuffer(1);
- drawBuffs.put(0, GL30.GL_COLOR_ATTACHMENT0);
- GL20.glDrawBuffers(drawBuffs);// SPme parts of code here mindlessly taken from TheArni/Advanced-Graphics-Processing-Units. https://github.com/TheArni/Advanced-Graphics-Processing-Units/
-
if (GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER) != GL30.GL_FRAMEBUFFER_COMPLETE)
{
IHLMod.log.error("Something went wrong while creating frame buffer!");
diff --git a/ihl/enviroment/MirrorTileEntity.java b/ihl/enviroment/MirrorTileEntity.java
index 083f61d..1808816 100644
--- a/ihl/enviroment/MirrorTileEntity.java
+++ b/ihl/enviroment/MirrorTileEntity.java
@@ -22,11 +22,10 @@ import ihl.utils.IHLUtils;
public class MirrorTileEntity extends TileEntityBlock
{
- public final List<BlockWithCoordinates> bwc = new ArrayList();
- public final List<Entity> reflectedEntity = new ArrayList();
- public final List<TileEntity> reflectedTileEntity = new ArrayList();
+ public final List<BlockWithCoordinates> bwc = new ArrayList<BlockWithCoordinates>();
+ public final List<Entity> reflectedEntity = new ArrayList<Entity>();
+ public final List<TileEntity> reflectedTileEntity = new ArrayList<TileEntity>();
private int bwcListPos=0;
- private int reflectedEntityListPos=0;
private int reflectedTileEntityListPos=0;
private int reflectionVolumePos=0;
boolean firstTick=true;
@@ -52,7 +51,8 @@ public class MirrorTileEntity extends TileEntityBlock
public MirrorTileEntity()
{}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void updateEntityClient()
{
super.updateEntityClient();
@@ -189,24 +189,6 @@ public class MirrorTileEntity extends TileEntityBlock
}
}
- private void dropMirrorStatusByDirection(ForgeDirection direction)
- {
- for(int i=1;i<=IHLMod.config.mirrorReflectionRange+2;i++)
- {
- TileEntity t = worldObj.getTileEntity(xCoord+direction.offsetX*i,yCoord+direction.offsetY*i, zCoord+direction.offsetZ*i);
- if(t instanceof MirrorTileEntity)
- {
- MirrorTileEntity te = (MirrorTileEntity) t;
- te.firstTick=false;
- }
- else
- {
- break;
- }
- }
-
- }
-
private boolean isBlockVisible(Block block, int x, int y, int z)
{
if(block instanceof MirrorBlock)
@@ -329,7 +311,6 @@ public class MirrorTileEntity extends TileEntityBlock
}
if(reflectionVolumeSize>0)
{
- int range=IHLMod.config.mirrorReflectionRange;
//reflectionVolumePos = x+y*maxX+z*maxX*maxY;
int z = reflectionVolumePos / (maxX-minX) / (maxY-minY);
int y = (reflectionVolumePos % ((maxX-minX) * (maxY-minY)))/ (maxX-minX);
diff --git a/ihl/enviroment/SpotlightTileEntity.java b/ihl/enviroment/SpotlightTileEntity.java
index 04b340b..b8bebab 100644
--- a/ihl/enviroment/SpotlightTileEntity.java
+++ b/ihl/enviroment/SpotlightTileEntity.java
@@ -1,7 +1,6 @@
package ihl.enviroment;
import ic2.api.network.INetworkTileEntityEventListener;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.IHLModInfo;
import ihl.i_hate_liquids.XYZ;
import ihl.utils.IHLUtils;
@@ -24,8 +23,8 @@ public class SpotlightTileEntity extends LightBulbTileEntity implements INetwork
{
Vec3 directionVector=Vec3.createVectorHelper(1, 0, 0);
private static final int maxLightRange=128;
- private final Set<XYZ> xyzGlowningAir = new HashSet();
- private static final Set<Vec3> lightSphereVectors = new HashSet();
+ private final Set<XYZ> xyzGlowningAir = new HashSet<XYZ>();
+ private static final Set<Vec3> lightSphereVectors = new HashSet<Vec3>();
public float rotationPitch=0f;
public float rotationYaw=0f;
public float prevRotationPitch=0f;
diff --git a/ihl/utils/ChunkAndWorldLoadEventHandler.java b/ihl/explosion/ChunkAndWorldLoadEventHandler.java
index 3fb51f7..d52672c 100644
--- a/ihl/utils/ChunkAndWorldLoadEventHandler.java
+++ b/ihl/explosion/ChunkAndWorldLoadEventHandler.java
@@ -1,11 +1,12 @@
-package ihl.utils;
+package ihl.explosion;
import ihl.IHLMod;
-import java.util.HashSet;
+import java.util.Iterator;
import java.util.Set;
import net.minecraft.world.ChunkCoordIntPair;
+import net.minecraft.world.Explosion;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class ChunkAndWorldLoadEventHandler
@@ -25,19 +26,27 @@ public class ChunkAndWorldLoadEventHandler
long cc = ChunkCoordIntPair.chunkXZ2Int(event.getChunk().xPosition, event.getChunk().zPosition);
if(bwdata.data.containsKey(cc))
{
- Long[][] bwArray = bwdata.data.remove(cc);
- Set<Long> svset = new HashSet(16);
- int sourceIndex=0;
- for(int i1=0;i1<16;i1++)
+ Set<Integer[]> bwArraySet = bwdata.data.remove(cc);
+ int[] svset = new int[bwArraySet.size()];
+ int[] directionMask = new int[3];
+ int i=0;
+ Iterator<Integer[]> bwArrayI = bwArraySet.iterator();
+ Integer[] bwArray = null;
+ while(bwArrayI.hasNext())
{
- if(bwArray[i1][0]!=null && !bwArray[i1][0].equals(0))
- {
- sourceIndex=i1;
- svset.add(bwArray[i1][0]);
- IHLMod.explosionHandler.setPower(bwArray[i1][0], bwArray[i1][4].intValue());
- }
+ bwArray=bwArrayI.next();
+ svset[i]=bwArray[0];
+ i++;
+ directionMask[0]=bwArray[5];
+ directionMask[1]=bwArray[6];
+ directionMask[2]=bwArray[7];
+ IHLMod.explosionHandler.setPower(bwArray[0], bwArray[4]);
}
- IHLMod.explosionHandler.doExplosion(event.world, bwArray[sourceIndex][1].intValue(), bwArray[sourceIndex][2].intValue(), bwArray[sourceIndex][3].intValue(), svset);
+/* IHLMod.log.info("Doing schleduled explosion. Direction: ("+
+ directionMask[0]+";"+directionMask[1]+";"+directionMask[2]+") "+
+ "svset.length"+svset.length);*/
+ IHLMod.explosionHandler.doExplosion(event.world, bwArray[1], bwArray[2], bwArray[3], svset, directionMask, new Explosion(event.world, null, bwArray[1], bwArray[2], bwArray[3], 100f));
+ IHLMod.explosionHandler.sendChunkUpdateToPlayersInExplosionAffectedZone(event.world, bwArray[1], bwArray[2], bwArray[3]);
}
}
}
diff --git a/ihl/explosion/DetonatorMiniGUI.java b/ihl/explosion/DetonatorMiniGUI.java
new file mode 100644
index 0000000..c969983
--- /dev/null
+++ b/ihl/explosion/DetonatorMiniGUI.java
@@ -0,0 +1,83 @@
+package ihl.explosion;
+
+import java.awt.event.KeyEvent;
+import org.lwjgl.opengl.GL11;
+
+import net.minecraft.client.gui.GuiTextField;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.inventory.Slot;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+import ihl.IHLMod;
+import ihl.interfaces.ItemMiniGUI;
+import ihl.utils.IHLUtils;
+
+public class DetonatorMiniGUI extends ItemMiniGUI
+{
+ private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIIronWorkbench.png");
+ private int detonator_delay;
+ private GuiTextField detonatorDelayTextField;
+ private int xPos;
+ private int yPos;
+
+ public DetonatorMiniGUI(GuiContainer gui, Slot slot)
+ {
+ super(gui, slot);
+ detonator_delay=slot.getStack().stackTagCompound.getInteger("detonator_delay");
+ xPos = this.slotBase.xDisplayPosition-18;
+ yPos = this.slotBase.yDisplayPosition+18;
+ detonatorDelayTextField=new GuiTextField(this.guiBase.mc.fontRenderer, xPos+78, yPos+3, 28, 11);
+ detonatorDelayTextField.setText(Integer.toString(detonator_delay));
+ detonatorDelayTextField.setFocused(true);
+ }
+
+ @Override
+ public void displayGUI()
+ {
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ this.guiBase.mc.renderEngine.bindTexture(background);
+ this.guiBase.drawTexturedModalRect(xPos, yPos, 0, 202, 126, 25);
+ int runnerXPos=xPos+5+114*detonator_delay/1350;
+ this.guiBase.drawTexturedModalRect(runnerXPos, yPos+18, 126, 202, 3, 5);
+ this.guiBase.mc.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("ihl.detonator_delay"), xPos+3, yPos+4, 0xFFCC00);
+ this.detonatorDelayTextField.drawTextBox();
+ this.guiBase.mc.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("s"), xPos+110, yPos+4, 0xFFCC00);
+ }
+
+ @Override
+ public boolean handleMouseClick(int mouseX, int mouseY, int mouseButton)
+ {
+ if(mouseX>=xPos+5 && mouseX<=xPos+119 && mouseY>=yPos+17 && mouseY<=yPos+24)
+ {
+ this.detonator_delay=Math.max(1, Math.min(1350,(mouseX-xPos-5)*1350/114));
+ this.detonatorDelayTextField.setText(Integer.toString(detonator_delay));
+ }
+ if(mouseX>=xPos+78 && mouseX<=xPos+78+28 && mouseY>=yPos+3 && mouseY<=yPos+3+11)
+ {
+ this.detonatorDelayTextField.setFocused(true);
+ }
+ return mouseX>=xPos && mouseX<=xPos+202 && mouseY>=yPos && mouseY<=yPos+25;
+ }
+
+ @Override
+ public boolean handleKeyTyped(char characterTyped, int keyIndex)
+ {
+ this.detonatorDelayTextField.textboxKeyTyped(characterTyped, keyIndex);
+ if(keyIndex==KeyEvent.VK_ACCEPT || keyIndex==KeyEvent.VK_ENTER || keyIndex==28 || keyIndex==156)//28 - enter;156 - numpad enter
+ {
+ this.detonator_delay=Math.max(1, Math.min(1350,(int)(IHLUtils.parseIntSafe(this.detonatorDelayTextField.getText(),this.detonator_delay))));
+ this.detonatorDelayTextField.setText(Integer.toString(detonator_delay));
+ this.detonatorDelayTextField.setFocused(false);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void onGUIClosed()
+ {
+ IHLMod.proxy.sendItemStackNBTTagFromClientToServerPlayer(this.guiBase.mc.thePlayer, this.slotBase.slotNumber, "detonator_delay", this.detonator_delay);
+ }
+
+}
diff --git a/ihl/explosion/ExplosionEntityFX.java b/ihl/explosion/ExplosionEntityFX.java
new file mode 100644
index 0000000..38e1034
--- /dev/null
+++ b/ihl/explosion/ExplosionEntityFX.java
@@ -0,0 +1,177 @@
+package ihl.explosion;
+
+import java.util.Random;
+
+import ihl.utils.IHLMathUtils;
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.world.World;
+
+public class ExplosionEntityFX extends EntityFX {
+
+ private float radius;
+ private static final Random random = new Random();
+ private final int[] particlesMaxAge;
+ private final int[] particlesTextureIndexX;
+ private final int[] particlesTextureIndexY;
+ private final double[][] startPos;
+ private final double[][] pos;
+ private final double[][] prevPos;
+ private final float[][] motion;
+ private final int[] center;
+
+ public ExplosionEntityFX(World world, double x, double y, double z)
+ {
+ super(world, x, y, z);
+ this.renderDistanceWeight = 5.0D;
+ int numParticles = 1;
+ particlesMaxAge = new int[numParticles];
+ particlesTextureIndexX = new int[numParticles];
+ particlesTextureIndexY= new int[numParticles];
+ startPos = new double[numParticles][3];
+ pos = new double[numParticles][3];
+ prevPos = new double[numParticles][3];
+ motion = new float[numParticles][3];
+ center = new int[3];
+ }
+
+ public ExplosionEntityFX(World par1World, int centerX1, int centerY1, int centerZ1, float radius1)
+ {
+ super(par1World, centerX1, centerY1, centerZ1, 0.0D, 0.0D, 0.0D);
+ this.particleMaxAge = 100;
+ this.center = new int[3];
+ this.lastTickPosX=this.posX=this.prevPosX=this.center[0]=centerX1;
+ this.lastTickPosY=this.posY=this.prevPosY=this.center[1]=centerY1;
+ this.lastTickPosZ=this.posZ=this.prevPosZ=this.center[2]=centerZ1;
+ this.radius=radius1;
+ float r2 = radius*radius;
+ int numParticles = (int)(r2*radius/32)+64;
+ this.startPos = new double[numParticles][3];
+ this.pos = new double[numParticles][3];
+ this.prevPos = new double[numParticles][3];
+ this.particleScale *= 40f;
+ this.particlesMaxAge = new int[numParticles];
+ this.particlesTextureIndexX = new int[numParticles];
+ this.particlesTextureIndexY= new int[numParticles];
+ this.motion = new float[numParticles][3];
+ for(int i=0;i<numParticles;i++)
+ {
+ float fPosX = random.nextFloat()*2f-1f;
+ float fPosY = (random.nextFloat()*2f-1f)*IHLMathUtils.sqrt(1f-fPosX*fPosX);
+ float fPosZ = (random.nextFloat()*2f-1f)*IHLMathUtils.sqrt(1f-fPosX*fPosX-fPosY*fPosY);
+ fPosX *= radius1;
+ fPosY *= radius1;
+ fPosZ *= radius1;
+ prevPos[i][0] = pos[i][0] = startPos[i][0] = fPosX + centerX1;
+ prevPos[i][1] = pos[i][1] = startPos[i][1] = fPosY + centerY1;
+ prevPos[i][2] = pos[i][2] = startPos[i][2] = fPosZ + centerZ1;
+ particlesMaxAge[i] = random.nextInt(particleMaxAge-20)+16;
+ particlesTextureIndexY[i]=random.nextInt(8);
+ }
+ this.noClip = true;
+ this.renderDistanceWeight = 6.0D+radius1/2;
+ }
+
+ @Override
+ public void renderParticle(Tessellator tessellator, float interFrame, float rotationX, float rotationXZ, float rotationZ, float rotationYZ, float rotationXY)
+ {
+ for(int i=0;i<particlesMaxAge.length;i++)
+ {
+ float u1 = this.particlesTextureIndexX[i] / 16.0F;
+ float u2 = u1 + 1F / 16.0F;
+ float v1 = this.particlesTextureIndexY[i] / 8.0F;
+ float v2 = v1 + 1F / 8.0F;
+ float scale = 0.1F * this.particleScale;
+
+ float fPosX = (float)(this.prevPos[i][0] - this.prevPosX + (this.pos[i][0] - this.prevPos[i][0]) * interFrame);
+ float fPosY = (float)(this.prevPos[i][1] - this.prevPosY + (this.pos[i][1] - this.prevPos[i][1]) * interFrame);
+ float fPosZ = (float)(this.prevPos[i][2] - this.prevPosZ + (this.pos[i][2] - this.prevPos[i][2]) * interFrame);
+ tessellator.addVertexWithUV(
+ fPosX - rotationX * scale - rotationYZ * scale,
+ fPosY - rotationXZ * scale,
+ fPosZ - rotationZ * scale - rotationXY * scale,
+ u2, v2);
+ tessellator.addVertexWithUV(
+ fPosX - rotationX * scale + rotationYZ * scale,
+ fPosY + rotationXZ * scale,
+ fPosZ - rotationZ * scale + rotationXY * scale,
+ u2, v1);
+ tessellator.addVertexWithUV(
+ fPosX + rotationX * scale + rotationYZ * scale,
+ fPosY + rotationXZ * scale,
+ fPosZ + rotationZ * scale + rotationXY * scale,
+ u1, v1);
+ tessellator.addVertexWithUV(
+ fPosX + rotationX * scale - rotationYZ * scale,
+ fPosY - rotationXZ * scale,
+ fPosZ + rotationZ * scale - rotationXY * scale,
+ u1, v2);
+ }
+ }
+
+ @Override
+ public void onUpdate()
+ {
+ if (this.particleAge++ >= this.particleMaxAge)
+ {
+ this.setDead();
+ }
+ for(int i=0;i<particlesMaxAge.length;i++)
+ {
+ this.prevPos[i][0] = this.pos[i][0];
+ this.prevPos[i][1] = this.pos[i][1];
+ this.prevPos[i][2] = this.pos[i][2];
+
+ int maxFrameX = 15;
+ int frameX = this.particleAge * maxFrameX / this.particlesMaxAge[i];
+ if(frameX<=maxFrameX)
+ {
+ this.particlesTextureIndexX[i] = frameX;
+ }
+
+ if(this.startPos[i][1] < this.center[1])
+ {
+ IHLMathUtils.vector_add(this.motion[i],
+ (float)(this.center[0]-this.pos[i][0])*0.0004f,
+ 0.004f,
+ (float)(this.center[2]-this.pos[i][2])*0.0004f);
+ }
+ else
+ {
+ float[] ring = new float[] {
+ (float)(this.startPos[i][0]-this.center[0]),
+ 0f,
+ (float)(this.startPos[i][2]-this.center[2])};
+ IHLMathUtils.scale_vector_to_value(ring, radius*0.6f);
+ IHLMathUtils.vector_add(ring,
+ this.center[0],
+ (float)this.startPos[i][1]+this.particleAge*0.001f,
+ this.center[2]);
+ float[] from_point_to_ring = IHLMathUtils.vector_return_difference(ring,this.pos[i]);
+ float[] from_point_to_center = IHLMathUtils.vector_return_difference(this.center,this.pos[i]);
+ float[] tangent_to_ring = IHLMathUtils.vector_vector_multiply(from_point_to_ring, from_point_to_center);
+ float[] tangent_to_torus = IHLMathUtils.vector_vector_multiply(from_point_to_ring, tangent_to_ring);
+ IHLMathUtils.normalize_vector(tangent_to_torus);
+ IHLMathUtils.vector_add(this.motion[i],
+ from_point_to_ring[0]*0.01f + tangent_to_torus[0]*0.02f,
+ from_point_to_ring[1]*0.01f + tangent_to_torus[1]*0.02f + 0.004f,
+ from_point_to_ring[2]*0.01f + tangent_to_torus[2]*0.02f);
+ }
+ IHLMathUtils.vector_add(this.pos[i],this.motion[i]);
+ IHLMathUtils.multiply_vector_to_value(this.motion[i], 0.98f);
+ }
+ }
+
+ @Override
+ public void setParticleTextureIndex(int par1)
+ {
+ this.particleTextureIndexX = par1;
+ }
+
+ @Override
+ public boolean shouldRenderInPass(int pass)
+ {
+ return pass==1;
+ }
+
+}
diff --git a/ihl/explosion/ExplosionRenderFX.java b/ihl/explosion/ExplosionRenderFX.java
new file mode 100644
index 0000000..da42d4e
--- /dev/null
+++ b/ihl/explosion/ExplosionRenderFX.java
@@ -0,0 +1,51 @@
+package ihl.explosion;
+
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.renderer.ActiveRenderInfo;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.entity.Render;
+import net.minecraft.entity.Entity;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+
+public class ExplosionRenderFX extends Render{
+ private ResourceLocation tex;
+
+public ExplosionRenderFX(String textureLocation)
+{
+ super();
+ tex = new ResourceLocation(textureLocation);
+}
+
+@Override
+public void doRender(Entity entity, double x, double y, double z,
+ float interFrame, float arg5)
+{
+ float rotationX = ActiveRenderInfo.rotationX;
+ float rotationZ = ActiveRenderInfo.rotationZ;
+ float rotationYZ = ActiveRenderInfo.rotationYZ;
+ float rotationXY = ActiveRenderInfo.rotationXY;
+ float rotationXZ = ActiveRenderInfo.rotationXZ;
+ this.renderManager.renderEngine.bindTexture(tex);
+ GL11.glPushMatrix();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glTranslatef((float)x, (float)y, (float)z);
+ GL11.glDepthMask(false);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ Tessellator tessellator = Tessellator.instance;
+ tessellator.startDrawingQuads();
+ EntityFX entityFX = (EntityFX) entity;
+ entityFX.renderParticle(tessellator, interFrame, rotationX, rotationXZ, rotationZ, rotationYZ, rotationXY);
+ tessellator.draw();
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glDepthMask(true);
+ GL11.glPopMatrix();
+}
+
+ @Override
+ protected ResourceLocation getEntityTexture(Entity arg0)
+ {
+ return tex;
+ }
+} \ No newline at end of file
diff --git a/ihl/explosion/ExplosionVectorBlockV2.java b/ihl/explosion/ExplosionVectorBlockV2.java
new file mode 100644
index 0000000..5d94609
--- /dev/null
+++ b/ihl/explosion/ExplosionVectorBlockV2.java
@@ -0,0 +1,552 @@
+package ihl.explosion;
+
+import ihl.IHLMod;
+import ihl.utils.IHLUtils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.network.play.server.S26PacketMapChunkBulk;
+import net.minecraft.util.DamageSource;
+import net.minecraft.world.ChunkCoordIntPair;
+import net.minecraft.world.Explosion;
+import net.minecraft.world.World;
+import net.minecraft.world.chunk.Chunk;
+import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
+
+public class ExplosionVectorBlockV2
+{
+ public int[] startVectors = new int[1];
+ private final int[][] directionMasks = new int[8][3];
+ private final int bits = 8;
+ private final int maxValue = (1<<bits)-1;
+ private final int maxArraySize = (1<<bits*3)-1;
+ public final int[][] vectors = new int[maxArraySize][2];
+ public final float[] explosionPowerDampingFactor = new float[maxArraySize];
+ public final int[] explosionPower = new int[maxArraySize];
+ public final int[] cachedBlockHardness = new int[maxArraySize];
+ public final int[] cachedFluidBlocks = new int[maxArraySize];
+ public Map<Integer,List<ItemStack>> cachedBlockDrops = new HashMap<Integer, List<ItemStack>>(128);
+ public final List<int[]> dropBlocksPos = new ArrayList<int[]>(64);
+ public Set<Chunk> chunksToUpdate=new HashSet<Chunk>(64);
+ public Map<Integer,ItemStack> cachedDrops = new HashMap<Integer, ItemStack>(128);
+ public Set<Integer> dropBlocks = new HashSet<Integer>();
+ public Map<Integer,WorldSavedDataBlastWave> blastWaveByDimensionId = new HashMap<Integer, WorldSavedDataBlastWave>();
+ private Entity[] cachedEntities = new Entity[maxArraySize];
+
+ public ExplosionVectorBlockV2()
+ {
+ this.precalculateExplosion();
+ directionMasks[0] = new int[] {1,1,1};
+ directionMasks[1] = new int[] {-1,1,1};
+ directionMasks[2] = new int[] {1,-1,1};
+ directionMasks[3] = new int[] {1,1,-1};
+ directionMasks[4] = new int[] {-1,-1,1};
+ directionMasks[5] = new int[] {1,-1,-1};
+ directionMasks[6] = new int[] {-1,1,-1};
+ directionMasks[7] = new int[] {-1,-1,-1};
+ Arrays.fill(cachedBlockHardness,-1);
+ }
+
+ private int encodeXYZ(int x, int y, int z)
+ {
+ return x<<bits*2|y<<bits|z;
+ }
+
+ private int[] decodeXYZ(int l)
+ {
+ return new int[] {l>>bits*2,l>>bits&maxValue,l&maxValue};
+ }
+
+ public void precalculateExplosion()
+ {
+ startVectors[0]=0;
+ explosionPowerDampingFactor[0]=1f;
+ for(int levelRadius=1; levelRadius<this.maxValue; levelRadius++)
+ for(int ix=0;ix<=levelRadius;ix++)
+ for(int iy=0;iy<=levelRadius;iy++)
+ for(int iz=(ix==levelRadius||iy==levelRadius)?0:levelRadius;iz<=levelRadius;iz++)
+ {
+ int vxyz = encodeXYZ(ix,iy,iz);
+ int[] prevXYZ= new int[] {ix,iy,iz};
+ reduceCoordinate(prevXYZ, levelRadius);
+ int pvxyz = encodeXYZ(prevXYZ[0],prevXYZ[1],prevXYZ[2]);
+ findFreeSpace(pvxyz,vxyz);
+ float df = (float)(prevXYZ[0]*prevXYZ[0]+prevXYZ[1]*prevXYZ[1]+prevXYZ[2]*prevXYZ[2]+64)/(float)(ix*ix+iy*iy+iz*iz+64);
+ explosionPowerDampingFactor[vxyz]=df;
+ }
+ }
+
+ private void findFreeSpace(int pvxyz,int vxyz)
+ {
+ if(vectors[pvxyz][0]==0)
+ {
+ vectors[pvxyz][0]=vxyz;
+ }
+ else if(vectors[pvxyz][1]==0)
+ {
+ vectors[pvxyz][1]=vxyz;
+ }
+ else
+ {
+ findFreeSpace(vectors[pvxyz][0],vxyz);
+ }
+ }
+
+ private void reduceCoordinate(int[] pxyz, int levelRadius)
+ {
+ if(Math.abs(pxyz[0])+Math.abs(pxyz[1])+Math.abs(pxyz[2])>Math.round(levelRadius*1.8f))
+ {
+ pxyz[0]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[0]);
+ pxyz[1]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[1]);
+ pxyz[2]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[2]);
+ }
+ else if(Math.abs(pxyz[0])<=Math.abs(pxyz[1]) && Math.abs(pxyz[0])<=Math.abs(pxyz[2]))
+ {
+ pxyz[1]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[1]);
+ pxyz[2]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[2]);
+ }
+ else if(Math.abs(pxyz[1])<=Math.abs(pxyz[0]) && Math.abs(pxyz[1])<=Math.abs(pxyz[2]))
+ {
+ pxyz[0]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[0]);
+ pxyz[2]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[2]);
+ }
+ else if(Math.abs(pxyz[2])<=Math.abs(pxyz[0]) && Math.abs(pxyz[2])<=Math.abs(pxyz[1]))
+ {
+ pxyz[1]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[1]);
+ pxyz[0]=IHLUtils.reduceVariableByAbsoluteValue(pxyz[0]);
+ }
+ }
+
+ public void setPower(int[] sv2, int power1)
+ {
+ for(int ev:sv2)
+ {
+ this.setPower(ev, power1);
+ }
+ }
+
+ public void setPower(int ev, int power1) {
+ this.explosionPower[ev]=power1;
+ }
+
+ public int[] breakBlocksAndGetDescendants(World world, int sourceX,int sourceY,int sourceZ, Explosion explosion, int ev, int[] directionMask)
+ {
+ int power1 = explosionPower[ev];
+ power1 = this.getNewPowerAndProcessBlocks(world, ev, sourceX, sourceY, sourceZ, explosion, power1, directionMask);
+ power1 = (int)(power1*explosionPowerDampingFactor[ev])-1;
+ if(power1<=1 || this.vectors[ev][0]==0)
+ {
+ return null;
+ }
+ else
+ {
+ for(int d1:this.vectors[ev])
+ {
+ if(d1!=0)
+ {
+ explosionPower[d1]=power1;
+ }
+ }
+ return this.vectors[ev];
+ }
+ }
+
+ private int getNewPowerAndProcessBlocks(World world, int ev, int sourceX, int sourceY, int sourceZ, Explosion explosion, int power2, int[] directionMask)
+ {
+ int power1=power2;
+ int[] xyz = decodeXYZ(ev);
+ int absX = xyz[0]*directionMask[0] + sourceX;
+ int absY = xyz[1]*directionMask[1] + sourceY;
+ int absZ = xyz[2]*directionMask[2] + sourceZ;
+ if(absY<0 || absY>=256)
+ {
+ return 0;
+ }
+ int absEBSX = absX>>4;
+ int absEBSZ = absZ>>4;
+ if(world.getChunkProvider().chunkExists(absEBSX, absEBSZ))
+ {
+ if(world.getChunkProvider().provideChunk(absEBSX, absEBSZ).getTopFilledSegment()+24>=absY)
+ {
+ int explosionResistance = this.getBlockResistance(world, ev, absX, absY, absZ, sourceX, sourceY, sourceZ, explosion, directionMask);
+ if(explosionResistance>=power1)
+ {
+ if(this.cachedFluidBlocks[ev]!=0)
+ {
+ //IHLMod.log.info("Schleduling update for "+Block.getBlockById(this.cachedFluidBlocks[ev]).getUnlocalizedName());
+ Block block = Block.getBlockById(this.cachedFluidBlocks[ev]);
+ block.onNeighborBlockChange(world, absX, absY, absZ, block);
+ }
+ else
+ {
+ this.dropBlocksPos.add(new int[] {absX, absY+1, absZ});
+ }
+ return 0;
+ }
+ else
+ {
+ power1-=explosionResistance;
+ this.onBlockDestroy(world, ev, absX, absY, absZ, power1, explosion);
+ return power1;
+ }
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ else
+ {
+ WorldSavedDataBlastWave blastWave = null;
+ int dimensionId = world.provider.dimensionId;
+ if(this.blastWaveByDimensionId.containsKey(dimensionId))
+ {
+ blastWave=this.blastWaveByDimensionId.get(dimensionId);
+ }
+ else
+ {
+ blastWave=new WorldSavedDataBlastWave("blastWave");
+ this.blastWaveByDimensionId.put(dimensionId, blastWave);
+ }
+ long chunkXZKey = ChunkCoordIntPair.chunkXZ2Int(absEBSX, absEBSZ);
+ blastWave.scheduleExplosionEffectsOnChunkLoad(chunkXZKey, ev, sourceX, sourceY, sourceZ, power1, directionMask);
+ return 0;
+ }
+ }
+
+ public int getBlockResistance(World world, int ev, int absX, int absY, int absZ, int sourceX, int sourceY, int sourceZ, Explosion explosion, int[] directionMask)
+ {
+ if(this.cachedBlockHardness[ev]!=-1)
+ {
+ return this.cachedBlockHardness[ev];
+ }
+ else
+ {
+ this.precacheEBSBlocks(world, absX, absY, absZ, sourceX, sourceY, sourceZ, explosion, directionMask);
+ return this.cachedBlockHardness[ev];
+ }
+ }
+
+ public void precacheEBSBlocks(World world, int absX, int absY, int absZ, int sourceX, int sourceY, int sourceZ, Explosion explosion, int[] directonMask)
+ {
+ Chunk chunk = world.getChunkProvider().provideChunk(absX>>4, absZ>>4);
+ List<Entity> eList = this.getEntityList(chunk, absX, absY, absZ);
+ if(eList!=null)
+ {
+ Iterator<Entity> eListI = eList.iterator();
+ while(eListI.hasNext())
+ {
+ Entity entity = eListI.next();
+ int entityX = (int)entity.boundingBox.minX;
+ int entityY = (int)entity.boundingBox.minY;
+ int entityZ = (int)entity.boundingBox.minZ;
+ int rx = (entityX - sourceX) * directonMask[0];
+ int ry = (entityY - sourceY) * directonMask[1];
+ int rz = (entityZ - sourceZ) * directonMask[2];
+ int ev = this.encodeXYZ(rx, ry, rz);
+ if(rx >= 0 && ry >= 0 && rz >= 0 && ev>=0 && ev<this.maxArraySize)
+ {
+ this.cachedEntities[ev]=entity;
+ }
+ }
+ }
+ ExtendedBlockStorage ebs = this.getEBS(chunk, absX, absY, absZ);
+ if(ebs==null)
+ {
+ for(int i4=0;i4<4096;i4++)
+ {
+ int blockWorldX = (i4 & 15)|(absX & 0xFFFFFFF0);
+ int blockWorldY = ((i4>>8) & 15)|(absY & 0xFFFFFFF0);
+ int blockWorldZ = ((i4>>4) & 15)|(absZ & 0xFFFFFFF0);
+
+ int rx = (blockWorldX - sourceX) * directonMask[0];
+ int ry = (blockWorldY - sourceY) * directonMask[1];
+ int rz = (blockWorldZ - sourceZ) * directonMask[2];
+
+ int ev = this.encodeXYZ(rx, ry, rz);
+ if(rx >= 0 && ry >= 0 && rz >= 0 && ev>=0 && ev<this.maxArraySize)
+ {
+ this.cachedBlockHardness[ev]=0;
+ }
+ }
+ }
+ else
+ {
+ byte[] lbsArray = ebs.getBlockLSBArray();
+ for(int i4=0;i4<lbsArray.length;i4++)
+ {
+ int var4 = lbsArray[i4] & 255;
+ if (ebs.getBlockMSBArray() != null)
+ {
+ var4 |= ebs.getBlockMSBArray().get(i4 & 15, (i4>>8) & 15, (i4>>4) & 15) << 8;
+ }
+ int blockWorldX = (i4 & 15)|(absX & 0xFFFFFFF0);
+ int blockWorldY = ((i4>>8) & 15)|(absY & 0xFFFFFFF0);
+ int blockWorldZ = ((i4>>4) & 15)|(absZ & 0xFFFFFFF0);
+ int rx = (blockWorldX - sourceX) * directonMask[0];
+ int ry = (blockWorldY - sourceY) * directonMask[1];
+ int rz = (blockWorldZ - sourceZ) * directonMask[2];
+
+ int ev = this.encodeXYZ(rx, ry, rz);
+ if(rx >= 0 && ry >= 0 && rz >= 0 && ev>=0 && ev<this.maxArraySize)
+ {
+ Block block = Block.getBlockById(var4);
+ if(block.canDropFromExplosion(explosion))
+ {
+ List<ItemStack> dropsList = (block.getDrops(world, blockWorldX, blockWorldY, blockWorldZ, ebs.getExtBlockMetadata(i4 & 15, (i4>>8) & 15, (i4>>4) & 15), 0));
+ if(dropsList!=null)
+ {
+ this.cachedBlockDrops.put(ev, dropsList);
+ }
+ }
+ if(block.getBlockHardness(world, blockWorldX, blockWorldY, blockWorldZ)<0)
+ {
+ this.cachedBlockHardness[ev]=Integer.MAX_VALUE;
+ }
+ else if(ev==0 && directonMask[0]+directonMask[1]+directonMask[2]==3)
+ {
+ this.cachedBlockHardness[ev]=0;
+ }
+ else
+ {
+ int br=Math.round(block.getExplosionResistance(null, world, blockWorldX, blockWorldY, blockWorldZ, sourceX, sourceY, sourceZ)*10f);
+ this.cachedBlockHardness[ev]=br;
+ }
+ if(block.getMaterial().isLiquid())
+ {
+ this.cachedFluidBlocks[ev]=var4;
+ }
+ }
+ }
+ }
+ }
+
+ public ExtendedBlockStorage getEBS(Chunk chunk, int absX, int absY, int absZ)
+ {
+ ExtendedBlockStorage[] ebsA = chunk.getBlockStorageArray();
+ ExtendedBlockStorage ebs = ebsA[absY>>4];
+ if(ebs!=null)
+ {
+ this.chunksToUpdate.add(chunk);
+ }
+ return ebs;
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<Entity> getEntityList(Chunk chunk, int absX, int absY, int absZ)
+ {
+ return chunk.entityLists[absY>>4];
+ }
+
+
+ public void onBlockDestroy(World world, int ev, int absX,int absY,int absZ, int power, Explosion explosion)
+ {
+ Chunk chunk = world.getChunkProvider().provideChunk(absX>>4, absZ>>4);
+ ExtendedBlockStorage ebs = this.getEBS(chunk, absX, absY, absZ);
+ if(ebs==null || ebs.isEmpty())
+ {
+ return;
+ }
+ int array_index = (absY & 15)<<8 | (absZ & 15)<<4 | (absX & 15);
+ if(ebs.getBlockLSBArray()[array_index] != 0 &&
+ ebs.getBlockMSBArray()!=null &&
+ ebs.getBlockMSBArray().get(absX & 15, absY & 15, absZ & 15) != 0)
+ {
+ ebs.blockRefCount--;
+ }
+ ebs.getBlockLSBArray()[array_index] = 0;
+ if(ebs.getBlockMSBArray()!=null){
+ ebs.getBlockMSBArray().set(absX & 15, absY & 15, absZ & 15, 0);
+ }
+ if(this.cachedBlockDrops.containsKey(ev))
+ {
+ Iterator<ItemStack> drops = this.cachedBlockDrops.remove(ev).iterator();
+ while(drops.hasNext())
+ {
+ ItemStack drop = drops.next();
+ int key = Item.getIdFromItem(drop.getItem())^(drop.getItemDamage()<<16);
+ if(this.cachedDrops.containsKey(key))
+ {
+ this.cachedDrops.get(key).stackSize+=drop.stackSize;
+ }
+ else
+ {
+ this.cachedDrops.put(key, drop);
+ }
+ }
+ }
+ Entity victim = this.cachedEntities[ev];
+ if(victim!=null)
+ {
+ victim.attackEntityFrom(DamageSource.setExplosionSource(explosion), power/10f);
+ this.cachedEntities[ev]=null;
+ }
+ this.dropBlocks.add(ev);
+ }
+
+ private void addDrops(World world, int sourceX, int sourceY, int sourceZ, int[] directionMask)
+ {
+ Iterator<Entry<Integer, ItemStack>> di = this.cachedDrops.entrySet().iterator();
+ Entry<Integer, ItemStack> cde = di.next();
+ while(di.hasNext() && this.dropBlocksPos.size() > 0)
+ {
+ int[] xyz = this.dropBlocksPos.remove(this.dropBlocksPos.size()-1);
+ int x = xyz[0];
+ int y = xyz[1];
+ int z = xyz[2];
+ int rx = (x - sourceX) * directionMask[0];
+ int ry = (y - sourceY) * directionMask[1];
+ int rz = (z - sourceZ) * directionMask[2];
+ int ev = encodeXYZ(rx,ry,rz);
+ int ev2 = encodeXYZ(rx,ry-1,rz);
+ if(this.dropBlocks.contains(ev) && !this.dropBlocks.contains(ev2))
+ {
+ ItemStack stack = cde.getValue();
+ if(stack!=null && stack.getItem()!=null && stack.stackSize>0)
+ {
+ if(stack.stackSize <= stack.getMaxStackSize())
+ {
+ if(stack.stackSize>0)
+ {
+ PileTileEntity pte = new PileTileEntity();
+ pte.xCoord=x;
+ pte.yCoord=y;
+ pte.zCoord=z;
+ pte.setWorldObj(world);
+ pte.validate();
+ pte.setContent(stack);
+ IHLUtils.setBlockAndTileEntityRaw(world, x, y, z, PileBlock.instance, pte);
+ }
+ di.remove();
+ if(di.hasNext())
+ {
+ cde = di.next();
+ }
+ else
+ {
+ return;
+ }
+ }
+ else
+ {
+ ItemStack stack1=stack.copy();
+ stack1.stackSize=stack.getMaxStackSize();
+ PileTileEntity pte = new PileTileEntity();
+ pte.content=stack1;
+ IHLUtils.setBlockAndTileEntityRaw(world, x, y, z, PileBlock.instance, pte);
+ stack.stackSize-=stack.getMaxStackSize();
+ }
+ }
+ }
+ }
+ }
+
+ public void sendChunkUpdateToPlayersInExplosionAffectedZone(World world, int sourceX, int sourceY, int sourceZ)
+ {
+// Set<Long> clientSideChunkXZKeySet = new HashSet<Long>();
+ Iterator<Chunk> ci = this.chunksToUpdate.iterator();
+ while(ci.hasNext())
+ {
+ Chunk chunk = ci.next();
+ chunk.generateSkylightMap();
+ Arrays.fill(chunk.updateSkylightColumns, true);
+ chunk.func_150804_b(false);
+// long chunkXZKey = ChunkCoordIntPair.chunkXZ2Int(chunk.xPosition, chunk.zPosition);
+// clientSideChunkXZKeySet.add(chunkXZKey);
+ }
+ List<Chunk> chunks = new ArrayList<Chunk>();
+ chunks.addAll(this.chunksToUpdate);
+ for(Object player:world.playerEntities)
+ {
+ if(player instanceof EntityPlayerMP)
+ {
+ EntityPlayerMP playerMP = (EntityPlayerMP)player;
+ playerMP.playerNetServerHandler.sendPacket(new S26PacketMapChunkBulk(chunks));
+ }
+ }
+// IHLMod.proxy.sendChunksLightUpdateQuery(world, sourceX, sourceY, sourceZ, clientSideChunkXZKeySet);
+ this.chunksToUpdate.clear();
+ }
+
+ public void doExplosion(World world, int sourceX, int sourceY, int sourceZ, final int[] startVectors1, int[] directionMask, Explosion explosion)
+ {
+ boolean doExplosion=true;
+ int[] sv = null;
+ int svsize = 0;
+ while(doExplosion)
+ {
+ int[] sv2= new int[1<<bits*2];
+ int sv2size = 0;
+ if(sv==null)
+ {
+ sv = startVectors1;
+ svsize = startVectors1.length;
+ }
+ for(int i=0;i<svsize;i++)
+ {
+ int[] sv3 = this.breakBlocksAndGetDescendants(world,
+ sourceX-(directionMask[0]<0?1:0),
+ sourceY-(directionMask[1]<0?1:0),
+ sourceZ-(directionMask[2]<0?1:0),
+ explosion, sv[i],directionMask);
+ if(sv3!=null)
+ {
+ for(int sv3v:sv3)
+ {
+ if(sv3v!=0)
+ {
+ sv2[sv2size]=sv3v;
+ sv2size++;
+ }
+ }
+ }
+ }
+ if(sv2size==0)
+ {
+ doExplosion=false;
+ sv = null;
+ if(!this.cachedDrops.isEmpty())
+ {
+ addDrops(world, sourceX, sourceY, sourceZ, directionMask);
+ }
+ break;
+ }
+ else
+ {
+ sv=sv2;
+ svsize=sv2size;
+ }
+ }
+ // Free and clean resources
+ this.cachedBlockDrops.clear();
+ this.cachedDrops.clear();
+ this.dropBlocks.clear();
+ this.dropBlocksPos.clear();
+ Arrays.fill(cachedBlockHardness,-1);
+ Arrays.fill(cachedFluidBlocks,0);
+ }
+
+ public void doExplosion(World world, int sourceX, int sourceY, int sourceZ, final int[] startVectors1)
+ {
+ IHLMod.log.info("Starting explosion server");
+ Explosion explosion = new Explosion(world, null, sourceX, sourceY, sourceZ, 100f);
+ for(int[] directionMask:directionMasks)
+ {
+ this.doExplosion(world, sourceX, sourceY, sourceZ, startVectors1, directionMask, explosion);
+ }
+ sendChunkUpdateToPlayersInExplosionAffectedZone(world, sourceX, sourceY, sourceZ);
+ }
+} \ No newline at end of file
diff --git a/ihl/items_blocks/ExplosiveBlock.java b/ihl/explosion/ExplosiveBlock.java
index 225873f..446b177 100644
--- a/ihl/items_blocks/ExplosiveBlock.java
+++ b/ihl/explosion/ExplosiveBlock.java
@@ -1,10 +1,9 @@
-package ihl.items_blocks;
+package ihl.explosion;
-import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
import ihl.IHLCreativeTab;
import ihl.IHLModInfo;
-import ihl.processing.chemistry.ExplosiveTileEntity;
+import ihl.items_blocks.IHLItemBlock;
import ihl.processing.metallurgy.MuffleFurnanceTileEntity;
import java.util.List;
@@ -16,6 +15,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -23,6 +23,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
+import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -31,10 +32,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ExplosiveBlock extends Block implements ITileEntityProvider{
- @SideOnly(Side.CLIENT)
- IIcon textureSide,
- textureBack,
- textureTop;
+ IIcon[] textures = new IIcon[6];
public ExplosiveBlock()
{
@@ -45,41 +43,24 @@ public class ExplosiveBlock extends Block implements ITileEntityProvider{
this.setResistance(1F);
}
-
@Override
- public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
- {
- if(IC2.platform.isSimulating())
- {
- }
- }
-
- @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
ItemStack result = new ItemStack(item);
result.stackTagCompound=new NBTTagCompound();
- result.stackTagCompound.setInteger("explosionType", 0);//0 - IC2; 1- IHL
- result.stackTagCompound.setInteger("explosionPower", 100000);
- //itemList.add(result);
+ result.stackTagCompound.setInteger("explosionType", 1);//0 - IC2; 1- IHL
+ result.stackTagCompound.setInteger("explosionPower", 100);
+ itemList.add(result);
result = new ItemStack(item);
result.stackTagCompound=new NBTTagCompound();
result.stackTagCompound.setInteger("explosionType", 1);//0 - IC2; 1- IHL
- result.stackTagCompound.setInteger("explosionPower", Integer.MAX_VALUE);//31000
+ result.stackTagCompound.setInteger("explosionPower", 31000);//31000
itemList.add(result);
}
@Override
- public void onBlockPreDestroy(World world, int x, int y, int z, int meta)
- {
- if(!world.isRemote)
- {
- TileEntity te = world.getTileEntity(x, y, z);
- }
- super.onBlockPreDestroy(world, x, y, z, meta);
- }
-
- @Override
+ @SuppressWarnings("rawtypes")
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity)
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.1F, 1.0F);
@@ -101,24 +82,10 @@ public class ExplosiveBlock extends Block implements ITileEntityProvider{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
- @Override
- public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int x, int y, int z)
- {
- int facing = 3;
- TileEntity te = blockAccess.getTileEntity(x, y, z);
- if(te!=null && te instanceof IWrenchable)
- {
- IWrenchable tebh = (IWrenchable) te;
- facing=tebh.getFacing();
- }
- super.setBlockBoundsBasedOnState(blockAccess, x, y, z);
- }
-
public static void init()
{
GameRegistry.registerBlock(new ExplosiveBlock(), IHLItemBlock.class,"ihlExplosive");
GameRegistry.registerTileEntity(ExplosiveTileEntity.class, "explosiveTileEntity");
- ExplosiveType[] var1 = ExplosiveType.values();
}
@Override
@@ -136,10 +103,10 @@ public class ExplosiveBlock extends Block implements ITileEntityProvider{
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister)
{
- this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenSide");
- this.textureBack = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenBack");
- this.textureSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenSide");
- this.textureTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenTop");
+ this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":explosiveBlockSide");
+ this.textures[0] = par1IconRegister.registerIcon(IHLModInfo.MODID + ":explosiveBlockBottom");
+ this.textures[1] = par1IconRegister.registerIcon(IHLModInfo.MODID + ":explosiveBlockTop");
+ this.textures[2] = this.textures[3] = this.textures[4] = this.textures[5] = this.blockIcon;
}
@Override
@@ -153,11 +120,27 @@ public class ExplosiveBlock extends Block implements ITileEntityProvider{
TileEntity te = world.getTileEntity(x,y,z);
if(IC2.platform.isSimulating() && te instanceof ExplosiveTileEntity)
{
- ((ExplosiveTileEntity)te).createExplosion(player);
+ return ((ExplosiveTileEntity)te).ignite(player);
}
return false;
}
+ @Override
+ public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
+ {
+ TileEntity te = world.getTileEntity(x,y,z);
+ if(IC2.platform.isSimulating() && te instanceof ExplosiveTileEntity)
+ {
+ int[] xyz = {0,0,1,0,0,-1,0,0};
+ for(int i=2;i<xyz.length;i++)
+ {
+ if(world.getBlock(x+xyz[i-2], y+xyz[i-1], z+xyz[i])==Blocks.fire && !te.isInvalid())
+ {
+ ((ExplosiveTileEntity)te).ignite();
+ }
+ }
+ }
+ }
/**
* Called when the block is placed in the world.
@@ -176,37 +159,16 @@ public class ExplosiveBlock extends Block implements ITileEntityProvider{
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
{
- int facing=3;
- int mask[] = {
- 0,1,2,3,4,5,
- 1,0,3,2,4,5,
- 2,3,0,1,4,5,
- 2,3,1,0,4,5,
- 2,3,5,4,0,1,
- 2,3,4,5,1,0
- };
- TileEntity te = world.getTileEntity(x, y, z);
- if(te instanceof IWrenchable)
- {
- IWrenchable tebh = (IWrenchable) te;
- facing=tebh.getFacing();
- }
- return this.getIconFromFacing(facing, side);
+ return this.getIcon(side, 0);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
- return this.getIconFromFacing(3, side);
+ return this.textures[side];
}
- @SideOnly(Side.CLIENT)
- public IIcon getIconFromFacing(int facing, int side)
- {
- return this.textureSide;
- }
-
@Override
public boolean onBlockEventReceived(World world, int x, int y, int z, int metadata, int flag)
{
@@ -216,7 +178,7 @@ public class ExplosiveBlock extends Block implements ITileEntityProvider{
public enum ExplosiveType
{
MuffleFurnace("muffleFurnance",MuffleFurnanceTileEntity.class, true, new ItemStack(Items.brick));
- ExplosiveType(String unlocalizedName1, Class teclass1, boolean isNormalBlock1,ItemStack itemDroppedOnBlockDestroy1)
+ ExplosiveType(String unlocalizedName1, Class<?> teclass1, boolean isNormalBlock1,ItemStack itemDroppedOnBlockDestroy1)
{
unlocalizedName=unlocalizedName1;
teclass=teclass1;
@@ -224,7 +186,7 @@ public class ExplosiveBlock extends Block implements ITileEntityProvider{
itemDroppedOnBlockDestroy=itemDroppedOnBlockDestroy1;
}
String unlocalizedName;
- Class teclass;
+ Class<?> teclass;
boolean isNormalBlock=true;
ItemStack itemDroppedOnBlockDestroy;
}
@@ -252,4 +214,39 @@ public class ExplosiveBlock extends Block implements ITileEntityProvider{
{
return this.blockIcon;
}
+
+ @Override
+ public boolean canDropFromExplosion(Explosion explosion)
+ {
+ return false;
+ }
+
+ @Override
+ public float getExplosionResistance(Entity entity)
+ {
+ return -1f;
+ }
+
+ @Override
+ public float getExplosionResistance(Entity entity, World world, int x, int y ,int z, double explosionX, double explosionY, double explosionZ)
+ {
+ TileEntity te = world.getTileEntity(x, y, z);
+ if(te instanceof ExplosiveTileEntity && !((ExplosiveTileEntity)te).isInvalid())
+ {
+ return -((ExplosiveTileEntity)te).explosionPower;
+ }
+ return -1f;
+ }
+
+ @Override
+ public void onBlockDestroyedByExplosion(World world, int x, int y ,int z, Explosion explosion)
+ {
+ TileEntity te = world.getTileEntity(x, y, z);
+ if(te instanceof ExplosiveTileEntity)
+ {
+ ((ExplosiveTileEntity)te).createExplosion(null);
+ }
+ }
+
+
}
diff --git a/ihl/explosion/ExplosiveTileEntity.java b/ihl/explosion/ExplosiveTileEntity.java
new file mode 100644
index 0000000..002c959
--- /dev/null
+++ b/ihl/explosion/ExplosiveTileEntity.java
@@ -0,0 +1,85 @@
+package ihl.explosion;
+
+import ic2.core.IC2;
+import ihl.IHLMod;
+import ihl.utils.IHLMathUtils;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+
+public class ExplosiveTileEntity extends TileEntity {
+
+ public int explosionPower=10000;
+ private int explosionType=1;
+ private int detonator_delay=1;
+ private int burn_time=0;
+ public boolean is_detonator_burning = false;
+
+
+ public void createExplosion(EntityPlayer player)
+ {
+ this.invalidate();
+ int power = this.explosionPower;
+ this.explosionPower = 0;
+ IHLMod.explosionHandler.setPower(IHLMod.explosionHandler.startVectors, power);
+ IHLMod.explosionHandler.doExplosion(worldObj, xCoord, yCoord, zCoord, IHLMod.explosionHandler.startVectors);
+ IHLMod.proxy.createExplosionEffectFromServer(worldObj, xCoord, yCoord, zCoord, 32f*IHLMathUtils.sqrt(power/16384f));
+ }
+
+ @Override
+ public boolean canUpdate()
+ {
+ return IC2.platform.isSimulating();
+ }
+
+ @Override
+ public void updateEntity()
+ {
+ if(is_detonator_burning)
+ {
+ IHLMod.proxy.spawnParticleFromServer(4, worldObj, xCoord+0.5d, yCoord+1d, zCoord+0.5d, 0d, 0.2d, 0d, 1f);
+ if(this.burn_time++>detonator_delay*20)
+ {
+ this.createExplosion(null);
+ }
+ }
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ if(nbt!=null)
+ {
+ explosionPower=nbt.getInteger("explosionPower");
+ explosionType=nbt.getInteger("explosionType");
+ detonator_delay=nbt.getInteger("detonator_delay");
+ }
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ nbt.setInteger("explosionPower",explosionPower);
+ nbt.setInteger("explosionType",explosionType);
+ nbt.setInteger("detonator_delay",detonator_delay);
+ }
+
+ public boolean ignite(EntityPlayer player)
+ {
+ if(player!=null &&
+ player.getCurrentEquippedItem()!=null &&
+ player.getCurrentEquippedItem().getItem()==Items.flint_and_steel)
+ {
+ ignite();
+ return true;
+ }
+ return false;
+ }
+
+ public void ignite()
+ {
+ IHLMod.proxy.playSoundEffectFromServer(0, this.worldObj, this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 10.0F, 1.0F);
+ this.is_detonator_burning=true;
+ }
+}
diff --git a/ihl/items_blocks/GroundRemoverItem.java b/ihl/explosion/GroundRemoverItem.java
index 47c5a1f..d3d2b80 100644
--- a/ihl/items_blocks/GroundRemoverItem.java
+++ b/ihl/explosion/GroundRemoverItem.java
@@ -1,12 +1,13 @@
-package ihl.items_blocks;
+package ihl.explosion;
import java.util.HashSet;
import java.util.List;
+import java.util.Random;
import java.util.Set;
+import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
@@ -14,17 +15,18 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import net.minecraft.server.MinecraftServer;
+import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import ihl.IHLCreativeTab;
+import ihl.IHLMod;
import ihl.IHLModInfo;
-import ihl.worldgen.ores.BlockOre;
public class GroundRemoverItem extends Item{
private String registryName;
- private final Set<Block> removableBlockSet = new HashSet();
-
+ private final Set<Block> removableBlockSet = new HashSet<Block>();
+ private final Random random = new Random();
+
public GroundRemoverItem(String registryName1)
{
super();
@@ -54,7 +56,8 @@ public class GroundRemoverItem extends Item{
//GameRegistry.registerItem(new GroundRemoverItem("groundRemover"),"groundRemover");
}
- @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
{
info.add("Vanilla block remover tool");
@@ -66,10 +69,21 @@ public class GroundRemoverItem extends Item{
this.itemIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":vacuumSwitch");
}
+ @Override
+ public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
+ {
+ TileEntity t = world.getTileEntity(x, y, z);
+ if(world.isRemote)
+ {
+ IHLMod.proxy.createExplosionEffect(world, x, y, z, 16f);
+ }
+ return true;
+ }
+
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem)
{
- if(entity instanceof EntityPlayer && isCurrentItem && MinecraftServer.getServer().getTickCounter()%100==99)
+/* if(entity instanceof EntityPlayer && isCurrentItem && MinecraftServer.getServer().getTickCounter()%100==99)
{
int x = (int)entity.posX;
int y = (int)entity.posY;
@@ -87,6 +101,6 @@ public class GroundRemoverItem extends Item{
}
}
}
- }
+ }*/
}
}
diff --git a/ihl/explosion/IHLEntityFallingPile.java b/ihl/explosion/IHLEntityFallingPile.java
new file mode 100644
index 0000000..79973d8
--- /dev/null
+++ b/ihl/explosion/IHLEntityFallingPile.java
@@ -0,0 +1,152 @@
+package ihl.explosion;
+
+import ihl.utils.IHLUtils;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.network.play.server.S23PacketBlockChange;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.item.ItemExpireEvent;
+
+public class IHLEntityFallingPile extends EntityItem{
+
+ public IHLEntityFallingPile(World world) {
+ super(world);
+ }
+
+ @Override
+ public void onUpdate()
+ {
+ ItemStack stack = this.getDataWatcher().getWatchableObjectItemStack(10);
+ if (stack != null && stack.getItem() != null)
+ {
+ if (stack.getItem().onEntityItemUpdate(this))
+ {
+ return;
+ }
+ }
+
+ if (this.getEntityItem() == null)
+ {
+ this.setDead();
+ }
+ else
+ {
+ this.onEntityUpdate();
+
+ if (this.delayBeforeCanPickup > 0)
+ {
+ --this.delayBeforeCanPickup;
+ }
+
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+ this.motionY -= 0.03999999910593033D;
+ this.noClip = this.func_145771_j(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ);
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ boolean flag = (int)this.prevPosX != (int)this.posX || (int)this.prevPosY != (int)this.posY || (int)this.prevPosZ != (int)this.posZ;
+
+ if (flag || this.ticksExisted % 25 == 0)
+ {
+ if (this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial() == Material.lava)
+ {
+ this.motionY = 0.20000000298023224D;
+ this.motionX = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F);
+ this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F);
+ this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F);
+ }
+
+ }
+
+ this.motionX *= 0.98D;
+ this.motionY *= 0.98D;
+ this.motionZ *= 0.98D;
+
+ if (this.onGround)
+ {
+ this.motionY *= -0.5D;
+ }
+
+ ++this.age;
+
+ ItemStack item = this.getEntityItem();
+
+ if (!this.worldObj.isRemote &&
+ (this.age >= lifespan || this.onGround))
+ {
+ if (item != null)
+ {
+ ItemExpireEvent event = new ItemExpireEvent(this, (item.getItem() == null ? 6000 : item.getItem().getEntityLifespan(item, worldObj)));
+ if (MinecraftForge.EVENT_BUS.post(event))
+ {
+ lifespan += event.extraLife;
+ }
+ else
+ {
+ int x = (int)(this.boundingBox.minX);
+ int y = (int)(this.boundingBox.minY);
+ int z = (int)(this.boundingBox.minZ);
+ int i=1;
+ do
+ {
+ int[] xz = new int[] {0,0,1,0,-1,0};
+ if(i<xz.length)
+ {
+ if(IHLUtils.isBlockCanBeReplaced(worldObj, x+xz[i-1], y, z+xz[i]))
+ {
+ x+=xz[i-1];
+ z+=xz[i];
+ if(IHLUtils.isBlockCanBeReplaced(worldObj, x, y-1, z))
+ {
+ this.setPosition(x+0.5d, y-0.5d, z+0.5d);
+ return;
+ }
+ PileTileEntity pte = new PileTileEntity();
+ pte.content=this.getEntityItem();
+ IHLUtils.setBlockAndTileEntityRaw(worldObj, x, y, z, PileBlock.instance, pte);
+ for(Object player:worldObj.playerEntities)
+ {
+ if(player instanceof EntityPlayerMP)
+ {
+ EntityPlayerMP playerMP = (EntityPlayerMP)player;
+ playerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x,y,z,worldObj));
+ }
+ }
+
+ break;
+ }
+ else
+ {
+ i++;
+ }
+ }
+ else
+ {
+ i=1;
+ y++;
+ }
+ }
+ while(!IHLUtils.isBlockCanBeReplaced(worldObj, x, y, z) && y < 254);
+ this.setDead();
+ }
+ }
+ else
+ {
+ this.setDead();
+ }
+ }
+
+ if (item != null && item.stackSize <= 0)
+ {
+ this.setDead();
+ }
+ }
+ }
+
+ public void applyEntityCollision(Entity entity){}
+}
diff --git a/ihl/explosion/IHLEntityFallingPileRender.java b/ihl/explosion/IHLEntityFallingPileRender.java
new file mode 100644
index 0000000..e3e0334
--- /dev/null
+++ b/ihl/explosion/IHLEntityFallingPileRender.java
@@ -0,0 +1,52 @@
+package ihl.explosion;
+import net.minecraft.client.renderer.entity.Render;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.entity.Entity;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
+
+import java.util.Random;
+
+import org.lwjgl.opengl.GL11;
+
+import ihl.utils.IHLItemRenderer;
+
+public class IHLEntityFallingPileRender extends Render{
+
+ private final IHLItemRenderer itemRenderer;
+ private final Random random = new Random(400);
+
+ public IHLEntityFallingPileRender()
+ {
+ super();
+ this.itemRenderer=new IHLItemRenderer(true);
+ }
+
+ @Override
+ public void doRender(Entity entity, double x, double y, double z, float arg4, float arg5)
+ {
+ GL11.glTranslated(x, y, z);
+ random.setSeed(entity.getEntityId());
+ IHLEntityFallingPile fp = (IHLEntityFallingPile) entity;
+ ItemStack stack = fp.getEntityItem();
+ for (int i = 0; i < 16; i++)
+ {
+ GL11.glPushMatrix();
+ GL11.glRotatef(90f,random.nextFloat()*2f-1f,random.nextFloat()*2f-1f,random.nextFloat()*2f-1f);
+ float tx = random.nextFloat()-0.5f;
+ float ty = random.nextFloat()-0.5f;
+ float tz = random.nextFloat()-0.5f;
+ GL11.glTranslatef(tx, ty, tz);
+ itemRenderer.doRender(RenderManager.instance,stack, 0, 0, 0);
+ GL11.glTranslatef(-tx, -ty, tz);
+ GL11.glPopMatrix();
+ }
+ }
+
+ @Override
+ protected ResourceLocation getEntityTexture(Entity arg0) {
+ return TextureMap.locationItemsTexture;
+ }
+
+} \ No newline at end of file
diff --git a/ihl/explosion/PileBlock.java b/ihl/explosion/PileBlock.java
new file mode 100644
index 0000000..a2c56c3
--- /dev/null
+++ b/ihl/explosion/PileBlock.java
@@ -0,0 +1,125 @@
+package ihl.explosion;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import ihl.IHLModInfo;
+import ihl.items_blocks.IHLItemBlock;
+import net.minecraft.block.Block;
+import net.minecraft.block.ITileEntityProvider;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+
+public class PileBlock extends Block implements ITileEntityProvider
+{
+ public static PileBlock instance;
+ public static int id;
+ protected PileBlock(Material material) {
+ super(material);
+ this.setBlockName("pileBlock");
+ this.setBlockTextureName("tubBronzeIcon");
+ instance = this;
+ this.setBlockBounds(0f, 0f, 0f, 1f, 0.5f, 1f);
+ }
+
+ @Override
+ public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
+ {
+ if(!world.isRemote)
+ {
+ PileTileEntity pte = (PileTileEntity)world.getTileEntity(x, y, z);
+ pte.checkAndFall();
+ }
+ }
+
+ @Override
+ public int getRenderType()
+ {
+ return PileBlockRender.renderId;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World word, int metadata) {
+ return new PileTileEntity();
+ }
+
+ public static void init()
+ {
+ GameRegistry.registerBlock(new PileBlock(Material.sand), IHLItemBlock.class,"pileBlock");
+ GameRegistry.registerTileEntity(PileTileEntity.class, "pileBlockTileEntity");
+ id = Block.getIdFromBlock(instance);
+ }
+
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister par1IconRegister)
+ {
+ this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":fluidAcetyleneFlowing");
+ }
+
+ @Override
+ public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer entityPlayer,int i,float pos_x,float pos_y,float pos_z)
+ {
+ if(!world.isRemote && world.getTileEntity(x,y,z) instanceof PileTileEntity)
+ {
+ PileTileEntity te = (PileTileEntity)world.getTileEntity(x,y,z);
+ if(entityPlayer.inventory.addItemStackToInventory(te.content))
+ {
+ te.content=null;
+ world.setBlockToAir(x, y, z);
+ entityPlayer.inventoryContainer.detectAndSendChanges();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void onBlockHarvested(World world,int x,int y,int z,int meta, EntityPlayer entityPlayer)
+ {
+ if(!world.isRemote && world.getTileEntity(x,y,z) instanceof PileTileEntity)
+ {
+ PileTileEntity te = (PileTileEntity)world.getTileEntity(x,y,z);
+ if(entityPlayer.inventory.addItemStackToInventory(te.content))
+ {
+ te.content=null;
+ entityPlayer.inventoryContainer.detectAndSendChanges();
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(IBlockAccess world, int x,int y,int z,int meta)
+ {
+ if(world.getTileEntity(x,y,z) instanceof PileTileEntity)
+ {
+ PileTileEntity te = (PileTileEntity)world.getTileEntity(x,y,z);
+ if(te.content!=null)
+ {
+ return te.content.getIconIndex();
+ }
+ }
+ return this.blockIcon;
+ }
+
+ @Override
+ public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag){}
+}
diff --git a/ihl/explosion/PileBlockRender.java b/ihl/explosion/PileBlockRender.java
new file mode 100644
index 0000000..307cf3c
--- /dev/null
+++ b/ihl/explosion/PileBlockRender.java
@@ -0,0 +1,342 @@
+package ihl.explosion;
+
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
+import cpw.mods.fml.client.registry.RenderingRegistry;
+import ihl.utils.IHLMathUtils;
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.RenderBlocks;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.IBlockAccess;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class PileBlockRender implements ISimpleBlockRenderingHandler
+{
+ public static int renderId;
+ public final PileTileEntityRender pileTileEntityRender;
+
+ public PileBlockRender()
+ {
+ renderId = RenderingRegistry.getNextAvailableRenderId();
+ pileTileEntityRender = new PileTileEntityRender(this);
+ }
+
+ @Override
+ public int getRenderId()
+ {
+ return renderId;
+ }
+
+ @Override
+ public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderblocks)
+ {
+ Tessellator tessellator = Tessellator.instance;
+ block.setBlockBoundsForItemRender();
+ renderblocks.setRenderBoundsFromBlock(block);
+ GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ tessellator.startDrawingQuads();
+ tessellator.setNormal(0.0F, -1.0F, 0.0F);
+ renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 0, metadata));
+ tessellator.draw();
+ tessellator.startDrawingQuads();
+ tessellator.setNormal(0.0F, 1.0F, 0.0F);
+ renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 1, metadata));
+ tessellator.draw();
+ tessellator.startDrawingQuads();
+ tessellator.setNormal(0.0F, 0.0F, -1.0F);
+ renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 2, metadata));
+ tessellator.draw();
+ tessellator.startDrawingQuads();
+ tessellator.setNormal(0.0F, 0.0F, 1.0F);
+ renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 3, metadata));
+ tessellator.draw();
+ tessellator.startDrawingQuads();
+ tessellator.setNormal(-1.0F, 0.0F, 0.0F);
+ renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 4, metadata));
+ tessellator.draw();
+ tessellator.startDrawingQuads();
+ tessellator.setNormal(1.0F, 0.0F, 0.0F);
+ renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderblocks.getBlockIconFromSideAndMetadata(block, 5, metadata));
+ tessellator.draw();
+ GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ }
+
+ @Override
+ public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta, RenderBlocks blockRenderer)
+ {
+ TileEntity te = blockAccess.getTileEntity(x, y, z);
+ if(te instanceof PileTileEntity)
+ {
+ PileTileEntity pte = (PileTileEntity) te;
+ long itemHash = getItemStackHash(pte.content);
+ if(this.pileTileEntityRender.textureIdMap.containsKey(itemHash))
+ {
+ Tessellator tessellator = Tessellator.instance;
+ tessellator.draw();
+ int texture=this.pileTileEntityRender.textureIdMap.get(itemHash);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
+ int[][][] brightness = new int[3][3][3];
+ this.generateBrightnessMatrix(blockAccess, x, y, z, brightness);
+ tessellator.startDrawing(GL11.GL_TRIANGLES);
+ tessellator.setColorOpaque_F(1f, 1f, 1f);
+ boolean[] blocksViewAround = this.getBlocksViewAround(blockAccess, x, y, z);
+ if( blocksViewAround[0] &&
+ blocksViewAround[1] &&
+ blocksViewAround[2] &&
+ blocksViewAround[3])
+ {
+ this.addFlatTop(tessellator, x, y, z, brightness);
+ }
+ else if(!blocksViewAround[0] &&
+ blocksViewAround[1] &&
+ blocksViewAround[2] &&
+ blocksViewAround[3])
+ {
+ this.addSlope(tessellator, x, y, z, 1, 1, 0, 1, brightness);
+ }
+ else if(blocksViewAround[0] &&
+ !blocksViewAround[1] &&
+ blocksViewAround[2] &&
+ blocksViewAround[3])
+ {
+ this.addSlope(tessellator, x, y, z, 0, 1, 1, 1, brightness);
+ }
+ else if(blocksViewAround[0] &&
+ blocksViewAround[1] &&
+ !blocksViewAround[2] &&
+ blocksViewAround[3])
+ {
+ this.addSlope(tessellator, x, y, z, 1, 1, 1, 0, brightness);
+ }
+ else if(blocksViewAround[0] &&
+ blocksViewAround[1] &&
+ blocksViewAround[2] &&
+ !blocksViewAround[3])
+ {
+ this.addSlope(tessellator, x, y, z, 1, 0, 1, 1, brightness);
+ }
+ // 2-sided piramid
+ else if(blocksViewAround[0] &&
+ blocksViewAround[1] &&
+ !blocksViewAround[2] &&
+ !blocksViewAround[3])
+ {
+ this.addSlope(tessellator, x, y, z, 1, 0, 1, 0, brightness);
+ }
+ else if(!blocksViewAround[0] &&
+ blocksViewAround[1] &&
+ blocksViewAround[2] &&
+ !blocksViewAround[3])
+ {
+ this.addSlope(tessellator, x, y, z, 1, 0, 0, 1, brightness);
+ }
+ else if(!blocksViewAround[0] &&
+ !blocksViewAround[1] &&
+ blocksViewAround[2] &&
+ blocksViewAround[3])
+ {
+ this.addSlope(tessellator, x, y, z, 0, 1, 0, 1, brightness);
+ }
+ else if(blocksViewAround[0] &&
+ !blocksViewAround[1] &&
+ !blocksViewAround[2] &&
+ blocksViewAround[3])
+ {
+ this.addSlope(tessellator, x, y, z, 0, 1, 1, 0, brightness);
+ }
+ else
+ {
+ this.addPyramid(tessellator, x, y, z, brightness);
+ }
+ if(!blockAccess.getBlock(x, y-1, z).isOpaqueCube())
+ {
+ this.addBottom(tessellator, x, y, z, brightness);
+ }
+ tessellator.draw();
+ Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
+ tessellator.startDrawingQuads();
+ }
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ private boolean[] getBlocksViewAround(IBlockAccess blockAccess, int x, int y, int z)
+ {
+ // +Z
+ // ^
+ //[ ][0][ ]
+ //[3][x][1] ->+X
+ //[ ][2][ ]
+ return new boolean[] {
+ blockAccess.getBlock(x, y, z+1).isOpaqueCube(),
+ blockAccess.getBlock(x+1, y, z).isOpaqueCube(),
+ blockAccess.getBlock(x, y, z-1).isOpaqueCube(),
+ blockAccess.getBlock(x-1, y, z).isOpaqueCube(),
+ };
+ }
+
+ private void addBottom(Tessellator tessellator, int x, int y, int z, int[][][] brightness)
+ {
+ double[][] triangle1 = new double[3][3];
+ double[][] triangle2 = new double[3][3];
+ triangle1[0] = new double[] {0D,0D,1D};
+ triangle1[1] = new double[] {0D,0D,0D};
+ triangle1[2] = new double[] {1D,0D,0D};
+ triangle2[0] = triangle1[0];
+ triangle2[1] = triangle1[2];
+ triangle2[2] = new double[] {1D,0D,1D};
+ this.addTriangle(tessellator, triangle1, x, y, z, ForgeDirection.UP, brightness);
+ this.addTriangle(tessellator, triangle2, x, y, z, ForgeDirection.UP, brightness);
+ }
+
+ private void addFlatTop(Tessellator tessellator, int x, int y, int z, int[][][] brightness)
+ {
+ double[][] triangle1 = new double[3][3];
+ double[][] triangle2 = new double[3][3];
+ double height = 0.9D;
+ triangle1[0] = new double[] {1D,height,0D};
+ triangle1[1] = new double[] {0D,height,0D};
+ triangle1[2] = new double[] {0D,height,1D};
+ triangle2[0] = triangle1[2];
+ triangle2[1] = new double[] {1D,height,1D};
+ triangle2[2] = triangle1[0];
+ this.addTriangle(tessellator, triangle1, x, y, z, ForgeDirection.UP, brightness);
+ this.addTriangle(tessellator, triangle2, x, y, z, ForgeDirection.UP, brightness);
+ }
+
+ private void addSlope(Tessellator tessellator, int x, int y, int z, int px, int nx, int pz, int nz, int[][][] brightness)
+ {
+ double[][] triangle1 = new double[3][3];
+ double[][] triangle2 = new double[3][3];
+ if(px*pz+nx*nz==1)
+ {
+ triangle1[0] = new double[] {1D,px*nz,0D}; //+X -Z
+ triangle1[1] = new double[] {0D,nx*nz,0D}; //-X -Z
+ triangle1[2] = new double[] {1D,px*pz,1D}; //-X +Z
+ triangle2[0] = triangle1[2];
+ triangle2[1] = triangle1[1]; //+X +Z
+ triangle2[2] = new double[] {0D,nx*pz,1D};
+ }
+ else
+ {
+ triangle1[0] = new double[] {1D,px*nz,0D}; //+X -Z
+ triangle1[1] = new double[] {0D,nx*nz,0D}; //-X -Z
+ triangle1[2] = new double[] {0D,nx*pz,1D}; //-X +Z
+ triangle2[0] = triangle1[2];
+ triangle2[1] = new double[] {1D,px*pz,1D}; //+X +Z
+ triangle2[2] = triangle1[0];
+ }
+ this.addTriangle(tessellator, triangle1, x, y, z, ForgeDirection.UP, brightness);
+ this.addTriangle(tessellator, triangle2, x, y, z, ForgeDirection.UP, brightness);
+ }
+
+ private void addPyramid(Tessellator tessellator, int x, int y, int z, int[][][] brightness)
+ {
+ double[][] triangle1 = new double[3][3];
+ double[][] triangle2 = new double[3][3];
+ double[][] triangle3 = new double[3][3];
+ double[][] triangle4 = new double[3][3];
+ double pileHeight = 0.3D;
+ triangle1[0] = new double[] {1D,0D,0D};
+ triangle1[1] = new double[] {0D,0D,0D};
+ triangle1[2] = new double[] {0.5D,pileHeight,0.5D};
+ triangle2[0] = triangle1[1];
+ triangle2[1] = new double[] {0D,0D,1D};
+ triangle2[2] = triangle1[2];
+ triangle3[0] = triangle2[1];
+ triangle3[1] = new double[] {1D,0D,1D};
+ triangle3[2] = triangle1[2];
+ triangle4[0] = triangle3[1];
+ triangle4[1] = triangle1[0];
+ triangle4[2] = triangle1[2];
+ this.addTriangle(tessellator, triangle1, x, y, z, ForgeDirection.UP, brightness);
+ this.addTriangle(tessellator, triangle2, x, y, z, ForgeDirection.UP, brightness);
+ this.addTriangle(tessellator, triangle3, x, y, z, ForgeDirection.UP, brightness);
+ this.addTriangle(tessellator, triangle4, x, y, z, ForgeDirection.UP, brightness);
+ }
+
+ private void addTriangle(Tessellator tessellator, double[][] triangle, int x, int y, int z, ForgeDirection uvmapping, int[][][] brightness)
+ {
+ int iu = 0;
+ int iv = 2;
+ if(uvmapping.offsetY == 0)
+ {
+ iv = 1;
+ if(uvmapping.offsetZ == 0)
+ {
+ iu = 2;
+ }
+ }
+ float[] normal = IHLMathUtils.get_triangle_normal(triangle);
+ tessellator.setNormal(normal[0], normal[1], normal[2]);
+ tessellator.setBrightness(this.getBrightness(triangle[0], brightness));
+ tessellator.addVertexWithUV(x+triangle[0][0], y+triangle[0][1], z+triangle[0][2], triangle[0][iu], triangle[0][iv]);
+ tessellator.setBrightness(this.getBrightness(triangle[1], brightness));
+ tessellator.addVertexWithUV(x+triangle[1][0], y+triangle[1][1], z+triangle[1][2], triangle[1][iu], triangle[1][iv]);
+ tessellator.setBrightness(this.getBrightness(triangle[2], brightness));
+ tessellator.addVertexWithUV(x+triangle[2][0], y+triangle[2][1], z+triangle[2][2], triangle[2][iu], triangle[2][iv]);
+ }
+
+ public long getItemStackHash(ItemStack stack)
+ {
+ if(stack==null)
+ {
+ return 0;
+ }
+ return ((long)Item.getIdFromItem(stack.getItem())<<31^stack.getItemDamage());
+ }
+
+ private void generateBrightnessMatrix(IBlockAccess blockAccess, int x, int y, int z, int[][][] brightness)
+ {
+ for(int ix = -1; ix <= 1; ix++)
+ for(int iy = -1; iy <= 1; iy++)
+ for(int iz = -1; iz <= 1; iz++)
+ {
+ Block block = blockAccess.getBlock(ix+x, iy+y, iz+z);
+ if(block!=null && block!=Blocks.air)
+ {
+ brightness[ix+1][iy+1][iz+1] = block.getMixedBrightnessForBlock(blockAccess, ix+x, iy+y, iz+z);
+ }
+ else
+ {
+ brightness[ix+1][iy+1][iz+1] = block.getMixedBrightnessForBlock(blockAccess, x, y, z);
+ }
+ }
+ }
+
+ private int getBrightness(double v[], int[][][] brightness)
+ {
+ int x1 = v[0]<0.5d?0:1;
+ int x2 = x1+1;
+ int y1 = v[1]<0.5d?0:1;
+ int y2 = y1+1;
+ int z1 = v[2]<0.5d?0:1;
+ int z2 = z1+1;
+ float dx = v[0]<0.5d?(float)v[0]*2f:(float)v[0]*2f-1f;
+ float dy = v[1]<0.5d?(float)v[1]*2f:(float)v[1]*2f-1f;
+ float dz = v[2]<0.5d?(float)v[2]*2f:(float)v[2]*2f-1f;
+ int brightness1 = brightness[x1][y1][z1];
+ int brightness2 = brightness[x2][y2][z2];
+ float d = IHLMathUtils.sqrt(dx*dx+dy*dy+dz*dz);
+ return (int)(brightness1*(1f-d)*0.8f+brightness2*d*0.8f+brightness[1][1][1]*0.2f) & 16711935;
+ }
+
+ @Override
+ public boolean shouldRender3DInInventory(int arg0)
+ {
+ return true;
+ }
+}
+ \ No newline at end of file
diff --git a/ihl/explosion/PileTileEntity.java b/ihl/explosion/PileTileEntity.java
new file mode 100644
index 0000000..b6046db
--- /dev/null
+++ b/ihl/explosion/PileTileEntity.java
@@ -0,0 +1,91 @@
+package ihl.explosion;
+
+import ic2.core.IC2;
+import ihl.IHLMod;
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+
+public class PileTileEntity extends TileEntity
+{
+ public ItemStack content = new ItemStack(Blocks.sandstone);
+ private boolean firstTick = true;
+
+ @Override
+ public boolean canUpdate()
+ {
+ return IC2.platform.isRendering();
+ }
+
+ @Override
+ public void updateEntity()
+ {
+ if(firstTick && this.content!=null)
+ {
+ if(this.worldObj.isRemote)
+ {
+ IHLMod.proxy.requestTileEntityInitdataFromClientToServer(xCoord, yCoord, zCoord);
+ }
+ else
+ {
+ checkAndFall();
+ }
+ firstTick = false;
+ }
+ }
+
+ public void setContent(ItemStack other)
+ {
+ this.content=other;
+ }
+
+ public boolean checkAndFall()
+ {
+ Block underblock = this.worldObj.getBlock(xCoord, yCoord-1, zCoord);
+ if(underblock.isAir(worldObj, xCoord, yCoord-1, zCoord) || underblock==Blocks.air || underblock.getCollisionBoundingBoxFromPool(worldObj, xCoord, yCoord-1, zCoord)==null)
+ {
+ IHLEntityFallingPile fallingPile = new IHLEntityFallingPile(worldObj);
+ fallingPile.setPosition(xCoord+0.5d, yCoord+0.5d, zCoord+0.5d);
+ fallingPile.setEntityItemStack(content);
+ this.worldObj.setBlockToAir(xCoord, yCoord, zCoord);
+ this.worldObj.spawnEntityInWorld(fallingPile);
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound nbttagcompound)
+ {
+ super.readFromNBT(nbttagcompound);
+ this.content = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("content"));
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound nbttagcompound)
+ {
+ super.writeToNBT(nbttagcompound);
+ NBTTagCompound contentNBT = new NBTTagCompound();
+ this.content.writeToNBT(contentNBT);
+ nbttagcompound.setTag("content", contentNBT);
+ }
+
+ public void updateBlockRender()
+ {
+ Minecraft.getMinecraft().renderGlobal.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
+ }
+
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
+ {
+ this.readFromNBT(pkt.func_148857_g());
+ Minecraft.getMinecraft().renderGlobal.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
+ }
+}
+
+
diff --git a/ihl/explosion/PileTileEntityRender.java b/ihl/explosion/PileTileEntityRender.java
new file mode 100644
index 0000000..ea8ab4f
--- /dev/null
+++ b/ihl/explosion/PileTileEntityRender.java
@@ -0,0 +1,160 @@
+package ihl.explosion;
+
+import java.nio.IntBuffer;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL30;
+import org.lwjgl.util.glu.GLU;
+
+import ihl.IHLMod;
+import ihl.utils.IHLItemRenderer;
+
+public class PileTileEntityRender extends TileEntitySpecialRenderer {
+
+private int fb=-1;
+private final int textureWidth=64;
+private final int textureHeight=64;
+private final PileBlockRender pileBlockRender;
+public final Map<Long,Integer> textureIdMap = new HashMap<Long,Integer>();
+private IntBuffer textureIDBuffer;
+private int nextAvailableId = -1;
+private boolean framebufferReady = false;
+private Minecraft mc;
+private final IHLItemRenderer ihlItemRenderer=new IHLItemRenderer(false);
+private final Random random = new Random();
+
+public PileTileEntityRender(PileBlockRender pileBlockRender1)
+{
+ pileBlockRender=pileBlockRender1;
+ mc = Minecraft.getMinecraft();
+}
+
+public void renderAModelAt(PileTileEntity tile, double x, double y, double z, float f)
+{
+ ItemStack stack = tile.content;
+ if(!framebufferReady)
+ {
+ this.generateFrameBuffer();
+ Minecraft.getMinecraft().entityRenderer.setupCameraTransform(f, 0);
+ Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false);
+ }
+ else if(stack!=null)
+ {
+ long hash = this.pileBlockRender.getItemStackHash(stack);
+ if(!textureIdMap.containsKey(hash))
+ {
+ textureIdMap.put(hash,textureIDBuffer.get(++nextAvailableId));
+ this.preparetexture(nextAvailableId);
+ this.drawTexture(tile);
+ Minecraft.getMinecraft().entityRenderer.setupCameraTransform(f, 0);
+ Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false);
+ tile.updateBlockRender();
+ }
+ }
+}
+
+private void generateFrameBuffer()
+{
+ textureIDBuffer = BufferUtils.createIntBuffer(Short.MAX_VALUE);
+ GL11.glGenTextures(textureIDBuffer);
+ fb=GL30.glGenFramebuffers();
+ this.preparetexture(0);
+ if (GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER) != GL30.GL_FRAMEBUFFER_COMPLETE)
+ {
+ IHLMod.log.error("Something went wrong while creating frame buffer!");
+ IHLMod.log.error(GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER));
+ }
+ else
+ {
+ IHLMod.log.info("FrameBuffer loaded correctly!");
+ }
+ this.framebufferReady=true;
+}
+
+private void preparetexture(int textureID)
+{
+ GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, fb);
+ int texture = textureIDBuffer.get(textureID);
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
+ GL30.glFramebufferTexture2D(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL11.GL_TEXTURE_2D, texture, 0);
+ GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB8, textureWidth, textureHeight, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, (java.nio.ByteBuffer)null);
+ GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP);
+ GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP);
+ GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER,GL11.GL_NEAREST);
+ GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
+}
+
+private void drawTexture(PileTileEntity tile)
+{
+ GL11.glViewport(0, 0, textureWidth, textureHeight);
+ GL11.glClearColor(0f, 0f, 0f, 1f);
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GL11.glOrtho(-1d, 1d, -1d, 1d, 0.05F, this.mc.gameSettings.renderDistanceChunks * 32F);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ ItemStack stack = tile.content;
+ GL11.glTranslatef(0, 0, -1f);
+ GLU.gluLookAt(0, 0, 0, -32f/*x reference*/, 0f/*y reference*/, 0f/*z reference*/, 0.0f, 1.0f, 0.0f);
+ GL11.glColor4f(1f, 1f, 1f, 1f);
+ GL11.glRotatef(90f,0,1f,0);
+ GL11.glScalef(2f, 2f, 2f);
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 0xf0, 0xf0);
+// Tessellator.instance.setBrightness(16711935);
+ if(stack.getItem() instanceof ItemBlock)
+ {
+ Block block = ((ItemBlock)stack.getItem()).field_150939_a;
+ IIcon icon = block.getIcon(0, stack.getItemDamage());
+ double u1 = (double)icon.getInterpolatedU(0D);
+ double u2 = (double)icon.getInterpolatedU(16.0D);
+ double v1 = (double)icon.getInterpolatedV(0D);
+ double v2 = (double)icon.getInterpolatedV(16.0D);
+ Tessellator tessellator = Tessellator.instance;
+ bindTexture(TextureMap.locationBlocksTexture);
+ tessellator.startDrawingQuads();
+ tessellator.setColorOpaque_F(1f, 1f, 1f);
+ tessellator.addVertexWithUV(-0.5,-0.5, 0,u1,v1);
+ tessellator.addVertexWithUV( 0.5,-0.5, 0,u1,v2);
+ tessellator.addVertexWithUV( 0.5, 0.5, 0,u2,v2);
+ tessellator.addVertexWithUV(-0.5, 0.5, 0,u2,v1);
+ tessellator.draw();
+ }
+ for (int i = 0; i < 128; i++)
+ {
+ GL11.glPushMatrix();
+ float tx = random.nextFloat()-0.5f;
+ float ty = random.nextFloat()-0.5f;
+ GL11.glTranslatef(tx, ty, 0);
+ this.ihlItemRenderer.doRender(RenderManager.instance,stack, 0f, 0f, 0f);
+ GL11.glTranslatef(-tx, -ty, 0);
+ GL11.glPopMatrix();
+ }
+ GL11.glViewport(0, 0, Display.getWidth(), Display.getHeight());
+// IHLRenderUtils.instance.disableAmbientLighting();
+}
+
+@Override
+public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
+{
+ this.renderAModelAt((PileTileEntity)par1TileEntity, par2, par4, par6, par8);
+}
+
+} \ No newline at end of file
diff --git a/ihl/explosion/WorldSavedDataBlastWave.java b/ihl/explosion/WorldSavedDataBlastWave.java
new file mode 100644
index 0000000..73019b9
--- /dev/null
+++ b/ihl/explosion/WorldSavedDataBlastWave.java
@@ -0,0 +1,108 @@
+package ihl.explosion;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.world.WorldSavedData;
+
+public class WorldSavedDataBlastWave extends WorldSavedData {
+ Map<Long,Set<Integer[]>> data = new HashMap<Long,Set<Integer[]>>(256);
+
+ public WorldSavedDataBlastWave(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ if(nbt.hasKey("entryList"))
+ {
+ NBTTagList entryList=nbt.getTagList("entryList", 10);
+ for(int i=0;i<entryList.tagCount();i++)
+ {
+ NBTTagCompound chunk = entryList.getCompoundTagAt(i);
+ long chunkXZKey = chunk.getLong("chunkXZKey");
+ NBTTagList blastWaveList = chunk.getTagList("blastWaveList", 10);
+ Set<Integer[]> blastWaveArraySet= new HashSet<Integer[]>();
+ for(int i1=0;i1<blastWaveList.tagCount();i1++)
+ {
+ NBTTagCompound blastWave = blastWaveList.getCompoundTagAt(i1);
+ Integer[] blastWaveArray = new Integer[5];
+ blastWaveArray[0]=blastWave.getInteger("ev");
+ blastWaveArray[1]=blastWave.getInteger("sourceX");
+ blastWaveArray[2]=blastWave.getInteger("sourceY");
+ blastWaveArray[3]=blastWave.getInteger("sourceZ");
+ blastWaveArray[4]=blastWave.getInteger("power");
+ blastWaveArray[5]=blastWave.getInteger("directionX");
+ blastWaveArray[6]=blastWave.getInteger("directionY");
+ blastWaveArray[7]=blastWave.getInteger("directionZ");
+ blastWaveArraySet.add(blastWaveArray);
+ }
+ data.put(chunkXZKey, blastWaveArraySet);
+ }
+ }
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ NBTTagList entryList = new NBTTagList();
+ Iterator<Entry<Long, Set<Integer[]>>> dataESI = data.entrySet().iterator();
+ while(dataESI.hasNext())
+ {
+ Entry<Long, Set<Integer[]>> dataEntry = dataESI.next();
+ Iterator<Integer[]> bwArrayI = dataEntry.getValue().iterator();
+ NBTTagCompound chunk = new NBTTagCompound();
+ NBTTagList blastWaveList = new NBTTagList();
+ while(bwArrayI.hasNext())
+ {
+ NBTTagCompound blastWave = new NBTTagCompound();
+ Integer[] bwArray = bwArrayI.next();
+ blastWave.setInteger("ev", bwArray[0]);
+ blastWave.setInteger("sourceX", bwArray[1]);
+ blastWave.setInteger("sourceY", bwArray[2]);
+ blastWave.setInteger("sourceZ", bwArray[3]);
+ blastWave.setInteger("power", bwArray[4]);
+ blastWave.setInteger("directionX", bwArray[5]);
+ blastWave.setInteger("directionY", bwArray[6]);
+ blastWave.setInteger("directionZ", bwArray[7]);
+ blastWaveList.appendTag(blastWave);
+ }
+ chunk.setTag("blastWaveList", blastWaveList);
+ chunk.setLong("chunkHash", dataEntry.getKey());
+ entryList.appendTag(chunk);
+ }
+ nbt.setTag("entryList", entryList);
+ }
+
+ public void scheduleExplosionEffectsOnChunkLoad(long chunkXZKey, int ev, int sourceX, int sourceY, int sourceZ, int power1, int[] directionMask)
+ {
+ Set<Integer[]> waves;
+ if(data.containsKey(chunkXZKey))
+ {
+ waves=data.get(chunkXZKey);
+ }
+ else
+ {
+ waves=new HashSet<Integer[]>(1024);
+ data.put(chunkXZKey, waves);
+ }
+ Integer[] wave = new Integer[8];
+ wave[0]=ev;
+ wave[1]=sourceX;
+ wave[2]=sourceY;
+ wave[3]=sourceZ;
+ wave[4]=power1;
+ wave[5]=directionMask[0];
+ wave[6]=directionMask[1];
+ wave[7]=directionMask[2];
+ waves.add(wave);
+ }
+}
diff --git a/ihl/flexible_cable/AnchorBlock.java b/ihl/flexible_cable/AnchorBlock.java
index 7c12b49..9d9c1dc 100644
--- a/ihl/flexible_cable/AnchorBlock.java
+++ b/ihl/flexible_cable/AnchorBlock.java
@@ -1,10 +1,5 @@
package ihl.flexible_cable;
-import ic2.core.IC2;
-import ic2.core.item.tool.ItemToolWrench;
-import ihl.IHLCreativeTab;
import ihl.IHLModInfo;
-import ihl.enviroment.LightBulbTileEntity;
-import ihl.utils.IHLUtils;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -12,19 +7,14 @@ import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
-import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class AnchorBlock extends Block implements ITileEntityProvider {
- private String unlocalizedName;
private IIcon blockIconSide;
public AnchorBlock(String unlocalizedName1)
@@ -170,7 +160,6 @@ public class AnchorBlock extends Block implements ITileEntityProvider {
{
AnchorTileEntity ate = (AnchorTileEntity) te;
float portSize=0.1f;
- boolean firstBB=false;
float bbMinX = 1f;
float bbMaxX = 0f;
float bbMinY = 1f;
diff --git a/ihl/flexible_cable/AnchorTileEntity.java b/ihl/flexible_cable/AnchorTileEntity.java
index b9057ba..b03a3d9 100644
--- a/ihl/flexible_cable/AnchorTileEntity.java
+++ b/ihl/flexible_cable/AnchorTileEntity.java
@@ -8,8 +8,6 @@ import ic2.api.energy.tile.IEnergySource;
import ic2.core.ExplosionIC2;
import ic2.core.IC2;
import ic2.core.block.TileEntityBlock;
-import ihl.IHLMod;
-import ihl.interfaces.ICableHolder;
import ihl.interfaces.IEnergyNetNode;
import ihl.interfaces.IMultiPowerCableHolder;
import ihl.utils.IHLUtils;
@@ -19,15 +17,11 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ForgeDirection;
@@ -406,6 +400,7 @@ public class AnchorTileEntity extends TileEntityBlock implements IEnergySink, IE
}
}
+ @Override
public boolean isCableRemoved(int chainUniqueID)
{
if(!checkCables)
diff --git a/ihl/flexible_cable/BatterySwitchUnitTileEntity.java b/ihl/flexible_cable/BatterySwitchUnitTileEntity.java
index 375cb21..f4fc6c1 100644
--- a/ihl/flexible_cable/BatterySwitchUnitTileEntity.java
+++ b/ihl/flexible_cable/BatterySwitchUnitTileEntity.java
@@ -12,19 +12,12 @@ import ic2.api.energy.tile.IEnergySource;
import ic2.api.network.INetworkClientTileEntityEventListener;
import ic2.core.ExplosionIC2;
import ic2.core.IC2;
-import ic2.core.block.TileEntityBlock;
-import ihl.IHLMod;
-import ihl.flexible_cable.IHLGrid;
-import ihl.flexible_cable.NodeEntity;
-import ihl.interfaces.IEnergyNetNode;
import ihl.utils.IHLUtils;
-import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ForgeDirection;
diff --git a/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java b/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java
index ee8ebf7..34455ac 100644
--- a/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java
+++ b/ihl/flexible_cable/FlexibleCableHolderBaseTileEntity.java
@@ -1,18 +1,10 @@
package ihl.flexible_cable;
-import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import ic2.api.energy.event.EnergyTileLoadEvent;
-import ic2.api.energy.event.EnergyTileUnloadEvent;
-import ic2.api.energy.tile.IEnergySource;
-import ic2.api.network.INetworkClientTileEntityEventListener;
-import ic2.core.ExplosionIC2;
-import ic2.core.IC2;
-import ic2.core.block.TileEntityBlock;
import ic2.core.block.TileEntityInventory;
import ihl.IHLMod;
import ihl.flexible_cable.IHLGrid;
@@ -20,16 +12,10 @@ import ihl.flexible_cable.NodeEntity;
import ihl.interfaces.IEnergyNetNode;
import ihl.utils.IHLUtils;
import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-import net.minecraft.server.MinecraftServer;
-import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.common.util.ForgeDirection;
public abstract class FlexibleCableHolderBaseTileEntity extends TileEntityInventory implements IEnergyNetNode{
@@ -43,7 +29,7 @@ public abstract class FlexibleCableHolderBaseTileEntity extends TileEntityInvent
public FlexibleCableHolderBaseTileEntity()
{
super();
- cableList=new HashSet();
+ cableList=new HashSet<NBTTagCompound>();
}
@Override
@@ -57,6 +43,7 @@ public abstract class FlexibleCableHolderBaseTileEntity extends TileEntityInvent
}
}
+ @SuppressWarnings("unchecked")
@Override
public void setFacing(short facing1)
{
@@ -70,7 +57,7 @@ public abstract class FlexibleCableHolderBaseTileEntity extends TileEntityInvent
setConnectionZ(this.zCoord+0.5D);
if(!nodeList.isEmpty())
{
- Iterator ei = nodeList.iterator();
+ Iterator<NodeEntity> ei = nodeList.iterator();
while(ei.hasNext())
{
NodeEntity ne=(NodeEntity) ei.next();
@@ -174,7 +161,6 @@ public abstract class FlexibleCableHolderBaseTileEntity extends TileEntityInvent
if(newGridID!=-1)
{
this.gridID=newGridID;
- IHLGrid newGrid = IHLMod.enet.getGrid(newGridID);
IHLMod.enet.getGrid(newGridID).add(this);
}
else
diff --git a/ihl/flexible_cable/IHLENet.java b/ihl/flexible_cable/IHLENet.java
index 2429aa7..32b5ebf 100644
--- a/ihl/flexible_cable/IHLENet.java
+++ b/ihl/flexible_cable/IHLENet.java
@@ -12,8 +12,8 @@ import net.minecraft.nbt.NBTTagCompound;
public class IHLENet {
- public Map<Integer, IHLGrid> grids = new HashMap();
- public Map<Integer, IHLGrid> cablesToGrids = new HashMap();
+ public Map<Integer, IHLGrid> grids = new HashMap<Integer, IHLGrid>();
+ public Map<Integer, IHLGrid> cablesToGrids = new HashMap<Integer, IHLGrid>();
private int griduid=0;
diff --git a/ihl/flexible_cable/IHLGrid.java b/ihl/flexible_cable/IHLGrid.java
index 04a9d4c..a47c229 100644
--- a/ihl/flexible_cable/IHLGrid.java
+++ b/ihl/flexible_cable/IHLGrid.java
@@ -18,22 +18,21 @@ import net.minecraft.server.MinecraftServer;
public class IHLGrid
{
private static final double powerLossLimitPerMeter=1.6D;
- public final Set<IEnergyNetNode> telist = new HashSet();
+ public final Set<IEnergyNetNode> telist = new HashSet<IEnergyNetNode>();
public double energy=0D;
private IEnergyNetNode sink;
private IEnergyNetNode source;
private double voltage;
- private short frequency=0;
private double lastVoltage;
public boolean isGridValid=true;
private double total20TicksEU;
private int lastTickCounter=0;
private int tickCounterFireStart=0;
- public final List<IEnergyNetNode> calculatedSinks = new ArrayList();
- public final List<IEnergyNetNode> calculatedSources = new ArrayList();
- public final Set<NBTTagCompound> cablesOnFire = new HashSet();
- private final Map<IEnergyNetNode, Double> energyLossSinkMap = new HashMap();
- private final Map<IEnergyNetNode, Double> voltageSinkMap = new HashMap();
+ public final List<IEnergyNetNode> calculatedSinks = new ArrayList<IEnergyNetNode>();
+ public final List<IEnergyNetNode> calculatedSources = new ArrayList<IEnergyNetNode>();
+ public final Set<NBTTagCompound> cablesOnFire = new HashSet<NBTTagCompound> ();
+ private final Map<IEnergyNetNode, Double> energyLossSinkMap = new HashMap<IEnergyNetNode, Double>();
+ private final Map<IEnergyNetNode, Double> voltageSinkMap = new HashMap<IEnergyNetNode, Double>();
private double averageEUTransfered;
private double lastAverageEUTransfered=0D;
@@ -151,10 +150,10 @@ public class IHLGrid
this.averageEUTransfered>this.lastAverageEUTransfered ||
this.voltage!=this.lastVoltage))
{
- Map<IEnergyNetNode, NBTTagCompound> map = new HashMap();
- Set<IEnergyNetNode> templist = new HashSet();
- Set<IEnergyNetNode> processlist = new HashSet();
- Set<IEnergyNetNode> templist2 = new HashSet();
+ Map<IEnergyNetNode, NBTTagCompound> map = new HashMap<IEnergyNetNode, NBTTagCompound>();
+ Set<IEnergyNetNode> templist = new HashSet<IEnergyNetNode>();
+ Set<IEnergyNetNode> processlist = new HashSet<IEnergyNetNode>();
+ Set<IEnergyNetNode> templist2 = new HashSet<IEnergyNetNode>();
templist.addAll(telist);
processlist.add(sink);
int threads=0;
diff --git a/ihl/flexible_cable/InvSlotOutputInProgress.java b/ihl/flexible_cable/InvSlotOutputInProgress.java
index 2b5bfda..3694aee 100644
--- a/ihl/flexible_cable/InvSlotOutputInProgress.java
+++ b/ihl/flexible_cable/InvSlotOutputInProgress.java
@@ -79,7 +79,7 @@ public class InvSlotOutputInProgress extends IronWorkbenchInvSlot{
public List<ItemStack> getRecipeOutputs(int currentSlot)
{
int slotRecipeIndex=this.slotRecipe[currentSlot];
- List<ItemStack> list = new ArrayList();
+ List<ItemStack> list = new ArrayList<ItemStack>();
for(int i=0;i<this.size;i++)
{
if(this.slotRecipe[i]==slotRecipeIndex)
diff --git a/ihl/flexible_cable/InvSlotProcessableIronWorkbench.java b/ihl/flexible_cable/InvSlotProcessableIronWorkbench.java
index a5b8ee5..adb51f5 100644
--- a/ihl/flexible_cable/InvSlotProcessableIronWorkbench.java
+++ b/ihl/flexible_cable/InvSlotProcessableIronWorkbench.java
@@ -1,10 +1,14 @@
package ihl.flexible_cable;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidContainerRegistry;
import ic2.api.recipe.IRecipeInput;
+import ic2.api.recipe.RecipeInputFluidContainer;
import ic2.core.IC2;
import ic2.core.item.ItemUpgradeModule;
import ihl.interfaces.IWire;
@@ -41,8 +45,9 @@ public class InvSlotProcessableIronWorkbench extends IronWorkbenchInvSlot {
}
}
- public void substract(List<IRecipeInput> materials, int multiplier)
+ public Set<ItemStack> substract(List<IRecipeInput> materials, int multiplier)
{
+ Set<ItemStack> output = new HashSet<ItemStack>();
Iterator<IRecipeInput> i1 = materials.iterator();
while(i1.hasNext())
{
@@ -59,6 +64,25 @@ public class InvSlotProcessableIronWorkbench extends IronWorkbenchInvSlot {
is.stackSize=0;
}
}
+ else if(is1 instanceof RecipeInputFluidContainer)
+ {
+ if(is.stackSize==1)
+ {
+ output.add(FluidContainerRegistry.drainFluidContainer(is));
+ is.stackSize=0;
+ }
+ else
+ {
+ is.stackSize-=is1.getAmount()*multiplier;
+ ItemStack iscopy = is.copy();
+ iscopy.stackSize=1;
+ ItemStack emptyContainer = FluidContainerRegistry.drainFluidContainer(iscopy);
+ if(emptyContainer!=null)
+ {
+ output.add(emptyContainer);
+ }
+ }
+ }
else
{
is.stackSize-=is1.getAmount()*multiplier;
@@ -71,6 +95,7 @@ public class InvSlotProcessableIronWorkbench extends IronWorkbenchInvSlot {
}
}
}
+ return output;
}
public int getAmountOf(ItemStack rubber)
diff --git a/ihl/flexible_cable/InvSlotTool.java b/ihl/flexible_cable/InvSlotTool.java
index b3a3855..0ffbcd9 100644
--- a/ihl/flexible_cable/InvSlotTool.java
+++ b/ihl/flexible_cable/InvSlotTool.java
@@ -9,77 +9,61 @@ import ic2.core.IC2;
import ic2.core.Ic2Items;
import ic2.core.item.ItemUpgradeModule;
import ihl.interfaces.IWire;
+import ihl.recipes.IronWorkbenchRecipe;
import ihl.utils.IHLUtils;
public class InvSlotTool extends IronWorkbenchInvSlot {
- public InvSlotTool(IronWorkbenchTileEntity base1, String name1,
- int oldStartIndex1, Access access1, int count) {
+ public InvSlotTool(IronWorkbenchTileEntity base1, String name1, int oldStartIndex1, Access access1, int count) {
super(base1, name1, oldStartIndex1, access1, count);
// TODO Auto-generated constructor stub
}
- public void damage(List<IRecipeInput> tools)
- {
- if(tools!=null && !tools.isEmpty())
- {
- for(int i=0;i<this.size();i++)
- {
+ public void damage(List<IRecipeInput> tools) {
+ if (tools != null && !tools.isEmpty()) {
+ for (int i = 0; i < this.size(); i++) {
ItemStack is = this.get(i);
- Iterator<IRecipeInput> i1 = tools.iterator();
- while(i1.hasNext())
- {
+ Iterator<IRecipeInput> i1 = tools.iterator();
+ while (i1.hasNext()) {
IRecipeInput is1 = i1.next();
- if(is!=null && (is1.matches(is)))
- {
- if(!is.attemptDamageItem(1, IC2.random))
- {
- if(is.stackTagCompound!=null && is.stackTagCompound.hasKey("GT.ToolStats"))
- {
+ if (is != null && (is1.matches(is))) {
+ if (!is.attemptDamageItem(1, IC2.random)) {
+ if (is.stackTagCompound != null && is.stackTagCompound.hasKey("GT.ToolStats")) {
IHLUtils.damageItemViaNBTTag(is, 1);
}
}
- if(is.stackSize<=0)
- {
- this.put(i,null);
+ if (is.stackSize <= 0) {
+ this.put(i, null);
}
}
}
}
}
}
-
+
@Override
- public void put(int index, ItemStack content)
- {
+ public void put(int index, ItemStack content) {
super.put(index, content);
- if(IC2.platform.isSimulating() && ((IronWorkbenchTileEntity)this.base).container!=null)
- {
- ((IronWorkbenchTileEntity)this.base).resetOutput();
- ((IronWorkbenchTileEntity)this.base).container.detectAndSendChanges();
+ if (IC2.platform.isSimulating() && ((IronWorkbenchTileEntity) this.base).container != null) {
+ ((IronWorkbenchTileEntity) this.base).resetOutput();
+ ((IronWorkbenchTileEntity) this.base).container.detectAndSendChanges();
}
- }
-
+ }
+
@Override
- public boolean accepts(ItemStack itemStack)
- {
- if (itemStack != null && (itemStack.getItem() instanceof ItemUpgradeModule || itemStack.getItem() instanceof IWire|| itemStack.getItem()==Ic2Items.rubber.getItem()))
- {
- return false;
- }
- else
- {
- return true;
- }
- }
+ public boolean accepts(ItemStack itemStack) {
+ for (IronWorkbenchRecipe recipe : IronWorkbenchTileEntity.recipes) {
+ if (recipe.isTool(itemStack)) {
+ return true;
+ }
+ }
+ return false;
+ }
- public boolean contain(ItemStack is1)
- {
- for(int i=0;i<this.size();i++)
- {
+ public boolean contain(ItemStack is1) {
+ for (int i = 0; i < this.size(); i++) {
ItemStack is = this.get(i);
- if(is!=null && (is.getItem()==is1.getItem()||IHLUtils.isItemsHaveSameOreDictionaryEntry(is, is1)))
- {
+ if (is != null && (is.getItem() == is1.getItem() || IHLUtils.isItemsHaveSameOreDictionaryEntry(is, is1))) {
return true;
}
}
diff --git a/ihl/flexible_cable/InvSlotWorkspaceElement.java b/ihl/flexible_cable/InvSlotWorkspaceElement.java
index 53af541..0ae0d26 100644
--- a/ihl/flexible_cable/InvSlotWorkspaceElement.java
+++ b/ihl/flexible_cable/InvSlotWorkspaceElement.java
@@ -7,7 +7,6 @@ import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
-import ihl.IHLMod;
import ihl.interfaces.IWorkspaceElement;
import ihl.utils.IHLUtils;
@@ -68,7 +67,6 @@ public class InvSlotWorkspaceElement extends IronWorkbenchInvSlot {
while(iterator.hasNext())
{
ItemStack rWorkspaceElementItemStack = iterator.next();
- boolean presence=false;
for(int i=1;i<workspaceElements.length;i++)
{
IWorkspaceElement cWorkspaceElement=workspaceElements[i];
@@ -149,18 +147,6 @@ public class InvSlotWorkspaceElement extends IronWorkbenchInvSlot {
return false;
}
- private boolean contains(ItemStack wse)
- {
- for(int i=1;i<size();i++)
- {
- if(this.get(i)!=null && this.get(i).getItem()==wse.getItem())
- {
- return true;
- }
- }
- return false;
- }
-
public short encodeReadyStatus()
{
short result=0;
@@ -187,7 +173,7 @@ public class InvSlotWorkspaceElement extends IronWorkbenchInvSlot {
@Override
public List<ItemStack> getItemStackList()
{
- List<ItemStack> list = new ArrayList();
+ List<ItemStack> list = new ArrayList<ItemStack>();
for(int i=1; i<this.size(); i++)
{
if(get(i)!=null)list.add(get(i));
diff --git a/ihl/flexible_cable/IronWorkbenchContainer.java b/ihl/flexible_cable/IronWorkbenchContainer.java
index 9429663..b25c790 100644
--- a/ihl/flexible_cable/IronWorkbenchContainer.java
+++ b/ihl/flexible_cable/IronWorkbenchContainer.java
@@ -1,13 +1,13 @@
package ihl.flexible_cable;
import ic2.core.ContainerBase;
-import ic2.core.slot.SlotInvSlot;
import ihl.processing.invslots.SlotInvSlotOutputInProgress;
+import ihl.processing.invslots.SlotInvSlotIronWorkbench;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class IronWorkbenchContainer extends ContainerBase {
+public class IronWorkbenchContainer extends ContainerBase<IronWorkbenchTileEntity> {
protected IronWorkbenchTileEntity tileEntity;
private int lastProgress1 = -1;
@@ -37,14 +37,14 @@ public class IronWorkbenchContainer extends ContainerBase {
{
for(col=0;col<=1;col++)
{
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.tools, row+col*6, 26+col*18, 8+row*18));
+ this.addSlotToContainer(new SlotInvSlotIronWorkbench(tileEntity1.tools, row+col*6, 26+col*18, 8+row*18));
}
}
for(row=0;row<6;row++)
{
for(col=0;col<=1;col++)
{
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.inputMaterial, row+col*6, 65+col*18, 8+row*18));
+ this.addSlotToContainer(new SlotInvSlotIronWorkbench(tileEntity1.inputMaterial, row+col*6, 65+col*18, 8+row*18));
}
}
for (row = 0; row<6; ++row)
diff --git a/ihl/flexible_cable/IronWorkbenchGui.java b/ihl/flexible_cable/IronWorkbenchGui.java
index 131f2f7..dedb9d8 100644
--- a/ihl/flexible_cable/IronWorkbenchGui.java
+++ b/ihl/flexible_cable/IronWorkbenchGui.java
@@ -9,7 +9,6 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
-import ic2.core.network.NetworkManager;
import ihl.interfaces.IItemHasMiniGUI;
import ihl.interfaces.ItemMiniGUI;
import ihl.utils.IHLRenderUtils;
@@ -22,21 +21,12 @@ public class IronWorkbenchGui extends GuiContainer {
private static final short outputslotoffset=66;
public IronWorkbenchGui (IronWorkbenchContainer container1) {
- //the container is instanciated and passed to the superclass for handling
super(container1);
this.container=container1;
this.ySize=IronWorkbenchContainer.height;
}
@Override
- public void initGui()
- {
- super.initGui();
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- }
-
- @Override
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
int x = (width - xSize) / 2;
@@ -103,7 +93,6 @@ public class IronWorkbenchGui extends GuiContainer {
this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
if (this.container.tileEntity.progress > 0)
{
- int progressLevel=Math.min(Math.round(this.container.tileEntity.progress*16.0F/this.container.tileEntity.maxProgress),16);
int frameNum=0;
short slotRecipeNum=this.container.tileEntity.output.slotRecipe[0];
for(int row = 0;row<6;row++)
diff --git a/ihl/flexible_cable/IronWorkbenchInvSlot.java b/ihl/flexible_cable/IronWorkbenchInvSlot.java
index 830f9b4..380b6d3 100644
--- a/ihl/flexible_cable/IronWorkbenchInvSlot.java
+++ b/ihl/flexible_cable/IronWorkbenchInvSlot.java
@@ -15,7 +15,7 @@ public class IronWorkbenchInvSlot extends InvSlot {
public List<ItemStack> getItemStackList()
{
- List<ItemStack> list = new ArrayList();
+ List<ItemStack> list = new ArrayList<ItemStack>();
for(int i=0; i<this.size(); i++)
{
if(get(i)!=null)list.add(get(i));
diff --git a/ihl/flexible_cable/IronWorkbenchRender.java b/ihl/flexible_cable/IronWorkbenchRender.java
index 3bfc946..7afdf17 100644
--- a/ihl/flexible_cable/IronWorkbenchRender.java
+++ b/ihl/flexible_cable/IronWorkbenchRender.java
@@ -2,15 +2,11 @@ package ihl.flexible_cable;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
-import ic2.api.tile.IWrenchable;
-import ihl.IHLModInfo;
import ihl.utils.IHLItemRenderer;
public class IronWorkbenchRender extends TileEntitySpecialRenderer{
-private final float scale=1F/16F;
private IHLItemRenderer itemRenderer=new IHLItemRenderer(true);
public IronWorkbenchRender(){}
diff --git a/ihl/flexible_cable/IronWorkbenchRender.java~ b/ihl/flexible_cable/IronWorkbenchRender.java~
deleted file mode 100644
index b6420c6..0000000
--- a/ihl/flexible_cable/IronWorkbenchRender.java~
+++ /dev/null
@@ -1,40 +0,0 @@
-package ihl.flexible_cable;
-import net.minecraft.client.renderer.entity.RenderManager;
-import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.ResourceLocation;
-import org.lwjgl.opengl.GL11;
-
-import ic2.api.tile.IWrenchable;
-import ihl.IHLModInfo;
-import ihl.utils.IHLItemRenderer;
-
-public class IronWorkbenchRender extends TileEntitySpecialRenderer{
-private final float scale=1F/16F;
-private IHLItemRenderer itemRenderer=new IHLItemRenderer(true);
-
-public IronWorkbenchRender(){}
-
-public void renderAModelAt(IronWorkbenchTileEntity tile, double x, double y, double z, float f) {
- GL11.glPushMatrix();
- GL11.glTranslatef((float)x + 0.5F, (float)y+0.5F, (float)z + 0.5F);
- GL11.glRotatef(90f, 1F, 0F, 0F);
- int index = 0;
- for (int i = 0; i < tile.tools.size() && index < 8; i++) {
- if (tile.tools.get(i)!=null) {
- float iy = index >= 4 ? -0.5f : 0f;
- float ix = (index % 2) * 0.4f-0.2f;
- float iz = (index / 2) * 0.4f-0.2f + iy;
- this.itemRenderer.doRender(RenderManager.instance,tile.tools.get(i),ix,iz,iy-0.002f*index);
- index++;
- }
- }
- GL11.glPopMatrix();
-}
-
- @Override
- public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
- {
- this.renderAModelAt((IronWorkbenchTileEntity)par1TileEntity, par2, par4, par6, par8);
- }
-}
diff --git a/ihl/flexible_cable/IronWorkbenchTileEntity.java b/ihl/flexible_cable/IronWorkbenchTileEntity.java
index 3821a0c..73a3eb1 100644
--- a/ihl/flexible_cable/IronWorkbenchTileEntity.java
+++ b/ihl/flexible_cable/IronWorkbenchTileEntity.java
@@ -3,9 +3,11 @@ package ihl.flexible_cable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -14,29 +16,26 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import ic2.api.network.INetworkClientTileEntityEventListener;
import ic2.api.network.INetworkTileEntityEventListener;
import ic2.api.recipe.IRecipeInput;
-import ic2.api.recipe.RecipeInputItemStack;
import ic2.core.ContainerBase;
-import ic2.core.IC2;
import ic2.core.IHasGui;
-import ic2.core.Ic2Items;
import ic2.core.block.TileEntityInventory;
import ic2.core.block.invslot.InvSlot.Access;
import ihl.IHLMod;
import ihl.interfaces.IWire;
-import ihl.items_blocks.FlexibleCableItem;
-import ihl.processing.chemistry.GaedesMercuryRotaryPumpTileEntity;
-import ihl.processing.metallurgy.GasWeldingStationTileEntity;
import ihl.recipes.IronWorkbenchRecipe;
+import ihl.recipes.RecipeInputDetonator;
import ihl.recipes.RecipeInputDie;
import ihl.recipes.RecipeInputObjectInstance;
import ihl.utils.IHLUtils;
public class IronWorkbenchTileEntity extends TileEntityInventory implements IHasGui, INetworkClientTileEntityEventListener, INetworkTileEntityEventListener{
- public static List<IronWorkbenchRecipe> recipes = new ArrayList();
+ public static List<IronWorkbenchRecipe> recipes = new ArrayList<IronWorkbenchRecipe>();
public int progress;
public int currentSlot=-1;
public final int maxProgress;
@@ -49,7 +48,8 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas
private boolean outputDefined=false;
private EntityPlayer crafter;
public ContainerBase<?> container;
- private Map<Integer, IronWorkbenchRecipe> slotRecipeMap = new HashMap();
+ private Map<Integer, IronWorkbenchRecipe> slotRecipeMap = new HashMap<Integer, IronWorkbenchRecipe>();
+ private boolean firstTick = true;
public IronWorkbenchTileEntity()
{
@@ -77,7 +77,18 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas
{
return IHLUtils.getThisModItemStack("ironWorkbench");
}
-
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateEntityClient()
+ {
+ if(firstTick)
+ {
+ IHLMod.proxy.requestTileEntityInitdataFromClientToServer(xCoord, yCoord, zCoord);
+ this.firstTick=false;
+ }
+ }
+
@Override
public void updateEntityServer()
{
@@ -102,6 +113,13 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas
newOutputs = ((RecipeInputDie)rinput).transformOutput(this.getMatchedItemStack(rinput),recipe.outputs);
}
}
+ for(IRecipeInput rinput:recipe.materials)
+ {
+ if(rinput instanceof RecipeInputDetonator)
+ {
+ newOutputs = ((RecipeInputDetonator)rinput).transformOutput(this.getMatchedItemStack(rinput),recipe.outputs);
+ }
+ }
int slot = this.output.put(newOutputs);
if(slot<0)break;
slotRecipeMap.put(slot, recipe);
@@ -109,7 +127,6 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas
}
}
}
- List<ItemStack> processingMaterials = new ArrayList<ItemStack>();
for(int i=0; i<this.inputMaterial.size();i++)
{
ItemStack stack = this.inputMaterial.get(i);
@@ -136,7 +153,7 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas
}
else if(!this.output.isEmpty())
{
- List<Integer> crafterEmptyInventorySlotsList = getCrafterEmptyInventorySlotsList();
+ Set<Integer> crafterEmptyInventorySlotsList = getCrafterEmptyInventorySlotsList();
if(startProcess && crafterEmptyInventorySlotsList.size()>=this.slotRecipeMap.get(currentSlot).outputs.size())
{
if(++this.progress>=this.maxProgress)
@@ -150,10 +167,8 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas
{
int slot = emptySlotsIterator.next();
ItemStack stack = optsi.next();
- this.crafter.inventory.mainInventory[slot]=stack.copy();
if(stack.getItem() instanceof IWire)
{
- System.out.println(multiplier);
this.crafter.inventory.mainInventory[slot]=IHLUtils.getWireItemStackCopyWithLengthMultiplied(stack,multiplier);
}
else
@@ -162,8 +177,23 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas
this.crafter.inventory.mainInventory[slot].stackSize*=multiplier;
}
}
+ Iterator<ItemStack> emptyContainers = this.inputMaterial.substract(crecipe.materials, multiplier).iterator();
+ while(emptyContainers.hasNext())
+ {
+ if(emptySlotsIterator.hasNext())
+ {
+ int slot = emptySlotsIterator.next();
+ ItemStack stack = emptyContainers.next();
+ this.crafter.inventory.mainInventory[slot]=stack.copy();
+ this.crafter.inventory.mainInventory[slot].stackSize*=multiplier;
+ }
+ else
+ {
+ EntityItem eistack = new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, emptyContainers.next());
+ this.worldObj.spawnEntityInWorld(eistack);
+ }
+ }
this.crafter.inventoryContainer.detectAndSendChanges();
- this.inputMaterial.substract(crecipe.materials, multiplier);
this.tools.damage(crecipe.tools);
if(!crecipe.workspaceElements.isEmpty())
{
@@ -196,9 +226,9 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas
return null;
}
- private List<Integer> getCrafterEmptyInventorySlotsList()
+ private Set<Integer> getCrafterEmptyInventorySlotsList()
{
- List<Integer> list = new ArrayList<Integer>();
+ Set<Integer> list = new HashSet<Integer>(4);
if(this.crafter!=null)
{
for (int var1 = 0; var1 < this.crafter.inventory.mainInventory.length; ++var1)
@@ -213,7 +243,7 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas
}
private List<RecipeInputObjectInstance> getListOfSameWires(ItemStack stack1) {
- List<RecipeInputObjectInstance> list = new ArrayList();
+ List<RecipeInputObjectInstance> list = new ArrayList<RecipeInputObjectInstance>();
for(int i=0; i<this.inputMaterial.size();i++)
{
ItemStack stack = this.inputMaterial.get(i);
@@ -361,7 +391,12 @@ public class IronWorkbenchTileEntity extends TileEntityInventory implements IHas
ri.remove();
}
}
-
}
+
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
+ {
+ this.readFromNBT(pkt.func_148857_g());
+ }
}
diff --git a/ihl/flexible_cable/IronWorkbenchTileEntity.java~ b/ihl/flexible_cable/IronWorkbenchTileEntity.java~
deleted file mode 100644
index 3821a0c..0000000
--- a/ihl/flexible_cable/IronWorkbenchTileEntity.java~
+++ /dev/null
@@ -1,367 +0,0 @@
-package ihl.flexible_cable;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import ic2.api.network.INetworkClientTileEntityEventListener;
-import ic2.api.network.INetworkTileEntityEventListener;
-import ic2.api.recipe.IRecipeInput;
-import ic2.api.recipe.RecipeInputItemStack;
-import ic2.core.ContainerBase;
-import ic2.core.IC2;
-import ic2.core.IHasGui;
-import ic2.core.Ic2Items;
-import ic2.core.block.TileEntityInventory;
-import ic2.core.block.invslot.InvSlot.Access;
-import ihl.IHLMod;
-import ihl.interfaces.IWire;
-import ihl.items_blocks.FlexibleCableItem;
-import ihl.processing.chemistry.GaedesMercuryRotaryPumpTileEntity;
-import ihl.processing.metallurgy.GasWeldingStationTileEntity;
-import ihl.recipes.IronWorkbenchRecipe;
-import ihl.recipes.RecipeInputDie;
-import ihl.recipes.RecipeInputObjectInstance;
-import ihl.utils.IHLUtils;
-
-public class IronWorkbenchTileEntity extends TileEntityInventory implements IHasGui, INetworkClientTileEntityEventListener, INetworkTileEntityEventListener{
-
- public static List<IronWorkbenchRecipe> recipes = new ArrayList();
- public int progress;
- public int currentSlot=-1;
- public final int maxProgress;
- public final InvSlotTool tools;
- public final InvSlotWorkspaceElement workspaceElements;
- public final InvSlotProcessableIronWorkbench inputMaterial;
- public final InvSlotOutputInProgress output;
- public boolean isGuiScreenOpened=false;
- private boolean startProcess=false;
- private boolean outputDefined=false;
- private EntityPlayer crafter;
- public ContainerBase<?> container;
- private Map<Integer, IronWorkbenchRecipe> slotRecipeMap = new HashMap();
-
- public IronWorkbenchTileEntity()
- {
- this.maxProgress=80;
- this.workspaceElements = new InvSlotWorkspaceElement(this, "workspaceElements", 3, Access.NONE, 6);
- this.tools=new InvSlotTool(this, "tools", 0, Access.IO, 12);
- this.inputMaterial=new InvSlotProcessableIronWorkbench(this, "input", 1, Access.IO, 12);
- this.output=new InvSlotOutputInProgress(this, "output", 2, 18);
- }
-
- public static void addRecipe(IronWorkbenchRecipe recipe)
- {
- IronWorkbenchTileEntity.recipes.add(recipe);
- }
-
- @Override
- public String getInventoryName()
- {
- return "ironWorkbench";
- }
-
-
- @Override
- public ItemStack getWrenchDrop(EntityPlayer player)
- {
- return IHLUtils.getThisModItemStack("ironWorkbench");
- }
-
- @Override
- public void updateEntityServer()
- {
- if(this.isGuiScreenOpened)
- {
- if(this.output.isEmpty() && !outputDefined)
- {
- this.workspaceElements.reset();
- Iterator<IronWorkbenchRecipe> iwri=IronWorkbenchTileEntity.recipes.iterator();
- while(iwri.hasNext())
- {
- IronWorkbenchRecipe recipe = iwri.next();
- if(recipe.isCanBeCrafted(this.tools.getItemStackList(), this.inputMaterial.getItemStackList(), this.workspaceElements.getItemStackList()))
- {
- if(recipe.workspaceElements==null || recipe.workspaceElements.isEmpty() || this.workspaceElements.containsAndCanUse(recipe.workspaceElements))
- {
- List<ItemStack> newOutputs = recipe.outputs;
- for(IRecipeInput rinput:recipe.tools)
- {
- if(rinput instanceof RecipeInputDie)
- {
- newOutputs = ((RecipeInputDie)rinput).transformOutput(this.getMatchedItemStack(rinput),recipe.outputs);
- }
- }
- int slot = this.output.put(newOutputs);
- if(slot<0)break;
- slotRecipeMap.put(slot, recipe);
- this.startProcess=false;
- }
- }
- }
- List<ItemStack> processingMaterials = new ArrayList<ItemStack>();
- for(int i=0; i<this.inputMaterial.size();i++)
- {
- ItemStack stack = this.inputMaterial.get(i);
- if(stack!=null && stack.getItem() instanceof IWire)
- {
- if(stack.stackTagCompound==null)
- {
- stack.stackTagCompound=new NBTTagCompound();
- }
- int fullLength = this.getFullLengthOfSameWires(stack);
- List<RecipeInputObjectInstance> list = this.getListOfSameWires(stack);
- ItemStack result = stack.copy();
- result.stackTagCompound.setInteger("length", fullLength);
- result.stackTagCompound.setInteger("fullLength", fullLength);
- IronWorkbenchRecipe recipe = new IronWorkbenchRecipe(null, list, Arrays.asList(new ItemStack[] {result}));
- int slot = this.output.put(recipe.outputs);
- if(slot<0)break;
- slotRecipeMap.put(slot, recipe);
- this.startProcess=false;
- break;
- }
- }
- outputDefined=true;
- }
- else if(!this.output.isEmpty())
- {
- List<Integer> crafterEmptyInventorySlotsList = getCrafterEmptyInventorySlotsList();
- if(startProcess && crafterEmptyInventorySlotsList.size()>=this.slotRecipeMap.get(currentSlot).outputs.size())
- {
- if(++this.progress>=this.maxProgress)
- {
- IronWorkbenchRecipe crecipe = this.slotRecipeMap.get(currentSlot);
- List<ItemStack> opts = this.output.getRecipeOutputs(currentSlot);
- int multiplier = this.inputMaterial.getMultiplier(crecipe.materials);
- Iterator<ItemStack> optsi = opts.iterator();
- Iterator<Integer> emptySlotsIterator = crafterEmptyInventorySlotsList.iterator();
- while(optsi.hasNext())
- {
- int slot = emptySlotsIterator.next();
- ItemStack stack = optsi.next();
- this.crafter.inventory.mainInventory[slot]=stack.copy();
- if(stack.getItem() instanceof IWire)
- {
- System.out.println(multiplier);
- this.crafter.inventory.mainInventory[slot]=IHLUtils.getWireItemStackCopyWithLengthMultiplied(stack,multiplier);
- }
- else
- {
- this.crafter.inventory.mainInventory[slot]=stack.copy();
- this.crafter.inventory.mainInventory[slot].stackSize*=multiplier;
- }
- }
- this.crafter.inventoryContainer.detectAndSendChanges();
- this.inputMaterial.substract(crecipe.materials, multiplier);
- this.tools.damage(crecipe.tools);
- if(!crecipe.workspaceElements.isEmpty())
- {
- this.workspaceElements.use(crecipe.workspaceElements);
- }
- this.resetOutput();
- }
- }
- }
- }
- }
-
- private ItemStack getMatchedItemStack(IRecipeInput rinput)
- {
- for(ItemStack tool:this.tools.getItemStackList())
- {
- if(rinput.matches(tool))
- {
- return tool;
- }
- }
- for(ItemStack material:this.inputMaterial.getItemStackList())
- {
- if(rinput.matches(material))
- {
- return material;
- }
- }
-
- return null;
- }
-
- private List<Integer> getCrafterEmptyInventorySlotsList()
- {
- List<Integer> list = new ArrayList<Integer>();
- if(this.crafter!=null)
- {
- for (int var1 = 0; var1 < this.crafter.inventory.mainInventory.length; ++var1)
- {
- if (this.crafter.inventory.mainInventory[var1] == null)
- {
- list.add(var1);
- }
- }
- }
- return list;
- }
-
- private List<RecipeInputObjectInstance> getListOfSameWires(ItemStack stack1) {
- List<RecipeInputObjectInstance> list = new ArrayList();
- for(int i=0; i<this.inputMaterial.size();i++)
- {
- ItemStack stack = this.inputMaterial.get(i);
- if(stack!=null && ((IWire)stack1.getItem()).isSameWire(stack1, stack))
- {
- list.add(new RecipeInputObjectInstance(stack));
- }
- }
- return list;
- }
-
- private int getFullLengthOfSameWires(ItemStack stack1) {
- int fullLength=0;
- for(int i=0; i<this.inputMaterial.size();i++)
- {
- ItemStack stack = this.inputMaterial.get(i);
- if(stack!=null && ((IWire)stack1.getItem()).isSameWire(stack1, stack))
- {
- fullLength += IHLUtils.getWireLength(stack);
- }
- }
- return fullLength;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public GuiScreen getGui(EntityPlayer player, boolean arg1) {
- return new IronWorkbenchGui(new IronWorkbenchContainer(player, this));
- }
-
- @Override
- public ContainerBase<?> getGuiContainer(EntityPlayer player) {
- resetOutput();
- this.isGuiScreenOpened=true;
- this.crafter=player;
- container = new IronWorkbenchContainer(player, this);
- return container;
- }
-
- @Override
- public void onGuiClosed(EntityPlayer arg0)
- {
- this.isGuiScreenOpened=false;
- }
-
- @Override
- public void onNetworkEvent(EntityPlayer player, int event)
- {
- if(event==16)
- {
- this.isGuiScreenOpened=false;
- this.crafter=null;
- this.container=null;
- return;
- }
- for(int i=event;i>=0;i--)
- {
- if(this.slotRecipeMap.containsKey(i))
- {
- if(!this.slotRecipeMap.get(i).isCanBeCrafted(this.tools.getItemStackList(), this.inputMaterial.getItemStackList(), this.workspaceElements.getItemStackList()))
- {
- resetOutput();
- }
- else
- {
- this.currentSlot=i;
- this.startProcess=true;
- return;
- }
- }
- }
- }
-
- public void resetOutput()
- {
- this.output.clear();
- this.slotRecipeMap.clear();
- this.progress=0;
- this.startProcess=false;
- this.currentSlot=-1;
- this.outputDefined=false;
- }
-
-
- public void dropContents() {
- for(int i=0;i<this.tools.size();i++)
- {
- if(this.tools.get(i)!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.tools.get(i)));
- }
- for(int i=0;i<this.inputMaterial.size();i++)
- {
- if(this.inputMaterial.get(i)!=null)this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord, this.yCoord+1, this.zCoord, this.inputMaterial.get(i)));
- }
- }
-
- @Override
- public void onNetworkEvent(int event)
- {
-
- }
-
- public int gaugeProgressScaled(int i)
- {
- return this.progress * i / this.maxProgress;
- }
-
- @Override
- public boolean shouldRenderInPass(int pass)
- {
- return pass==0;
- }
-
- public static void removeRecipeByOutput(List<ItemStack> recipeOutputsItems)
- {
- Iterator<IronWorkbenchRecipe> ri = recipes.iterator();
- while(ri.hasNext())
- {
- IronWorkbenchRecipe recipe = ri.next();
- boolean removeEntry=false;
- Iterator<ItemStack> roi = recipe.outputs.iterator();
- while(roi.hasNext())
- {
- if(IHLUtils.isItemStacksIsEqual(recipeOutputsItems.get(0), roi.next(), true))
- {
- removeEntry=true;
- }
- }
- if(removeEntry)
- {
- ri.remove();
- }
- }
-
- }
-
- public static void removeRecipeByInput(List<IRecipeInput> recipeInputsTools1,List<IRecipeInput> recipeInputsItems1,List<ItemStack> recipeInputsMachines) {
- List<ItemStack> recipeInputsTools = IHLUtils.convertRecipeInputToItemStackList(recipeInputsTools1);
- List<ItemStack> recipeInputsItems = IHLUtils.convertRecipeInputToItemStackList(recipeInputsItems1);
- Iterator<IronWorkbenchRecipe> ri = recipes.iterator();
- while(ri.hasNext())
- {
- IronWorkbenchRecipe recipe = ri.next();
- if(recipe.isCanBeCrafted(recipeInputsTools, recipeInputsItems, recipeInputsMachines))
- {
- ri.remove();
- }
- }
-
- }
-
-}
diff --git a/ihl/flexible_cable/NodeEntity.java b/ihl/flexible_cable/NodeEntity.java
index 623c9a1..b734cd1 100644
--- a/ihl/flexible_cable/NodeEntity.java
+++ b/ihl/flexible_cable/NodeEntity.java
@@ -6,36 +6,25 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
import ihl.IHLMod;
import ihl.IHLModInfo;
import ihl.interfaces.ICableHolder;
-import ihl.interfaces.IDataCableHolder;
-import ihl.interfaces.IEnergyNetNode;
import ihl.interfaces.IMultiPowerCableHolder;
import ihl.interfaces.INetworkListener;
import ihl.items_blocks.FlexibleCableItem;
-import ihl.utils.IHLUtils;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.ByteBufOutputStream;
import io.netty.buffer.Unpooled;
import net.minecraft.block.Block;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
@@ -109,6 +98,7 @@ public class NodeEntity extends Entity implements INetworkListener{
@Override
public void travelToDimension(int dimensionId){}
+ @Override
public void setSize(float width, float heigth)
{
super.setSize(width, heigth);
@@ -122,6 +112,7 @@ public class NodeEntity extends Entity implements INetworkListener{
this.registerAndSendData(null);
}
+ @Override
public void registerAndSendData(EntityPlayerMP player)
{
if(!worldObj.isRemote)
@@ -135,7 +126,7 @@ public class NodeEntity extends Entity implements INetworkListener{
}
else
{
- nes=new HashSet();
+ nes=new HashSet<NodeEntity>();
IHLMod.proxy.nodeEntityRegistry.put(this.getChainUniqueID(),nes);
}
nes.add(this);
@@ -172,7 +163,8 @@ public class NodeEntity extends Entity implements INetworkListener{
}
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void onUpdate()
{
super.onUpdate();
@@ -194,7 +186,7 @@ public class NodeEntity extends Entity implements INetworkListener{
List<NodeEntity> eItemsList = this.worldObj.getEntitiesWithinAABB(NodeEntity.class, searchArea);
if(!eItemsList.isEmpty())
{
- Iterator ei = eItemsList.iterator();
+ Iterator<NodeEntity> ei = eItemsList.iterator();
while(ei.hasNext())
{
NodeEntity node=(NodeEntity) ei.next();
@@ -227,7 +219,7 @@ public class NodeEntity extends Entity implements INetworkListener{
List<EntityPlayer> eItemsList = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, searchArea);
if(!eItemsList.isEmpty())
{
- Iterator ei = eItemsList.iterator();
+ Iterator<EntityPlayer> ei = eItemsList.iterator();
while(ei.hasNext())
{
EntityPlayer player=(EntityPlayer) ei.next();
@@ -415,15 +407,10 @@ public class NodeEntity extends Entity implements INetworkListener{
xi=(dx1-2*x1+2*dx0+2*x0-dx0)*i*i*i+(3*x1-dx1-3*dx0-3*x0+dx0)*i*i+dx0*i+x0;
yi=(dy1-2*y1+2*dy0+2*y0-dy0)*i*i*i+(3*y1-dy1-3*dy0-3*y0+dy0)*i*i+dy0*i+y0;
zi=(dz1-2*z1+2*dz0+2*z0-dz0)*i*i*i+(3*z1-dz1-3*dz0-3*z0+dz0)*i*i+dz0*i+z0;
- int blockX=(int)xi;
- int blockY=(int)yi;
- int blockZ=(int)zi;
dxi-=xi;
dyi-=yi;
dzi-=zi;
double var7 = MathHelper.sqrt_double(dxi * dxi + dzi * dzi);
- float var9 = (float)(Math.atan2(dzi, dxi) * 180.0D / Math.PI) - 90.0F;
- float var10 = (float)(-(Math.atan2(dyi, var7) * 180.0D / Math.PI));
float rotationPitch = (float) Math.atan2(dxi, dzi);
float rotationYaw = (float) (-Math.atan2(dyi, var7));
rotationPitchArray[i1]=rotationPitch;
diff --git a/ihl/flexible_cable/NodeRender.java b/ihl/flexible_cable/NodeRender.java
index 61c272b..157be67 100644
--- a/ihl/flexible_cable/NodeRender.java
+++ b/ihl/flexible_cable/NodeRender.java
@@ -1,19 +1,11 @@
package ihl.flexible_cable;
import ihl.IHLModInfo;
-import ihl.model.IHLModelRenderer;
import ihl.model.ModelTube;
-import ihl.utils.IHLMathUtils;
-import ihl.utils.IHLRenderUtils;
-import net.minecraft.client.model.ModelBase;
-import net.minecraft.client.model.ModelBox;
-import net.minecraft.client.renderer.ActiveRenderInfo;
-import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
-import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;
@@ -26,7 +18,6 @@ public class NodeRender extends Render
private ModelTube modelThin;
private ResourceLocation tex;
private float scale;
- private boolean firstTick=true;
public NodeRender()
{
diff --git a/ihl/flexible_cable/PowerCableNodeEntity.java b/ihl/flexible_cable/PowerCableNodeEntity.java
index 42d07fd..ed5a7ea 100644
--- a/ihl/flexible_cable/PowerCableNodeEntity.java
+++ b/ihl/flexible_cable/PowerCableNodeEntity.java
@@ -1,34 +1,22 @@
package ihl.flexible_cable;
-import java.util.ArrayList;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import ic2.api.network.INetworkClientTileEntityEventListener;
-import ic2.core.IC2;
import ic2.core.IC2DamageSource;
import ic2.core.item.armor.ItemArmorHazmat;
import ihl.IHLMod;
import ihl.IHLModInfo;
-import ihl.interfaces.IDataCableHolder;
import ihl.interfaces.IEnergyNetNode;
import ihl.utils.IHLUtils;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.network.play.server.S26PacketMapChunkBulk;
import net.minecraft.network.play.server.S29PacketSoundEffect;
import net.minecraft.network.play.server.S2APacketParticles;
-import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class PowerCableNodeEntity extends NodeEntity implements IEnergyNetNode{
@@ -56,6 +44,8 @@ public class PowerCableNodeEntity extends NodeEntity implements IEnergyNetNode{
return !worldObj.isRemote && !this.noClip;
}
+ @SuppressWarnings("unchecked")
+ @Override
public void onUpdate()
{
super.onUpdate();
@@ -191,7 +181,7 @@ public class PowerCableNodeEntity extends NodeEntity implements IEnergyNetNode{
public Set<NBTTagCompound> getCableList() {
if(cableList==null)
{
- cableList=new HashSet(1);
+ cableList=new HashSet<NBTTagCompound>(1);
if(this.cable!=null)
{
cableList.add(this.cable);
diff --git a/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java b/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java
index 1d13d0a..484df85 100644
--- a/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java
+++ b/ihl/flexible_cable/RectifierTransformerUnitTileEntity.java
@@ -1,6 +1,5 @@
package ihl.flexible_cable;
-import java.util.Iterator;
import java.util.List;
import ic2.api.energy.event.EnergyTileLoadEvent;
@@ -8,15 +7,10 @@ import ic2.api.energy.event.EnergyTileUnloadEvent;
import ic2.api.energy.tile.IEnergySink;
import ic2.api.network.INetworkClientTileEntityEventListener;
import ic2.core.IC2;
-import ic2.core.block.TileEntityBlock;
import ic2.core.block.TileEntityInventory;
-import ihl.IHLMod;
-import ihl.flexible_cable.IHLGrid;
-import ihl.flexible_cable.NodeEntity;
import ihl.interfaces.IEnergyNetNode;
import ihl.interfaces.IMultiPowerCableHolder;
import ihl.utils.IHLUtils;
-import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -280,6 +274,7 @@ public class RectifierTransformerUnitTileEntity extends TileEntityInventory impl
return amount;
}
+ @Override
public boolean isCableRemoved(int chainUniqueID)
{
if(!checkCables)
diff --git a/ihl/flexible_cable/SetOfDiesMiniGUI.java b/ihl/flexible_cable/SetOfDiesMiniGUI.java
index c00a19b..43f905d 100644
--- a/ihl/flexible_cable/SetOfDiesMiniGUI.java
+++ b/ihl/flexible_cable/SetOfDiesMiniGUI.java
@@ -1,9 +1,6 @@
package ihl.flexible_cable;
import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.util.regex.Pattern;
-
import org.lwjgl.opengl.GL11;
import net.minecraft.client.gui.GuiTextField;
@@ -20,7 +17,6 @@ public class SetOfDiesMiniGUI extends ItemMiniGUI
private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIIronWorkbench.png");
private int transverseSectionValue;
private GuiTextField transverseSectionTextField;
- private boolean leftMouseButtonPressed=false;
private int xPos;
private int yPos;
diff --git a/ihl/flexible_cable/SubAnchorEnergyNetNode.java b/ihl/flexible_cable/SubAnchorEnergyNetNode.java
index 6b84dd8..33f9fb3 100644
--- a/ihl/flexible_cable/SubAnchorEnergyNetNode.java
+++ b/ihl/flexible_cable/SubAnchorEnergyNetNode.java
@@ -1,13 +1,9 @@
package ihl.flexible_cable;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
@@ -16,9 +12,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import ic2.api.energy.EnergyNet;
import ic2.api.energy.event.EnergyTileLoadEvent;
import ic2.api.energy.event.EnergyTileUnloadEvent;
-import ic2.api.energy.tile.IEnergyConductor;
import ic2.api.energy.tile.IEnergySink;
-import ic2.api.energy.tile.IEnergySource;
import ic2.core.IC2;
import ihl.IHLMod;
import ihl.interfaces.IEnergyNetNode;
@@ -29,7 +23,7 @@ public class SubAnchorEnergyNetNode implements IEnergyNetNode{
private AnchorTileEntity base;
private short facing;
private int gridID=-1;
- private Set<NBTTagCompound> cableList = new HashSet();
+ private Set<NBTTagCompound> cableList = new HashSet<NBTTagCompound>();
public SubAnchorEnergyNetNode(AnchorTileEntity base1, short facing1)
{
diff --git a/ihl/flexible_cable/SubRTUEnergyNetNode.java b/ihl/flexible_cable/SubRTUEnergyNetNode.java
index 2dd0673..c068ba0 100644
--- a/ihl/flexible_cable/SubRTUEnergyNetNode.java
+++ b/ihl/flexible_cable/SubRTUEnergyNetNode.java
@@ -1,13 +1,9 @@
package ihl.flexible_cable;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.MinecraftForge;
@@ -23,7 +19,7 @@ public class SubRTUEnergyNetNode implements IEnergyNetNode{
private RectifierTransformerUnitTileEntity base;
private short side;
private int gridID=-1;
- private Set<NBTTagCompound> cableList = new HashSet();
+ private Set<NBTTagCompound> cableList = new HashSet<NBTTagCompound>();
public SubRTUEnergyNetNode(RectifierTransformerUnitTileEntity base1, short facing1)
{
diff --git a/ihl/guidebook/IHLGuidebookGui.java b/ihl/guidebook/IHLGuidebookGui.java
index 343f522..316660b 100644
--- a/ihl/guidebook/IHLGuidebookGui.java
+++ b/ihl/guidebook/IHLGuidebookGui.java
@@ -9,7 +9,6 @@ import org.xml.sax.SAXException;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
@@ -22,14 +21,10 @@ public class IHLGuidebookGui extends GuiContainer
public IHLGuidebookContainer container;
private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIGuidebook.png");
public Map<Integer, Integer[]> linksCoordinatesMap = new HashMap<Integer,Integer[]>();
- private GuiInvisibleButton prevPageAreaButton;
- private GuiInvisibleButton nextPageAreaButton;
private String title;
private String[] localisedContent=new String[2];;// By text block and row
private ResourceLocation[] resourceLocationCache = new ResourceLocation[16];//By section number
private int currentSection=0;
- private int textBlockNumberOnPageTurn=0;
- private int stringNumberOnPageTurn=0;
private final int titleX=25;
private final int titleY=7;
private final int textBlockWidth=104;
@@ -39,8 +34,6 @@ public class IHLGuidebookGui extends GuiContainer
private final int textBlockY2=5;
private final int textBlockMaxY=200;
private int stringHeight=10;
- private int textRowInRightPage=0;
- private int textBlockInRightPage=0;
private int textRowInNextPage=0;
private int textBlockInNextPage=0;
private int[] textRowStart=new int[2];
@@ -62,8 +55,8 @@ public class IHLGuidebookGui extends GuiContainer
super.initGui();
int x = (width - xSize) / 2;
int y = (height - ySize) / 2;
- prevPageAreaButton = new GuiInvisibleButton(0, x, y, xSize/2, 162, linksCoordinatesMap, buttonList);
- nextPageAreaButton = new GuiInvisibleButton(1, x+xSize/2, y, xSize/2, 162, linksCoordinatesMap, buttonList);
+ new GuiInvisibleButton(0, x, y, xSize/2, 162, linksCoordinatesMap, buttonList);
+ new GuiInvisibleButton(1, x+xSize/2, y, xSize/2, 162, linksCoordinatesMap, buttonList);
this.clear();
try {
IHLMod.xmlparser.setupGuidebookGUI(this, 0);
@@ -147,15 +140,11 @@ public class IHLGuidebookGui extends GuiContainer
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
IHLRenderUtils.instance.updateScreenSize();
- this.textRowInRightPage=0;
- this.textBlockInRightPage=0;
this.drawPage(this.textBlockX1,this.textBlockY1);
}
private void drawPage(int startX, int startY)
{
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.fontRendererObj.drawString(this.title, this.titleX, this.titleY, 0);
int xPos=startX;
@@ -192,7 +181,6 @@ public class IHLGuidebookGui extends GuiContainer
if(yPos+this.pictureHeight<this.textBlockMaxY)
{
yPos+=stringHeight;
- ITextureObject texture = this.mc.renderEngine.getTexture(this.resourceLocationCache[this.currentSection]);
this.mc.renderEngine.bindTexture(this.resourceLocationCache[this.currentSection]);
this.drawTexturedModalRect(Math.round(xPos), Math.round(yPos), 0, 0, this.pictureWidth, this.pictureHeight);
yPos+=Math.round(this.pictureHeight);
diff --git a/ihl/handpump/AdvancedHandPump.java b/ihl/handpump/AdvancedHandPump.java
index dc13ce2..c655391 100644
--- a/ihl/handpump/AdvancedHandPump.java
+++ b/ihl/handpump/AdvancedHandPump.java
@@ -245,7 +245,7 @@ public class AdvancedHandPump extends IHLHandPump {
}
else {break;}
}
- List<XYZ> xyzlist = new ArrayList();
+ List<XYZ> xyzlist = new ArrayList<XYZ>();
if(currentFlowDecay==0)
{
xyzlist.add(new XYZ(startx, starty, startz));
diff --git a/ihl/handpump/IHLHandPump.java b/ihl/handpump/IHLHandPump.java
index b04b3a0..29192e2 100644
--- a/ihl/handpump/IHLHandPump.java
+++ b/ihl/handpump/IHLHandPump.java
@@ -182,13 +182,14 @@ public class IHLHandPump extends Item implements IElectricItem, IBoxable, IItemH
@Override
public List<String> getHudInfo(ItemStack itemStack) {
- LinkedList info = new LinkedList();
+ LinkedList<String> info = new LinkedList<String>();
info.add(ElectricItem.manager.getToolTip(itemStack));
info.add("Power Tier: " + this.tier);
return info;
}
- @Override
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b)
{
info.add("PowerTier: " + this.tier);
@@ -207,6 +208,7 @@ public class IHLHandPump extends Item implements IElectricItem, IBoxable, IItemH
@Override
@SideOnly(Side.CLIENT)
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
itemList.add(this.getItemStack(this.maxCharge));
diff --git a/ihl/i_hate_liquids/BlockDynamicLiquidPlus.java b/ihl/i_hate_liquids/BlockDynamicLiquidPlus.java
index 7b7a8d7..ed8ddac 100644
--- a/ihl/i_hate_liquids/BlockDynamicLiquidPlus.java
+++ b/ihl/i_hate_liquids/BlockDynamicLiquidPlus.java
@@ -46,7 +46,6 @@ public class BlockDynamicLiquidPlus extends BlockLiquid{
}
int meta2=16;
int fd;
- Block block;
int xz[] = {0,-1,0,1,0};
for(int i=0;i<=3;i++)
{
diff --git a/ihl/i_hate_liquids/InvisibleMagicanEntity.java b/ihl/i_hate_liquids/InvisibleMagicanEntity.java
index 88539dc..2ad56d3 100644
--- a/ihl/i_hate_liquids/InvisibleMagicanEntity.java
+++ b/ihl/i_hate_liquids/InvisibleMagicanEntity.java
@@ -14,14 +14,13 @@ import net.minecraftforge.fluids.IFluidBlock;
public class InvisibleMagicanEntity extends Entity {
private int entityAge=0;
- private int timer=0;
private int viscosityTimer=0;
private int viscosity=5;
public int x0=0;
public int y0=0;
public int z0=0;
- public List<XYZ> flowXYZ = new ArrayList();
- public List<Block> blockList = new ArrayList();
+ public List<XYZ> flowXYZ = new ArrayList<XYZ>();
+ public List<Block> blockList = new ArrayList<Block>();
private Block block;
private int lowestPointsCounter=0;
@@ -103,7 +102,6 @@ public class InvisibleMagicanEntity extends Entity {
xyz = this.flowXYZ.remove(0);
if(this.flowXYZ.isEmpty())
{
- this.timer=0;
Block block1=this.blockList.get(0);
//System.out.println("Trying to create new source");
if(this.setBlock(xyz.x, xyz.y, xyz.z, block1))
@@ -182,115 +180,6 @@ public class InvisibleMagicanEntity extends Entity {
return block.getMaterial().isLiquid() ? this.worldObj.getBlockMetadata(par2, par3, par4) : -1;
}
- private boolean writeLowestFlowPoint()
- {
- int startx = this.x0;
- int starty = this.y0;
- int startz = this.z0;
- int currentFlowDecay=getFlowDecay(startx, starty, startz);
- for (int i=0; i<64;i++)
- {
- //Go search up, if possible.
- if(getFlowDecay(startx, starty+1, startz)>=0)
- {
- starty++;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
-
- else if(getFlowDecay(startx+1, starty+1, startz)>=0)
- {
- starty++;
- startx++;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
-
- else if(getFlowDecay(startx-1, starty+1, startz)>=0)
- {
- starty++;
- startx--;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
-
- else if(getFlowDecay(startx, starty+1, startz+1)>=0)
- {
- starty++;
- startz++;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
-
- else if(getFlowDecay(startx, starty+1, startz-1)>=0)
- {
- starty++;
- startz--;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
- //Start checking neighbor blocks to lower flow decay.
- else if(getFlowDecay(startx-1, starty, startz)<currentFlowDecay&&getFlowDecay(startx-1, starty, startz)!=-1)
- {
- startx--;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
- else if(getFlowDecay(startx, starty, startz+1)<currentFlowDecay&&getFlowDecay(startx, starty, startz+1)!=-1)
- {
- startz++;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
- else if(getFlowDecay(startx, starty, startz-1)<currentFlowDecay&&getFlowDecay(startx, starty, startz-1)!=-1)
- {
- startz--;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
- else if(getFlowDecay(startx+1, starty, startz)<currentFlowDecay&&getFlowDecay(startx+1, starty, startz)!=-1)
- {
- startx++;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
- else if(currentFlowDecay==0)
- {
- break;
- }
- else if(getFlowDecay(startx-1, starty, startz)==currentFlowDecay&&getFlowDecay(startx-1, starty, startz)!=-1)
- {
- startx--;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
- else if(getFlowDecay(startx, starty, startz+1)==currentFlowDecay&&getFlowDecay(startx, starty, startz+1)!=-1)
- {
- startz++;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
- else if(getFlowDecay(startx, starty, startz-1)==currentFlowDecay&&getFlowDecay(startx, starty, startz-1)!=-1)
- {
- startz--;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
- else if(getFlowDecay(startx+1, starty, startz)==currentFlowDecay&&getFlowDecay(startx+1, starty, startz)!=-1)
- {
- startx++;
- currentFlowDecay=getFlowDecay(startx, starty, startz);
- }
- else {break;}
- }
- if(currentFlowDecay==0)
- {
- Block block1 = this.worldObj.getBlock(startx, starty, startz);
- if(this.replaceBlock(startx, starty, startz, block1))
- {
- this.block=block1;
- return true;
- }
- }
- else if(currentFlowDecay>=7)
- {
- this.worldObj.setBlockToAir(startx, starty, startz);
- }
- else
- {
- this.worldObj.setBlockMetadataWithNotify(startx, starty, startz, currentFlowDecay+1, 0);
- }
- return false;
- }
-
public boolean replaceBlock(int x,int y,int z, Block block)
{
if(!IHLMod.cccFiniteWater&&(block==Blocks.flowing_water || block==Blocks.water))
@@ -394,8 +283,7 @@ public class InvisibleMagicanEntity extends Entity {
int x=x0;
int y=y0;
int z=z0;
- List list = new ArrayList();
- list.clear();
+ List<Long> list = new ArrayList<Long>();
this.flowXYZ.clear();
for(int thread=0;thread<=256;thread++)
{
@@ -502,7 +390,7 @@ public class InvisibleMagicanEntity extends Entity {
}
else {break;}
}
- List<XYZ> xyzlist = new ArrayList();
+ List<XYZ> xyzlist = new ArrayList<XYZ>();
if(currentFlowDecay==0)
{
xyzlist.add(new XYZ(startx, starty, startz));
diff --git a/ihl/interfaces/IDataCableHolder.java b/ihl/interfaces/IDataCableHolder.java
index 1bdaba1..f527f1b 100644
--- a/ihl/interfaces/IDataCableHolder.java
+++ b/ihl/interfaces/IDataCableHolder.java
@@ -1,12 +1,6 @@
package ihl.interfaces;
import ihl.datanet.Contact;
-import ihl.processing.invslots.InvSlotSignalProcessor;
-
-import java.util.Set;
-
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public interface IDataCableHolder extends ICableHolder
diff --git a/ihl/interfaces/IItemHasMiniGUI.java b/ihl/interfaces/IItemHasMiniGUI.java
index ce7badf..155d07b 100644
--- a/ihl/interfaces/IItemHasMiniGUI.java
+++ b/ihl/interfaces/IItemHasMiniGUI.java
@@ -2,7 +2,6 @@ package ihl.interfaces;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
diff --git a/ihl/interfaces/INetworkListener.java b/ihl/interfaces/INetworkListener.java
index 042177d..53f10d5 100644
--- a/ihl/interfaces/INetworkListener.java
+++ b/ihl/interfaces/INetworkListener.java
@@ -1,7 +1,6 @@
package ihl.interfaces;
import net.minecraft.entity.player.EntityPlayerMP;
-import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufInputStream;
public interface INetworkListener
diff --git a/ihl/interfaces/ItemMiniGUI.java b/ihl/interfaces/ItemMiniGUI.java
index 3b9a53d..4be2fe9 100644
--- a/ihl/interfaces/ItemMiniGUI.java
+++ b/ihl/interfaces/ItemMiniGUI.java
@@ -1,10 +1,7 @@
package ihl.interfaces;
-import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.Slot;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
public abstract class ItemMiniGUI
{
diff --git a/ihl/items_blocks/FiberItem.java b/ihl/items_blocks/FiberItem.java
index 0682abb..73d62f3 100644
--- a/ihl/items_blocks/FiberItem.java
+++ b/ihl/items_blocks/FiberItem.java
@@ -47,7 +47,8 @@ public class FiberItem extends Item implements IWire {
}
}
- @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
@@ -59,6 +60,7 @@ public class FiberItem extends Item implements IWire {
}
@Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
{
if(itemStack.stackTagCompound!=null)
diff --git a/ihl/items_blocks/FlexibleCableItem.java b/ihl/items_blocks/FlexibleCableItem.java
index 11023c4..54710cb 100644
--- a/ihl/items_blocks/FlexibleCableItem.java
+++ b/ihl/items_blocks/FlexibleCableItem.java
@@ -1,34 +1,23 @@
package ihl.items_blocks;
-import java.util.ArrayList;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Set;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
-import net.minecraft.util.MathHelper;
-import net.minecraft.util.MovingObjectPosition;
-import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import ic2.api.energy.tile.IEnergyTile;
@@ -60,7 +49,7 @@ public class FlexibleCableItem extends Item implements IWire {
insulatedIronRuber,
insulatedThickIronRuber;
public static FlexibleCableItem instance;
- public final Set<String> yellowColoredWires = new HashSet(3);
+ public final Set<String> yellowColoredWires = new HashSet<String>(3);
public boolean isDataCable=false;
public FlexibleCableItem()
@@ -77,6 +66,7 @@ public class FlexibleCableItem extends Item implements IWire {
@Override
@SideOnly(Side.CLIENT)
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
itemList.add(IHLUtils.getUninsulatedWire("Copper", 160, 15));
@@ -98,7 +88,8 @@ public class FlexibleCableItem extends Item implements IWire {
GameRegistry.registerItem(new FlexibleCableItem(),"copperWire");
}
- public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
+ @Override
+ public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
{
TileEntity t = world.getTileEntity(x, y, z);
short facing = IHLUtils.getFacingFromPlayerView(player, true);
@@ -173,11 +164,11 @@ public class FlexibleCableItem extends Item implements IWire {
{
if(t2 instanceof IMultiPowerCableHolder)
{
- te = ((IMultiPowerCableHolder)t).getEnergyNetNode(facing);
+ te = ((IMultiPowerCableHolder)t2).getEnergyNetNode(facing);
}
else
{
- te = (ICableHolder)t;
+ te = (ICableHolder)t2;
}
te.setCableCheck(true);
}
@@ -447,6 +438,7 @@ public class FlexibleCableItem extends Item implements IWire {
}
@Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
{
if(itemStack.stackTagCompound!=null)
diff --git a/ihl/items_blocks/FlexiblePipeItem.java b/ihl/items_blocks/FlexiblePipeItem.java
index 5de333f..5f1522e 100644
--- a/ihl/items_blocks/FlexiblePipeItem.java
+++ b/ihl/items_blocks/FlexiblePipeItem.java
@@ -21,10 +21,8 @@ import ihl.utils.IHLUtils;
public class FlexiblePipeItem extends Item implements IWire {
- private static Map<Integer, IIcon> iconMap = new HashMap();
- private static Map<Integer, String> nameMap = new HashMap();
- private static Map<Integer, String> infoMap = new HashMap();
- private static Map<Integer, Type> materialMap = new HashMap();
+ private static Map<Integer, IIcon> iconMap = new HashMap<Integer, IIcon>();
+ private static Map<Integer, String> nameMap = new HashMap<Integer, String>();
public FlexiblePipeItem()
{
@@ -46,7 +44,8 @@ public class FlexiblePipeItem extends Item implements IWire {
}
}
- @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
@@ -62,6 +61,7 @@ public class FlexiblePipeItem extends Item implements IWire {
}
@Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
{
if(itemStack.stackTagCompound!=null)
diff --git a/ihl/items_blocks/IHLItemBlock.java b/ihl/items_blocks/IHLItemBlock.java
index 8ac81a2..3bde475 100644
--- a/ihl/items_blocks/IHLItemBlock.java
+++ b/ihl/items_blocks/IHLItemBlock.java
@@ -14,7 +14,6 @@ import ihl.collector.ChargerEjectorTileEntity;
import ihl.processing.metallurgy.PassiveBlock;
import ihl.tunneling_shield.DriverTileEntity;
import net.minecraft.block.Block;
-import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -27,7 +26,7 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
public class IHLItemBlock extends ItemBlock{
- public Map<Integer, String> nameMap = new HashMap();
+ public Map<Integer, String> nameMap = new HashMap<Integer, String>();
public IHLItemBlock(Block block1)
{
super(block1);
@@ -216,9 +215,10 @@ public class IHLItemBlock extends ItemBlock{
}
@Override
+ @SideOnly(Side.CLIENT)
public CreativeTabs getCreativeTab()
{
- return IHLCreativeTab.tab;
+ return this.field_150939_a.getCreativeTabToDisplayOn();
}
@Override
@@ -255,12 +255,18 @@ public class IHLItemBlock extends ItemBlock{
return false;
}
- @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
{
if(itemStack.stackTagCompound!=null && itemStack.stackTagCompound.hasKey("resultSuffix"))
{
- info.add(StatCollector.translateToLocal("result_of_molding") + StatCollector.translateToLocal("ihl."+itemStack.stackTagCompound.getString("resultSuffix")));
+ String result_suffix = itemStack.stackTagCompound.getString("resultSuffix");
+ if(StatCollector.canTranslate("ihl."+result_suffix))
+ {
+ result_suffix = StatCollector.translateToLocal("ihl."+result_suffix);
+ }
+ info.add(StatCollector.translateToLocal("result_of_molding")+result_suffix);
if(itemStack.stackTagCompound.hasKey("isContainStearin") && itemStack.stackTagCompound.getBoolean("isContainStearin"))
{
info.add(StatCollector.translateToLocal("ihl.tooltip.step")+" 1: "+StatCollector.translateToLocal("remove_wax_using_muffle_furnace"));
@@ -275,6 +281,10 @@ public class IHLItemBlock extends ItemBlock{
info.add(StatCollector.translateToLocal("ihl.tooltip.step")+" 2: "+StatCollector.translateToLocal("wait_for_10_seconds"));
info.add(StatCollector.translateToLocal("ihl.tooltip.step")+" 3: "+StatCollector.translateToLocal("destroy_mold_to_get_results"));
}
+ if(itemStack.stackTagCompound.hasKey("detonator_delay"))
+ {
+ info.add(StatCollector.translateToLocal("ihl.detonator_delay")+" "+itemStack.stackTagCompound.getInteger("detonator_delay")+StatCollector.translateToLocal("ihl.seconds"));
+ }
}
}
}
diff --git a/ihl/items_blocks/IHLTool.java b/ihl/items_blocks/IHLTool.java
index 7ddf3fb..4e51b5b 100644
--- a/ihl/items_blocks/IHLTool.java
+++ b/ihl/items_blocks/IHLTool.java
@@ -35,7 +35,6 @@ import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.reactor.IReactor;
import ic2.core.Ic2Items;
import ihl.IHLCreativeTab;
-import ihl.IHLMod;
import ihl.IHLModInfo;
import ihl.flexible_cable.SetOfDiesMiniGUI;
import ihl.interfaces.IHasTemperature;
@@ -44,12 +43,11 @@ import ihl.interfaces.ItemMiniGUI;
import ihl.utils.IHLUtils;
public class IHLTool extends Item implements IItemHasMiniGUI{
- private static Map<Integer, IIcon> iconMap = new HashMap();
- private static Map<Integer, String> nameMap = new HashMap();
- private static Map<Integer, String> hintMap = new HashMap();
- private static Map<Integer, Integer> maxToolDamageMap = new HashMap();
- private static Map<Integer, Boolean> isWeaponMap = new HashMap();
- private static Map<Integer, Float> damageVersusEntityMap = new HashMap();
+ private static Map<Integer, IIcon> iconMap = new HashMap<Integer, IIcon>();
+ private static Map<Integer, String> nameMap = new HashMap<Integer, String>();
+ private static Map<Integer, String> hintMap = new HashMap<Integer, String>();
+ private static Map<Integer, Boolean> isWeaponMap = new HashMap<Integer, Boolean>();
+ private static Map<Integer, Float> damageVersusEntityMap = new HashMap<Integer, Float>();
public static Item instance;
private IIcon dice240;
@@ -163,7 +161,8 @@ public class IHLTool extends Item implements IItemHasMiniGUI{
@Override
@SideOnly(Side.CLIENT)
- public void getSubItems(Item item, CreativeTabs tabs, List itemList)
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
Type[] var1 = Type.values();
for(int i=0;i<var1.length;i++)
@@ -259,6 +258,7 @@ public class IHLTool extends Item implements IItemHasMiniGUI{
}
@Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
{
info.add(EnumChatFormatting.WHITE+StatCollector.translateToLocal("ihl.durability") +EnumChatFormatting.GREEN + (IHLUtils.getMaxDamageValueViaNBTTag(itemStack) - IHLUtils.getDamageValueViaNBTTag(itemStack))+" / "+IHLUtils.getMaxDamageValueViaNBTTag(itemStack));
diff --git a/ihl/items_blocks/ItemSubstance.java b/ihl/items_blocks/ItemSubstance.java
index bef37fa..464878c 100644
--- a/ihl/items_blocks/ItemSubstance.java
+++ b/ihl/items_blocks/ItemSubstance.java
@@ -5,20 +5,29 @@ import ic2.api.recipe.RecipeInputOreDict;
import ic2.api.recipe.Recipes;
import ihl.IHLCreativeTab;
import ihl.IHLModInfo;
+import ihl.explosion.DetonatorMiniGUI;
+import ihl.interfaces.IItemHasMiniGUI;
+import ihl.interfaces.ItemMiniGUI;
import ihl.utils.IHLUtils;
import ihl.worldgen.ores.IHLFluid.IHLFluidType;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
+import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
+import net.minecraft.util.StatCollector;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
@@ -27,11 +36,11 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-public class ItemSubstance extends Item {
+public class ItemSubstance extends Item implements IItemHasMiniGUI{
- private static Map<Integer, IIcon> iconMap = new HashMap();
- private static Map<Integer, String> nameMap = new HashMap();
- private static Map<Integer, String> descriptionMap = new HashMap();
+ private static Map<Integer, IIcon> iconMap = new HashMap<Integer, IIcon>();
+ private static Map<Integer, String> nameMap = new HashMap<Integer, String>();
+ private static Map<Integer, String> descriptionMap = new HashMap<Integer, String>();
public static ItemSubstance instance;
public ItemSubstance()
@@ -118,6 +127,7 @@ public class ItemSubstance extends Item {
}
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
@@ -126,6 +136,11 @@ public class ItemSubstance extends Item {
for(int i=0;i<var1.length;i++)
{
ItemStack stack = IHLUtils.getThisModItemStack(var1[i].unLocalizedName);
+ if(var1[i]==Type.Detonator)
+ {
+ stack.stackTagCompound=new NBTTagCompound();
+ stack.stackTagCompound.setInteger("detonator_delay", 5);
+ }
itemList.add(stack);
}
IHLFluidType[] var2 = IHLFluidType.values();
@@ -173,16 +188,33 @@ public class ItemSubstance extends Item {
}
@Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
{
if(ItemSubstance.descriptionMap.containsKey(itemStack.getItemDamage()))
{
info.add(ItemSubstance.descriptionMap.get(itemStack.getItemDamage()));
}
+ if(itemStack.stackTagCompound!=null && itemStack.stackTagCompound.hasKey("detonator_delay"))
+ {
+ info.add(StatCollector.translateToLocal("ihl.detonator_delay")+" "+itemStack.stackTagCompound.getInteger("detonator_delay")+StatCollector.translateToLocal("ihl.seconds"));
+ }
}
public enum Type
{
+ Detonator(194, "detonator"),
+ dustPentaerythritolTetranitrate(193,"dustPentaerythritolTetranitrate",true,"C(CH\u2082ONO\u2082)\u2084"),
+ DustPentaerythritol(192, "dustPentaerythritol",true,"C(CH\u2082OH)\u2084"),
+ DustPotassiumOxide(191, "dustPotassiumOxide",true,"K\u2082O"),
+ IngotPotassium(190, "ingotPotassium",true,"K"),
+ catalystIron(189, "catalystIron",false,"Fe (foam) + Al\u2082O\u2083 + K\u2082O"),
+ catalystIronOxide(188, "catalystIronOxide",false,"Fe\u2082O\u2083 + Al\u2082O\u2083 + K\u2082O"),
+ catalystRawIronOxide(187, "catalystRawIronOxide",false,"Fe\u2082O\u2083 + Al\u2082O\u2083 + K\u2082O"),
+ IronOxideCatalystMix(186, "dustIronOxideCatalystMix",false,"Fe\u2082O\u2083 + Al\u2082O\u2083 + K\u2082O"),
+ SodiumFormate(185, "dustSodiumFormate",true,"HCO\u2082Na"),
+ MercuryChloride(184, "dustMercuryChloride",true,"HgCl\u2082"),
+ CalciumAcetate(183, "dustCalciumAcetate",true,"Ca(CH\u2083COO)\u2082"),
TinySiliconDioxide(182, "dustTinySiliconDioxide",true,"SiO\u2082"),
TinyIronOxide(181, "dustTinyIronOxide",true,"Fe\u2082O\u2083"),
TinyManganeseOxide(180, "dustTinyManganeseOxide",true,"Mn\u2083O\u2084"),
@@ -389,4 +421,15 @@ public class ItemSubstance extends Item {
public boolean registerInOreDictionary=false;
}
+ @Override
+ @SideOnly(Side.CLIENT)
+ public ItemMiniGUI getMiniGUI(GuiContainer gui, Slot slot)
+ {
+ if(slot.getHasStack() && slot.getStack().getItemDamage()==Type.Detonator.damage && slot.getStack().stackTagCompound!=null)
+ {
+ return new DetonatorMiniGUI(gui, slot);
+ }
+ return null;
+ }
+
} \ No newline at end of file
diff --git a/ihl/items_blocks/MachineBaseBlock.java b/ihl/items_blocks/MachineBaseBlock.java
index 0cb10cb..a5d6764 100644
--- a/ihl/items_blocks/MachineBaseBlock.java
+++ b/ihl/items_blocks/MachineBaseBlock.java
@@ -4,7 +4,6 @@ import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
import ic2.core.IHasGui;
import ic2.core.item.tool.ItemToolCutter;
-import ic2.core.item.tool.ItemToolWrench;
import ihl.IHLCreativeTab;
import ihl.IHLMod;
import ihl.IHLModInfo;
@@ -63,7 +62,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
-import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
@@ -78,7 +76,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class MachineBaseBlock extends Block implements ITileEntityProvider{
MachineType type;
- private static List<MachineBaseBlock> instances = new ArrayList();
+ private static List<MachineBaseBlock> instances = new ArrayList<MachineBaseBlock>();
@SideOnly(Side.CLIENT)
IIcon textureSide,
@@ -203,6 +201,7 @@ public class MachineBaseBlock extends Block implements ITileEntityProvider{
super.onBlockPreDestroy(world, x, y, z, meta);
}
+ @SuppressWarnings("rawtypes")
@Override
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity)
{
@@ -468,14 +467,6 @@ public class MachineBaseBlock extends Block implements ITileEntityProvider{
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
{
int facing=3;
- int mask[] = {
- 0,1,2,3,4,5,
- 1,0,3,2,4,5,
- 2,3,0,1,4,5,
- 2,3,1,0,4,5,
- 2,3,5,4,0,1,
- 2,3,4,5,1,0
- };
TileEntity te = world.getTileEntity(x, y, z);
if(te instanceof IWrenchable)
{
@@ -793,7 +784,7 @@ public class MachineBaseBlock extends Block implements ITileEntityProvider{
BronzeTub("tubBronze",ImpregnatingMachineTileEntity.class, false, true, null),
AchesonFurnace("achesonFurnance",AchesonFurnanceTileEntity.class, true, new ItemStack(Items.brick)),
MuffleFurnace("muffleFurnance",MuffleFurnanceTileEntity.class, true, new ItemStack(Items.brick));
- MachineType(String unlocalizedName1, Class teclass1, boolean isNormalBlock1,ItemStack itemDroppedOnBlockDestroy1)
+ MachineType(String unlocalizedName1, Class<? extends TileEntity> teclass1, boolean isNormalBlock1,ItemStack itemDroppedOnBlockDestroy1)
{
unlocalizedName=unlocalizedName1;
teclass=teclass1;
@@ -808,7 +799,7 @@ public class MachineBaseBlock extends Block implements ITileEntityProvider{
}
itemDroppedOnBlockDestroy=itemDroppedOnBlockDestroy1;
}
- MachineType(String unlocalizedName1, Class teclass1, boolean isNormalBlock1,boolean hasSpecialBlockRenderer1, ItemStack itemDroppedOnBlockDestroy1)
+ MachineType(String unlocalizedName1, Class<? extends TileEntity> teclass1, boolean isNormalBlock1,boolean hasSpecialBlockRenderer1, ItemStack itemDroppedOnBlockDestroy1)
{
unlocalizedName=unlocalizedName1;
teclass=teclass1;
@@ -818,7 +809,7 @@ public class MachineBaseBlock extends Block implements ITileEntityProvider{
}
String unlocalizedName;
- Class teclass;
+ Class<? extends TileEntity> teclass;
boolean isNormalBlock=true;
boolean hasSpecialBlockRenderer=false;
int specialBlockRendererId=-2;
diff --git a/ihl/metallurgy/constants/Details.java b/ihl/metallurgy/constants/Details.java
index 2ece66a..80c715c 100644
--- a/ihl/metallurgy/constants/Details.java
+++ b/ihl/metallurgy/constants/Details.java
@@ -1,5 +1,7 @@
package ihl.metallurgy.constants;
+import ihl.IHLMod;
+
public enum Details {
block(1296),
highPressureVessel(432),
@@ -33,21 +35,21 @@ public enum Details {
ring(36),
toolHeadPickaxe(432),
gearSmall(144),
+ nozzle(864),
wire(48);
Details(int moltenAmount1)
{
- moltenAmount=moltenAmount1;
+ IHLMod.moltenAmounts.put(this.name(), moltenAmount1);
}
- private int moltenAmount;
public static int getMeltingFluidAmount(String name)
{
- if(Details.valueOf(name)==null)
+ if(IHLMod.moltenAmounts.containsKey(name))
{
- return 0;
+ return IHLMod.moltenAmounts.get(name);
}
else
{
- return Details.valueOf(name).moltenAmount;
+ return 0;
}
}
}
diff --git a/ihl/model/CableHolderSelectionBoxSpecialRenderer.java b/ihl/model/CableHolderSelectionBoxSpecialRenderer.java
index 9bb22f1..7d0de61 100644
--- a/ihl/model/CableHolderSelectionBoxSpecialRenderer.java
+++ b/ihl/model/CableHolderSelectionBoxSpecialRenderer.java
@@ -15,7 +15,8 @@ import org.lwjgl.opengl.GL11;
public class CableHolderSelectionBoxSpecialRenderer implements ISelectionBoxSpecialRenderer
{
- public void drawSelectionBox(EntityPlayer player, ItemStack currentItem, MovingObjectPosition movingObjectPosition, float partialTick)
+ @Override
+ public void drawSelectionBox(EntityPlayer player, ItemStack currentItem, MovingObjectPosition movingObjectPosition, float partialTick)
{
AnchorTileEntity ate = (AnchorTileEntity) Minecraft.getMinecraft().theWorld.getTileEntity(movingObjectPosition.blockX, movingObjectPosition.blockY, movingObjectPosition.blockZ);
short facing = IHLUtils.getFacingFromPlayerView(player, true);
@@ -26,9 +27,9 @@ public class CableHolderSelectionBoxSpecialRenderer implements ISelectionBoxSpec
GL11.glLineWidth(2.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDepthMask(false);
- double offsetX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)partialTick;
- double offsetY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)partialTick;
- double offsetZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)partialTick;
+ double offsetX = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTick;
+ double offsetY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTick;
+ double offsetZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTick;
double size=0.1d;
RenderGlobal.drawOutlinedBoundingBox(AxisAlignedBB.getBoundingBox(portPos[0]-size, portPos[1]-size, portPos[2]-size, portPos[0]+size, portPos[1]+size, portPos[2]+size).getOffsetBoundingBox(-offsetX, -offsetY, -offsetZ), -1);
GL11.glDepthMask(true);
diff --git a/ihl/model/FlexibleCableItemRender.java b/ihl/model/FlexibleCableItemRender.java
index 86b53ee..92b2036 100644
--- a/ihl/model/FlexibleCableItemRender.java
+++ b/ihl/model/FlexibleCableItemRender.java
@@ -1,22 +1,13 @@
package ihl.model;
-import ic2.core.block.RenderBlockDefault;
-import ihl.datanet.DataCableItem;
import ihl.items_blocks.FlexibleCableItem;
-import ihl.items_blocks.IHLItemBlock;
-import ihl.model.IHLModelRenderer;
-import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
-import net.minecraft.client.model.ModelBase;
-import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GLAllocation;
-import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.item.ItemStack;
-import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.common.util.ForgeDirection;
diff --git a/ihl/model/IHLModelRenderer.java b/ihl/model/IHLModelRenderer.java
index c9b1b77..a9168f8 100644
--- a/ihl/model/IHLModelRenderer.java
+++ b/ihl/model/IHLModelRenderer.java
@@ -39,8 +39,8 @@ public class IHLModelRenderer {
/** Hides the model. */
public boolean isHidden;
- public List cubeList;
- public List childModels;
+ public List<Object> cubeList;
+ public List<ModelRenderer> childModels;
public final String boxName;
private ModelBase baseModel;
public float offsetX;
@@ -48,14 +48,14 @@ public class IHLModelRenderer {
public float offsetZ;
public boolean drawFromInside=false;
- private static final String __OBFID = "CL_00000874";
-
- public IHLModelRenderer(ModelBase par1ModelBase, String par2Str)
+
+ @SuppressWarnings("unchecked")
+ public IHLModelRenderer(ModelBase par1ModelBase, String par2Str)
{
this.textureWidth = 64.0F;
this.textureHeight = 32.0F;
this.showModel = true;
- this.cubeList = new ArrayList();
+ this.cubeList = new ArrayList<Object>();
this.baseModel = par1ModelBase;
par1ModelBase.boxList.add(this);
this.boxName = par2Str;
@@ -80,7 +80,7 @@ public class IHLModelRenderer {
{
if (this.childModels == null)
{
- this.childModels = new ArrayList();
+ this.childModels = new ArrayList<ModelRenderer>();
}
this.childModels.add(par1ModelRenderer);
diff --git a/ihl/model/IHLToolRenderer.java b/ihl/model/IHLToolRenderer.java
index 6f2a30f..a5ba87b 100644
--- a/ihl/model/IHLToolRenderer.java
+++ b/ihl/model/IHLToolRenderer.java
@@ -9,7 +9,6 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
public class IHLToolRenderer implements IItemRenderer
diff --git a/ihl/model/IronWorkbenchBlockRender.java b/ihl/model/IronWorkbenchBlockRender.java
index 43793ed..b5bdec3 100644
--- a/ihl/model/IronWorkbenchBlockRender.java
+++ b/ihl/model/IronWorkbenchBlockRender.java
@@ -1,18 +1,11 @@
package ihl.model;
-import ic2.api.tile.IWrenchable;
-import ihl.items_blocks.MachineBaseBlock;
-import ihl.utils.IHLRenderUtils;
-
import org.lwjgl.opengl.GL11;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
-import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
diff --git a/ihl/model/ModelTube.java b/ihl/model/ModelTube.java
index b513c74..d4dcb08 100644
--- a/ihl/model/ModelTube.java
+++ b/ihl/model/ModelTube.java
@@ -1,9 +1,5 @@
package ihl.model;
-import ihl.handpump.BlockWithCoordinates;
-
-import java.util.Iterator;
-
import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.PositionTextureVertex;
diff --git a/ihl/model/MultiMetaBlockRender.java b/ihl/model/MultiMetaBlockRender.java
index 196cb99..c995989 100644
--- a/ihl/model/MultiMetaBlockRender.java
+++ b/ihl/model/MultiMetaBlockRender.java
@@ -64,7 +64,6 @@ public class MultiMetaBlockRender implements ISimpleBlockRenderingHandler
float var7 = (var6 >> 16 & 255) / 255.0F;
float var8 = (var6 >> 8 & 255) / 255.0F;
float var9 = (var6 & 255) / 255.0F;
- float var11;
var5.setColorOpaque_F(var7, var8, var9);
return true;
}
diff --git a/ihl/model/RectifierTransformerUnitBlockRender.java b/ihl/model/RectifierTransformerUnitBlockRender.java
index 081db7a..27d8ea9 100644
--- a/ihl/model/RectifierTransformerUnitBlockRender.java
+++ b/ihl/model/RectifierTransformerUnitBlockRender.java
@@ -1,7 +1,6 @@
package ihl.model;
import ic2.api.tile.IWrenchable;
-import ihl.items_blocks.MachineBaseBlock;
import ihl.utils.IHLRenderUtils;
import org.lwjgl.opengl.GL11;
diff --git a/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java b/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java
index 6e3e944..4cd52ea 100644
--- a/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java
+++ b/ihl/model/RectifierTransformerUnitSelectionBoxSpecialRenderer.java
@@ -1,30 +1,24 @@
package ihl.model;
-import ic2.api.tile.IWrenchable;
-import ihl.flexible_cable.AnchorTileEntity;
import ihl.flexible_cable.RectifierTransformerUnitTileEntity;
import ihl.interfaces.ISelectionBoxSpecialRenderer;
-import ihl.utils.IHLUtils;
import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderGlobal;
-import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import org.lwjgl.opengl.GL11;
public class RectifierTransformerUnitSelectionBoxSpecialRenderer implements ISelectionBoxSpecialRenderer
{
- public void drawSelectionBox(EntityPlayer player, ItemStack currentItem, MovingObjectPosition movingObjectPosition, float partialTick)
+ @Override
+ public void drawSelectionBox(EntityPlayer player, ItemStack currentItem, MovingObjectPosition movingObjectPosition, float partialTick)
{
- double offsetX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)partialTick;
- double offsetY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)partialTick;
- double offsetZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)partialTick;
+ double offsetX = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTick;
+ double offsetY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTick;
+ double offsetZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTick;
RectifierTransformerUnitTileEntity tile = (RectifierTransformerUnitTileEntity) Minecraft.getMinecraft().theWorld.getTileEntity(movingObjectPosition.blockX, movingObjectPosition.blockY, movingObjectPosition.blockZ);
if(tile!=null && tile.getWorldObj() != null)
{
diff --git a/ihl/model/RenderGameOverlayEventHandler.java b/ihl/model/RenderGameOverlayEventHandler.java
index e2bbde4..6770c3d 100644
--- a/ihl/model/RenderGameOverlayEventHandler.java
+++ b/ihl/model/RenderGameOverlayEventHandler.java
@@ -4,7 +4,6 @@ import ihl.utils.IHLRenderUtils;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.client.GuiIngameForge;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
public class RenderGameOverlayEventHandler
diff --git a/ihl/model/SwitchBoxBlockRender.java b/ihl/model/SwitchBoxBlockRender.java
index 93f63a7..87c9fb9 100644
--- a/ihl/model/SwitchBoxBlockRender.java
+++ b/ihl/model/SwitchBoxBlockRender.java
@@ -109,9 +109,7 @@ public class SwitchBoxBlockRender implements ISimpleBlockRenderingHandler
float var7 = (var6 >> 16 & 255) / 255.0F;
float var8 = (var6 >> 8 & 255) / 255.0F;
float var9 = (var6 & 255) / 255.0F;
- float var11;
var5.setColorOpaque_F(var7, var8, var9);
- var11 = 0.0625F;
blockRenderer.renderFaceXPos(block, x, y, z, sideToTypes[4]);
blockRenderer.renderFaceXNeg(block, x, y, z, sideToTypes[5]);
blockRenderer.renderFaceZPos(block, x, y, z, sideToTypes[2]);
diff --git a/ihl/nei_integration/AchesonFurnaceRecipeHandler.java b/ihl/nei_integration/AchesonFurnaceRecipeHandler.java
index 63dc0c8..8571f3a 100644
--- a/ihl/nei_integration/AchesonFurnaceRecipeHandler.java
+++ b/ihl/nei_integration/AchesonFurnaceRecipeHandler.java
@@ -86,7 +86,7 @@ public class AchesonFurnaceRecipeHandler extends MachineRecipeHandler
@Override
public List<PositionedStack> getAdditionalIngredients()
{
- List<PositionedStack> ps = new ArrayList();
+ List<PositionedStack> ps = new ArrayList<PositionedStack>();
RecipeInputOreDictionaryList ari = new RecipeInputOreDictionaryList(new String[] {"stickCoal","stickGraphite"});
ps.add(new PositionedStack(ari.getInputs(),16-5,41-11));
ps.add(new PositionedStack(ari.getInputs(),52-5,41-11));
diff --git a/ihl/nei_integration/ChemicalReactorRecipeHandler.java b/ihl/nei_integration/ChemicalReactorRecipeHandler.java
index 161bdfe..7dd6801 100644
--- a/ihl/nei_integration/ChemicalReactorRecipeHandler.java
+++ b/ihl/nei_integration/ChemicalReactorRecipeHandler.java
@@ -127,14 +127,4 @@ public class ChemicalReactorRecipeHandler extends MachineRecipeHandler
{
return ChemicalReactorTileEntity.getRecipes();
}
-
- private int getFrameY(int number)
- {
- return (number % 10) * 24 + 14;
- }
-
- private int getFrameX(int number)
- {
- return (number / 10) * 24 + 176;
- }
}
diff --git a/ihl/nei_integration/CrucibleRecipeHandler.java b/ihl/nei_integration/CrucibleRecipeHandler.java
index dc2c012..d91b137 100644
--- a/ihl/nei_integration/CrucibleRecipeHandler.java
+++ b/ihl/nei_integration/CrucibleRecipeHandler.java
@@ -78,7 +78,7 @@ public class CrucibleRecipeHandler extends MachineRecipeHandler
@Override
public List<PositionedStack> getAdditionalIngredients()
{
- List<PositionedStack> ps = new ArrayList();
+ List<PositionedStack> ps = new ArrayList<PositionedStack>();
ps.add(new PositionedStack(IHLUtils.getThisModItemStackWithDamage("crucible", 0),61-5,15-11));
ps.add(new PositionedStack(IHLUtils.getThisModItemStackWithDamage("crucible", 1),106-5,15-11));
return ps;
diff --git a/ihl/nei_integration/CryogenicDistillerRecipeHandler.java b/ihl/nei_integration/CryogenicDistillerRecipeHandler.java
index c3bcff3..5b1a637 100644
--- a/ihl/nei_integration/CryogenicDistillerRecipeHandler.java
+++ b/ihl/nei_integration/CryogenicDistillerRecipeHandler.java
@@ -80,7 +80,8 @@ public class CryogenicDistillerRecipeHandler extends MachineRecipeHandler
return "cryogenicDistiller";
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void drawExtras(int recipeNumber)
{
MachineRecipeHandler.CachedIORecipe recipe = (MachineRecipeHandler.CachedIORecipe) this.arecipes.get(recipeNumber);
diff --git a/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java b/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java
index 1c9cff3..535646f 100644
--- a/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java
+++ b/ihl/nei_integration/ElectricEvaporatorRecipeHandler.java
@@ -4,7 +4,6 @@ import java.awt.Rectangle;
import java.util.Map;
import ihl.processing.chemistry.ElectricEvaporatorGui;
-import ihl.processing.chemistry.ElectricEvaporatorTileEntity;
import ihl.processing.chemistry.EvaporatorTileEntity;
import ihl.recipes.UniversalRecipeInput;
import ihl.recipes.UniversalRecipeOutput;
diff --git a/ihl/nei_integration/IHLBlockHighlightHandler.java b/ihl/nei_integration/IHLBlockHighlightHandler.java
index c6f8359..4862a9b 100644
--- a/ihl/nei_integration/IHLBlockHighlightHandler.java
+++ b/ihl/nei_integration/IHLBlockHighlightHandler.java
@@ -2,12 +2,7 @@ package ihl.nei_integration;
import codechicken.nei.api.IHighlightHandler;
import codechicken.nei.api.ItemInfo;
-import codechicken.nei.guihook.GuiContainerManager;
-import net.minecraft.block.BlockRedstoneWire;
-import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
diff --git a/ihl/nei_integration/IHLRecipeHandler.java b/ihl/nei_integration/IHLRecipeHandler.java
index 4c0ada6..a0d7f7f 100644
--- a/ihl/nei_integration/IHLRecipeHandler.java
+++ b/ihl/nei_integration/IHLRecipeHandler.java
@@ -68,11 +68,11 @@ public abstract class IHLRecipeHandler extends TemplateRecipeHandler
{
if (outputId.equals(this.getRecipeId()))
{
- Iterator i$ = this.getRecipeList().entrySet().iterator();
+ Iterator<Entry<IRecipeInput, RecipeOutput>> i$ = this.getRecipeList().entrySet().iterator();
while (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
+ Entry<IRecipeInput, RecipeOutput> entry = i$.next();
this.arecipes.add(new IHLRecipeHandler.CachedIORecipe((IRecipeInput)entry.getKey(), (RecipeOutput)entry.getValue()));
}
}
@@ -85,16 +85,16 @@ public abstract class IHLRecipeHandler extends TemplateRecipeHandler
@Override
public void loadCraftingRecipes(ItemStack result)
{
- Iterator i$ = this.getRecipeList().entrySet().iterator();
+ Iterator<Entry<IRecipeInput, RecipeOutput>> i$ = this.getRecipeList().entrySet().iterator();
while (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
- Iterator i$1 = ((RecipeOutput)entry.getValue()).items.iterator();
+ Entry<IRecipeInput, RecipeOutput> entry = i$.next();
+ Iterator<ItemStack> i$1 = ((RecipeOutput)entry.getValue()).items.iterator();
while (i$1.hasNext())
{
- ItemStack output = (ItemStack)i$1.next();
+ ItemStack output = i$1.next();
if (NEIServerUtils.areStacksSameTypeCrafting(output, result))
{
@@ -108,11 +108,11 @@ public abstract class IHLRecipeHandler extends TemplateRecipeHandler
@Override
public void loadUsageRecipes(ItemStack ingredient)
{
- Iterator i$ = this.getRecipeList().entrySet().iterator();
+ Iterator<Entry<IRecipeInput, RecipeOutput>> i$ = this.getRecipeList().entrySet().iterator();
while (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
+ Entry<IRecipeInput, RecipeOutput> entry = i$.next();
if (((IRecipeInput)entry.getKey()).matches(ingredient))
{
@@ -148,9 +148,9 @@ public abstract class IHLRecipeHandler extends TemplateRecipeHandler
public class CachedIORecipe extends CachedRecipe
{
- private final List<PositionedStack> ingredients = new ArrayList();
+ private final List<PositionedStack> ingredients = new ArrayList<PositionedStack>();
private final PositionedStack output;
- private final List<PositionedStack> otherStacks = new ArrayList();
+ private final List<PositionedStack> otherStacks = new ArrayList<PositionedStack>();
@Override
public List<PositionedStack> getIngredients()
@@ -211,12 +211,12 @@ public abstract class IHLRecipeHandler extends TemplateRecipeHandler
}
else
{
- ArrayList items = new ArrayList();
- Iterator i = input.getInputs().iterator();
+ ArrayList<ItemStack> items = new ArrayList<ItemStack>();
+ Iterator<ItemStack> i = input.getInputs().iterator();
while (i.hasNext())
{
- ItemStack item = (ItemStack)i.next();
+ ItemStack item = i.next();
items.add(StackUtil.copyWithSize(item, input.getAmount()));
}
diff --git a/ihl/nei_integration/IronWorkbenchRecipeHandler.java b/ihl/nei_integration/IronWorkbenchRecipeHandler.java
index 1589f36..980f13a 100644
--- a/ihl/nei_integration/IronWorkbenchRecipeHandler.java
+++ b/ihl/nei_integration/IronWorkbenchRecipeHandler.java
@@ -5,14 +5,11 @@ import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import ic2.api.recipe.IRecipeInput;
-import ic2.core.Ic2Items;
-import ihl.IHLMod;
import ihl.recipes.IronWorkbenchRecipe;
import ihl.utils.IHLUtils;
import java.awt.Rectangle;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import net.minecraft.client.gui.inventory.GuiContainer;
@@ -78,7 +75,6 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler
@Override
public void drawBackground(int recipeNumber)
{
- IronWorkbenchRecipeHandler.CachedIORecipe recipe = (CachedIORecipe) this.arecipes.get(recipeNumber);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(this.getGuiTexture());
GuiDraw.drawTexturedModalRect(0, 0, 7, 7, 162, 108);
@@ -128,10 +124,10 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler
while (i$.hasNext())
{
IronWorkbenchRecipe entry = i$.next();
- Iterator i$1 = entry.outputs.iterator();
+ Iterator<ItemStack> i$1 = entry.outputs.iterator();
while (i$1.hasNext())
{
- ItemStack output = (ItemStack)i$1.next();
+ ItemStack output = i$1.next();
if (NEIServerUtils.areStacksSameTypeCrafting(output, result))
{
this.arecipes.add(new IronWorkbenchRecipeHandler.CachedIORecipe(entry));
@@ -150,7 +146,7 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler
IronWorkbenchRecipe entry = i$.next();
if(entry.workspaceElements!=null && !entry.workspaceElements.isEmpty())
{
- Iterator i$1 = entry.workspaceElements.iterator();
+ Iterator<ItemStack> i$1 = entry.workspaceElements.iterator();
while (i$1.hasNext())
{
ItemStack output = (ItemStack)i$1.next();
@@ -193,9 +189,9 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler
public class CachedIORecipe extends CachedRecipe
{
- private final List<PositionedStack> ingredients = new ArrayList();
+ private final List<PositionedStack> ingredients = new ArrayList<PositionedStack>();
private final PositionedStack output;
- private final List<PositionedStack> otherStacks = new ArrayList();
+ private final List<PositionedStack> otherStacks = new ArrayList<PositionedStack>();
@Override
public List<PositionedStack> getIngredients()
@@ -227,26 +223,26 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler
this.ingredients.add(new PositionedStack(IHLUtils.getThisModItemStack("ironWorkbench"), workspaceItemsPosX, workspaceItemsPosY));
if(recipe.workspaceElements!=null && !recipe.workspaceElements.isEmpty())
{
- Iterator i = recipe.workspaceElements.iterator();
+ Iterator<ItemStack> i = recipe.workspaceElements.iterator();
int index = 1;
while (i.hasNext())
{
int x = workspaceItemsPosX;
int y = workspaceItemsPosY + index * 18;
- ItemStack stack = (ItemStack)i.next();
+ ItemStack stack = i.next();
this.ingredients.add(new PositionedStack(stack, x, y));
index++;
}
}
if(recipe.tools!=null && !recipe.tools.isEmpty())
{
- Iterator i = recipe.tools.iterator();
+ Iterator<IRecipeInput> i = recipe.tools.iterator();
int index = 0;
while (i.hasNext())
{
int x = toolsPosX + (index % 2) * 18;
int y = toolsPosY + index / 2 * 18;
- IRecipeInput rInput = (IRecipeInput)i.next();
+ IRecipeInput rInput = i.next();
this.ingredients.add(new PositionedStack(rInput.getInputs(), x, y));
index++;
}
@@ -254,7 +250,7 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler
if(recipe.materials!=null && !recipe.materials.isEmpty())
{
- Iterator i = recipe.materials.iterator();
+ Iterator<IRecipeInput> i = recipe.materials.iterator();
int index = 0;
while (i.hasNext())
{
@@ -262,7 +258,7 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler
int y = materialsPosY + index / 2 * 18;
IRecipeInput rInput = (IRecipeInput)i.next();
Iterator<ItemStack> rInputsi = rInput.getInputs().iterator();
- List<ItemStack> itemInputs = new ArrayList();
+ List<ItemStack> itemInputs = new ArrayList<ItemStack>();
while(rInputsi.hasNext())
{
ItemStack stack = rInputsi.next().copy();
@@ -277,13 +273,13 @@ public class IronWorkbenchRecipeHandler extends TemplateRecipeHandler
}
}
this.output=new PositionedStack(recipe.outputs.get(0), outputPosX, outputPosY);
- Iterator i = recipe.outputs.iterator();
+ Iterator<ItemStack> i = recipe.outputs.iterator();
int index = 0;
while (i.hasNext())
{
int x = outputPosX + (index % 3) * 18;
int y = outputPosY + index / 3 * 18;
- ItemStack stack = (ItemStack)i.next();
+ ItemStack stack = i.next();
if(index>0)
{
this.otherStacks.add(new PositionedStack(stack, x, y));
diff --git a/ihl/nei_integration/LabElectrolyzerRecipeHandler.java b/ihl/nei_integration/LabElectrolyzerRecipeHandler.java
index c36e27d..6948a31 100644
--- a/ihl/nei_integration/LabElectrolyzerRecipeHandler.java
+++ b/ihl/nei_integration/LabElectrolyzerRecipeHandler.java
@@ -1,7 +1,9 @@
package ihl.nei_integration;
+import java.awt.Rectangle;
import java.util.Map;
+import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect;
import ihl.processing.chemistry.LabElectrolyzerGui;
import ihl.processing.chemistry.LabElectrolyzerTileEntity;
import ihl.recipes.UniversalRecipeInput;
@@ -59,6 +61,14 @@ public class LabElectrolyzerRecipeHandler extends MachineRecipeHandler
{
return "ihl:textures/gui/GUILabElectrolyzer.png";
}
+
+ @Override
+ public void loadTransferRects()
+ {
+ this.transferRects.add(new RecipeTransferRect(new Rectangle(7-5,32-10, 18, 18), this.getRecipeId(), new Object[0]));
+ this.transferRects.add(new RecipeTransferRect(new Rectangle(86-5,32-10, 37, 18), this.getRecipeId(), new Object[0]));
+ }
+
@Override
public String getOverlayIdentifier()
diff --git a/ihl/nei_integration/MachineRecipeHandler.java b/ihl/nei_integration/MachineRecipeHandler.java
index aa5a30b..82b541a 100644
--- a/ihl/nei_integration/MachineRecipeHandler.java
+++ b/ihl/nei_integration/MachineRecipeHandler.java
@@ -61,6 +61,13 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
{
MachineRecipeHandler.CachedIORecipe recipe = (CachedIORecipe) this.arecipes.get(recipeNumber);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ for(PositionedStack stack:recipe.ingredients)
+ {
+ if(stack.item.stackSize==0)
+ {
+ GuiDraw.fontRenderer.drawStringWithShadow("0.001", stack.relx+3, stack.rely+9, 16777215);
+ }
+ }
if(recipe.output instanceof IHLPositionedStack)
{
IHLPositionedStack rOutput = (IHLPositionedStack) recipe.output;
@@ -112,12 +119,12 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
{
if (outputId.equals(this.getRecipeId()))
{
- Iterator i$ = this.getRecipeList().entrySet().iterator();
+ Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.getRecipeList().entrySet().iterator();
while (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
- this.arecipes.add(new MachineRecipeHandler.CachedIORecipe((UniversalRecipeInput)entry.getKey(), (UniversalRecipeOutput)entry.getValue(),getAdditionalIngredients()));
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
+ this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(),getAdditionalIngredients()));
}
}
else
@@ -129,7 +136,7 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
@Override
public void loadCraftingRecipes(ItemStack result)
{
- Iterator i$ = this.getRecipeList().entrySet().iterator();
+ Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.getRecipeList().entrySet().iterator();
FluidStack fluidStack = FluidContainerRegistry.getFluidForFilledItem(result);
if(fluidStack==null && result.getItem() instanceof IFluidContainerItem)
{
@@ -152,11 +159,11 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
{
while (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
- Iterator i$1 = ((UniversalRecipeOutput)entry.getValue()).getFluidOutputs().iterator();
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
+ Iterator<FluidStack> i$1 = ((UniversalRecipeOutput)entry.getValue()).getFluidOutputs().iterator();
while (i$1.hasNext())
{
- FluidStack output = (FluidStack)i$1.next();
+ FluidStack output = i$1.next();
if (output!=null && output.getFluid()==fluidStack.getFluid())
{
this.arecipes.add(new MachineRecipeHandler.CachedIORecipe((UniversalRecipeInput)entry.getKey(), (UniversalRecipeOutput)entry.getValue(),getAdditionalIngredients()));
@@ -169,8 +176,8 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
{
while (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
- Iterator<RecipeOutputItemStack> i$1 = ((UniversalRecipeOutput)entry.getValue()).getItemOutputs().iterator();
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
+ Iterator<RecipeOutputItemStack> i$1 = (entry.getValue()).getItemOutputs().iterator();
while (i$1.hasNext())
{
@@ -178,7 +185,7 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
if (NEIServerUtils.areStacksSameTypeCrafting(output.itemStack, result) || IHLUtils.isItemsHaveSameOreDictionaryEntry(output.itemStack, result))
{
- this.arecipes.add(new MachineRecipeHandler.CachedIORecipe((UniversalRecipeInput)entry.getKey(), (UniversalRecipeOutput)entry.getValue(),getAdditionalIngredients()));
+ this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(),getAdditionalIngredients()));
break;
}
}
@@ -195,7 +202,7 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
@Override
public void loadUsageRecipes(ItemStack ingredient)
{
- Iterator i$ = this.getRecipeList().entrySet().iterator();
+ Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.getRecipeList().entrySet().iterator();
FluidStack fluidStack = FluidContainerRegistry.getFluidForFilledItem(ingredient);
if(fluidStack==null && ingredient.getItem() instanceof IFluidContainerItem)
{
@@ -219,10 +226,10 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
{
while (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
if (((UniversalRecipeInput)entry.getKey()).containFluidStack(fluidStack))
{
- this.arecipes.add(new MachineRecipeHandler.CachedIORecipe((UniversalRecipeInput)entry.getKey(), (UniversalRecipeOutput)entry.getValue(),getAdditionalIngredients()));
+ this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(),getAdditionalIngredients()));
}
}
}
@@ -230,10 +237,10 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
{
while (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
if (((UniversalRecipeInput)entry.getKey()).containItemStack(ingredient))
{
- this.arecipes.add(new MachineRecipeHandler.CachedIORecipe((UniversalRecipeInput)entry.getKey(), (UniversalRecipeOutput)entry.getValue(),getAdditionalIngredients()));
+ this.arecipes.add(new MachineRecipeHandler.CachedIORecipe(entry.getKey(), entry.getValue(),getAdditionalIngredients()));
}
}
}
@@ -266,9 +273,9 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
public class CachedIORecipe extends CachedRecipe
{
- private final List<PositionedStack> ingredients = new ArrayList();
+ private final List<PositionedStack> ingredients = new ArrayList<PositionedStack>();
public PositionedStack output;
- public final List<PositionedStack> otherStacks = new ArrayList();
+ public final List<PositionedStack> otherStacks = new ArrayList<PositionedStack>();
public boolean specialConditions=false;
@Override
@@ -307,16 +314,16 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
else
{
specialConditions=output1.specialConditions;
- ArrayList<List<ItemStack>> items = new ArrayList();
- ArrayList<List<ItemStack>> fluidItems = new ArrayList();
+ ArrayList<List<ItemStack>> items = new ArrayList<List<ItemStack>>();
+ ArrayList<List<ItemStack>> fluidItems = new ArrayList<List<ItemStack>>();
if(input.getFluidInputs()!=null && !input.getFluidInputs().isEmpty())
{
- Iterator i = input.getFluidInputs().iterator();
+ Iterator<?> i = input.getFluidInputs().iterator();
while (i.hasNext())
{
IRecipeInputFluid fstackRI = (IRecipeInputFluid)i.next();
List<FluidStack> fstackList = fstackRI.getInputs();
- List<ItemStack> fContainers = new ArrayList();
+ List<ItemStack> fContainers = new ArrayList<ItemStack>();
for(FluidStack fstack:fstackList)
{
ItemStack stack = Ic2Items.FluidCell.copy();
@@ -333,12 +340,12 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
if(input.getItemInputs()!=null && !input.getItemInputs().isEmpty())
{
- Iterator i = input.getItemInputs().iterator();
+ Iterator<?> i = input.getItemInputs().iterator();
while (i.hasNext())
{
IRecipeInput rInput = (IRecipeInput)i.next();
Iterator<ItemStack> rInputsi = rInput.getInputs().iterator();
- List<ItemStack> itemInputs = new ArrayList();
+ List<ItemStack> itemInputs = new ArrayList<ItemStack>();
while(rInputsi.hasNext())
{
ItemStack stack = rInputsi.next().copy();
@@ -407,7 +414,7 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
x = MachineRecipeHandler.this.getFluidOutputPosX()[0];
y = MachineRecipeHandler.this.getFluidOutputPosY()[0];
}
- Iterator i = output1.getFluidOutputs().iterator();
+ Iterator<?> i = output1.getFluidOutputs().iterator();
if(skipOneFluidOutput)
{
i.next();
diff --git a/ihl/nei_integration/NEIIHLConfig.java b/ihl/nei_integration/NEIIHLConfig.java
index 7ffc3fb..288ab24 100644
--- a/ihl/nei_integration/NEIIHLConfig.java
+++ b/ihl/nei_integration/NEIIHLConfig.java
@@ -19,7 +19,6 @@ import ihl.processing.metallurgy.MuffleFurnaceGui;
import ihl.processing.metallurgy.RollingMachineGui;
import ihl.processing.metallurgy.WireMillGui;
import ihl.processing.metallurgy.WoodenRollingMachineGui;
-import ihl.utils.IHLUtils;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import codechicken.nei.api.ItemInfo;
diff --git a/ihl/processing/chemistry/ApparatusProcessableInvSlot.java b/ihl/processing/chemistry/ApparatusProcessableInvSlot.java
index f0b69b3..3698160 100644
--- a/ihl/processing/chemistry/ApparatusProcessableInvSlot.java
+++ b/ihl/processing/chemistry/ApparatusProcessableInvSlot.java
@@ -18,7 +18,7 @@ public class ApparatusProcessableInvSlot extends InvSlot {
public List<ItemStack> getItemStackList()
{
- List<ItemStack> list = new ArrayList();
+ List<ItemStack> list = new ArrayList<ItemStack>();
for(int i=0; i<this.size(); i++)
{
if(get(i)!=null)
diff --git a/ihl/processing/chemistry/BatteryItem.java b/ihl/processing/chemistry/BatteryItem.java
index 4b2cf63..10cd7cd 100644
--- a/ihl/processing/chemistry/BatteryItem.java
+++ b/ihl/processing/chemistry/BatteryItem.java
@@ -27,9 +27,9 @@ public class BatteryItem extends Item implements IElectricItem, IItemHudInfo
public int maxCharge=65536;
public int transferLimit = 4096;
public int tier = 4;
- private static Map<Integer, IIcon> iconMap = new HashMap();
- private static Map<Integer, String> nameMap = new HashMap();
- private static Map<Integer, String> descriptionMap = new HashMap();
+ private static Map<Integer, IIcon> iconMap = new HashMap<Integer, IIcon>();
+ private static Map<Integer, String> nameMap = new HashMap<Integer, String>();
+ private static Map<Integer, String> descriptionMap = new HashMap<Integer, String>();
public BatteryItem()
{
@@ -96,7 +96,7 @@ public class BatteryItem extends Item implements IElectricItem, IItemHudInfo
@Override
public List<String> getHudInfo(ItemStack itemStack)
{
- LinkedList info = new LinkedList();
+ LinkedList<String> info = new LinkedList<String>();
info.add(ElectricItem.manager.getToolTip(itemStack));
return info;
}
@@ -125,11 +125,8 @@ public class BatteryItem extends Item implements IElectricItem, IItemHudInfo
return nameMap.get(0);//stack.getItemDamage());
}
- @SideOnly(Side.CLIENT)
-
- /**
- * This returns the sub items
- */
+ @SideOnly(Side.CLIENT)
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void func_150895_a(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
ItemStack itemStack = new ItemStack(this, 1);
@@ -158,6 +155,7 @@ public class BatteryItem extends Item implements IElectricItem, IItemHudInfo
}
@Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
{
if(BatteryItem.descriptionMap.containsKey(0))//itemStack.getItemDamage()))
diff --git a/ihl/processing/chemistry/ChemicalReactorContainer.java b/ihl/processing/chemistry/ChemicalReactorContainer.java
index ee60543..a20cc01 100644
--- a/ihl/processing/chemistry/ChemicalReactorContainer.java
+++ b/ihl/processing/chemistry/ChemicalReactorContainer.java
@@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidStack;
-public class ChemicalReactorContainer extends ContainerBase {
+public class ChemicalReactorContainer extends ContainerBase<ChemicalReactorTileEntity> {
protected ChemicalReactorTileEntity tileEntity;
public int lastFluidAmount = -1;
@@ -44,7 +44,7 @@ public class ChemicalReactorContainer extends ContainerBase {
this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 122, 15));
this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 122-18, 51));
this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 1, 122, 51));
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 8, 33));
+ this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 8, 33));
}
@Override
diff --git a/ihl/processing/chemistry/ChemicalReactorGui.java b/ihl/processing/chemistry/ChemicalReactorGui.java
index 6342d40..029281b 100644
--- a/ihl/processing/chemistry/ChemicalReactorGui.java
+++ b/ihl/processing/chemistry/ChemicalReactorGui.java
@@ -54,11 +54,6 @@ public class ChemicalReactorGui extends GuiContainer {
{
IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 102-18, 28, 114-18, 59, zLevel, par1, par2, xOffset, yOffset);
}
- if(!this.container.tileEntity.engine.correctContent())
- {
- this.mc.renderEngine.bindTexture(background);
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset);
- }
}
@Override
diff --git a/ihl/processing/chemistry/ChemicalReactorTileEntity.java b/ihl/processing/chemistry/ChemicalReactorTileEntity.java
index 7720d2b..cec4177 100644
--- a/ihl/processing/chemistry/ChemicalReactorTileEntity.java
+++ b/ihl/processing/chemistry/ChemicalReactorTileEntity.java
@@ -50,7 +50,6 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl
this.fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill);
this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 1);
this.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 2, 64);
- this.isGuiScreenOpened=true;
}
@Override
@@ -131,69 +130,12 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl
return "chemicalReactor";
}
- private int mX()
- {
- switch(this.getFacing())
- {
- case 4:
- return -1;
- case 5:
- return 1;
- default:
- return 0;
- }
- }
-
- private int mZ()
- {
- switch(this.getFacing())
- {
- case 3:
- return 1;
- case 2:
- return -1;
- case 4:
- return 0;
- case 5:
- return 0;
- default:
- return -1;
- }
- }
-
- private short getFacingFromXZ(int x, int z)
- {
- switch(x)
- {
- case -1:
- return (short)4;
- case 1:
- return (short)5;
- default:
- switch(z)
- {
- case 1:
- return (short)3;
- case -1:
- return (short)2;
- default:
- return (short)2;
- }
- }
- }
-
public float getRenderLiquidLevel()
{
return (float)this.fluidTank.getFluidAmount()/(float)this.fluidTank.getCapacity();
}
@Override
- public void onNetworkEvent(EntityPlayer player, int event)
- {
- // TODO Auto-generated method stub
- }
-
- @Override
public int gaugeProgressScaled(int i)
{
return this.progress * i / operationLength;
@@ -245,11 +187,13 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl
return false;
}
+ @SuppressWarnings("unchecked")
public UniversalRecipeOutput getOutput()
{
return ChemicalReactorTileEntity.recipeManager.getOutputFor(this.getInput()[0],this.getInput()[1], false, false);
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List[] getInput()
{
@@ -270,6 +214,7 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl
}
@Override
+ @SuppressWarnings({ "unchecked"})
public void operate()
{
UniversalRecipeInput recipeInput = ChemicalReactorTileEntity.recipeManager.getRecipeInput(this.getInput()[0],this.getInput()[1]);
@@ -285,7 +230,7 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl
if(te instanceof CryogenicDistillerTileEntity)
{
CryogenicDistillerTileEntity cgte = (CryogenicDistillerTileEntity)te;
- int filled = cgte.fill(ForgeDirection.getOrientation(this.getFacing()), recipeInput.getFluidInputs().get(1).getInputs().get(0), true);
+ cgte.fill(ForgeDirection.getOrientation(this.getFacing()), recipeInput.getFluidInputs().get(1).getInputs().get(0), true);
}
}
this.fluidTank.drain(recipeInput.getFluidInputs(), true);
@@ -347,12 +292,12 @@ public class ChemicalReactorTileEntity extends BasicElectricMotorTileEntity impl
public static void addRecipe(FluidStack fluidStackInput1, FluidStack fluidStackInput2, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1, ItemStack itemStackOutput2)
{
- addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1, fluidStackInput2}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1, itemStackOutput2}),200));
+ addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1, fluidStackInput2}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200));
}
public static void addSpecialConditionsRecipe(FluidStack fluidStackInput1, FluidStack fluidStackInput2, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1, ItemStack itemStackOutput2)
{
- addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1, fluidStackInput2}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true));
+ addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1, fluidStackInput2}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true));
}
public IHLFluidTank getFluidTank()
diff --git a/ihl/processing/chemistry/CryogenicDistillerContainer.java b/ihl/processing/chemistry/CryogenicDistillerContainer.java
index d3ed523..be35e2a 100644
--- a/ihl/processing/chemistry/CryogenicDistillerContainer.java
+++ b/ihl/processing/chemistry/CryogenicDistillerContainer.java
@@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidStack;
-public class CryogenicDistillerContainer extends ContainerBase {
+public class CryogenicDistillerContainer extends ContainerBase<CryogenicDistillerTileEntity> {
public CryogenicDistillerTileEntity tileEntity;
public int lastProgress = -1;
@@ -39,7 +39,7 @@ public class CryogenicDistillerContainer extends ContainerBase {
{
this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24));
}
- this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 8, 32));
+ this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 8, 32));
this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.fillInputSlotInput,0, 58, 51));
this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.fillInputSlotProducts,0, 103, 51));
this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.fluidItemsSlot,0, 58, 15));
diff --git a/ihl/processing/chemistry/CryogenicDistillerGui.java b/ihl/processing/chemistry/CryogenicDistillerGui.java
index ef18c53..3fbbfa4 100644
--- a/ihl/processing/chemistry/CryogenicDistillerGui.java
+++ b/ihl/processing/chemistry/CryogenicDistillerGui.java
@@ -42,11 +42,6 @@ public class CryogenicDistillerGui extends GuiContainer {
{
IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankProducts, 125, 28, 137, 67, zLevel, par1, par2, xOffset, yOffset);
}
- if(!this.container.tileEntity.engine.correctContent())
- {
- this.mc.renderEngine.bindTexture(tex);
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset);
- }
}
@Override
diff --git a/ihl/processing/chemistry/CryogenicDistillerTileEntity.java b/ihl/processing/chemistry/CryogenicDistillerTileEntity.java
index 4c237d3..5a0194f 100644
--- a/ihl/processing/chemistry/CryogenicDistillerTileEntity.java
+++ b/ihl/processing/chemistry/CryogenicDistillerTileEntity.java
@@ -45,8 +45,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i
public CryogenicDistillerTileEntity()
{
super();
- this.isGuiScreenOpened=true;
- this.fillInputSlotInput = new InvSlotConsumableLiquidIHL(this, "fillInputSlotInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill);
+ this.fillInputSlotInput = new InvSlotConsumableLiquidIHL(this, "fillInputSlotInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill);
this.fillInputSlotProducts = new InvSlotConsumableLiquidIHL(this, "fillInputSlotProducts", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill);
this.fluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 2);
}
@@ -61,10 +60,9 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i
{
super.updateEntityServer();
ForgeDirection dir = ForgeDirection.getOrientation(getFacing());
- TileEntity te = worldObj.getTileEntity(xCoord+dir.offsetX,yCoord+dir.offsetY,zCoord+dir.offsetZ);
- if(this.processTimer++>20 && this.engine.correctContent() && this.energy>=this.energyConsume/this.engine.getEfficiency())
+ if(this.processTimer++>20 && this.energy>=this.energyConsume)
{
- this.energy-=this.energyConsume/this.engine.getEfficiency();
+ this.energy-=this.energyConsume;
this.processTimer=0;
dir = dir.getOpposite();
Block block = worldObj.getBlock(xCoord+dir.offsetX,yCoord+dir.offsetY,zCoord+dir.offsetZ);
@@ -144,6 +142,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i
}
@Override
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public List[] getInput()
{
return new List [] {Arrays.asList(new FluidStack [] {this.fluidTankInput.getLigthestFluid()}),null};
@@ -152,7 +151,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i
@Override
public boolean canOperate()
{
- return this.engine.correctContent() && this.getOutput()!=null;
+ return this.getOutput()!=null;
}
@Override
@@ -182,11 +181,11 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i
{
if(output2!=null)
{
- recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {input}),null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output,output2}),null,20,specialCondition));
+ recipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] {input},null), new UniversalRecipeOutput(new FluidStack[] {output,output2},null,20,specialCondition));
}
else
{
- recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {input}),null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output}),null,20,specialCondition));
+ recipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] {input},null), new UniversalRecipeOutput(new FluidStack[] {output},null,20,specialCondition));
}
}
@@ -197,7 +196,7 @@ public class CryogenicDistillerTileEntity extends BasicElectricMotorTileEntity i
public boolean canProcess()
{
- return this.engine.correctContent() && this.energy>=this.maxStorage && this.fluidTankInput.getFluidAmount()<1000;
+ return this.energy>=this.maxStorage && this.fluidTankInput.getFluidAmount()<1000;
}
@Override
diff --git a/ihl/processing/chemistry/ElectricEvaporatorBlock.java b/ihl/processing/chemistry/ElectricEvaporatorBlock.java
index 2507b2e..f65b76d 100644
--- a/ihl/processing/chemistry/ElectricEvaporatorBlock.java
+++ b/ihl/processing/chemistry/ElectricEvaporatorBlock.java
@@ -185,7 +185,6 @@ public class ElectricEvaporatorBlock extends Block implements ITileEntityProvide
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
- IIcon sideIcon = this.blockIcon;
switch (side)
{
case 0:
diff --git a/ihl/processing/chemistry/ElectricEvaporatorContainer.java b/ihl/processing/chemistry/ElectricEvaporatorContainer.java
index 9dc136e..d981d94 100644
--- a/ihl/processing/chemistry/ElectricEvaporatorContainer.java
+++ b/ihl/processing/chemistry/ElectricEvaporatorContainer.java
@@ -8,7 +8,7 @@ import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
-public class ElectricEvaporatorContainer extends ContainerBase {
+public class ElectricEvaporatorContainer extends ContainerBase<ElectricEvaporatorTileEntity> {
protected ElectricEvaporatorTileEntity tileEntity;
public int lastFluidAmount = -1;
diff --git a/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java b/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java
index 3505cda..1b5b647 100644
--- a/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java
+++ b/ihl/processing/chemistry/ElectricEvaporatorTileEntity.java
@@ -27,7 +27,6 @@ import ic2.core.audio.AudioSource;
import ic2.core.block.invslot.InvSlot;
import ic2.core.block.invslot.InvSlotUpgrade;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
import ic2.core.upgrade.IUpgradableBlock;
import ic2.core.upgrade.IUpgradeItem;
import ic2.core.upgrade.UpgradableProperty;
@@ -39,7 +38,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement
{
public final InvSlotUpgrade upgradeSlot;
private int tier;
- private int lastTier;
public int maxStorage;
private int defaultMaxStorage;
private double energy;
@@ -48,9 +46,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement
public final int defaultTier;
public int energyConsume;
public AudioSource audioSource;
- private static final int EventStart = 0;
- private static final int EventInterrupt = 1;
- private static final int EventStop = 2;
private int updateChecksum=0;
private boolean addedToEnergyNet=false;
@@ -60,7 +55,7 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement
this.defaultEnergyConsume = this.energyConsume = 8;
this.defaultOperationLength = this.maxProgress = 400;
this.energy=0D;
- this.lastTier = this.tier = this.defaultTier = 1;
+ this.tier = this.defaultTier = 1;
this.maxStorage = this.defaultMaxStorage = defaultEnergyConsume * defaultOperationLength;
this.fuelSlot = new IHLInvSlotDischarge(this, 1, Access.IO, this.tier, InvSlot.InvSide.BOTTOM);
this.upgradeSlot = new InvSlotUpgrade(this, "upgrade", 4, 4);
@@ -206,7 +201,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement
}
if(IC2.platform.isSimulating())
{
- boolean needsInvUpdate = false;
this.setOverclockRates();
if(this.getDemandedEnergy() > 1.0D)
@@ -232,7 +226,6 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement
if (this.progress >= this.maxProgress)
{
this.operate();
- needsInvUpdate = true;
this.progress = 0;
IC2.network.get().initiateTileEntityEvent(this, 2, true);
}
@@ -253,20 +246,14 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement
{
ItemStack stack = this.upgradeSlot.get(i);
- if (stack != null && stack.getItem() instanceof IUpgradeItem && ((IUpgradeItem)stack.getItem()).onTick(stack, this))
+ if (stack != null && stack.getItem() instanceof IUpgradeItem)
{
- needsInvUpdate = true;
+ ((IUpgradeItem)stack.getItem()).onTick(stack, this);
}
}
}
}
- private static int applyModifier(int base, int extra, double multiplier)
- {
- double ret = Math.round(((double)base + (double)extra) * multiplier);
- return ret > 2.147483647E9D ? Integer.MAX_VALUE : (int)ret;
- }
-
@Override
public void onNetworkEvent(int event)
{
@@ -317,7 +304,7 @@ public class ElectricEvaporatorTileEntity extends EvaporatorTileEntity implement
}
@Override
- public ContainerBase getGuiContainer(EntityPlayer entityPlayer)
+ public ContainerBase<ElectricEvaporatorTileEntity> getGuiContainer(EntityPlayer entityPlayer)
{
return new ElectricEvaporatorContainer(entityPlayer, this);
}
diff --git a/ihl/processing/chemistry/ElectrolysisBathContainer.java b/ihl/processing/chemistry/ElectrolysisBathContainer.java
index f2cc74e..9797755 100644
--- a/ihl/processing/chemistry/ElectrolysisBathContainer.java
+++ b/ihl/processing/chemistry/ElectrolysisBathContainer.java
@@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidStack;
-public class ElectrolysisBathContainer extends ContainerBase {
+public class ElectrolysisBathContainer extends ContainerBase<ElectrolysisBathTileEntity> {
protected ElectrolysisBathTileEntity tileEntity;
public int lastFluidAmount = -1;
diff --git a/ihl/processing/chemistry/ElectrolysisBathGui.java b/ihl/processing/chemistry/ElectrolysisBathGui.java
index cb39044..a7788a5 100644
--- a/ihl/processing/chemistry/ElectrolysisBathGui.java
+++ b/ihl/processing/chemistry/ElectrolysisBathGui.java
@@ -8,7 +8,6 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
-import ic2.core.network.NetworkManager;
import ihl.collector.GuiMultiTextureButton;
import ihl.utils.IHLRenderUtils;
@@ -25,6 +24,7 @@ public class ElectrolysisBathGui extends GuiContainer {
this.container=container1;
}
+ @SuppressWarnings("unchecked")
@Override
public void initGui()
{
diff --git a/ihl/processing/chemistry/ElectrolysisBathTileEntity.java b/ihl/processing/chemistry/ElectrolysisBathTileEntity.java
index b549247..5a7a215 100644
--- a/ihl/processing/chemistry/ElectrolysisBathTileEntity.java
+++ b/ihl/processing/chemistry/ElectrolysisBathTileEntity.java
@@ -1,19 +1,16 @@
package ihl.processing.chemistry;
import java.util.Arrays;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.GuiScreen;
-import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@@ -23,17 +20,11 @@ import ic2.api.network.INetworkClientTileEntityEventListener;
import ic2.core.ContainerBase;
import ic2.core.IC2;
import ic2.core.IHasGui;
-import ic2.core.block.TileEntityInventory;
import ic2.core.block.invslot.InvSlot;
import ic2.core.block.invslot.InvSlot.Access;
import ic2.core.block.invslot.InvSlotConsumableLiquid;
import ic2.core.block.invslot.InvSlotOutput;
-import ic2.core.network.NetworkManager;
-import ihl.IHLMod;
import ihl.flexible_cable.FlexibleCableHolderBaseTileEntity;
-import ihl.flexible_cable.IHLGrid;
-import ihl.flexible_cable.NodeEntity;
-import ihl.interfaces.IEnergyNetNode;
import ihl.processing.chemistry.ApparatusProcessableInvSlot;
import ihl.processing.invslots.InvSlotConsumableLiquidIHL;
import ihl.recipes.UniversalRecipeInput;
@@ -77,7 +68,6 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit
NBTTagCompound fluidTankTag = new NBTTagCompound();
this.fluidTank.writeToNBT(fluidTankTag);
nbttagcompound.setTag("fluidTank", fluidTankTag);
- NBTTagCompound fractionalOutputNBT = new NBTTagCompound();
}
@Override
@@ -101,7 +91,6 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit
super.updateEntityServer();
temperature=(short) (this.fluidTank.getTemperature()-273);
IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank);
- boolean needsInvUpdate = false;
if (this.canOperate())
{
this.setActive(true);
@@ -120,7 +109,6 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit
if (this.progress >= this.operationLength)
{
this.operate();
- needsInvUpdate = true;
this.progress = 0;
IC2.network.get().initiateTileEntityEvent(this, 2, true);
}
@@ -209,6 +197,7 @@ public class ElectrolysisBathTileEntity extends FlexibleCableHolderBaseTileEntit
return ElectrolysisBathTileEntity.recipeManager.getOutputFor(this.getInput(), false, false);
}
+ @SuppressWarnings("rawtypes")
public List[] getInput()
{
for(int i=0;i<fluidTank.getNumberOfFluids();i++)
diff --git a/ihl/processing/chemistry/EvaporatorBlock.java b/ihl/processing/chemistry/EvaporatorBlock.java
index 038a044..6994176 100644
--- a/ihl/processing/chemistry/EvaporatorBlock.java
+++ b/ihl/processing/chemistry/EvaporatorBlock.java
@@ -185,7 +185,6 @@ public class EvaporatorBlock extends Block implements ITileEntityProvider{
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
- IIcon sideIcon = this.blockIcon;
switch (side)
{
case 0:
diff --git a/ihl/processing/chemistry/EvaporatorContainer.java b/ihl/processing/chemistry/EvaporatorContainer.java
index 1df3d2f..cb83269 100644
--- a/ihl/processing/chemistry/EvaporatorContainer.java
+++ b/ihl/processing/chemistry/EvaporatorContainer.java
@@ -8,7 +8,7 @@ import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
-public class EvaporatorContainer extends ContainerBase {
+public class EvaporatorContainer extends ContainerBase<EvaporatorTileEntity> {
protected EvaporatorTileEntity tileEntity;
public int lastFluidAmount = -1;
diff --git a/ihl/processing/chemistry/EvaporatorTileEntity.java b/ihl/processing/chemistry/EvaporatorTileEntity.java
index e4eb8c0..8160d63 100644
--- a/ihl/processing/chemistry/EvaporatorTileEntity.java
+++ b/ihl/processing/chemistry/EvaporatorTileEntity.java
@@ -138,7 +138,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen
public void updateEntityServer()
{
super.updateEntityServer();
- boolean needsInvUpdate = false;
if (this.needsFluid())
{
IHLUtils.handleFluidSlotsBehaviour(fillItemsSlot, fluidItemsSlot, emptyFluidItemsSlot, fluidTank);
@@ -146,11 +145,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen
if (this.fuel <= 0 && this.canOperate())
{
this.fuel = this.maxFuel = ((InvSlotConsumableFuel) this.fuelSlot).consumeFuel();
-
- if (this.fuel > 0)
- {
- needsInvUpdate = true;
- }
}
if (this.isBurning() && this.canOperate())
@@ -161,7 +155,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen
{
this.progress = 0;
this.operate();
- needsInvUpdate = true;
}
}
else
@@ -177,7 +170,6 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen
if (this.getActive() != this.isBurning())
{
this.setActive(this.isBurning());
- needsInvUpdate = true;
}
}
@@ -219,7 +211,7 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen
}
@Override
- public ContainerBase getGuiContainer(EntityPlayer entityPlayer)
+ public ContainerBase<? extends EvaporatorTileEntity> getGuiContainer(EntityPlayer entityPlayer)
{
return new EvaporatorContainer(entityPlayer, this);
}
@@ -277,7 +269,7 @@ public class EvaporatorTileEntity extends TileEntityLiquidTankInventory implemen
public static void addRecipe(FluidStack input, ItemStack output)
{
- recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack [] {input}),null), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {output}),20));
+ recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack [] {input}),null), new UniversalRecipeOutput(null, (new ItemStack[] {output}),20));
}
public UniversalRecipeOutput getOutput()
diff --git a/ihl/processing/chemistry/ExplosiveTileEntity.java b/ihl/processing/chemistry/ExplosiveTileEntity.java
deleted file mode 100644
index 777f527..0000000
--- a/ihl/processing/chemistry/ExplosiveTileEntity.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package ihl.processing.chemistry;
-
-import ic2.core.ExplosionIC2;
-import ic2.core.block.EntityIC2Explosive;
-import ihl.utils.EntityIHLExplosion;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-
-public class ExplosiveTileEntity extends TileEntity {
-
- public int explosionPower=10000;
- public int explosionType=1;
-
- public void createExplosion(EntityPlayer player)
- {
- switch(this.explosionType)
- {
- case 0:
- ExplosionIC2 explosion = new ExplosionIC2(this.worldObj, new EntityIC2Explosive(worldObj), xCoord+0.5d, yCoord+0.5d, zCoord+0.5d, this.explosionPower/1000f, 0f, ExplosionIC2.Type.Normal,player, 0);
- System.out.println("Start");
- explosion.doExplosion();
- System.out.println("End");
- break;
- case 1:
- EntityIHLExplosion ex1 = new EntityIHLExplosion(worldObj, xCoord, yCoord, zCoord,this.explosionPower);
- worldObj.spawnEntityInWorld(ex1);
- break;
- }
- }
-
- @Override
- public void readFromNBT(NBTTagCompound nbt)
- {
- if(nbt!=null)
- {
- explosionPower=nbt.getInteger("explosionPower");
- explosionType=nbt.getInteger("explosionType");
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound nbt)
- {
- nbt.setInteger("explosionPower",explosionPower);
- nbt.setInteger("explosionType",explosionType);
- }
-
-}
diff --git a/ihl/processing/chemistry/FluidizedBedReactorContainer.java b/ihl/processing/chemistry/FluidizedBedReactorContainer.java
index 4d42d29..b2c7738 100644
--- a/ihl/processing/chemistry/FluidizedBedReactorContainer.java
+++ b/ihl/processing/chemistry/FluidizedBedReactorContainer.java
@@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidStack;
-public class FluidizedBedReactorContainer extends ContainerBase {
+public class FluidizedBedReactorContainer extends ContainerBase<FluidizedBedReactorTileEntity> {
protected FluidizedBedReactorTileEntity tileEntity;
public int lastFluidAmount = -1;
@@ -43,7 +43,7 @@ public class FluidizedBedReactorContainer extends ContainerBase {
this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 8, 23));
this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 8, 41));
this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 43, 33));
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 151, 33));
+ this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 151, 33));
}
@Override
diff --git a/ihl/processing/chemistry/FluidizedBedReactorGui.java b/ihl/processing/chemistry/FluidizedBedReactorGui.java
index 6d07aca..3b52c38 100644
--- a/ihl/processing/chemistry/FluidizedBedReactorGui.java
+++ b/ihl/processing/chemistry/FluidizedBedReactorGui.java
@@ -22,35 +22,30 @@ public class FluidizedBedReactorGui extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.renderEngine.bindTexture(background);
- int i1;
- if (this.container.tileEntity.getEnergy() > 0D)
- {
- i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12);
- this.drawTexturedModalRect(155, 17 + 12 - i1, 179, 12 - i1, 14, i1 + 2);
- }
- if (this.container.tileEntity.progress > 0)
- {
- i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(17),17);
- this.drawTexturedModalRect(25, 34, 198, 0,i1,13);
- if(mixerFrame++>3)
- {
- mixerFrame=0;
- }
- this.drawTexturedModalRect(126, 31, 244, 126+26*mixerFrame,12,26);
- }
- if (this.container.tileEntity.getTankAmount() > 0)
- {
- IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 126, 28, 138, 59, zLevel, par1, par2, xOffset, yOffset);
- }
- if(!this.container.tileEntity.engine.correctContent())
- {
- this.mc.renderEngine.bindTexture(background);
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 169, 34, xOffset, yOffset);
- }
+ int xOffset = (this.width - xSize) / 2;
+ int yOffset = (this.height - ySize) / 2;
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.renderEngine.bindTexture(background);
+ int i1;
+ if (this.container.tileEntity.getEnergy() > 0D)
+ {
+ i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12);
+ this.drawTexturedModalRect(155, 17 + 12 - i1, 179, 12 - i1, 14, i1 + 2);
+ }
+ if (this.container.tileEntity.progress > 0)
+ {
+ i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(17),17);
+ this.drawTexturedModalRect(25, 34, 198, 0,i1,13);
+ if(mixerFrame++>3)
+ {
+ mixerFrame=0;
+ }
+ this.drawTexturedModalRect(126, 31, 244, 126+26*mixerFrame,12,26);
+ }
+ if (this.container.tileEntity.getTankAmount() > 0)
+ {
+ IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 126, 28, 138, 59, zLevel, par1, par2, xOffset, yOffset);
+ }
}
@Override
diff --git a/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java b/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java
index e9b2ec5..0e279b5 100644
--- a/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java
+++ b/ihl/processing/chemistry/FluidizedBedReactorTileEntity.java
@@ -42,7 +42,6 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity
public final InvSlotOutput emptyFluidItemsSlot;
private final IHLFluidTank fluidTank = new IHLFluidTank(8000);
public short temperature=20;
- private int fractionalOutputAmount=0;
public FluidizedBedReactorTileEntity() {
super();
@@ -51,7 +50,6 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity
this.fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill);
this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 1);
this.input = new ApparatusProcessableInvSlot(this, "input", 3, Access.IO, 2, 64);
- this.isGuiScreenOpened=true;
}
@Override
@@ -125,65 +123,8 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity
public String getInventoryName() {
return "fluidizedBedReactor";
}
-
- private int mX()
- {
- switch(this.getFacing())
- {
- case 4:
- return -1;
- case 5:
- return 1;
- default:
- return 0;
- }
- }
-
- private int mZ()
- {
- switch(this.getFacing())
- {
- case 3:
- return 1;
- case 2:
- return -1;
- case 4:
- return 0;
- case 5:
- return 0;
- default:
- return -1;
- }
- }
-
- private short getFacingFromXZ(int x, int z)
- {
- switch(x)
- {
- case -1:
- return (short)4;
- case 1:
- return (short)5;
- default:
- switch(z)
- {
- case 1:
- return (short)3;
- case -1:
- return (short)2;
- default:
- return (short)2;
- }
- }
- }
-
- @Override
- public void onNetworkEvent(EntityPlayer player, int event)
- {
- // TODO Auto-generated method stub
- }
- @Override
+ @Override
public int gaugeProgressScaled(int i)
{
return this.progress * i / operationLength;
@@ -240,6 +181,7 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity
return FluidizedBedReactorTileEntity.recipeManager.getOutputFor(this.getInput(), false, false);
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public List[] getInput()
{
@@ -267,6 +209,19 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity
UniversalRecipeOutput output1 = getOutput();
this.fluidTank.drain(recipeInput.getFluidInputs(), true);
this.input.consume(0, recipeInput.getItemInputs().get(0).getAmount());
+ if(recipeInput.getItemInputs().get(0).getAmount()==0)
+ {
+ ItemStack stack = this.input.get();
+ if(stack.stackTagCompound==null)
+ {
+ stack.stackTagCompound = new NBTTagCompound();
+ }
+ stack.stackTagCompound.setInteger("catalyst_uses",stack.stackTagCompound.getInteger("catalyst_uses")+1);
+ if(stack.stackTagCompound.getInteger("catalyst_uses")>1000)
+ {
+ this.input.consume(0,1);
+ }
+ }
if(recipeInput.getItemInputs().size()>1)this.input.consume(1, recipeInput.getItemInputs().get(1).getAmount());
if(output1.getFluidOutputs().size()>0)this.fluidTank.fill(output1.getFluidOutputs().get(0).copy(), true);
if(output1.getFluidOutputs().size()>1)this.fluidTank.fill(output1.getFluidOutputs().get(1).copy(), true);
@@ -331,11 +286,11 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity
{
if(fluidStackOutput!=null)
{
- addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1}),200));
+ addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1}),200));
}
else
{
- addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {itemStackOutput1}),200));
+ addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, (new ItemStack[] {itemStackOutput1}),200));
}
}
@@ -347,11 +302,11 @@ public class FluidizedBedReactorTileEntity extends BasicElectricMotorTileEntity
public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackInput, FluidStack fluidStackOutput, RecipeOutputItemStack itemStackOutput1) {
if(fluidStackOutput!=null)
{
- addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new RecipeOutputItemStack[] {itemStackOutput1}),200));
+ addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new RecipeOutputItemStack[] {itemStackOutput1}),200));
}
else
{
- addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, Arrays.asList(new RecipeOutputItemStack[] {itemStackOutput1}),200));
+ addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(null, (new RecipeOutputItemStack[] {itemStackOutput1}),200));
}
}
diff --git a/ihl/processing/chemistry/FractionatorBottomTileEntity.java b/ihl/processing/chemistry/FractionatorBottomTileEntity.java
index 41840e0..20132e9 100644
--- a/ihl/processing/chemistry/FractionatorBottomTileEntity.java
+++ b/ihl/processing/chemistry/FractionatorBottomTileEntity.java
@@ -29,7 +29,6 @@ public class FractionatorBottomTileEntity extends TileEntityInventory
{
private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("fractionator");
private static float kF = 24000F;
- private static float gasC = 1F;
private static float fluidC = 4F;
private static float H = 2256F;
private final IHLFluidTank waterTank = new IHLFluidTank(100);
@@ -38,7 +37,7 @@ public class FractionatorBottomTileEntity extends TileEntityInventory
private int amountOfFluidEvaporated=0;
private int systemHeat=0;
private static final int maxSystemHeat=10000;
- private final List<FractionatorSectionTileEntity> listOfColumnSections = new ArrayList();
+ private final List<FractionatorSectionTileEntity> listOfColumnSections = new ArrayList<FractionatorSectionTileEntity>();
private FractionatorCoverTileEntity columnCover;
private RefluxCondenserTileEntity refluxCondenser;
private IHeatSource heatSource;
@@ -78,7 +77,7 @@ public class FractionatorBottomTileEntity extends TileEntityInventory
public static void addRecipe(FluidStack fluidIn, FluidStack fluidOut1, FluidStack fluidOut2)
{
- recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidIn}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidOut1,fluidOut2}),null,2));
+ recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidIn}), null), new UniversalRecipeOutput((new FluidStack[] {fluidOut1,fluidOut2}),null,2));
}
diff --git a/ihl/processing/chemistry/FractionatorCoverTileEntity.java b/ihl/processing/chemistry/FractionatorCoverTileEntity.java
index d7addf2..048f953 100644
--- a/ihl/processing/chemistry/FractionatorCoverTileEntity.java
+++ b/ihl/processing/chemistry/FractionatorCoverTileEntity.java
@@ -6,7 +6,6 @@ import java.util.List;
import ic2.api.network.INetworkDataProvider;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.utils.IHLUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -32,7 +31,7 @@ public class FractionatorCoverTileEntity extends TileEntity implements IWrenchab
@Override
public List<String> getNetworkedFields()
{
- List<String> fields = new ArrayList();
+ List<String> fields = new ArrayList<String>();
fields.add("facing");
return fields;
}
diff --git a/ihl/processing/chemistry/FractionatorSectionTileEntity.java b/ihl/processing/chemistry/FractionatorSectionTileEntity.java
index 18314d6..ddd3f31 100644
--- a/ihl/processing/chemistry/FractionatorSectionTileEntity.java
+++ b/ihl/processing/chemistry/FractionatorSectionTileEntity.java
@@ -6,7 +6,6 @@ import java.util.List;
import ic2.api.network.INetworkDataProvider;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.utils.IHLUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -37,7 +36,7 @@ public class FractionatorSectionTileEntity extends TileEntity implements IWrench
@Override
public List<String> getNetworkedFields()
{
- List<String> fields = new ArrayList();
+ List<String> fields = new ArrayList<String>();
fields.add("facing");
return fields;
}
diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java
index cbd3239..b283a48 100644
--- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java
+++ b/ihl/processing/chemistry/GaedesMercuryRotaryPumpContainer.java
@@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class GaedesMercuryRotaryPumpContainer extends ContainerBase {
+public class GaedesMercuryRotaryPumpContainer extends ContainerBase<GaedesMercuryRotaryPumpTileEntity> {
protected GaedesMercuryRotaryPumpTileEntity tileEntity;
private final static int height=166;
@@ -28,7 +28,7 @@ public class GaedesMercuryRotaryPumpContainer extends ContainerBase {
{
this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24));
}
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 61, 36));
+ this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 61, 36));
}
@Override
diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java
index 78f1b0c..28c9edc 100644
--- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java
+++ b/ihl/processing/chemistry/GaedesMercuryRotaryPumpGui.java
@@ -2,7 +2,6 @@ package ihl.processing.chemistry;
import org.lwjgl.opengl.GL11;
-import ihl.utils.IHLRenderUtils;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
@@ -19,9 +18,6 @@ public class GaedesMercuryRotaryPumpGui extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
-
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(tex);
int i1;
@@ -39,11 +35,6 @@ public class GaedesMercuryRotaryPumpGui extends GuiContainer {
i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27);
this.drawTexturedModalRect(17, 30, getFrameX(i1), getFrameY(i1),24,24);
}
- if(!this.container.tileEntity.engine.correctContent())
- {
- this.mc.renderEngine.bindTexture(tex);
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 79, 37, xOffset, yOffset);
- }
}
@Override
diff --git a/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java b/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java
index 3a9b814..3227ab7 100644
--- a/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java
+++ b/ihl/processing/chemistry/GaedesMercuryRotaryPumpTileEntity.java
@@ -18,7 +18,6 @@ public class GaedesMercuryRotaryPumpTileEntity extends BasicElectricMotorTileEnt
public GaedesMercuryRotaryPumpTileEntity()
{
- this.isGuiScreenOpened=true;
}
@Override
@@ -33,6 +32,7 @@ public class GaedesMercuryRotaryPumpTileEntity extends BasicElectricMotorTileEnt
return IHLUtils.getThisModItemStack("gaedesMercuryRotaryPump");
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List[] getInput()
{
diff --git a/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java b/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java
index 6c73a5b..34b3de2 100644
--- a/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java
+++ b/ihl/processing/chemistry/GoldChimneyKneeTileEntity.java
@@ -8,7 +8,6 @@ import java.util.Map;
import ic2.api.network.INetworkDataProvider;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.recipes.UniversalRecipeInput;
import ihl.recipes.UniversalRecipeManager;
import ihl.recipes.UniversalRecipeOutput;
@@ -52,7 +51,7 @@ public class GoldChimneyKneeTileEntity extends TileEntity implements IWrenchable
@Override
public List<String> getNetworkedFields()
{
- List<String> fields = new ArrayList();
+ List<String> fields = new ArrayList<String>();
fields.add("facing");
return fields;
}
@@ -273,7 +272,7 @@ public class GoldChimneyKneeTileEntity extends TileEntity implements IWrenchable
public static void addRecipe(UniversalRecipeInput input, FluidStack fluidStackWithSize)
{
- recipeManager.addRecipe(input, new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackWithSize}),null,20));
+ recipeManager.addRecipe(input, new UniversalRecipeOutput((new FluidStack[] {fluidStackWithSize}),null,20));
}
public UniversalRecipeOutput getOutput()
@@ -281,6 +280,7 @@ public class GoldChimneyKneeTileEntity extends TileEntity implements IWrenchable
return GoldChimneyKneeTileEntity.recipeManager.getOutputFor(this.getInput(), false, false);
}
+ @SuppressWarnings("rawtypes")
public List[] getInput()
{
return new List[] {Arrays.asList(new FluidStack[] {this.gasBuffer.getFluid(),this.fluidTank.getFluid()}),null};
diff --git a/ihl/processing/chemistry/LabElectrolyzerContainer.java b/ihl/processing/chemistry/LabElectrolyzerContainer.java
index 5ee9caf..b1fec2f 100644
--- a/ihl/processing/chemistry/LabElectrolyzerContainer.java
+++ b/ihl/processing/chemistry/LabElectrolyzerContainer.java
@@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidStack;
-public class LabElectrolyzerContainer extends ContainerBase {
+public class LabElectrolyzerContainer extends ContainerBase<LabElectrolyzerTileEntity> {
protected LabElectrolyzerTileEntity tileEntity;
public short lastProgress = -1;
@@ -53,7 +53,7 @@ public class LabElectrolyzerContainer extends ContainerBase {
this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 1, 42, 33));
this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 2, 106, 15));
this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 1, 87, 51));
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 152, 15));
+ this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 152, 15));
}
@Override
diff --git a/ihl/processing/chemistry/LabElectrolyzerGui.java b/ihl/processing/chemistry/LabElectrolyzerGui.java
index c5997ca..aea51f8 100644
--- a/ihl/processing/chemistry/LabElectrolyzerGui.java
+++ b/ihl/processing/chemistry/LabElectrolyzerGui.java
@@ -12,7 +12,6 @@ import ihl.utils.IHLRenderUtils;
public class LabElectrolyzerGui extends GuiContainer {
private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUILabElectrolyzer.png");
private LabElectrolyzerContainer container;
- private int mixerFrame=0;
public LabElectrolyzerGui (LabElectrolyzerContainer container1) {
//the container is instanciated and passed to the superclass for handling
@@ -53,11 +52,6 @@ public class LabElectrolyzerGui extends GuiContainer {
{
IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTankAnodeOutput, 125, 28, 137, 67, zLevel, par1, par2, xOffset, yOffset);
}
- if(!this.container.tileEntity.engine.correctContent())
- {
- this.mc.renderEngine.bindTexture(background);
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 170, 16, xOffset, yOffset);
- }
}
@Override
diff --git a/ihl/processing/chemistry/LabElectrolyzerTileEntity.java b/ihl/processing/chemistry/LabElectrolyzerTileEntity.java
index cde3e39..10feef6 100644
--- a/ihl/processing/chemistry/LabElectrolyzerTileEntity.java
+++ b/ihl/processing/chemistry/LabElectrolyzerTileEntity.java
@@ -10,7 +10,6 @@ import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@@ -52,7 +51,6 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl
this.fillInputSlotAnodeOutput = new InvSlotConsumableLiquidIHL(this, "fillInputAnodeOutput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill);
this.fillInputSlotCathodeOutput = new InvSlotConsumableLiquidIHL(this, "fillInputCathodeOutput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill);
this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 3);
- this.isGuiScreenOpened=true;
}
@Override
@@ -142,12 +140,6 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl
return "labElectrolizer";
}
- @Override
- public void onNetworkEvent(EntityPlayer player, int event)
- {
- // TODO Auto-generated method stub
- }
-
@Override
public int gaugeProgressScaled(int i)
{
@@ -188,23 +180,12 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl
return false;
}
- private boolean checkSpecialConditions()
- {
- ForgeDirection dir = ForgeDirection.getOrientation(this.getFacing());
- TileEntity te = worldObj.getTileEntity(xCoord+dir.offsetX, yCoord, zCoord+dir.offsetZ);
- if(te instanceof CryogenicDistillerTileEntity)
- {
- CryogenicDistillerTileEntity cgte = (CryogenicDistillerTileEntity)te;
- return cgte.getFacing()==this.getFacing() && cgte.canProcess();
- }
- return false;
- }
-
public UniversalRecipeOutput getOutput()
{
return LabElectrolyzerTileEntity.recipeManager.getOutputFor(this.getInput(), false, false);
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List[] getInput()
{
@@ -282,11 +263,11 @@ public class LabElectrolyzerTileEntity extends BasicElectricMotorTileEntity impl
{
if(itemStackOutput1!=null)
{
- addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), Arrays.asList(new ItemStack[] {itemStackOutput1}),200));
+ addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), (new ItemStack[] {itemStackOutput1}),200));
}
else
{
- addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), null,200));
+ addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutputAnode, fluidStackOutputCathode}), null,200));
}
}
diff --git a/ihl/processing/chemistry/LeadOvenContainer.java b/ihl/processing/chemistry/LeadOvenContainer.java
index aa0eafc..c273623 100644
--- a/ihl/processing/chemistry/LeadOvenContainer.java
+++ b/ihl/processing/chemistry/LeadOvenContainer.java
@@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class LeadOvenContainer extends ContainerBase {
+public class LeadOvenContainer extends ContainerBase<LeadOvenTileEntity> {
protected LeadOvenTileEntity tileEntity;
public int lastFluidAmount = -1;
diff --git a/ihl/processing/chemistry/LeadOvenGui.java b/ihl/processing/chemistry/LeadOvenGui.java
index 133cb4e..2d8e785 100644
--- a/ihl/processing/chemistry/LeadOvenGui.java
+++ b/ihl/processing/chemistry/LeadOvenGui.java
@@ -5,15 +5,12 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
-import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class LeadOvenGui extends GuiContainer {
private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUILeadOven.png");
private LeadOvenContainer container;
- private String title = StatCollector.translateToLocal("ihl.gui.leadOven");
-
public LeadOvenGui (LeadOvenContainer container1) {
//the container is instanciated and passed to the superclass for handling
@@ -23,10 +20,8 @@ public class LeadOvenGui extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.renderEngine.bindTexture(background);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.renderEngine.bindTexture(background);
}
@Override
diff --git a/ihl/processing/chemistry/LeadOvenTileEntity.java b/ihl/processing/chemistry/LeadOvenTileEntity.java
index 01f69bf..340d848 100644
--- a/ihl/processing/chemistry/LeadOvenTileEntity.java
+++ b/ihl/processing/chemistry/LeadOvenTileEntity.java
@@ -24,6 +24,7 @@ import ic2.core.block.TileEntityLiquidTankInventory;
import ic2.core.block.invslot.InvSlotConsumableFuel;
import ic2.core.block.invslot.InvSlot.Access;
import ihl.processing.invslots.IHLInvSlotOutput;
+import ihl.recipes.RecipeOutputItemStack;
import ihl.recipes.UniversalRecipeInput;
import ihl.recipes.UniversalRecipeManager;
import ihl.recipes.UniversalRecipeOutput;
@@ -152,7 +153,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements
}
}
}
- boolean needsInvUpdate = false;
if (this.fuel <= 0 && this.canOperate())
{
if(this.fuelSlot.get()!=null)
@@ -168,11 +168,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements
}
}
this.fuel = this.maxFuel = this.fuelSlot.consumeFuel();
-
- if (this.fuel > 0)
- {
- needsInvUpdate = true;
- }
}
if (this.isBurning() && this.canOperate())
@@ -183,7 +178,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements
{
this.progress = 0;
this.operate();
- needsInvUpdate = true;
}
}
else
@@ -199,7 +193,6 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements
if (this.getActive() != this.isBurning())
{
this.setActive(this.isBurning());
- needsInvUpdate = true;
}
}
@@ -223,12 +216,12 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements
}
@Override
- public ContainerBase getGuiContainer(EntityPlayer entityPlayer)
+ public ContainerBase<LeadOvenTileEntity> getGuiContainer(EntityPlayer entityPlayer)
{
return new LeadOvenContainer(entityPlayer, this);
}
- @Override
+ @Override
@SideOnly(Side.CLIENT)
public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin)
{
@@ -269,6 +262,7 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements
return LeadOvenTileEntity.recipeManager.getOutputFor(this.getInput(), false, false);
}
+ @SuppressWarnings("rawtypes")
public List[] getInput()
{
if(this.inputSlot.get(1)!=null)
@@ -287,7 +281,7 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements
{
this.getFluidTank().fill(output2.get(0), true);
}
- List itemOutputs = routput.getItemOutputs();
+ List<RecipeOutputItemStack> itemOutputs = routput.getItemOutputs();
if(itemOutputs!=null && !itemOutputs.isEmpty())
{
this.outputSlot.add(itemOutputs);
@@ -326,7 +320,7 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements
public static void addRecipe(UniversalRecipeInput input, FluidStack fluidStackWithSize)
{
- recipeManager.addRecipe(input, new UniversalRecipeOutput(Arrays.asList(new FluidStack[]{fluidStackWithSize}),null,20));
+ recipeManager.addRecipe(input, new UniversalRecipeOutput((new FluidStack[]{fluidStackWithSize}),null,20));
}
public static Map<UniversalRecipeInput, UniversalRecipeOutput> getRecipes() {
@@ -334,10 +328,10 @@ public class LeadOvenTileEntity extends TileEntityLiquidTankInventory implements
}
public static void addRecipe(ItemStack input, FluidStack fluidStackOutput, ItemStack output) {
- recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input})),new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}),Arrays.asList(new ItemStack[] {output}),20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input})),new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}),(new ItemStack[] {output}),20));
}
public static void addRecipe(ItemStack input, ItemStack output) {
- recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input})),new UniversalRecipeOutput(null,(new ItemStack[] {output}),20));
}
} \ No newline at end of file
diff --git a/ihl/processing/chemistry/LoomContainer.java b/ihl/processing/chemistry/LoomContainer.java
index 4b8e182..2d480ef 100644
--- a/ihl/processing/chemistry/LoomContainer.java
+++ b/ihl/processing/chemistry/LoomContainer.java
@@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class LoomContainer extends ContainerBase {
+public class LoomContainer extends ContainerBase<LoomTileEntity> {
public LoomTileEntity tileEntity;
public int lastProgress = -1;
diff --git a/ihl/processing/chemistry/LoomGui.java b/ihl/processing/chemistry/LoomGui.java
index 1052252..4964687 100644
--- a/ihl/processing/chemistry/LoomGui.java
+++ b/ihl/processing/chemistry/LoomGui.java
@@ -3,7 +3,6 @@ package ihl.processing.chemistry;
import org.lwjgl.opengl.GL11;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.utils.IHLRenderUtils;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
diff --git a/ihl/processing/chemistry/LoomTileEntity.java b/ihl/processing/chemistry/LoomTileEntity.java
index df5ce20..e81680d 100644
--- a/ihl/processing/chemistry/LoomTileEntity.java
+++ b/ihl/processing/chemistry/LoomTileEntity.java
@@ -11,7 +11,6 @@ import ic2.core.IC2;
import ic2.core.IHasGui;
import ic2.core.block.TileEntityInventory;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
import ihl.processing.chemistry.ApparatusProcessableInvSlot;
import ihl.processing.invslots.IHLInvSlotOutput;
import ihl.recipes.RecipeInputWire;
@@ -106,7 +105,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet
public void operate()
{
List<IRecipeInput> input1 = LoomTileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs();
- List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs();
+ List<?> output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs();
this.output.add(output1);
if(input1.get(0) instanceof RecipeInputWire)
{
@@ -123,6 +122,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet
}
}
+ @SuppressWarnings("rawtypes")
public List[] getInput()
{
return new List[] {null,Arrays.asList(new ItemStack[] {input.get()})};
@@ -131,7 +131,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet
public boolean canOperate()
{
if(LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false)==null) return false;
- List output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs();
+ List<?> output1 = LoomTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs();
return this.output.canAdd(output1);
}
@@ -141,7 +141,7 @@ public class LoomTileEntity extends TileEntityInventory implements IHasGui, INet
public static void addRecipe(ItemStack input, ItemStack output)
{
if(input==null || output==null) throw new NullPointerException();
- recipeManager.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new ItemStack[] {input})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {output}),20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null,new ItemStack[] {input}), new UniversalRecipeOutput(null, new ItemStack[] {output},20));
}
public int gaugeProgressScaled(int i)
diff --git a/ihl/processing/chemistry/PaperMachineContainer.java b/ihl/processing/chemistry/PaperMachineContainer.java
index 99bfa61..ea07afc 100644
--- a/ihl/processing/chemistry/PaperMachineContainer.java
+++ b/ihl/processing/chemistry/PaperMachineContainer.java
@@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidStack;
-public class PaperMachineContainer extends ContainerBase {
+public class PaperMachineContainer extends ContainerBase<PaperMachineTileEntity> {
protected PaperMachineTileEntity tileEntity;
public int lastFluidAmount = -1;
@@ -41,7 +41,7 @@ public class PaperMachineContainer extends ContainerBase {
this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 78, 15));
this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 78, 33));
this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 122, 51));
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 8, 32));
+ this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 8, 32));
}
@Override
diff --git a/ihl/processing/chemistry/PaperMachineGui.java b/ihl/processing/chemistry/PaperMachineGui.java
index 4c8cb72..b65f041 100644
--- a/ihl/processing/chemistry/PaperMachineGui.java
+++ b/ihl/processing/chemistry/PaperMachineGui.java
@@ -54,11 +54,6 @@ public class PaperMachineGui extends GuiContainer {
{
IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.getFluidTank(), 102, 28, 114, 59, zLevel, par1, par2, xOffset, yOffset);
}
- if(!this.container.tileEntity.engine.correctContent())
- {
- this.mc.renderEngine.bindTexture(background);
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset);
- }
}
@Override
diff --git a/ihl/processing/chemistry/PaperMachineTileEntity.java b/ihl/processing/chemistry/PaperMachineTileEntity.java
index a694b82..4784d38 100644
--- a/ihl/processing/chemistry/PaperMachineTileEntity.java
+++ b/ihl/processing/chemistry/PaperMachineTileEntity.java
@@ -39,7 +39,6 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme
public final InvSlotOutput emptyFluidItemsSlot;
private final IHLFluidTank fluidTank = new IHLFluidTank(8000);
public short temperature=20;
- private int fractionalOutputAmount=0;
public PaperMachineTileEntity() {
super();
@@ -47,7 +46,6 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme
this.drainInputSlot = new InvSlotConsumableLiquidIHL(this, "drainInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.TOP, InvSlotConsumableLiquid.OpType.Drain);
this.fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill);
this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 1);
- this.isGuiScreenOpened=true;
}
@Override
@@ -64,7 +62,6 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme
NBTTagCompound fluidTankTag = new NBTTagCompound();
this.fluidTank.writeToNBT(fluidTankTag);
nbttagcompound.setTag("fluidTank", fluidTankTag);
- NBTTagCompound fractionalOutputNBT = new NBTTagCompound();
}
@Override
@@ -115,69 +112,12 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme
return "chemicalReactor";
}
- private int mX()
- {
- switch(this.getFacing())
- {
- case 4:
- return -1;
- case 5:
- return 1;
- default:
- return 0;
- }
- }
-
- private int mZ()
- {
- switch(this.getFacing())
- {
- case 3:
- return 1;
- case 2:
- return -1;
- case 4:
- return 0;
- case 5:
- return 0;
- default:
- return -1;
- }
- }
-
- private short getFacingFromXZ(int x, int z)
- {
- switch(x)
- {
- case -1:
- return (short)4;
- case 1:
- return (short)5;
- default:
- switch(z)
- {
- case 1:
- return (short)3;
- case -1:
- return (short)2;
- default:
- return (short)2;
- }
- }
- }
-
public float getRenderLiquidLevel()
{
return (float)this.fluidTank.getFluidAmount()/(float)this.fluidTank.getCapacity();
}
@Override
- public void onNetworkEvent(EntityPlayer player, int event)
- {
- // TODO Auto-generated method stub
- }
-
- @Override
public int gaugeProgressScaled(int i)
{
return this.progress * i / operationLength;
@@ -235,6 +175,7 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme
}
@Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public List[] getInput()
{
return new List[] {Arrays.asList(new FluidStack[]{fluidTank.getFluid()}), null};
@@ -304,12 +245,12 @@ public class PaperMachineTileEntity extends BasicElectricMotorTileEntity impleme
public static void addRecipe(FluidStack fluidStackInput1, ItemStack itemStackOutput1)
{
- addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {itemStackOutput1}),200));
+ addRecipe(new UniversalRecipeInput((new FluidStack[] {fluidStackInput1}), null), new UniversalRecipeOutput(null, (new ItemStack[] {itemStackOutput1}),200));
}
public static void addSpecialConditionsRecipe(FluidStack fluidStackInput1, FluidStack fluidStackInput2, ItemStack itemStackInput, FluidStack fluidStackOutput, ItemStack itemStackOutput1, ItemStack itemStackOutput2)
{
- addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {fluidStackInput1, fluidStackInput2}), Arrays.asList(new ItemStack[] {itemStackInput})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStackOutput}), Arrays.asList(new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true));
+ addRecipe(new UniversalRecipeInput(new FluidStack[] {fluidStackInput1, fluidStackInput2}, (new ItemStack[] {itemStackInput})), new UniversalRecipeOutput((new FluidStack[] {fluidStackOutput}), (new ItemStack[] {itemStackOutput1, itemStackOutput2}),200, true));
}
public IHLFluidTank getFluidTank()
diff --git a/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java b/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java
index becd7e8..6f3b43f 100644
--- a/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java
+++ b/ihl/processing/chemistry/PrecipitatorCondenserTileEntity.java
@@ -25,7 +25,6 @@ public class PrecipitatorCondenserTileEntity extends TileEntityInventory impleme
{
private final static UniversalRecipeManager recipeManager = new UniversalRecipeManager("precipitatorcondenser");
private static float kF = 24000F;
- private static float gasC = 1F;
private static float fluidC = 4F;
private static float H = 2256F;
private final IHLFluidTank gasBuffer = new IHLFluidTank(10000);
@@ -49,7 +48,7 @@ public class PrecipitatorCondenserTileEntity extends TileEntityInventory impleme
public static void addRecipe(String fluidNameIn, String fluidNameOut, int conversionRateToGas)
{
- recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameIn, conversionRateToGas)}), null), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameOut, 1)}),null,2));
+ recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameIn, conversionRateToGas)}), null), new UniversalRecipeOutput((new FluidStack[] {IHLUtils.getFluidStackWithSize(fluidNameOut, 1)}),null,2));
}
@Override
diff --git a/ihl/processing/chemistry/RefluxCondenserTileEntity.java b/ihl/processing/chemistry/RefluxCondenserTileEntity.java
index 91366fb..b6cbcb0 100644
--- a/ihl/processing/chemistry/RefluxCondenserTileEntity.java
+++ b/ihl/processing/chemistry/RefluxCondenserTileEntity.java
@@ -6,7 +6,6 @@ import java.util.List;
import ic2.api.network.INetworkDataProvider;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.utils.IHLUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -37,7 +36,7 @@ public class RefluxCondenserTileEntity extends TileEntity implements IWrenchable
@Override
public List<String> getNetworkedFields()
{
- List<String> fields = new ArrayList();
+ List<String> fields = new ArrayList<String>();
fields.add("facing");
return fields;
}
diff --git a/ihl/processing/invslots/IHLInvSlotOutput.java b/ihl/processing/invslots/IHLInvSlotOutput.java
index 94bf3c8..7e10ab3 100644
--- a/ihl/processing/invslots/IHLInvSlotOutput.java
+++ b/ihl/processing/invslots/IHLInvSlotOutput.java
@@ -18,11 +18,12 @@ import ihl.utils.IHLUtils;
public class IHLInvSlotOutput extends InvSlotOutput{
- private final Map<Long,Float> substanceAmount = new HashMap();
+ private final Map<Long,Float> substanceAmount = new HashMap<Long,Float>();
public IHLInvSlotOutput(TileEntityInventory base1, String name1, int oldStartIndex1, int count) {
super(base1, name1, oldStartIndex1, count);
}
+ @SuppressWarnings("rawtypes")
@Override
public boolean canAdd(List itemOutputs)
{
@@ -82,7 +83,6 @@ public class IHLInvSlotOutput extends InvSlotOutput{
public boolean objectMatchesSlot(Object obj, int slot)
{
- boolean matches=true;
if(this.get(slot)==null)
{
return true;
@@ -131,6 +131,7 @@ public class IHLInvSlotOutput extends InvSlotOutput{
}
@Override
+ @SuppressWarnings("rawtypes")
public int add(List itemOutputs)
{
if(itemOutputs==null || itemOutputs.isEmpty())
@@ -196,7 +197,6 @@ public class IHLInvSlotOutput extends InvSlotOutput{
{
super.writeToNbt(nbtTagCompound);
NBTTagList sAmountsList = new NBTTagList();
- int i = 0;
Iterator<Entry<Long, Float>> entrySetIterator = this.substanceAmount.entrySet().iterator();
while(entrySetIterator.hasNext())
{
diff --git a/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java b/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java
index c88584e..0a3b664 100644
--- a/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java
+++ b/ihl/processing/invslots/InvSlotConsumableLiquidIHL.java
@@ -225,11 +225,11 @@ public class InvSlotConsumableLiquidIHL extends InvSlotConsumableLiquid{
return true;
}
- Iterator containerItem1 = this.getPossibleFluids().iterator();
+ Iterator<Fluid> containerItem1 = this.getPossibleFluids().iterator();
while (containerItem1.hasNext())
{
- Fluid prevFluid = (Fluid)containerItem1.next();
+ Fluid prevFluid = containerItem1.next();
if (FluidContainerRegistry.fillFluidContainer(new FluidStack(prevFluid, Integer.MAX_VALUE), stack) != null)
{
@@ -250,11 +250,11 @@ public class InvSlotConsumableLiquidIHL extends InvSlotConsumableLiquid{
}
ItemStack singleStack = StackUtil.copyWithSize(stack, 1);
- Iterator i$ = this.getPossibleFluids().iterator();
+ Iterator<Fluid> i$ = this.getPossibleFluids().iterator();
while (i$.hasNext())
{
- Fluid fluid = (Fluid)i$.next();
+ Fluid fluid = i$.next();
if (containerItem2.fill(singleStack, new FluidStack(fluid, Integer.MAX_VALUE), false) > 0)
{
diff --git a/ihl/processing/invslots/InvSlotSignalProcessor.java b/ihl/processing/invslots/InvSlotSignalProcessor.java
index 6663db0..f66ab13 100644
--- a/ihl/processing/invslots/InvSlotSignalProcessor.java
+++ b/ihl/processing/invslots/InvSlotSignalProcessor.java
@@ -1,11 +1,9 @@
package ihl.processing.invslots;
-import java.util.Iterator;
import net.minecraft.block.Block;
import net.minecraftforge.common.util.ForgeDirection;
import ic2.core.Ic2Items;
import ic2.core.block.invslot.InvSlot;
-import ihl.IHLMod;
import ihl.datanet.Contact;
import ihl.datanet.RedstoneSignalConverterTileEntity;
import ihl.interfaces.IDataNode;
diff --git a/ihl/processing/invslots/SlotInvSlotIronWorkbench.java b/ihl/processing/invslots/SlotInvSlotIronWorkbench.java
new file mode 100644
index 0000000..94354ea
--- /dev/null
+++ b/ihl/processing/invslots/SlotInvSlotIronWorkbench.java
@@ -0,0 +1,31 @@
+package ihl.processing.invslots;
+
+import net.minecraft.entity.player.EntityPlayer;
+import ic2.core.slot.SlotInvSlot;
+import ihl.flexible_cable.*;
+
+public class SlotInvSlotIronWorkbench extends SlotInvSlot {
+
+ public IronWorkbenchInvSlot invSlot;
+
+ public SlotInvSlotIronWorkbench(IronWorkbenchInvSlot invSlot1, int index1,
+ int xDisplayPosition1, int yDisplayPosition1) {
+ super(invSlot1, index1, xDisplayPosition1, yDisplayPosition1);
+ this.invSlot=invSlot1;
+
+ }
+
+ @Override
+ public boolean canTakeStack(EntityPlayer player)
+ {
+ return this.invSlot.getCanTakeStack();
+ }
+
+
+ @Override
+ public void onSlotChanged()
+ {
+ super.onSlotChanged();
+ ((IronWorkbenchTileEntity)this.invSlot.base).resetOutput();
+ }
+}
diff --git a/ihl/processing/metallurgy/AchesonFurnaceGui.java b/ihl/processing/metallurgy/AchesonFurnaceGui.java
index bafa530..70e9d05 100644
--- a/ihl/processing/metallurgy/AchesonFurnaceGui.java
+++ b/ihl/processing/metallurgy/AchesonFurnaceGui.java
@@ -17,8 +17,6 @@ public class AchesonFurnaceGui extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(achesonFurnaceBackground);
int i1;
diff --git a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java b/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java
index 5d228fc..0c1b75f 100644
--- a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java
+++ b/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java
@@ -1,6 +1,5 @@
package ihl.processing.metallurgy;
-import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -35,7 +34,7 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{
public static void addRecipe(IRecipeInput input1, IRecipeInput input2, String output1)
{
- recipeManager.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new IRecipeInput [] {input1,input2})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack [] {IHLUtils.getThisModItemStack(output1)}),20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null,new IRecipeInput [] {input1,input2}),new UniversalRecipeOutput(null,new ItemStack [] {IHLUtils.getThisModItemStack(output1)},20));
}
@Override
@@ -46,13 +45,11 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{
@Override
public String getLoopSoundFile() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getStopSoundFile() {
- // TODO Auto-generated method stub
return null;
}
@@ -104,7 +101,7 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{
ItemStack crucible = input.getItemStack(IHLMod.crucible);
if(crucible!=null)
{
- ItemStack stack = ((Crucible)crucible.getItem()).processContent(crucible, this);
+ ((Crucible)crucible.getItem()).processContent(crucible, this);
}
}
@@ -117,7 +114,7 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{
}
@Override
- public List[] getInput()
+ public List<?>[] getInput()
{
return new List[] {null, this.input.getItemStackList()};
}
diff --git a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java b/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java
index 11865a4..47cfda9 100644
--- a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java
+++ b/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java
@@ -9,18 +9,12 @@ import ic2.api.energy.tile.IEnergySink;
import ic2.api.network.INetworkClientTileEntityEventListener;
import ic2.core.IC2;
import ic2.core.IHasGui;
-import ic2.core.block.TileEntityInventory;
+import ic2.core.block.invslot.InvSlot;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
-import ihl.IHLMod;
import ihl.flexible_cable.FlexibleCableHolderBaseTileEntity;
-import ihl.flexible_cable.IHLGrid;
import ihl.flexible_cable.NodeEntity;
-import ihl.interfaces.IEnergyNetNode;
-import ihl.utils.IHLUtils;
-import net.minecraft.entity.item.EntityItem;
+import ihl.utils.IHLInvSlotDischarge;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
@@ -29,10 +23,9 @@ import net.minecraftforge.common.util.ForgeDirection;
public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBaseTileEntity implements IHasGui, INetworkClientTileEntityEventListener, IEnergySink{
- public final ElectricEngineInvSlot engine;
+ public final IHLInvSlotDischarge dischargeSlot;
public short progress;
protected short operationLength=600;
- public boolean isGuiScreenOpened=false;
protected final double energyConsume=0.1D;
public double energy;
public int maxStorage=128;
@@ -41,7 +34,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa
public BasicElectricMotorTileEntity()
{
super();
- engine = new ElectricEngineInvSlot(this, "engine", 0, Access.IO, 1, 1);
+ dischargeSlot = new IHLInvSlotDischarge(this, 1, Access.IO, 4, InvSlot.InvSide.BOTTOM);
}
@@ -79,6 +72,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa
}
+ @SuppressWarnings("unchecked")
@Override
public void setFacing(short facing1)
{
@@ -125,10 +119,10 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa
}
if(!nodeList.isEmpty())
{
- Iterator ei = nodeList.iterator();
+ Iterator<NodeEntity> ei = nodeList.iterator();
while(ei.hasNext())
{
- NodeEntity ne=(NodeEntity) ei.next();
+ NodeEntity ne= ei.next();
if((ne.prevAnchorEntity==null||ne.nextAnchorEntity==null) && this.cableListContains(ne.getChainUniqueID()))
{
ne.setVirtualNodePos(connectionX,connectionY,connectionZ);
@@ -194,7 +188,6 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa
switch(event)
{
case 0:
- this.isGuiScreenOpened=false;
break;
}
}
@@ -204,14 +197,19 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa
@Override
public void updateEntityServer()
{
- if(this.gridID!=-1 && this.getGrid().energy>0D && this.energy<this.maxStorage)
- {
- this.energy+=energyConsume*10D;
- this.getGrid().drawEnergy(energyConsume*10D, this);
- }
- if (this.canOperate() && this.engine.correctContent() && this.isGuiScreenOpened && this.energy>=this.energyConsume/this.engine.getEfficiency())
+ if(this.getDemandedEnergy() > 1.0D)
+ {
+ double amount = this.dischargeSlot.discharge(this.getDemandedEnergy(), false);
+ this.energy += amount;
+ }
+ if(this.gridID!=-1 && this.getGrid().energy>0D && this.energy<this.maxStorage)
{
- this.energy-=this.energyConsume/this.engine.getEfficiency();
+ this.energy+=energyConsume*10D;
+ this.getGrid().drawEnergy(energyConsume*10D, this);
+ }
+ if (this.canOperate() && this.energy>=this.energyConsume)
+ {
+ this.energy-=this.energyConsume;
if (this.progress == 0)
{
IC2.network.get().initiateTileEntityEvent(this, 0, true);
@@ -238,7 +236,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa
}
- public abstract List[] getInput();
+ public abstract List<?>[] getInput();
public abstract boolean canOperate();
@Override
public void onGuiClosed(EntityPlayer arg0) {}
@@ -294,6 +292,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa
return 0d;
}
+ @Override
public void injectEnergyInThisNode(double amount, double voltage)
{
this.energy+=amount;
diff --git a/ihl/processing/metallurgy/CoilerContainer.java b/ihl/processing/metallurgy/CoilerContainer.java
index ba809d2..710a708 100644
--- a/ihl/processing/metallurgy/CoilerContainer.java
+++ b/ihl/processing/metallurgy/CoilerContainer.java
@@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class CoilerContainer extends ContainerBase {
+public class CoilerContainer extends ContainerBase<CoilerTileEntity> {
public CoilerTileEntity tileEntity;
private short lastEnergy = -1;
@@ -31,7 +31,7 @@ public class CoilerContainer extends ContainerBase {
this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24));
}
this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.output, 0, 69, 22));
- this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55));
+ this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55));
}
@Override
diff --git a/ihl/processing/metallurgy/CoilerGui.java b/ihl/processing/metallurgy/CoilerGui.java
index fd3b7cd..b635506 100644
--- a/ihl/processing/metallurgy/CoilerGui.java
+++ b/ihl/processing/metallurgy/CoilerGui.java
@@ -32,10 +32,6 @@ public class CoilerGui extends GuiContainer {
i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12);
this.drawTexturedModalRect(39, 55 + 12 - i1, 179, 12 - i1, 14, i1 + 2);
}
- if(!this.container.tileEntity.engine.correctContent())
- {
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset);
- }
IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.coiler.tip"));
}
diff --git a/ihl/processing/metallurgy/CoilerRender.java b/ihl/processing/metallurgy/CoilerRender.java
index 646b342..f3da8fa 100644
--- a/ihl/processing/metallurgy/CoilerRender.java
+++ b/ihl/processing/metallurgy/CoilerRender.java
@@ -70,11 +70,8 @@ private final float scale=1F/16F;
{
model.CoilRotating.render(scale);
}
- if(cte.hasEngine)
- {
- model.MotorPart1.render(scale);
- model.MotorPart2.render(scale);
- }
+ model.MotorPart1.render(scale);
+ model.MotorPart2.render(scale);
}
model.RotatingPart2.render(scale);
GL11.glPopMatrix(); //end
diff --git a/ihl/processing/metallurgy/CoilerTileEntity.java b/ihl/processing/metallurgy/CoilerTileEntity.java
index 6a671b0..5fdcf13 100644
--- a/ihl/processing/metallurgy/CoilerTileEntity.java
+++ b/ihl/processing/metallurgy/CoilerTileEntity.java
@@ -5,7 +5,6 @@ import java.util.List;
import ic2.core.ContainerBase;
import ic2.core.IC2;
import ic2.core.block.invslot.InvSlotOutput;
-import ic2.core.network.NetworkManager;
import ihl.interfaces.IWire;
import ihl.utils.IHLUtils;
import net.minecraft.client.gui.GuiScreen;
@@ -19,13 +18,11 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP
public final InvSlotOutput output;
private int activeTimer=0;
public boolean hasCoil=false;
- public boolean hasEngine=false;
public CoilerTileEntity()
{
super();
this.output = new InvSlotOutput(this, "output", 1, 1);
- this.isGuiScreenOpened=true;
}
@@ -39,7 +36,6 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP
{
List<String> fields = super.getNetworkedFields();
fields.add("hasCoil");
- fields.add("hasEngine");
return fields;
}
@@ -89,34 +85,22 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP
this.hasCoil=true;
IC2.network.get().updateTileEntityField(this, "hasCoil");
}
- if(this.engine.isEmpty() && hasEngine==true)
- {
- this.hasEngine=false;
- IC2.network.get().updateTileEntityField(this, "hasEngine");
- }
- else if(this.engine.correctContent() && hasEngine==false)
- {
- this.hasEngine=true;
- IC2.network.get().updateTileEntityField(this, "hasEngine");
- }
-
}
@Override
public void operate()
{}
-
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List[] getInput()
{
return null;
}
-
@Override
public boolean canProcess(ItemStack cable) {
- if(this.engine.correctContent() && this.energy>1D/this.engine.getEfficiency() && cable.getItem() instanceof IWire)
+ if(this.energy>1D && cable.getItem() instanceof IWire)
{
if(this.output.isEmpty())
{
@@ -139,7 +123,7 @@ public class CoilerTileEntity extends BasicElectricMotorTileEntity implements IP
public void process(ItemStack cable) {
if(cable.getItem() instanceof IWire)
{
- this.energy-=1D/this.engine.getEfficiency();
+ this.energy-=1D;
if(this.output.isEmpty())
{
setActive(true);
diff --git a/ihl/processing/metallurgy/Crucible.java b/ihl/processing/metallurgy/Crucible.java
index a435e49..3f14f48 100644
--- a/ihl/processing/metallurgy/Crucible.java
+++ b/ihl/processing/metallurgy/Crucible.java
@@ -25,7 +25,6 @@ import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler;
-import net.minecraftforge.oredict.OreDictionary;
import ic2.api.item.IItemHudInfo;
import ic2.api.recipe.IRecipeInput;
import ic2.api.recipe.RecipeInputOreDict;
@@ -62,7 +61,7 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine
public static void addRecipe(String string, FluidStack output)
{
- recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new IRecipeInput[] {new RecipeInputOreDict(string)})), new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output}),null,20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, new IRecipeInput[] {new RecipeInputOreDict(string)}), new UniversalRecipeOutput(new FluidStack[] {output},null,20));
}
@Override
@@ -84,7 +83,8 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine
/**
* allows items to add custom lines of information to the mouseover description
*/
- @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b)
{
super.addInformation(itemStack, player, info, b);
@@ -103,7 +103,7 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine
@Override
public List<String> getHudInfo(ItemStack itemStack)
{
- LinkedList info = new LinkedList();
+ LinkedList<String> info = new LinkedList<String>();
FluidStack fs = this.getFluid(itemStack);
if (fs != null)
@@ -249,29 +249,7 @@ public class Crucible extends Item implements IHandHeldInventory, IFluidContaine
}
}
}
- private String getFormattedFluidNameFromMaterialName(String input)
- {
- if(input.length()<6)
- {
- return "";
- }
- String input2 = input.substring(5);
- return "molten."+input2.toLowerCase();
- }
-
- private String getOreName(ItemStack stack)
- {
- int[] arrayIDs = OreDictionary.getOreIDs(stack);
- for(int i=0; i<arrayIDs.length;i++)
- {
- if(OreDictionary.getOreName(arrayIDs[i]).startsWith("ingot"))
- {
- return OreDictionary.getOreName(arrayIDs[i]);
- }
- }
- return "";
- }
-
+
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register)
diff --git a/ihl/processing/metallurgy/CrucibleContainer.java b/ihl/processing/metallurgy/CrucibleContainer.java
index b3ab3d8..647c277 100644
--- a/ihl/processing/metallurgy/CrucibleContainer.java
+++ b/ihl/processing/metallurgy/CrucibleContainer.java
@@ -4,7 +4,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
import ic2.core.ContainerBase;
import ic2.core.IC2;
import ic2.core.util.StackUtil;
@@ -44,7 +43,7 @@ public class CrucibleContainer extends ContainerBase<CrucibleInventory>
if (stack != null)
{
- NBTTagCompound nbtTagCompoundSlot = StackUtil.getOrCreateNbtData(stack);
+ StackUtil.getOrCreateNbtData(stack);
if (this.box.isThisContainer(stack))
{
diff --git a/ihl/processing/metallurgy/CrucibleGui.java b/ihl/processing/metallurgy/CrucibleGui.java
index b0bfc85..e92347c 100644
--- a/ihl/processing/metallurgy/CrucibleGui.java
+++ b/ihl/processing/metallurgy/CrucibleGui.java
@@ -27,8 +27,6 @@ public class CrucibleGui extends GuiContainer
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
fontRendererObj.drawString(title, 68, 0, 6171880);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java b/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java
index 3bfd2b0..94d479c 100644
--- a/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java
+++ b/ihl/processing/metallurgy/DetonationSprayingMachineContainer.java
@@ -5,7 +5,7 @@ import ic2.core.slot.SlotInvSlot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
-public class DetonationSprayingMachineContainer extends ContainerBase {
+public class DetonationSprayingMachineContainer extends ContainerBase<DetonationSprayingMachineTileEntity> {
protected DetonationSprayingMachineTileEntity tileEntity;
public int lastFluidAmount = -1;
diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineGui.java b/ihl/processing/metallurgy/DetonationSprayingMachineGui.java
index cc4d455..66d9acb 100644
--- a/ihl/processing/metallurgy/DetonationSprayingMachineGui.java
+++ b/ihl/processing/metallurgy/DetonationSprayingMachineGui.java
@@ -17,24 +17,21 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class DetonationSprayingMachineGui extends GuiContainer {
private static final ResourceLocation background = new ResourceLocation("ihl", "textures/gui/GUIDetonationSprayingMachine.png");
- private DetonationSprayingMachineContainer container;
private static final String hint = StatCollector.translateToLocal("ihl.dsmhint");
public DetonationSprayingMachineGui (DetonationSprayingMachineContainer detonationSprayingMachineContainer) {
//the container is instanciated and passed to the superclass for handling
super(detonationSprayingMachineContainer);
- this.container=detonationSprayingMachineContainer;
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.renderEngine.bindTexture(background);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.renderEngine.bindTexture(background);
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2,
int par3) {
//draw your Gui here, only thing you need to change is the path
diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineModel.java b/ihl/processing/metallurgy/DetonationSprayingMachineModel.java
index 48329d5..7335125 100644
--- a/ihl/processing/metallurgy/DetonationSprayingMachineModel.java
+++ b/ihl/processing/metallurgy/DetonationSprayingMachineModel.java
@@ -2,7 +2,6 @@ package ihl.processing.metallurgy;
import ihl.model.IHLModelRenderer;
import net.minecraft.client.model.ModelBase;
-import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraftforge.common.util.ForgeDirection;
@@ -48,13 +47,6 @@ public class DetonationSprayingMachineModel extends ModelBase {
Base.addTube("Tube11", -1F, 10F, -8F, 2, 2, 1, 0F,1F,ForgeDirection.NORTH);
}
- private void setRotation(ModelRenderer model, float x, float y, float z)
- {
- model.rotateAngleX = x;
- model.rotateAngleY = y;
- model.rotateAngleZ = z;
- }
-
@Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineRender.java b/ihl/processing/metallurgy/DetonationSprayingMachineRender.java
index 9bb0c6e..ee64b65 100644
--- a/ihl/processing/metallurgy/DetonationSprayingMachineRender.java
+++ b/ihl/processing/metallurgy/DetonationSprayingMachineRender.java
@@ -49,7 +49,7 @@ public void renderAModelAt(DetonationSprayingMachineTileEntity tile, double x, d
bindTexture(tex); //texture
GL11.glScalef(1F, -1F, -1F);
GL11.glTranslatef(0F, -1.0F, 0F);
- model.Base.render(1.0F/16.0F);
+ model.Base.render(scale);
GL11.glPopMatrix();
}
diff --git a/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java b/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java
index 590f6e9..f9d2cb6 100644
--- a/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java
+++ b/ihl/processing/metallurgy/DetonationSprayingMachineTileEntity.java
@@ -23,7 +23,6 @@ import ic2.core.audio.AudioSource;
import ic2.core.audio.PositionSpec;
import ic2.core.block.TileEntityInventory;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
import ihl.processing.chemistry.ApparatusProcessableInvSlot;
import ihl.recipes.RecipeOutputItemStack;
import ihl.recipes.UniversalRecipeInput;
@@ -76,58 +75,6 @@ public class DetonationSprayingMachineTileEntity extends TileEntityInventory imp
return "detonationSprayingMachine";
}
- private int mX()
- {
- switch(this.getFacing())
- {
- case 4:
- return -1;
- case 5:
- return 1;
- default:
- return 0;
- }
- }
-
- private int mZ()
- {
- switch(this.getFacing())
- {
- case 3:
- return 1;
- case 2:
- return -1;
- case 4:
- return 0;
- case 5:
- return 0;
- default:
- return -1;
- }
- }
-
- private short getFacingFromXZ(int x, int z)
- {
- switch(x)
- {
- case -1:
- return (short)4;
- case 1:
- return (short)5;
- default:
- switch(z)
- {
- case 1:
- return (short)3;
- case -1:
- return (short)2;
- default:
- return (short)2;
- }
- }
- }
-
-
@Override
public void onNetworkEvent(int event)
{
@@ -158,7 +105,7 @@ public class DetonationSprayingMachineTileEntity extends TileEntityInventory imp
return DetonationSprayingMachineTileEntity.recipeManager.getOutputFor(this.getInput(), false, false);
}
- public List[] getInput()
+ public List<?>[] getInput()
{
return new List[] {null,this.input.getItemStackList()};
}
@@ -226,11 +173,11 @@ public class DetonationSprayingMachineTileEntity extends TileEntityInventory imp
public static void addRecipe(ItemStack input, ItemStack output)
{
- List<IRecipeInput> dsmInputs1 = new ArrayList();
- dsmInputs1.add(new RecipeInputItemStack(input));
- dsmInputs1.add(new RecipeInputOreDict("dustDiamond"));
- dsmInputs1.add(new RecipeInputOreDict("dustGunpowder"));
- recipeManager.addRecipe(new UniversalRecipeInput(null, dsmInputs1), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),1));
+ IRecipeInput[] dsmInputs1 = new IRecipeInput[3];
+ dsmInputs1[0]=new RecipeInputItemStack(input);
+ dsmInputs1[1]=new RecipeInputOreDict("dustDiamond");
+ dsmInputs1[2]=new RecipeInputOreDict("dustGunpowder");
+ recipeManager.addRecipe(new UniversalRecipeInput(null, dsmInputs1), new UniversalRecipeOutput(null,new ItemStack[] {output},1));
}
public static void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output)
diff --git a/ihl/processing/metallurgy/DrawingDeskContainer.java b/ihl/processing/metallurgy/DrawingDeskContainer.java
deleted file mode 100644
index ca570a1..0000000
--- a/ihl/processing/metallurgy/DrawingDeskContainer.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package ihl.processing.metallurgy;
-
-import ic2.core.ContainerBase;
-import ic2.core.slot.SlotInvSlot;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.ICrafting;
-import net.minecraft.inventory.Slot;
-
-public class DrawingDeskContainer extends ContainerBase {
-
- public DrawingDeskTileEntity tileEntity;
- public int lastProgress = -1;
- private final static int height=166;
-
- public DrawingDeskContainer(EntityPlayer entityPlayer,
- DrawingDeskTileEntity tileEntity1) {
- super(tileEntity1);
- tileEntity=tileEntity1;
- int col;
-
- for (col = 0; col < 3; ++col)
- {
- for (int col1 = 0; col1 < 9; ++col1)
- {
- this.addSlotToContainer(new Slot(entityPlayer.inventory, col1 + col * 9 + 9, 8 + col1 * 18, height + -82 + col * 18));
- }
- }
-
- for (col = 0; col < 9; ++col)
- {
- this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24));
- }
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 8, 44));
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.output, 0, 127, 44));
- }
-}
diff --git a/ihl/processing/metallurgy/DrawingDeskGui.java b/ihl/processing/metallurgy/DrawingDeskGui.java
deleted file mode 100644
index 301e072..0000000
--- a/ihl/processing/metallurgy/DrawingDeskGui.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package ihl.processing.metallurgy;
-
-import org.lwjgl.opengl.GL11;
-
-import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
-import ihl.utils.IHLRenderUtils;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.util.ResourceLocation;
-
-public class DrawingDeskGui extends GuiContainer {
-
- private DrawingDeskContainer container;
- protected static final ResourceLocation tex = new ResourceLocation("ihl", "textures/gui/GUIDrawingDesk.png");
-
- public DrawingDeskGui(DrawingDeskContainer latheContainer) {
- super(latheContainer);
- container = latheContainer;
- }
-
-
- @Override
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.renderEngine.bindTexture(tex);
- int i1;
- if (this.container.tileEntity.progress > 0)
- {
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.99F);
- i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(38),38);
- this.drawTexturedModalRect(68, 30, 176, 0, i1 + 1, 10);
- }
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float par1, int par2,
- int par3) {
- //draw your Gui here, only thing you need to change is the path
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.renderEngine.bindTexture(tex);
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
- }
-
- @Override
- public void onGuiClosed()
- {
- super.onGuiClosed();
- this.container.tileEntity.isGuiScreenOpened=false;
- IC2.network.get().initiateClientTileEntityEvent(this.container.tileEntity, 0);
- }
-
-}
diff --git a/ihl/processing/metallurgy/DrawingDeskModel.java b/ihl/processing/metallurgy/DrawingDeskModel.java
deleted file mode 100644
index 55f1c84..0000000
--- a/ihl/processing/metallurgy/DrawingDeskModel.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package ihl.processing.metallurgy;
-
-import net.minecraft.client.model.ModelBase;
-import net.minecraftforge.common.util.ForgeDirection;
-import ihl.model.IHLModelRenderer;
-
-public class DrawingDeskModel extends ModelBase
-{
- //fields
- IHLModelRenderer RotatePart;
- IHLModelRenderer Piece1;
-
- public DrawingDeskModel()
- {
- textureWidth = 64;
- textureHeight = 32;
- setTextureOffset("RotatePart.Shape1", 0, 14);
- setTextureOffset("RotatePart.Pipe2", 0, 17);
- setTextureOffset("RotatePart.Shape4", 3, 14);
- setTextureOffset("RotatePart.Shape3", 0, 26);
- setTextureOffset("RotatePart.Pipe5", 16, 20);
- setTextureOffset("RotatePart.Pipe6", 0, 18);
- setTextureOffset("RotatePart.Pipe11", 13, 22);
- setTextureOffset("RotatePart.Pipe12", 13, 22);
- setTextureOffset("RotatePart.Pipe13", 13, 22);
- setTextureOffset("RotatePart.Pipe14", 13, 22);
- setTextureOffset("RotatePart.Pipe15", 13, 22);
- setTextureOffset("Piece1.Shape7", 0, 17);
- setTextureOffset("Piece1.Shape8", 0, 17);
- setTextureOffset("Piece1.PipeW9", 0, 18);
- setTextureOffset("Piece1.PipeW10", 0, 20);
- setTextureOffset("Piece1.Shape2", 0, 0);
-
- RotatePart = new IHLModelRenderer(this, "RotatePart");
- RotatePart.setRotationPoint(0F, 23F, -6F);
- setRotation(RotatePart, 0.4F, 0F, 0F);
- RotatePart.mirror = true;
- RotatePart.addBox("Shape1", 7F, -1F, -1F, 1, 2, 16,false);
- RotatePart.addTube("Pipe2", -7.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP);
- RotatePart.addBox("Shape4", -8F, -1F, -1F, 1, 2, 16,false);
- RotatePart.addBox("Shape3", -7F, -1F, -1F, 14, 2, 2,false);
- RotatePart.addTube("Pipe5", -5.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP);
- RotatePart.addTube("Pipe6", -3.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP);
- RotatePart.addTube("Pipe11", -1.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP);
- RotatePart.addTube("Pipe12", 0.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP);
- RotatePart.addTube("Pipe13", 2.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP);
- RotatePart.addTube("Pipe14", 4.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP);
- RotatePart.addTube("Pipe15", 6.5F, -3F, 0F, 1, 2, 1, 0F,1F,ForgeDirection.UP);
- Piece1 = new IHLModelRenderer(this, "Piece1");
- Piece1.setRotationPoint(0F, 16F, 0F);
- setRotation(Piece1, 0F, 0F, 0F);
- Piece1.mirror = true;
- Piece1.addBox("Shape7", 6F, -4F, 6F, 1, 12, 2,false);
- Piece1.addBox("Shape8", -7F, -4F, 6F, 1, 12, 2,false);
- Piece1.addTube("PipeW9", -6F, 7F, 7F, 12, 1, 1, 0F,1F,ForgeDirection.EAST);
- Piece1.addTube("PipeW10", -6F, -4F, 6F, 12, 1, 1, 0F,1F,ForgeDirection.EAST);
- Piece1.addBox("Shape2", 0F, 7F, 0F, 4, 1, 1,false);
- }
-
- private void setRotation(IHLModelRenderer model, float x, float y, float z)
- {
- model.rotateAngleX = x;
- model.rotateAngleY = y;
- model.rotateAngleZ = z;
- }
-}
diff --git a/ihl/processing/metallurgy/DrawingDeskTileEntity.java b/ihl/processing/metallurgy/DrawingDeskTileEntity.java
deleted file mode 100644
index aed1a97..0000000
--- a/ihl/processing/metallurgy/DrawingDeskTileEntity.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package ihl.processing.metallurgy;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import ic2.api.network.INetworkClientTileEntityEventListener;
-import ic2.api.recipe.IRecipeInput;
-import ic2.core.ContainerBase;
-import ic2.core.IC2;
-import ic2.core.IHasGui;
-import ic2.core.block.TileEntityInventory;
-import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
-import ihl.processing.chemistry.ApparatusProcessableInvSlot;
-import ihl.processing.invslots.IHLInvSlotOutput;
-import ihl.recipes.RecipeInputWire;
-import ihl.recipes.UniversalRecipeInput;
-import ihl.recipes.UniversalRecipeManager;
-import ihl.recipes.UniversalRecipeOutput;
-import ihl.utils.IHLUtils;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-
-public class DrawingDeskTileEntity extends TileEntityInventory implements IHasGui, INetworkClientTileEntityEventListener
-{
- protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("DrawingDesk");
- public short progress;
- protected short operationLength=200;
- public final ApparatusProcessableInvSlot input;
- public final IHLInvSlotOutput output;
- boolean isGuiScreenOpened=false;
-
- public DrawingDeskTileEntity()
- {
- super();
- input = new ApparatusProcessableInvSlot(this, "input", 0, Access.IO, 1, 64);
- output = new IHLInvSlotOutput(this, "output", 1, 1);
- }
-
- public boolean enableUpdateEntity()
- {
- return IC2.platform.isSimulating();
- }
-
- @Override
- public void updateEntityServer()
- {
- super.updateEntityServer();
- if (this.canOperate() && this.isGuiScreenOpened)
- {
- this.setActive(true);
-
- if (this.progress == 0)
- {
- IC2.network.get().initiateTileEntityEvent(this, 0, true);
- }
- ++this.progress;
- if (this.progress >= this.operationLength)
- {
- this.operate();
- this.progress = 0;
- IC2.network.get().initiateTileEntityEvent(this, 2, true);
- }
- }
- else
- {
- if (this.progress != 0 && this.getActive())
- {
- IC2.network.get().initiateTileEntityEvent(this, 1, true);
- }
- if (!this.canOperate())
- {
- this.progress = 0;
- }
- this.setActive(false);
- }
- }
-
- @Override
- public String getInventoryName() {
- return "DrawingDesk";
- }
-
- @Override
- public ItemStack getWrenchDrop(EntityPlayer player)
- {
- return IHLUtils.getThisModItemStack("DrawingDesk");
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public GuiScreen getGui(EntityPlayer player, boolean arg1) {
- return new DrawingDeskGui(new DrawingDeskContainer(player, this));
- }
-
- @Override
- public ContainerBase<?> getGuiContainer(EntityPlayer player) {
- this.isGuiScreenOpened=true;
- return new DrawingDeskContainer(player, this);
- }
-
- public void operate()
- {
- List<IRecipeInput> input1 = DrawingDeskTileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs();
- List output1 = DrawingDeskTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs();
- this.output.add(output1);
- if(input1.get(0) instanceof RecipeInputWire)
- {
- int fiberLength = input1.get(0).getAmount();
- boolean isFiberConsumed = IHLUtils.adjustWireLength(this.input.get(), -fiberLength);
- if(isFiberConsumed)
- {
- this.input.put(null);
- }
- }
- else
- {
- this.input.consume(0, input1.get(0).getAmount());
- }
- }
-
- public List[] getInput()
- {
- return new List[] {null,Arrays.asList(new ItemStack[] {input.get()})};
- }
-
- public boolean canOperate()
- {
- if(DrawingDeskTileEntity.recipeManager.getOutputFor(getInput(), false, false)==null) return false;
- List output1 = DrawingDeskTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs();
- return this.output.canAdd(output1);
- }
-
- @Override
- public void onGuiClosed(EntityPlayer arg0) {}
-
- public static void addRecipe(ItemStack input, ItemStack output)
- {
- if(input==null || output==null) throw new NullPointerException();
- recipeManager.addRecipe(new UniversalRecipeInput(null,Arrays.asList(new ItemStack[] {input})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {output}),20));
- }
-
- public int gaugeProgressScaled(int i)
- {
- return this.progress * i / this.operationLength;
- }
-
- @Override
- public void onNetworkEvent(EntityPlayer player, int event)
- {
- switch(event)
- {
- case 0:
- this.isGuiScreenOpened=false;
- break;
- }
- }
-
- public static Map<UniversalRecipeInput, UniversalRecipeOutput> getRecipes() {
- return recipeManager.getRecipes();
- }
-
- @Override
- public boolean shouldRenderInPass(int pass)
- {
- return pass==0;
- }
-
-}
diff --git a/ihl/processing/metallurgy/ElectricEngineItem.java b/ihl/processing/metallurgy/ElectricEngineItem.java
index ec1bdf6..59d6d07 100644
--- a/ihl/processing/metallurgy/ElectricEngineItem.java
+++ b/ihl/processing/metallurgy/ElectricEngineItem.java
@@ -18,8 +18,8 @@ import ihl.IHLModInfo;
public class ElectricEngineItem extends Item{
public Type type;
- public static List<ElectricEngineItem> instances = new ArrayList();
- private static Map<Type, IIcon> iconMap = new HashMap();
+ public static List<ElectricEngineItem> instances = new ArrayList<ElectricEngineItem> ();
+ private static Map<Type, IIcon> iconMap = new HashMap<Type, IIcon>();
public ElectricEngineItem(Type type1)
diff --git a/ihl/processing/metallurgy/ExtruderContainer.java b/ihl/processing/metallurgy/ExtruderContainer.java
index f4af0c0..77b92e6 100644
--- a/ihl/processing/metallurgy/ExtruderContainer.java
+++ b/ihl/processing/metallurgy/ExtruderContainer.java
@@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class ExtruderContainer extends ContainerBase {
+public class ExtruderContainer extends ContainerBase<ExtruderTileEntity> {
public ExtruderTileEntity tileEntity;
public int lastProgress = -1;
@@ -33,7 +33,7 @@ public class ExtruderContainer extends ContainerBase {
}
this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 0, 39, 32));
this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input2, 0, 57, 32));
- this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 8, 32));
+ this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 8, 32));
}
@Override
diff --git a/ihl/processing/metallurgy/ExtruderGui.java b/ihl/processing/metallurgy/ExtruderGui.java
index 1c10b89..acf1a76 100644
--- a/ihl/processing/metallurgy/ExtruderGui.java
+++ b/ihl/processing/metallurgy/ExtruderGui.java
@@ -2,7 +2,6 @@ package ihl.processing.metallurgy;
import org.lwjgl.opengl.GL11;
-import ihl.utils.IHLRenderUtils;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
@@ -19,9 +18,6 @@ public class ExtruderGui extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
-
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(tex);
int i1;
@@ -38,11 +34,6 @@ public class ExtruderGui extends GuiContainer {
i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(18),18);
this.drawTexturedModalRect(74, 34, 198, 0, i1 + 1, 13);
}
- if(!this.container.tileEntity.engine.correctContent())
- {
- this.mc.renderEngine.bindTexture(tex);
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 34, xOffset, yOffset);
- }
}
@Override
diff --git a/ihl/processing/metallurgy/ExtruderTileEntity.java b/ihl/processing/metallurgy/ExtruderTileEntity.java
index de7a4c7..a654bfc 100644
--- a/ihl/processing/metallurgy/ExtruderTileEntity.java
+++ b/ihl/processing/metallurgy/ExtruderTileEntity.java
@@ -5,9 +5,7 @@ import java.util.List;
import java.util.Map;
import ic2.core.ContainerBase;
-import ic2.core.IC2;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
import ihl.processing.chemistry.ApparatusProcessableInvSlot;
import ihl.recipes.UniversalRecipeInput;
import ihl.recipes.UniversalRecipeManager;
@@ -30,7 +28,6 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{
public final ApparatusProcessableInvSlot input;
public final ApparatusProcessableInvSlot input2;
- public boolean hasEngine;
private int processTimer=0;
private FluidTank fluidTank = new FluidTank(1000);
protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("extruder");
@@ -40,7 +37,6 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{
super();
input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 1, 64);
input2 = new ApparatusProcessableInvSlot(this, "input2", 2, Access.IO, 1, 64);
- isGuiScreenOpened=true;
}
@@ -48,9 +44,7 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{
@Override
public List<String> getNetworkedFields()
{
- List<String> fields = super.getNetworkedFields();
- fields.add("hasEngine");
- return fields;
+ return super.getNetworkedFields();
}
@@ -63,16 +57,6 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{
public void updateEntityServer()
{
super.updateEntityServer();
- if(this.engine.isEmpty() && hasEngine==true)
- {
- this.hasEngine=false;
- IC2.network.get().updateTileEntityField(this, "hasEngine");
- }
- else if(this.engine.correctContent() && hasEngine==false)
- {
- this.hasEngine=true;
- IC2.network.get().updateTileEntityField(this, "hasEngine");
- }
ForgeDirection dir = ForgeDirection.getOrientation(getFacing());
TileEntity te = worldObj.getTileEntity(xCoord+dir.offsetX,yCoord+dir.offsetY,zCoord+dir.offsetZ);
if(checkCorrectAccembly() && this.fluidTank.getFluidAmount()>0 && this.processTimer++>20)
@@ -114,6 +98,7 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{
return ExtruderTileEntity.recipeManager.getOutputFor(this.getInput(), false, false);
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List[] getInput()
{
@@ -123,7 +108,7 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{
@Override
public boolean canOperate()
{
- return this.fluidTank.getFluidAmount()<this.fluidTank.getCapacity() && this.engine.correctContent() && this.getOutput()!=null && checkCorrectAccembly();
+ return this.fluidTank.getFluidAmount()<this.fluidTank.getCapacity() && this.getOutput()!=null && checkCorrectAccembly();
}
private boolean checkCorrectAccembly()
@@ -153,7 +138,7 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{
public static void addRecipe(ItemStack input, ItemStack input2, FluidStack output)
{
- recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input,input2})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {output}),null,20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, new ItemStack[] {input,input2}), new UniversalRecipeOutput(new FluidStack [] {output},null,20));
}
diff --git a/ihl/processing/metallurgy/GasWeldingStationContainer.java b/ihl/processing/metallurgy/GasWeldingStationContainer.java
index 2f9e160..e960edb 100644
--- a/ihl/processing/metallurgy/GasWeldingStationContainer.java
+++ b/ihl/processing/metallurgy/GasWeldingStationContainer.java
@@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidStack;
-public class GasWeldingStationContainer extends ContainerBase {
+public class GasWeldingStationContainer extends ContainerBase<GasWeldingStationTileEntity> {
protected GasWeldingStationTileEntity tileEntity;
public short lastProgress2 = -1;
diff --git a/ihl/processing/metallurgy/GasWeldingStationGui.java b/ihl/processing/metallurgy/GasWeldingStationGui.java
index 7a34fa6..6248159 100644
--- a/ihl/processing/metallurgy/GasWeldingStationGui.java
+++ b/ihl/processing/metallurgy/GasWeldingStationGui.java
@@ -8,7 +8,6 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.Slot;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
-import ic2.core.network.NetworkManager;
import ihl.utils.IHLRenderUtils;
@SideOnly(Side.CLIENT)
diff --git a/ihl/processing/metallurgy/GasWeldingStationTileEntity.java b/ihl/processing/metallurgy/GasWeldingStationTileEntity.java
index 764b524..ff15f5a 100644
--- a/ihl/processing/metallurgy/GasWeldingStationTileEntity.java
+++ b/ihl/processing/metallurgy/GasWeldingStationTileEntity.java
@@ -127,57 +127,6 @@ public class GasWeldingStationTileEntity extends TileEntityInventory implements
return "detonationSprayingMachine";
}
- private int mX()
- {
- switch(this.getFacing())
- {
- case 4:
- return -1;
- case 5:
- return 1;
- default:
- return 0;
- }
- }
-
- private int mZ()
- {
- switch(this.getFacing())
- {
- case 3:
- return 1;
- case 2:
- return -1;
- case 4:
- return 0;
- case 5:
- return 0;
- default:
- return -1;
- }
- }
-
- private short getFacingFromXZ(int x, int z)
- {
- switch(x)
- {
- case -1:
- return (short)4;
- case 1:
- return (short)5;
- default:
- switch(z)
- {
- case 1:
- return (short)3;
- case -1:
- return (short)2;
- default:
- return (short)2;
- }
- }
- }
-
@Override
@SideOnly(Side.CLIENT)
public GuiScreen getGui(EntityPlayer player, boolean arg1) {
@@ -225,12 +174,12 @@ public class GasWeldingStationTileEntity extends TileEntityInventory implements
public UniversalRecipeInput getInput()
{
- return new UniversalRecipeInput(Arrays.asList(new FluidStack[] {this.flammableGasTank.getLigthestFluid(), this.oxygenTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get(0),this.input.get(1),this.input.get(2)}));
+ return new UniversalRecipeInput(new FluidStack[] {this.flammableGasTank.getLigthestFluid(), this.oxygenTank.getFluid()}, new ItemStack[]{this.input.get(0),this.input.get(1),this.input.get(2)});
}
public static void addGasRecipe(ItemStack input, FluidStack inputFluid, FluidStack output, FluidStack output2)
{
- acetyleneRecipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {inputFluid}), Arrays.asList(new ItemStack[] {input})), new UniversalRecipeOutput(Arrays.asList(new FluidStack [] {output, output2}),Arrays.asList(new ItemStack [] {}),20));
+ acetyleneRecipeManager.addRecipe(new UniversalRecipeInput(new FluidStack[] {inputFluid},new ItemStack[] {input}), new UniversalRecipeOutput(new FluidStack [] {output, output2},new ItemStack [] {}, 20));
}
public static Map<UniversalRecipeInput, UniversalRecipeOutput> getGasRecipes() {
diff --git a/ihl/processing/metallurgy/ImpregnatingMachineContainer.java b/ihl/processing/metallurgy/ImpregnatingMachineContainer.java
index 4489af2..2a95dcb 100644
--- a/ihl/processing/metallurgy/ImpregnatingMachineContainer.java
+++ b/ihl/processing/metallurgy/ImpregnatingMachineContainer.java
@@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidStack;
-public class ImpregnatingMachineContainer extends ContainerBase {
+public class ImpregnatingMachineContainer extends ContainerBase<ImpregnatingMachineTileEntity> {
protected ImpregnatingMachineTileEntity tileEntity;
public int lastFluidAmount = -1;
diff --git a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java b/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java
index 89a8a63..2ea5d2e 100644
--- a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java
+++ b/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java
@@ -25,7 +25,6 @@ import ic2.core.block.invslot.InvSlot;
import ic2.core.block.invslot.InvSlot.Access;
import ic2.core.block.invslot.InvSlotConsumableLiquid;
import ic2.core.block.invslot.InvSlotOutput;
-import ic2.core.network.NetworkManager;
import ihl.interfaces.IHasTemperature;
import ihl.processing.chemistry.ApparatusProcessableInvSlot;
import ihl.processing.chemistry.ChemicalReactorTileEntity;
@@ -125,7 +124,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement
}
temperature=(short) (this.fluidTank.getTemperature()-273);
IHLUtils.handleFluidSlotsBehaviour(fillInputSlot, drainInputSlot, emptyFluidItemsSlot, fluidTank);
- boolean needsInvUpdate = false;
if (this.canOperate())
{
this.setActive(true);
@@ -138,7 +136,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement
if (this.progress >= this.operationLength)
{
this.operate();
- needsInvUpdate = true;
this.progress = 0;
IC2.network.get().initiateTileEntityEvent(this, 2, true);
}
@@ -181,57 +178,6 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement
return "impregnatingMachine";
}
- private int mX()
- {
- switch(this.getFacing())
- {
- case 4:
- return -1;
- case 5:
- return 1;
- default:
- return 0;
- }
- }
-
- private int mZ()
- {
- switch(this.getFacing())
- {
- case 3:
- return 1;
- case 2:
- return -1;
- case 4:
- return 0;
- case 5:
- return 0;
- default:
- return -1;
- }
- }
-
- private short getFacingFromXZ(int x, int z)
- {
- switch(x)
- {
- case -1:
- return (short)4;
- case 1:
- return (short)5;
- default:
- switch(z)
- {
- case 1:
- return (short)3;
- case -1:
- return (short)2;
- default:
- return (short)2;
- }
- }
- }
-
public float getRenderLiquidLevel()
{
return (float)this.visibleFluidAmount/(float)this.fluidTank.getCapacity();
@@ -273,6 +219,7 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement
return ImpregnatingMachineTileEntity.recipeManager.getOutputFor(this.getInput(), false, false);
}
+ @SuppressWarnings("rawtypes")
public List[] getInput()
{
for(int i=0;i<fluidTank.getNumberOfFluids();i++)
@@ -365,7 +312,7 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement
public static void addQuenchingRecipe(String nameHot, String nameQuenched)
{
- addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {new FluidStack(FluidRegistry.WATER, 50)}), Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack(nameHot)})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStack(nameQuenched)}),2));
+ addRecipe(new UniversalRecipeInput((new FluidStack[] {new FluidStack(FluidRegistry.WATER, 50)}), (new ItemStack[] {IHLUtils.getThisModItemStack(nameHot)})), new UniversalRecipeOutput(null, (new ItemStack[] {IHLUtils.getThisModItemStack(nameQuenched)}),2));
}
public IHLFluidTank getFluidTank()
diff --git a/ihl/processing/metallurgy/InjectionMoldBlock.java b/ihl/processing/metallurgy/InjectionMoldBlock.java
index 68a9ea9..1cd18d3 100644
--- a/ihl/processing/metallurgy/InjectionMoldBlock.java
+++ b/ihl/processing/metallurgy/InjectionMoldBlock.java
@@ -24,7 +24,6 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
-import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -34,8 +33,7 @@ public class InjectionMoldBlock extends Block implements ITileEntityProvider{
IIcon textureSide;
public static InjectionMoldBlock instance;
- public static int moldDamageForRecipe=0;
- public static String[] materials = new String[] {"Bronze","Steel","Gold","Magnesium", "Lithium", "TarPitch"};
+ public static String[] materials = new String[] {"Bronze","Steel","Gold","Magnesium", "Lithium", "TarPitch", "Potassium", "Sodium"};
public InjectionMoldBlock()
{
@@ -60,7 +58,8 @@ public class InjectionMoldBlock extends Block implements ITileEntityProvider{
}
- @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
ItemStack result = new ItemStack(item);
@@ -183,7 +182,6 @@ public class InjectionMoldBlock extends Block implements ITileEntityProvider{
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
- IIcon sideIcon = this.blockIcon;
switch (side)
{
case 1:
@@ -225,29 +223,25 @@ public class InjectionMoldBlock extends Block implements ITileEntityProvider{
public static void registerRecipes(String result1,ItemStack stack1)
{
- if (Loader.isModLoaded("NotEnoughItems"))
+ for(int i=0;i<materials.length;i++)
{
- for(int i=0;i<materials.length;i++)
+ String material = InjectionMoldBlock.materials[i];
+ ItemStack stack = IHLUtils.getItemStackIfExist(result1+material);
+ if(stack!=null)
{
- String material = InjectionMoldBlock.materials[i];
- ItemStack stack = IHLUtils.getItemStackIfExist(result1+material);
- if(stack!=null)
+ material=material.toLowerCase(Locale.ROOT);
+ FluidStack fluidstack = IHLUtils.getFluidStackIfExist("molten."+material,Details.getMeltingFluidAmount(result1));
+ if(fluidstack!=null)
{
- material=material.toLowerCase(Locale.ROOT);
- FluidStack fluidstack = IHLUtils.getFluidStackIfExist("molten."+material,Details.getMeltingFluidAmount(result1));
- if(fluidstack!=null)
- {
- stack1.setItemDamage(++moldDamageForRecipe);
- InjectionMoldTileEntity.addRecipe(fluidstack,stack1,stack);
- //System.out.println("Recipe added for "+fluidstack.getLocalizedName() + " and "+ stack.getDisplayName());
- }
- else
- {
- //System.out.println("No such fluid: "+"molten."+material);
- }
+ // Cap hash to positive integer range.
+ stack1.setItemDamage(result1.hashCode() & Integer.MAX_VALUE);
+/* IHLMod.log.info("Setting damage for injection mold to: "
+ +result1.toLowerCase(Locale.ROOT).hashCode()
+ +" using hash code of "+result1
+ +" Result of lower case: "+result1.toLowerCase(Locale.ROOT));*/
+ InjectionMoldTileEntity.addRecipe(fluidstack,stack1,stack);
}
}
-
}
}
diff --git a/ihl/processing/metallurgy/InjectionMoldTileEntity.java b/ihl/processing/metallurgy/InjectionMoldTileEntity.java
index ce3f339..e87acd8 100644
--- a/ihl/processing/metallurgy/InjectionMoldTileEntity.java
+++ b/ihl/processing/metallurgy/InjectionMoldTileEntity.java
@@ -2,6 +2,7 @@ package ihl.processing.metallurgy;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
import java.util.Map;
import net.minecraft.entity.item.EntityItem;
@@ -41,7 +42,7 @@ public class InjectionMoldTileEntity extends TileEntity implements IFluidHandler
public static void addRecipe(FluidStack input, ItemStack input1, ItemStack output)
{
- recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {input}),Arrays.asList(new ItemStack[] {input1})), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[]{output}),20));
+ recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {input}),(new ItemStack[] {input1})), new UniversalRecipeOutput(null,(new ItemStack[]{output}),20));
}
@Override
@@ -66,7 +67,7 @@ public class InjectionMoldTileEntity extends TileEntity implements IFluidHandler
{
return IC2.platform.isSimulating();
}
-
+
@Override
public void updateEntity()
{
@@ -78,13 +79,30 @@ public class InjectionMoldTileEntity extends TileEntity implements IFluidHandler
if(formattedFluidName!="")
{
int fluidAmountPerItem = Details.getMeltingFluidAmount(this.resultSuffix);
- int fluidAmountPerItem2 = Details.getMeltingFluidAmount("nugget");
ArrayList<ItemStack> resultList = OreDictionary.getOres(this.resultSuffix+formattedFluidName);
- if(resultList.isEmpty())
+ if(resultList.isEmpty() || fluidAmountPerItem<=0)
{
- resultList=new ArrayList();
- if(IHLUtils.getItemStackIfExist(this.resultSuffix+formattedFluidName)!=null)resultList.add(IHLUtils.getItemStackIfExist(this.resultSuffix+formattedFluidName));
+// IHLMod.log.info("Injection mold: resultList.isEmpty() || fluidAmountPerItem<=0");
+ resultList=new ArrayList<ItemStack>();
+ List<FluidStack> fi = Arrays.asList(new FluidStack[] {this.fluidTank.getFluid()});
+ List<ItemStack> ii = Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStackWithDamage("injectionMold", this.resultSuffix.hashCode() & Integer.MAX_VALUE)});
+ UniversalRecipeOutput ro = recipeManager.getOutputFor(fi, ii, false, false);
+ if(ro!=null)
+ {
+ // IHLMod.log.info("Injection mold: ro not null");
+ ItemStack stack = ro.getItemOutputs().get(0).itemStack.copy();
+ stack.stackSize=Math.round(ro.getItemOutputs().get(0).quantity);
+ resultList.add(stack);
+ UniversalRecipeInput ri = recipeManager.getRecipeInput(fi, ii);
+ fluidAmountPerItem = ri.getFluidInputs().get(0).getAmount();
+ // IHLMod.log.info("fluidAmountPerItem="+fluidAmountPerItem);
+ }
+ else
+ {
+ // IHLMod.log.info("Injection mold: ro is null. Input stack: "+ii.get(0).toString());
+ }
}
+ int fluidAmountPerItem2 = Details.getMeltingFluidAmount("nugget");
ArrayList<ItemStack> resultList2 = OreDictionary.getOres("nugget"+formattedFluidName);
if(!resultList.isEmpty())
{
@@ -132,10 +150,6 @@ public class InjectionMoldTileEntity extends TileEntity implements IFluidHandler
private String getFormattedMaterialName(String input)
{
- if(input.length()<8)
- {
- return "";
- }
String input2 = input.replace("molten.", "").replace(".molten", "");
String firstletter = String.valueOf(input2.charAt(0)).toUpperCase();
input2 = input2.replaceFirst(".", firstletter);
diff --git a/ihl/processing/metallurgy/LatheContainer.java b/ihl/processing/metallurgy/LatheContainer.java
index c863f7b..5e79a2a 100644
--- a/ihl/processing/metallurgy/LatheContainer.java
+++ b/ihl/processing/metallurgy/LatheContainer.java
@@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class LatheContainer extends ContainerBase {
+public class LatheContainer extends ContainerBase<LathePart1TileEntity> {
public LathePart1TileEntity tileEntity;
public int lastProgress = -1;
@@ -30,7 +30,7 @@ public class LatheContainer extends ContainerBase {
{
this.addSlotToContainer(new Slot(entityPlayer.inventory, col, 8 + col * 18, height + -24));
}
- this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55));
+ this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55));
}
@Override
diff --git a/ihl/processing/metallurgy/LatheGui.java b/ihl/processing/metallurgy/LatheGui.java
index e09f414..16f64c5 100644
--- a/ihl/processing/metallurgy/LatheGui.java
+++ b/ihl/processing/metallurgy/LatheGui.java
@@ -2,7 +2,6 @@ package ihl.processing.metallurgy;
import org.lwjgl.opengl.GL11;
-import ihl.utils.IHLRenderUtils;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
@@ -20,9 +19,6 @@ public class LatheGui extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
-
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
fontRendererObj.drawString(StatCollector.translateToLocal("ihl.gui.lathe"), 50, 10, 14722081);
this.mc.renderEngine.bindTexture(tex);
@@ -40,11 +36,6 @@ public class LatheGui extends GuiContainer {
i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50);
this.drawTexturedModalRect(64, 63, 197, 0, i1 + 1, 13);
}
- if(!this.container.tileEntity.engine.correctContent())
- {
- this.mc.renderEngine.bindTexture(tex);
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset);
- }
}
@Override
diff --git a/ihl/processing/metallurgy/LathePart1TileEntity.java b/ihl/processing/metallurgy/LathePart1TileEntity.java
index 9241ba1..ddf834b 100644
--- a/ihl/processing/metallurgy/LathePart1TileEntity.java
+++ b/ihl/processing/metallurgy/LathePart1TileEntity.java
@@ -19,7 +19,6 @@ public class LathePart1TileEntity extends BasicElectricMotorTileEntity implement
public LathePart1TileEntity()
{
super();
- this.isGuiScreenOpened=true;
}
@@ -52,6 +51,7 @@ public class LathePart1TileEntity extends BasicElectricMotorTileEntity implement
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public List[] getInput()
{
diff --git a/ihl/processing/metallurgy/LathePart2TileEntity.java b/ihl/processing/metallurgy/LathePart2TileEntity.java
index 4543afa..7d4dac7 100644
--- a/ihl/processing/metallurgy/LathePart2TileEntity.java
+++ b/ihl/processing/metallurgy/LathePart2TileEntity.java
@@ -6,7 +6,6 @@ import java.util.List;
import ic2.api.network.INetworkDataProvider;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.utils.IHLUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
diff --git a/ihl/processing/metallurgy/MachineBaseTileEntity.java b/ihl/processing/metallurgy/MachineBaseTileEntity.java
index 51df187..de20f5a 100644
--- a/ihl/processing/metallurgy/MachineBaseTileEntity.java
+++ b/ihl/processing/metallurgy/MachineBaseTileEntity.java
@@ -6,10 +6,8 @@ import ic2.api.energy.tile.IEnergySink;
import ic2.core.ContainerBase;
import ic2.core.IC2;
import ic2.core.IHasGui;
-import ic2.core.audio.AudioSource;
import ic2.core.block.TileEntityInventory;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
import ihl.processing.chemistry.ApparatusProcessableInvSlot;
import ihl.recipes.UniversalRecipeOutput;
import java.util.List;
@@ -26,9 +24,6 @@ public abstract class MachineBaseTileEntity extends TileEntityInventory implemen
{
public short progress;
protected short operationLength=200;
- private AudioSource startAS;
- private AudioSource loopAS;
- private AudioSource stopAS;
protected double energy;
public int maxStorage;
public int energyConsume;
@@ -222,6 +217,7 @@ public abstract class MachineBaseTileEntity extends TileEntityInventory implemen
public abstract UniversalRecipeOutput getOutput();
+ @SuppressWarnings("rawtypes")
public List[] getInput()
{
return new List[]{null, this.input.getItemStackList()};
diff --git a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java b/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java
index 73d12de..c5a54c7 100644
--- a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java
+++ b/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java
@@ -110,7 +110,7 @@ public class MuffleFurnanceTileEntity extends MachineBaseTileEntity{
public static void addRecipe(ItemStack input1, ItemStack output)
{
- recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input1})),new UniversalRecipeOutput(null, Arrays.asList(new ItemStack [] {output}),20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input1})),new UniversalRecipeOutput(null, (new ItemStack [] {output}),20));
}
@@ -130,6 +130,6 @@ public class MuffleFurnanceTileEntity extends MachineBaseTileEntity{
}
public static void addRecipe(ItemStack input1, ItemStack output, float f) {
- recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input1})),new UniversalRecipeOutput(null, Arrays.asList(new RecipeOutputItemStack [] {new RecipeOutputItemStack(output,f)}),20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input1})),new UniversalRecipeOutput(null, (new RecipeOutputItemStack [] {new RecipeOutputItemStack(output,f)}),20));
}
}
diff --git a/ihl/processing/metallurgy/RollingMachineContainer.java b/ihl/processing/metallurgy/RollingMachineContainer.java
index c3bdb31..7a83d9d 100644
--- a/ihl/processing/metallurgy/RollingMachineContainer.java
+++ b/ihl/processing/metallurgy/RollingMachineContainer.java
@@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class RollingMachineContainer extends ContainerBase {
+public class RollingMachineContainer extends ContainerBase<RollingMachinePart1TileEntity> {
public RollingMachinePart1TileEntity tileEntity;
public int lastProgress = -1;
@@ -33,7 +33,7 @@ public class RollingMachineContainer extends ContainerBase {
}
this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 0, 54, 25));
this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.output, 0, 105, 25));
- this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55));
+ this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55));
}
@Override
diff --git a/ihl/processing/metallurgy/RollingMachineGui.java b/ihl/processing/metallurgy/RollingMachineGui.java
index 16ccdac..a792bd3 100644
--- a/ihl/processing/metallurgy/RollingMachineGui.java
+++ b/ihl/processing/metallurgy/RollingMachineGui.java
@@ -2,7 +2,6 @@ package ihl.processing.metallurgy;
import org.lwjgl.opengl.GL11;
-import ihl.utils.IHLRenderUtils;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
@@ -19,9 +18,6 @@ public class RollingMachineGui extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
-
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(tex);
int i1;
@@ -39,11 +35,6 @@ public class RollingMachineGui extends GuiContainer {
i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50);
this.drawTexturedModalRect(64, 63, 197, 0, i1 + 1, 13);
}
- if(!this.container.tileEntity.engine.correctContent())
- {
- this.mc.renderEngine.bindTexture(tex);
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset);
- }
}
@Override
diff --git a/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java b/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java
index 9c02a47..a3d6ae6 100644
--- a/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java
+++ b/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java
@@ -7,7 +7,6 @@ import java.util.Map;
import ic2.core.ContainerBase;
import ic2.core.IC2;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
import ihl.processing.chemistry.ApparatusProcessableInvSlot;
import ihl.processing.invslots.IHLInvSlotOutput;
import ihl.recipes.RecipeOutputItemStack;
@@ -27,7 +26,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{
public final ApparatusProcessableInvSlot input;
public final IHLInvSlotOutput output;
- public boolean hasEngine;
public boolean assembled;
protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("rollingmachine");
@@ -36,7 +34,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{
super();
input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 1, 64);
output = new IHLInvSlotOutput(this, "output", 2, 1);
- isGuiScreenOpened=true;
}
public UniversalRecipeOutput getOutput()
@@ -49,7 +46,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{
{
List<String> fields = super.getNetworkedFields();
fields.add("assembled");
- fields.add("hasEngine");
return fields;
}
@@ -73,17 +69,6 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{
assembled=true;
IC2.network.get().updateTileEntityField(this, "assembled");
}
- if(this.engine.isEmpty() && hasEngine==true)
- {
- this.hasEngine=false;
- IC2.network.get().updateTileEntityField(this, "hasEngine");
- }
- else if(this.engine.correctContent() && hasEngine==false)
- {
- this.hasEngine=true;
- IC2.network.get().updateTileEntityField(this, "hasEngine");
- }
-
if (this.getActive() && this.progress == 0 && !this.canOperate())
{
this.setActive(false);
@@ -121,6 +106,7 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{
this.input.consume(0, 1);
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public List[] getInput()
{
@@ -130,7 +116,7 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{
@Override
public boolean canOperate()
{
- return this.engine.correctContent() && this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly();
+ return this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly();
}
private boolean checkCorrectAccembly()
@@ -144,7 +130,7 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{
public static void addRecipe(ItemStack input, ItemStack output)
{
- recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input})), new UniversalRecipeOutput(null, Arrays.asList(new ItemStack[] {output}), 20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input})), new UniversalRecipeOutput(null, (new ItemStack[] {output}), 20));
}
diff --git a/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java b/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java
index 6bab8c4..13f4f6c 100644
--- a/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java
+++ b/ihl/processing/metallurgy/RollingMachinePart2TileEntity.java
@@ -6,7 +6,6 @@ import java.util.List;
import ic2.api.network.INetworkDataProvider;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.utils.IHLUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
diff --git a/ihl/processing/metallurgy/RollingMachineRender.java b/ihl/processing/metallurgy/RollingMachineRender.java
index ee8b567..1990769 100644
--- a/ihl/processing/metallurgy/RollingMachineRender.java
+++ b/ihl/processing/metallurgy/RollingMachineRender.java
@@ -72,11 +72,8 @@ private final float scale=1F/16F;
model.RotatingPart1.render(scale);
model.RotatingPart2.render(scale);
}
- if(cte.hasEngine)
- {
- model.MotorPart1.render(scale);
- model.MotorPart2.render(scale);
- }
+ model.MotorPart1.render(scale);
+ model.MotorPart2.render(scale);
}
GL11.glPopMatrix(); //end
diff --git a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java
index 8b9ea9e..2f22a4d 100644
--- a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java
+++ b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceGui.java
@@ -1,7 +1,6 @@
package ihl.processing.metallurgy;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.collector.GuiMultiTextureButton;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
@@ -22,6 +21,7 @@ public class VacuumInductionMeltingFurnaceGui extends GuiContainer {
this.container=vacuumInductionMeltingFurnaceContainer;
}
+ @SuppressWarnings("unchecked")
@Override
public void initGui()
{
@@ -46,8 +46,6 @@ public class VacuumInductionMeltingFurnaceGui extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
fontRendererObj.drawString(StatCollector.translateToLocal("ihl.gui.muffleFurnace"), 40, 12, 14722081);
this.mc.renderEngine.bindTexture(background);
diff --git a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java
index 3fc85a8..e2867bc 100644
--- a/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java
+++ b/ihl/processing/metallurgy/VacuumInductionMeltingFurnaceTileEntity.java
@@ -4,14 +4,13 @@ import java.util.Arrays;
import java.util.Map;
import ic2.api.network.INetworkClientTileEntityEventListener;
+import ic2.api.recipe.IRecipeInput;
+import ic2.api.recipe.RecipeInputOreDict;
import ic2.core.ContainerBase;
-import ihl.IHLMod;
import ihl.processing.chemistry.GaedesMercuryRotaryPumpTileEntity;
import ihl.recipes.UniversalRecipeInput;
import ihl.recipes.UniversalRecipeManager;
import ihl.recipes.UniversalRecipeOutput;
-import ihl.tunneling_shield.IMultiBlock;
-import ihl.tunneling_shield.MultiBlockSpacerBlock;
import ihl.utils.IHLFluidTank;
import ihl.utils.IHLUtils;
import net.minecraft.client.gui.GuiScreen;
@@ -24,13 +23,12 @@ import net.minecraftforge.fluids.FluidStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEntity implements INetworkClientTileEntityEventListener, IMultiBlock{
+public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEntity implements INetworkClientTileEntityEventListener{
protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("vacuuminductionmeltingfurnace");
public final IHLFluidTank fluidTank = new IHLFluidTank(864);
public boolean vacuumPumpConnected=false;
private GaedesMercuryRotaryPumpTileEntity lastGMRP;
- private int minX,minY,minZ,maxX,maxY,maxZ;
public VacuumInductionMeltingFurnaceTileEntity()
{
@@ -42,27 +40,6 @@ public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEnti
{
short facing2 = (short) Math.max(facing1, 2);
super.setFacing(facing2);
- switch(facing2)
- {
- case 0:
- setupMultiblockStructure(-1,-2,0);
- break;
- case 1:
- setupMultiblockStructure(-1,0,0);
- break;
- case 2:
- setupMultiblockStructure(-1,0,-2);
- break;
- case 3:
- setupMultiblockStructure(-1,0,0);
- break;
- case 4:
- setupMultiblockStructure(-2,0,-1);
- break;
- case 5:
- setupMultiblockStructure(0,0,-1);
- break;
- }
}
@Override
@@ -159,9 +136,9 @@ public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEnti
return IHLUtils.getThisModItemStack("vacuumInductionMeltingFurnace");
}
- public static void addRecipe(ItemStack input, FluidStack output)
+ public static void addRecipe(String input, int amount, String input2, int amount2, FluidStack output)
{
- recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack [] {input})),new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {output}),null,20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput [] {new RecipeInputOreDict(input,amount),new RecipeInputOreDict(input2,amount2)})),new UniversalRecipeOutput((new FluidStack[] {output}),null,20));
}
@@ -220,41 +197,4 @@ public class VacuumInductionMeltingFurnaceTileEntity extends MachineBaseTileEnti
this.fluidTank.writeToNBT(fluidTankTag);
nbttagcompound.setTag("fluidTank", fluidTankTag);
}
-
- private void setupMultiblockStructure(int x0,int y0,int z0)
- {
- minX=xCoord+x0;
- maxX=xCoord+x0+3;
- minY=yCoord+y0;
- maxY=yCoord+y0+3;
- minZ=zCoord+z0;
- maxZ=zCoord+z0+3;
- for(int ix=xCoord+x0;ix<xCoord+x0+3;ix++)
- {
- for(int iy=yCoord+y0;iy<yCoord+y0+3;iy++)
- {
- for(int iz=zCoord+z0;iz<zCoord+z0+3;iz++)
- {
- if(!(worldObj.getTileEntity(ix, iy, iz) instanceof VacuumInductionMeltingFurnaceTileEntity))
- {
- worldObj.setBlock(ix, iy, iz, IHLMod.multiBlockSpacerBlock);
- }
- }
- }
- }
- MultiBlockSpacerBlock.teList.add(this);
- }
-
- @Override
- public boolean isAPartOfStructure(int x, int y, int z, boolean onBlockBeak)
- {
- return x>=minX && x<=maxX && y>=minY && y<=maxY && z>=minZ && z<=maxZ;
- }
-
- @Override
- public boolean getIsInvalid()
- {
- return this.isInvalid();
- }
-
}
diff --git a/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java b/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java
index 6feca57..40d44e4 100644
--- a/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java
+++ b/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java
@@ -11,7 +11,6 @@ import ic2.api.energy.tile.IEnergySink;
import ic2.api.network.INetworkDataProvider;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.items_blocks.FlexibleCableItem;
import ihl.recipes.UniversalRecipeInput;
import ihl.recipes.UniversalRecipeManager;
@@ -47,7 +46,7 @@ public class VulcanizationExtrudingMoldTileEntity extends TileEntity implements
public static void addRecipe(FluidStack inputFluid,ItemStack input,ItemStack output1)
{
- recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new FluidStack[] {inputFluid}),Arrays.asList(new ItemStack[] {input})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output1}),200));
+ recipeManager.addRecipe(new UniversalRecipeInput((new FluidStack[] {inputFluid}),(new ItemStack[] {input})),new UniversalRecipeOutput(null,(new ItemStack[] {output1}),200));
}
public boolean enableUpdateEntity()
diff --git a/ihl/processing/metallurgy/WireMillContainer.java b/ihl/processing/metallurgy/WireMillContainer.java
index ec1ddc0..34f79de 100644
--- a/ihl/processing/metallurgy/WireMillContainer.java
+++ b/ihl/processing/metallurgy/WireMillContainer.java
@@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidStack;
-public class WireMillContainer extends ContainerBase {
+public class WireMillContainer extends ContainerBase<WireMillTileEntity> {
public WireMillTileEntity tileEntity;
public int lastProgress = -1;
@@ -51,7 +51,7 @@ public class WireMillContainer extends ContainerBase {
this.addSlotToContainer(new SlotInvSlot(tileEntity.drainInputSlot, 0, 26+18, 14));
this.addSlotToContainer(new SlotInvSlot(tileEntity.fillInputSlot, 0, 26+18, 50));
this.addSlotToContainer(new SlotInvSlot(tileEntity.emptyFluidItemsSlot, 0, 26+18, 32));
- this.addSlotToContainer(new SlotInvSlot(tileEntity.engine,0, 8, 14));
+ this.addSlotToContainer(new SlotInvSlot(tileEntity.dischargeSlot,0, 8, 14));
}
@Override
diff --git a/ihl/processing/metallurgy/WireMillGui.java b/ihl/processing/metallurgy/WireMillGui.java
index e09b4ab..8a3d583 100644
--- a/ihl/processing/metallurgy/WireMillGui.java
+++ b/ihl/processing/metallurgy/WireMillGui.java
@@ -52,10 +52,6 @@ public class WireMillGui extends GuiContainer {
}
this.mc.renderEngine.bindTexture(tex);
- if(!this.container.tileEntity.engine.correctContent())
- {
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 25, 14, xOffset, yOffset);
- }
IHLRenderUtils.instance.drawTooltip(par1,par2,9,11,xOffset,yOffset,StatCollector.translateToLocal("ihl.wiremill.tip"));
}
diff --git a/ihl/processing/metallurgy/WireMillTileEntity.java b/ihl/processing/metallurgy/WireMillTileEntity.java
index 16eaa4b..4216960 100644
--- a/ihl/processing/metallurgy/WireMillTileEntity.java
+++ b/ihl/processing/metallurgy/WireMillTileEntity.java
@@ -4,17 +4,13 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
-import org.apache.commons.lang3.mutable.MutableObject;
-
import ic2.api.recipe.IRecipeInput;
import ic2.api.recipe.RecipeInputOreDict;
import ic2.core.ContainerBase;
import ic2.core.block.invslot.InvSlot;
-import ic2.core.block.invslot.InvSlotConsumableItemStack;
import ic2.core.block.invslot.InvSlotConsumableLiquid;
import ic2.core.block.invslot.InvSlotOutput;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.block.invslot.InvSlot.InvSide;
import ihl.IHLMod;
import ihl.items_blocks.IHLTool;
import ihl.processing.chemistry.ApparatusProcessableInvSlot;
@@ -23,7 +19,6 @@ import ihl.recipes.IRecipeInputFluid;
import ihl.recipes.RecipeInputDie;
import ihl.recipes.RecipeInputFluidDictionary;
import ihl.recipes.RecipeInputFluidStack;
-import ihl.recipes.RecipeOutputItemStack;
import ihl.recipes.UniversalRecipeInput;
import ihl.recipes.UniversalRecipeManager;
import ihl.recipes.UniversalRecipeOutput;
@@ -36,7 +31,6 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
@@ -62,7 +56,6 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements
fillInputSlot = new InvSlotConsumableLiquidIHL(this, "fillInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Fill);
drainInputSlot = new InvSlotConsumableLiquidIHL(this, "drainInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.BOTTOM, InvSlotConsumableLiquid.OpType.Drain, "ingot");
dice = new ApparatusProcessableInvSlot(this, "dice", 3, Access.IO, 1, 64);
- this.isGuiScreenOpened=true;
this.operationLength=600;
}
@@ -142,7 +135,6 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements
{
this.metalFluidTank.fill(rOutput.getFluidOutputs().get(0), true);
}
- ForgeDirection dir = ForgeDirection.getOrientation(getFacing()).getRotation(ForgeDirection.DOWN);
TileEntity te = worldObj.getTileEntity(xCoord+ForgeDirection.getOrientation(getFacing()).offsetX,yCoord+ForgeDirection.getOrientation(getFacing()).offsetY,zCoord+ForgeDirection.getOrientation(getFacing()).offsetZ);
if(rOutputItemStack!=null && te instanceof IProductionLine)
{
@@ -156,6 +148,7 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements
}
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public List[] getInput()
{
@@ -169,12 +162,12 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements
public static void addRecipe(FluidStack moltenMetal, IRecipeInput inputDice,ItemStack output1)
{
- recipeManager.addRecipe(new UniversalRecipeInput(Arrays.asList(new IRecipeInputFluid[] {new RecipeInputFluidDictionary("lubricant", 1),new RecipeInputFluidDictionary("water", 1),new RecipeInputFluidStack(moltenMetal)}),Arrays.asList(new IRecipeInput[] {inputDice})),new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output1}),200));
+ recipeManager.addRecipe(new UniversalRecipeInput((new IRecipeInputFluid[] {new RecipeInputFluidDictionary("lubricant", 1),new RecipeInputFluidDictionary("water", 1),new RecipeInputFluidStack(moltenMetal)}),(new IRecipeInput[] {inputDice})),new UniversalRecipeOutput(null,(new ItemStack[] {output1}),200));
}
public static void addRecipe(String string, FluidStack fluidStack)
{
- recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new IRecipeInput [] {new RecipeInputOreDict(string)})),new UniversalRecipeOutput(Arrays.asList(new FluidStack[] {fluidStack}),null,200));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput [] {new RecipeInputOreDict(string)})),new UniversalRecipeOutput((new FluidStack[] {fluidStack}),null,200));
}
diff --git a/ihl/processing/metallurgy/WoodenRollingMachineContainer.java b/ihl/processing/metallurgy/WoodenRollingMachineContainer.java
index 100da1b..ba191f8 100644
--- a/ihl/processing/metallurgy/WoodenRollingMachineContainer.java
+++ b/ihl/processing/metallurgy/WoodenRollingMachineContainer.java
@@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class WoodenRollingMachineContainer extends ContainerBase {
+public class WoodenRollingMachineContainer extends ContainerBase<WoodenRollingMachinePart1TileEntity> {
public WoodenRollingMachinePart1TileEntity tileEntity;
public int lastProgress = -1;
@@ -35,7 +35,7 @@ public class WoodenRollingMachineContainer extends ContainerBase {
this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 0, 123, 15));
this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 1, 123, 34));
this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.input, 2, 123, 53));
- this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.engine,0, 22, 55));
+ this.addSlotToContainer(new SlotInvSlot(lathePart1TileEntity.dischargeSlot,0, 22, 55));
}
@Override
diff --git a/ihl/processing/metallurgy/WoodenRollingMachineGui.java b/ihl/processing/metallurgy/WoodenRollingMachineGui.java
index d7b3456..085dae5 100644
--- a/ihl/processing/metallurgy/WoodenRollingMachineGui.java
+++ b/ihl/processing/metallurgy/WoodenRollingMachineGui.java
@@ -2,7 +2,6 @@ package ihl.processing.metallurgy;
import org.lwjgl.opengl.GL11;
-import ihl.utils.IHLRenderUtils;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
@@ -19,9 +18,6 @@ public class WoodenRollingMachineGui extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
-
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(tex);
int i1;
@@ -39,11 +35,6 @@ public class WoodenRollingMachineGui extends GuiContainer {
i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(27),27);
this.drawTexturedModalRect(18, 22, getFrameX(i1), getFrameY(i1),24,24);
}
- if(!this.container.tileEntity.engine.correctContent())
- {
- this.mc.renderEngine.bindTexture(tex);
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 47, 56, xOffset, yOffset);
- }
}
@Override
diff --git a/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java b/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java
index eb40389..31b6386 100644
--- a/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java
+++ b/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java
@@ -1,6 +1,5 @@
package ihl.processing.metallurgy;
-import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -8,7 +7,6 @@ import ic2.api.recipe.IRecipeInput;
import ic2.core.ContainerBase;
import ic2.core.IC2;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
import ihl.processing.chemistry.ApparatusProcessableInvSlot;
import ihl.processing.invslots.IHLInvSlotOutput;
import ihl.recipes.RecipeOutputItemStack;
@@ -28,7 +26,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE
public final ApparatusProcessableInvSlot input;
public final IHLInvSlotOutput output;
- public boolean hasEngine;
public boolean assembled;
protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("woodenrollingmachine");
@@ -37,7 +34,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE
super();
input = new ApparatusProcessableInvSlot(this, "input", 1, Access.IO, 3, 64);
output = new IHLInvSlotOutput(this, "output", 2, 1);
- isGuiScreenOpened=true;
}
public UniversalRecipeOutput getOutput()
@@ -50,7 +46,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE
{
List<String> fields = super.getNetworkedFields();
fields.add("assembled");
- fields.add("hasEngine");
return fields;
}
@@ -74,17 +69,6 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE
assembled=true;
IC2.network.get().updateTileEntityField(this, "assembled");
}
- if(this.engine.isEmpty() && hasEngine==true)
- {
- this.hasEngine=false;
- IC2.network.get().updateTileEntityField(this, "hasEngine");
- }
- else if(this.engine.correctContent() && hasEngine==false)
- {
- this.hasEngine=true;
- IC2.network.get().updateTileEntityField(this, "hasEngine");
- }
-
if (this.getActive() && this.progress == 0 && !this.canOperate())
{
this.setActive(false);
@@ -126,6 +110,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE
}
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public List[] getInput()
{
@@ -135,7 +120,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE
@Override
public boolean canOperate()
{
- return this.engine.correctContent() && this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly();
+ return this.getOutput()!=null && this.output.canAdd(this.getOutput().getItemOutputs()) && checkCorrectAccembly();
}
private boolean checkCorrectAccembly()
@@ -149,7 +134,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE
public static void addRecipe(ItemStack input, ItemStack input2, ItemStack input3, ItemStack output)
{
- recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input,input2,input3})), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input,input2,input3})), new UniversalRecipeOutput(null,(new ItemStack[] {output}),20));
}
@@ -159,7 +144,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE
public static void addRecipe(ItemStack input, ItemStack input3, ItemStack output)
{
- recipeManager.addRecipe(new UniversalRecipeInput(null, Arrays.asList(new ItemStack[] {input,input3})), new UniversalRecipeOutput(null,Arrays.asList(new ItemStack[] {output}),20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] {input,input3})), new UniversalRecipeOutput(null,(new ItemStack[] {output}),20));
}
@Override
diff --git a/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java b/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java
index 165d84b..9aec41b 100644
--- a/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java
+++ b/ihl/processing/metallurgy/WoodenRollingMachinePart2TileEntity.java
@@ -6,7 +6,6 @@ import java.util.List;
import ic2.api.network.INetworkDataProvider;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.utils.IHLUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
diff --git a/ihl/processing/metallurgy/WoodenRollingMachineRender.java b/ihl/processing/metallurgy/WoodenRollingMachineRender.java
index 84fbcd6..f5fd12a 100644
--- a/ihl/processing/metallurgy/WoodenRollingMachineRender.java
+++ b/ihl/processing/metallurgy/WoodenRollingMachineRender.java
@@ -80,13 +80,10 @@ private final float scale=1F/16F;
model.RotatingPart3.render(scale);
model.RotatingPart4.render(scale);
}
- if(cte.hasEngine)
- {
- model.MotorPart1.render(scale);
- model.MotorPart2.render(scale);
- model.Belt1.render(scale);
- model.Belt2.render(scale);
- }
+ model.MotorPart1.render(scale);
+ model.MotorPart2.render(scale);
+ model.Belt1.render(scale);
+ model.Belt2.render(scale);
}
GL11.glPopMatrix(); //end
diff --git a/ihl/recipes/IRecipeInputFluid.java b/ihl/recipes/IRecipeInputFluid.java
index 8faf15d..823c0ae 100644
--- a/ihl/recipes/IRecipeInputFluid.java
+++ b/ihl/recipes/IRecipeInputFluid.java
@@ -1,8 +1,6 @@
package ihl.recipes;
import java.util.List;
-
-import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public interface IRecipeInputFluid {
diff --git a/ihl/recipes/IronWorkbenchRecipe.java b/ihl/recipes/IronWorkbenchRecipe.java
index 8ecb8df..f0bd81f 100644
--- a/ihl/recipes/IronWorkbenchRecipe.java
+++ b/ihl/recipes/IronWorkbenchRecipe.java
@@ -16,11 +16,11 @@ public class IronWorkbenchRecipe {
public List<IRecipeInput> materials=new ArrayList<IRecipeInput>();
public List<ItemStack> outputs = new ArrayList<ItemStack>();
- public IronWorkbenchRecipe(List tools1, List materials1, List<ItemStack> output1_1)
+ public IronWorkbenchRecipe(List<?> tools1, List<?> materials1, List<ItemStack> output1_1)
{
if(tools1!=null)
{
- Iterator iTools1 = tools1.iterator();
+ Iterator<?> iTools1 = tools1.iterator();
while(iTools1.hasNext())
{
Object tool = iTools1.next();
@@ -37,13 +37,13 @@ public class IronWorkbenchRecipe {
tools.add(new RecipeInputItemStack(stack));
}
}
- else
+ else
{
tools.add((IRecipeInput) tool);
}
}
}
- Iterator iMaterials1 = materials1.iterator();
+ Iterator<?> iMaterials1 = materials1.iterator();
while(iMaterials1.hasNext())
{
Object material = iMaterials1.next();
@@ -77,9 +77,33 @@ public class IronWorkbenchRecipe {
}
}
- public IronWorkbenchRecipe(List asList, List asList2, List<ItemStack> asList3, List<ItemStack> workspaceElements1) {
+ public IronWorkbenchRecipe(List<?> asList, List<?> asList2, List<ItemStack> asList3, List<ItemStack> workspaceElements1) {
this(asList, asList2, asList3);
+ if(workspaceElements1!=null)
+ {
this.workspaceElements.addAll(workspaceElements1);
+ }
+ }
+
+ public boolean isTool(ItemStack tool1)
+ {
+ if(tools!=null && !tools.isEmpty())
+ {
+ if(tool1==null)
+ {
+ return false;
+ }
+ Iterator<IRecipeInput> i1 = tools.iterator();
+ while(i1.hasNext())
+ {
+ IRecipeInput tool = i1.next();
+ if(tool.matches(tool1))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
}
public boolean isCanBeCrafted(List<ItemStack> tools1, List<ItemStack> materials1, List<ItemStack> workspaceElements1)
diff --git a/ihl/recipes/RecipeInputDetonator.java b/ihl/recipes/RecipeInputDetonator.java
new file mode 100644
index 0000000..efef075
--- /dev/null
+++ b/ihl/recipes/RecipeInputDetonator.java
@@ -0,0 +1,73 @@
+package ihl.recipes;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import ic2.api.recipe.IRecipeInput;
+import ihl.utils.IHLUtils;
+import net.minecraft.item.ItemStack;
+
+public class RecipeInputDetonator implements IRecipeInput
+{
+ public final ItemStack input;
+ public final int detonator_delay;
+
+ public RecipeInputDetonator(String string, int detonator_delay)
+ {
+ this(IHLUtils.getItemStackWithTag(string, "detonator_delay", detonator_delay));
+ }
+
+ public RecipeInputDetonator(ItemStack itemStack)
+ {
+ input=itemStack;
+ detonator_delay=itemStack.stackTagCompound.getInteger("detonator_delay");
+ }
+
+ @Override
+ public boolean matches(ItemStack subject)
+ {
+ return subject.getItem() == this.input.getItem() && (subject.getItemDamage() == this.input.getItemDamage() || this.input.getItemDamage() == 32767);
+ }
+
+ @Override
+ public int getAmount()
+ {
+ return 1;
+ }
+
+ @Override
+ public List<ItemStack> getInputs()
+ {
+ return Arrays.asList(new ItemStack[] {this.input});
+ }
+
+ @Override
+ public String toString()
+ {
+ ItemStack stack = this.input.copy();
+ return "RInputDice<" + stack + ">";
+ }
+
+ public List<ItemStack> transformOutput(ItemStack matchedItemStack, List<ItemStack> outputs)
+ {
+ List<ItemStack> newOutputs = new ArrayList<ItemStack>();
+ int misTS = matchedItemStack.stackTagCompound.getInteger("detonator_delay");
+ ItemStack material;
+ for(ItemStack material1:outputs)
+ {
+ if(IHLUtils.getFirstOreDictName(material1) == "blockExplosive")
+ {
+ material=material1.copy();
+ material.stackTagCompound.setInteger("detonator_delay", misTS);
+ newOutputs.add(material);
+ }
+ else
+ {
+ newOutputs.add(material1);
+ }
+ }
+ return newOutputs;
+ }
+}
+
diff --git a/ihl/recipes/RecipeInputDie.java b/ihl/recipes/RecipeInputDie.java
index c8356ca..8fbd4db 100644
--- a/ihl/recipes/RecipeInputDie.java
+++ b/ihl/recipes/RecipeInputDie.java
@@ -6,7 +6,6 @@ import java.util.List;
import ic2.api.recipe.IRecipeInput;
import ihl.interfaces.IWire;
-import ihl.items_blocks.FlexibleCableItem;
import ihl.utils.IHLUtils;
import net.minecraft.item.ItemStack;
@@ -53,7 +52,7 @@ public class RecipeInputDie implements IRecipeInput
public List<ItemStack> transformOutput(ItemStack matchedItemStack, List<ItemStack> outputs)
{
- List<ItemStack> newOutputs = new ArrayList();
+ List<ItemStack> newOutputs = new ArrayList<ItemStack>();
int misTS = matchedItemStack.stackTagCompound.getInteger("transverseSection");
ItemStack material;
for(ItemStack material1:outputs)
@@ -75,7 +74,7 @@ public class RecipeInputDie implements IRecipeInput
}
return newOutputs;
}
-
+
public int transformOutput(ItemStack matchedItemStack, ItemStack material)
{
int consumeAmountMultiplier=1;
diff --git a/ihl/recipes/RecipeInputFluidDictionary.java b/ihl/recipes/RecipeInputFluidDictionary.java
index 46c51eb..e1581c3 100644
--- a/ihl/recipes/RecipeInputFluidDictionary.java
+++ b/ihl/recipes/RecipeInputFluidDictionary.java
@@ -1,12 +1,8 @@
package ihl.recipes;
-import java.util.Arrays;
import java.util.List;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
-import ic2.api.recipe.IRecipeInput;
import ihl.IHLMod;
public class RecipeInputFluidDictionary implements IRecipeInputFluid
@@ -39,5 +35,12 @@ public class RecipeInputFluidDictionary implements IRecipeInputFluid
public List<FluidStack> getInputs() {
return IHLMod.fluidDictionary.getFluids(input);
}
+
+ @Override
+ public String toString()
+ {
+ return "RInputFluidStackDictionary<" + this.amount + "x" + this.input;
+ }
+
}
diff --git a/ihl/recipes/RecipeInputFluidStack.java b/ihl/recipes/RecipeInputFluidStack.java
index a7b5d0e..e4c116d 100644
--- a/ihl/recipes/RecipeInputFluidStack.java
+++ b/ihl/recipes/RecipeInputFluidStack.java
@@ -3,10 +3,8 @@ package ihl.recipes;
import java.util.Arrays;
import java.util.List;
-import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
-import ic2.api.recipe.IRecipeInput;
public class RecipeInputFluidStack implements IRecipeInputFluid
{
@@ -37,5 +35,11 @@ public class RecipeInputFluidStack implements IRecipeInputFluid
public List<FluidStack> getInputs() {
return Arrays.asList(new FluidStack[] {new FluidStack(fluid,amount)});
}
+
+ @Override
+ public String toString()
+ {
+ return "RInputFluidStack<" + this.amount + "x" + this.fluid.getName();
+ }
}
diff --git a/ihl/recipes/RecipeInputObjectInstance.java b/ihl/recipes/RecipeInputObjectInstance.java
index eeadc5c..8648e72 100644
--- a/ihl/recipes/RecipeInputObjectInstance.java
+++ b/ihl/recipes/RecipeInputObjectInstance.java
@@ -5,8 +5,6 @@ import java.util.List;
import net.minecraft.item.ItemStack;
import ic2.api.recipe.IRecipeInput;
-import ihl.interfaces.IWire;
-import ihl.items_blocks.FlexibleCableItem;
import ihl.utils.IHLUtils;
public class RecipeInputObjectInstance implements IRecipeInput
diff --git a/ihl/recipes/RecipeInputOreDictionaryList.java b/ihl/recipes/RecipeInputOreDictionaryList.java
index 3c4b551..572f15b 100644
--- a/ihl/recipes/RecipeInputOreDictionaryList.java
+++ b/ihl/recipes/RecipeInputOreDictionaryList.java
@@ -35,14 +35,14 @@ public class RecipeInputOreDictionaryList implements IRecipeInput
this.meta = meta;
}
- @Override
+ @Override
public boolean matches(ItemStack subject)
{
- List inputs = this.getOres();
+ List<ItemStack> inputs = this.getOres();
boolean useOreStackMeta = this.meta == null;
Item subjectItem = subject.getItem();
int subjectMeta = subject.getItemDamage();
- Iterator i$ = inputs.iterator();
+ Iterator<ItemStack> i$ = inputs.iterator();
Item oreItem;
int metaRequired;
@@ -59,7 +59,7 @@ public class RecipeInputOreDictionaryList implements IRecipeInput
return false;
}
- oreStack = (ItemStack)i$.next();
+ oreStack = i$.next();
oreItem = oreStack.getItem();
}
while (oreItem == null);
@@ -82,13 +82,13 @@ public class RecipeInputOreDictionaryList implements IRecipeInput
@Override
public List<ItemStack> getInputs()
{
- List ores = this.getOres();
+ List<ItemStack> ores = this.getOres();
boolean hasInvalidEntries = false;
- Iterator ret = ores.iterator();
+ Iterator<ItemStack> ret = ores.iterator();
while (ret.hasNext())
{
- ItemStack i$ = (ItemStack)ret.next();
+ ItemStack i$ = ret.next();
if (i$.getItem() == null)
{
@@ -103,12 +103,12 @@ public class RecipeInputOreDictionaryList implements IRecipeInput
}
else
{
- ArrayList ret1 = new ArrayList(ores.size());
- Iterator i$1 = ores.iterator();
+ ArrayList<ItemStack> ret1 = new ArrayList<ItemStack>(ores.size());
+ Iterator<ItemStack> i$1 = ores.iterator();
while (i$1.hasNext())
{
- ItemStack stack = (ItemStack)i$1.next();
+ ItemStack stack = i$1.next();
if (stack.getItem() != null)
{
@@ -134,10 +134,10 @@ public class RecipeInputOreDictionaryList implements IRecipeInput
}
else
{
- this.ores = new ArrayList();
+ this.ores = new ArrayList<ItemStack>();
for(int i=0;i<this.input.length;i++)
{
- ArrayList ret = OreDictionary.getOres(this.input[i]);
+ ArrayList<ItemStack> ret = OreDictionary.getOres(this.input[i]);
if (ret != OreDictionary.EMPTY_LIST)
{
this.ores.addAll(ret);
diff --git a/ihl/recipes/UniversalRecipeInput.java b/ihl/recipes/UniversalRecipeInput.java
index f0b42e2..1d2b06c 100644
--- a/ihl/recipes/UniversalRecipeInput.java
+++ b/ihl/recipes/UniversalRecipeInput.java
@@ -15,29 +15,16 @@ import net.minecraftforge.fluids.FluidStack;
public class UniversalRecipeInput{
- private final List<IRecipeInputFluid> fluidInputs=new ArrayList();
- private final List<IRecipeInput> itemInputs=new ArrayList();
- private boolean sharp=true;
- private int temperatureMin = 273;
- private int temperatureMax = Integer.MAX_VALUE;
- private float speedFactor=-1.0f;//=-Ea/R (k=k0*exp(-Ea/(RT)))
+ private final List<IRecipeInputFluid> fluidInputs=new ArrayList<IRecipeInputFluid>();
+ private final List<IRecipeInput> itemInputs=new ArrayList<IRecipeInput>();
private int multiplier=Integer.MAX_VALUE;
-
- public UniversalRecipeInput(List fluidInputs1, List itemInputs1, boolean sharp1)
- {
- this(fluidInputs1, itemInputs1);
- this.sharp=false;
- }
-
- public UniversalRecipeInput(List fluidInputs1, List itemInputs1)
+ public UniversalRecipeInput(Object[] fluidStacks, Object[] iRecipeInputs)
{
- if(fluidInputs1!=null)
+ if(fluidStacks!=null)
{
- Iterator ifluidInputs1 = fluidInputs1.iterator();
- while(ifluidInputs1.hasNext())
+ for(Object material:fluidStacks)
{
- Object material = ifluidInputs1.next();
if(material==null)
{
throw new NullPointerException("Recipe input cannot be null!");
@@ -52,12 +39,10 @@ public class UniversalRecipeInput{
}
}
}
- if(itemInputs1!=null)
+ if(iRecipeInputs!=null)
{
- Iterator iitemInputs1 = itemInputs1.iterator();
- while(iitemInputs1.hasNext())
+ for(Object material:iRecipeInputs)
{
- Object material = iitemInputs1.next();
if(material==null)
{
throw new NullPointerException("Recipe input cannot be null!");
@@ -103,13 +88,13 @@ public class UniversalRecipeInput{
public boolean matches(UniversalRecipeInput input) {
List<IRecipeInput> rInputs = input.getItemInputs();
Iterator<IRecipeInput> ii = rInputs.iterator();
- List<ItemStack> rInputsItems = new ArrayList();
+ List<ItemStack> rInputsItems = new ArrayList<ItemStack>();
while(ii.hasNext())
{
IRecipeInput is = ii.next();
rInputsItems.add(is.getInputs().get(0));
}
- List<FluidStack> rInputsFluids = new ArrayList();
+ List<FluidStack> rInputsFluids = new ArrayList<FluidStack>();
List<IRecipeInputFluid> rInputsF = input.getFluidInputs();
Iterator<IRecipeInputFluid> iiF = rInputsF.iterator();
while(iiF.hasNext())
@@ -226,13 +211,13 @@ public class UniversalRecipeInput{
public boolean adjustAmounts(UniversalRecipeInput input, boolean doAdjustAmounts) {
List<IRecipeInput> rInputs = input.getItemInputs();
Iterator<IRecipeInput> ii = rInputs.iterator();
- List<ItemStack> rInputsItems = new ArrayList();
+ List<ItemStack> rInputsItems = new ArrayList<ItemStack>();
while(ii.hasNext())
{
IRecipeInput is = ii.next();
rInputsItems.add(is.getInputs().get(0));
}
- List<FluidStack> rInputsFluids = new ArrayList();
+ List<FluidStack> rInputsFluids = new ArrayList<FluidStack>();
List<IRecipeInputFluid> rInputsF = input.getFluidInputs();
Iterator<IRecipeInputFluid> iiF = rInputsF.iterator();
while(iiF.hasNext())
diff --git a/ihl/recipes/UniversalRecipeManager.java b/ihl/recipes/UniversalRecipeManager.java
index 443a67f..99f43bc 100644
--- a/ihl/recipes/UniversalRecipeManager.java
+++ b/ihl/recipes/UniversalRecipeManager.java
@@ -6,9 +6,9 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import ic2.api.recipe.IRecipeInput;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
-import ic2.api.recipe.IRecipeInput;
import ihl.utils.IHLUtils;
public class UniversalRecipeManager {
@@ -25,7 +25,8 @@ public class UniversalRecipeManager {
machineRecipeManagers.put(machine1, this);
}
- private final Map<UniversalRecipeInput, UniversalRecipeOutput> recipes = new HashMap();
+ private final Map<UniversalRecipeInput, UniversalRecipeOutput> recipes = new HashMap<UniversalRecipeInput, UniversalRecipeOutput>();
+ private final Map<String, UniversalRecipeInput> keywordMap = new HashMap<String, UniversalRecipeInput>();
public void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output)
{
@@ -41,31 +42,53 @@ public class UniversalRecipeManager {
}
}
- Iterator var8 = this.recipes.keySet().iterator();
+ Iterator<UniversalRecipeInput> var8 = this.recipes.keySet().iterator();
while (var8.hasNext())
{
UniversalRecipeInput existingInput = (UniversalRecipeInput)var8.next();
if (existingInput.matches(input))
{
- Iterator<IRecipeInput> ilist1 = existingInput.getItemInputs().iterator();
- Iterator<IRecipeInput> ilist2 = input.getItemInputs().iterator();
- while(ilist1.hasNext())
+ StringBuffer ssError =new StringBuffer(255);
+ ssError.append("Ambiguous recipe. \n");
+ ssError.append("Existing input: \n");
+ Iterator<IRecipeInput> iii1 = existingInput.getItemInputs().iterator();
+ Iterator<IRecipeInputFluid> fii1 = existingInput.getFluidInputs().iterator();
+ while(iii1!=null && iii1.hasNext())
+ {
+ ssError.append(iii1.next().toString());
+ ssError.append(" \n");
+ }
+ while(fii1!=null && fii1.hasNext())
{
- IRecipeInput is = ilist1.next();
+ ssError.append(fii1.next().toString());
+ ssError.append(" \n");
}
- System.out.println("recipe 2:");
- while(ilist2.hasNext())
+ ssError.append("New input: \n");
+ Iterator<IRecipeInput> iii2 = input.getItemInputs().iterator();
+ Iterator<IRecipeInputFluid> fii2 = input.getFluidInputs().iterator();
+ while(iii2!=null && iii2.hasNext())
{
- IRecipeInput is = ilist2.next();
+ ssError.append(iii2.next().toString());
+ ssError.append(" \n");
}
- throw new RuntimeException("Ambiguous recipe.");
+ while(fii2!=null && fii2.hasNext())
+ {
+ ssError.append(fii2.next().toString());
+ ssError.append(" \n");
+ }
+ throw new RuntimeException(ssError.toString());
}
}
this.recipes.put(input, output);
}
+ public void addRecipe(String keyword, UniversalRecipeInput input, UniversalRecipeOutput output)
+ {
+ this.addRecipe(input, output);
+ this.keywordMap.put(keyword, input);
+ }
public UniversalRecipeOutput getOutputFor(List<FluidStack> fluidInputs, List<ItemStack> itemInputs, boolean adjustInput, boolean inputAffectOutput)
{
@@ -75,14 +98,14 @@ public class UniversalRecipeManager {
}
else
{
- Iterator i$ = this.recipes.entrySet().iterator();
+ Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.recipes.entrySet().iterator();
while (true)
{
if (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
- UniversalRecipeInput recipeInput = (UniversalRecipeInput)entry.getKey();
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
+ UniversalRecipeInput recipeInput = entry.getKey();
if (!recipeInput.matches(fluidInputs, itemInputs))
{
@@ -91,7 +114,7 @@ public class UniversalRecipeManager {
if (recipeInput.adjustAmounts(fluidInputs, itemInputs,true, false))
{
- UniversalRecipeOutput output = (UniversalRecipeOutput)entry.getValue();
+ UniversalRecipeOutput output = entry.getValue();
if (adjustInput)
{
if(inputAffectOutput)
@@ -121,14 +144,14 @@ public class UniversalRecipeManager {
public UniversalRecipeInput getRecipeInput(List<FluidStack> fluidInputs1, List<ItemStack> itemInputs1) {
{
- Iterator i$ = this.recipes.entrySet().iterator();
+ Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.recipes.entrySet().iterator();
while (true)
{
if (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
- UniversalRecipeInput recipeInput = (UniversalRecipeInput)entry.getKey();
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
+ UniversalRecipeInput recipeInput = entry.getKey();
if (!recipeInput.matches(fluidInputs1,itemInputs1))
{
@@ -147,12 +170,14 @@ public class UniversalRecipeManager {
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public UniversalRecipeOutput getOutputFor(List[] input, boolean adjustInput, boolean inputAffectOutput)
{
return this.getOutputFor(input[0], input[1], adjustInput, inputAffectOutput);
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public UniversalRecipeInput getRecipeInput(List[] input)
{
return this.getRecipeInput(input[0], input[1]);
@@ -161,36 +186,34 @@ public class UniversalRecipeManager {
public void removeRecipeByInput(UniversalRecipeInput uRecipeInput)
{
- Entry entryToRemove = null;
List<FluidStack> fluidInputs = IHLUtils.convertRecipeInputToFluidStackList(uRecipeInput.getFluidInputs());
List<ItemStack> itemInputs = IHLUtils.convertRecipeInputToItemStackList(uRecipeInput.getItemInputs());
{
- Iterator i$ = this.recipes.entrySet().iterator();
+ Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.recipes.entrySet().iterator();
while (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
- UniversalRecipeInput recipeInput = (UniversalRecipeInput)entry.getKey();
- if (recipeInput.matches(fluidInputs, itemInputs))
- {
- i$.remove();
- break;
- }
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
+ UniversalRecipeInput recipeInput = entry.getKey();
+ if (recipeInput.matches(fluidInputs, itemInputs))
+ {
+ i$.remove();
+ break;
+ }
}
}
}
public void removeRecipeByOutput(UniversalRecipeOutput uRecipeOutput)
{
- Entry entryToRemove = null;
- Iterator i$ = this.recipes.entrySet().iterator();
+ Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.recipes.entrySet().iterator();
while (i$.hasNext())
{
- Entry entry = (Entry)i$.next();
- UniversalRecipeOutput recipeOutput = (UniversalRecipeOutput)entry.getValue();
- if (recipeOutputHasCommonEntries(recipeOutput,uRecipeOutput))
- {
- i$.remove();
- }
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
+ UniversalRecipeOutput recipeOutput = entry.getValue();
+ if (recipeOutputHasCommonEntries(recipeOutput,uRecipeOutput))
+ {
+ i$.remove();
+ }
}
}
diff --git a/ihl/recipes/UniversalRecipeOutput.java b/ihl/recipes/UniversalRecipeOutput.java
index bda2bcf..17c20e4 100644
--- a/ihl/recipes/UniversalRecipeOutput.java
+++ b/ihl/recipes/UniversalRecipeOutput.java
@@ -9,24 +9,22 @@ import net.minecraftforge.fluids.FluidStack;
public class UniversalRecipeOutput{
- private final List<FluidStack> fluidOutputs=new ArrayList();
- private final List<RecipeOutputItemStack> itemOutputs=new ArrayList();
+ private final List<FluidStack> fluidOutputs=new ArrayList<FluidStack>();
+ private final List<RecipeOutputItemStack> itemOutputs=new ArrayList<RecipeOutputItemStack>();
private final int time;
public final boolean specialConditions;
- public UniversalRecipeOutput(List<FluidStack> fluidOutputs1, List itemOutputs1, int time1)
+ public UniversalRecipeOutput(FluidStack[] fluidOutputs1, Object[] itemOutputs1, int time1)
{
this(fluidOutputs1, itemOutputs1, time1,false);
}
- public UniversalRecipeOutput(List<FluidStack> fluidOutputs1, List itemOutputs1, int time1, boolean specialConditions1)
+ public UniversalRecipeOutput(FluidStack[] fluidStacks, Object[] recipeOutputItemStacks, int time1, boolean specialConditions1)
{
- if(fluidOutputs1!=null)
+ if(fluidStacks!=null)
{
- Iterator<FluidStack> ioi = fluidOutputs1.iterator();
- while(ioi.hasNext())
+ for(FluidStack fStack:fluidStacks)
{
- FluidStack fStack = ioi.next();
if(fStack==null)
{
throw new NullPointerException("Recipe cannot contain null elements!");
@@ -34,12 +32,10 @@ public class UniversalRecipeOutput{
fluidOutputs.add(fStack);
}
}
- if(itemOutputs1!=null)
+ if(recipeOutputItemStacks!=null)
{
- Iterator ioi = itemOutputs1.iterator();
- while(ioi.hasNext())
+ for(Object io:recipeOutputItemStacks)
{
- Object io = ioi.next();
if(io==null)
{
throw new NullPointerException("Recipe output cannot be null!");
@@ -58,6 +54,14 @@ public class UniversalRecipeOutput{
time=time1;
}
+ public UniversalRecipeOutput(List<FluidStack> recipeOutputsFluids,
+ List<RecipeOutputItemStack> recipeOutputsRecipeOut, int time1) {
+ this.fluidOutputs.addAll(recipeOutputsFluids);
+ this.itemOutputs.addAll(recipeOutputsRecipeOut);
+ this.time=time1;
+ this.specialConditions=false;
+ }
+
public boolean matches(List<FluidStack> fluidOutputs1, List<ItemStack> itemOutputs1)
{
if(fluidOutputs.size()!=fluidOutputs1.size()||itemOutputs.size()!=itemOutputs.size())
@@ -98,27 +102,27 @@ public class UniversalRecipeOutput{
}
public UniversalRecipeOutput copyWithMultiplier(int mulipier) {
- ArrayList<FluidStack> fluidStacks = new ArrayList<FluidStack>();
- ArrayList<RecipeOutputItemStack> itemStacks = new ArrayList<RecipeOutputItemStack>();
+ FluidStack[] fluidStacks = null;
+ RecipeOutputItemStack[] itemStacks = null;
if(fluidOutputs!=null && !fluidOutputs.isEmpty())
{
- Iterator<FluidStack> fi = fluidOutputs.iterator();
- while(fi.hasNext())
+ fluidStacks = new FluidStack[fluidOutputs.size()];
+ for(int i=0;i<fluidOutputs.size();i++)
{
- FluidStack fs = fi.next();
+ FluidStack fs = fluidOutputs.get(i);
FluidStack newFs = fs.copy();
newFs.amount*=mulipier;
- fluidStacks.add(newFs);
+ fluidStacks[i]=fs;
}
}
if(itemOutputs!=null && !itemOutputs.isEmpty())
{
- Iterator<RecipeOutputItemStack> ii = itemOutputs.iterator();
- while(ii.hasNext())
+ itemStacks = new RecipeOutputItemStack[itemOutputs.size()];
+ for(int i=0;i<itemOutputs.size();i++)
{
- RecipeOutputItemStack is = ii.next();
+ RecipeOutputItemStack is = itemOutputs.get(i);
RecipeOutputItemStack newIs = is.copy(mulipier);
- itemStacks.add(newIs);
+ itemStacks[i]=newIs;
}
}
return new UniversalRecipeOutput(fluidStacks,itemStacks, getTime(),false);
diff --git a/ihl/servitor/BoneBlock.java b/ihl/servitor/BoneBlock.java
index 1c88b37..d8e9c32 100644
--- a/ihl/servitor/BoneBlock.java
+++ b/ihl/servitor/BoneBlock.java
@@ -37,6 +37,7 @@ public class BoneBlock extends Block {
}
+ @SuppressWarnings("rawtypes")
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
{
diff --git a/ihl/servitor/FlameRenderFX.java b/ihl/servitor/FlameRenderFX.java
index 1b587b7..21729de 100644
--- a/ihl/servitor/FlameRenderFX.java
+++ b/ihl/servitor/FlameRenderFX.java
@@ -1,6 +1,5 @@
package ihl.servitor;
-import ihl.IHLModInfo;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.Tessellator;
diff --git a/ihl/servitor/LostHeadEntity.java b/ihl/servitor/LostHeadEntity.java
index 2734d4a..8a20a42 100644
--- a/ihl/servitor/LostHeadEntity.java
+++ b/ihl/servitor/LostHeadEntity.java
@@ -87,7 +87,8 @@ public class LostHeadEntity extends EntityFlying implements IMob
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D);
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void onLivingUpdate()
{
super.onLivingUpdate();
@@ -115,7 +116,7 @@ public class LostHeadEntity extends EntityFlying implements IMob
}
Entity var5 = null;
- List var6 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
+ List<Entity> var6 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double var7 = 0.0D;
int var9;
float var11;
@@ -165,8 +166,6 @@ public class LostHeadEntity extends EntityFlying implements IMob
{
if (var4.entityHit instanceof EntityLivingBase)
{
- EntityLivingBase var24 = (EntityLivingBase)var4.entityHit;
-
var26 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
if (var26 > 0.0F)
{
@@ -244,7 +243,6 @@ public class LostHeadEntity extends EntityFlying implements IMob
if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < var9 * var9)
{
double var11 = this.targetedEntity.posX - this.posX;
- double var13 = this.targetedEntity.boundingBox.minY + this.targetedEntity.height / 2.0F - (this.posY + this.height / 2.0F);
double var15 = this.targetedEntity.posZ - this.posZ;
this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(var11, var15)) * 180.0F / (float)Math.PI;
diff --git a/ihl/trans_dimensional_item_teleporter/TDITContainer.java b/ihl/trans_dimensional_item_teleporter/TDITContainer.java
index 6afac87..35dd1a0 100644
--- a/ihl/trans_dimensional_item_teleporter/TDITContainer.java
+++ b/ihl/trans_dimensional_item_teleporter/TDITContainer.java
@@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class TDITContainer extends ContainerBase {
+public class TDITContainer extends ContainerBase<TDITTileEntity> {
protected TDITTileEntity tileEntity;
public int lastStorage = -1;
diff --git a/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java b/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java
index 3ccf1dd..43701eb 100644
--- a/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java
+++ b/ihl/trans_dimensional_item_teleporter/TDITFrequencyTransmitter.java
@@ -124,7 +124,7 @@ public class TDITFrequencyTransmitter extends Item implements IItemHudInfo {
@Override
public List<String> getHudInfo(ItemStack itemStack) {
- LinkedList info = new LinkedList();
+ LinkedList<String> info = new LinkedList<String>();
if(itemStack.stackTagCompound!=null)
{
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(itemStack);
diff --git a/ihl/trans_dimensional_item_teleporter/TDITGui.java b/ihl/trans_dimensional_item_teleporter/TDITGui.java
index 5d4dcfd..ab17b17 100644
--- a/ihl/trans_dimensional_item_teleporter/TDITGui.java
+++ b/ihl/trans_dimensional_item_teleporter/TDITGui.java
@@ -19,15 +19,7 @@ public class TDITGui extends GuiContainer {
super(container1);
this.container=container1;
}
-
- @Override
- public void initGui()
- {
- super.initGui();
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- }
-
+
@Override
protected void drawGuiContainerForegroundLayer(int param1, int param2)
{
diff --git a/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java b/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java
index df0cb6f..6c6f268 100644
--- a/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java
+++ b/ihl/trans_dimensional_item_teleporter/TDITTileEntity.java
@@ -3,7 +3,6 @@ package ihl.trans_dimensional_item_teleporter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
-import java.util.Random;
import java.util.Set;
import cpw.mods.fml.relauncher.Side;
@@ -42,7 +41,6 @@ import ihl.utils.IHLInvSlotDischarge;
public class TDITTileEntity extends TileEntityInventory implements IEnergySink, IHasGui, IUpgradableBlock
{
- private int startUpCounter=0;
private int tier=4;
private int defaultTier=4;
public int maxStorage=12000;
@@ -56,7 +54,6 @@ public class TDITTileEntity extends TileEntityInventory implements IEnergySink,
public final InvSlot inputSlot;
public int updateChecksum=-1;
- private Random rand = new Random();
private AudioSource startAS;
public boolean targetSet=false;
@@ -427,7 +424,7 @@ public class TDITTileEntity extends TileEntityInventory implements IEnergySink,
if(te!=null && te instanceof TDITTileEntity)
{
TDITTileEntity tdit = (TDITTileEntity) te;
- List<ItemStack> itemStackList = new ArrayList();
+ List<ItemStack> itemStackList = new ArrayList<ItemStack>();
for(int i=0;i<this.inputSlot.size();i++)
{
if(this.inputSlot.get(i)!=null)
diff --git a/ihl/tunneling_shield/DriverContainer.java b/ihl/tunneling_shield/DriverContainer.java
index b7e8687..ee14de8 100644
--- a/ihl/tunneling_shield/DriverContainer.java
+++ b/ihl/tunneling_shield/DriverContainer.java
@@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
-public class DriverContainer extends ContainerBase {
+public class DriverContainer extends ContainerBase<DriverTileEntity> {
protected DriverTileEntity tileEntity;
public int lastStorage = -1;
diff --git a/ihl/tunneling_shield/DriverGui.java b/ihl/tunneling_shield/DriverGui.java
index c7c8664..446c9f1 100644
--- a/ihl/tunneling_shield/DriverGui.java
+++ b/ihl/tunneling_shield/DriverGui.java
@@ -10,7 +10,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
-import ic2.core.network.NetworkManager;
@SideOnly(Side.CLIENT)
public class DriverGui extends GuiContainer {
@@ -23,7 +22,8 @@ public class DriverGui extends GuiContainer {
this.container=container1;
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void initGui()
{
super.initGui();
diff --git a/ihl/tunneling_shield/DriverRenderEntity.java b/ihl/tunneling_shield/DriverRenderEntity.java
index 127c9a3..40ed977 100644
--- a/ihl/tunneling_shield/DriverRenderEntity.java
+++ b/ihl/tunneling_shield/DriverRenderEntity.java
@@ -11,11 +11,8 @@ public class DriverRenderEntity extends Render{
private DriverModel model = new DriverModel();
private ResourceLocation tex = new ResourceLocation(IHLModInfo.MODID+":textures/blocks/shield.png");
- private float rotationSpeed=0F;
private float rotationAmount=1F;
private float rotationAmount2=0F;
- private float shiftCorrection=0F;
-
public DriverRenderEntity()
{
super();
diff --git a/ihl/tunneling_shield/DriverTileEntity.java b/ihl/tunneling_shield/DriverTileEntity.java
index 2c3f2d8..f547dec 100644
--- a/ihl/tunneling_shield/DriverTileEntity.java
+++ b/ihl/tunneling_shield/DriverTileEntity.java
@@ -26,7 +26,6 @@ import ic2.core.block.invslot.InvSlotConsumableId;
import ic2.core.block.invslot.InvSlot;
import ic2.core.block.invslot.InvSlotUpgrade;
import ic2.core.block.invslot.InvSlot.Access;
-import ic2.core.network.NetworkManager;
import ic2.core.upgrade.IUpgradableBlock;
import ic2.core.upgrade.UpgradableProperty;
import ic2.core.util.StackUtil;
@@ -86,8 +85,8 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink
public boolean reverseModeOn=false;
public boolean autoReverseModeOn=true;
private float lastModelShiftAmount=1F;
- private List<Block> blockBlackList = new ArrayList();
- private List<Block> blockWhiteList = new ArrayList();
+ private List<Block> blockBlackList = new ArrayList<Block>();
+ private List<Block> blockWhiteList = new ArrayList<Block>();
public boolean advancedShield=false;
public DriverTileEntity()
@@ -225,7 +224,8 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void updateEntityClient()
{
super.updateEntityClient();
@@ -318,7 +318,8 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink
}
}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void updateEntityServer()
{
if (IC2.platform.isSimulating())
@@ -720,7 +721,7 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink
}
@Override
- public ContainerBase getGuiContainer(EntityPlayer arg0) {
+ public ContainerBase<DriverTileEntity> getGuiContainer(EntityPlayer arg0) {
return new DriverContainer(arg0, this);
}
@@ -799,9 +800,6 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink
private AxisAlignedBB getShieldBladesZone(double offset)
{
- int x=this.xCoord;
- int y=this.yCoord;
- int z=this.zCoord;
double extension=this.getModelShiftAmount()+offset;
double xShieldMinD=this.xCoord+extension*this.mX()-1D*Math.max(this.mX(), 0)-2D*Math.abs(this.mZ());
double xShieldMaxD=this.xCoord+extension*this.mX()-1D*Math.min(this.mX(), 0)+3D*Math.abs(this.mZ());
@@ -960,7 +958,7 @@ public class DriverTileEntity extends TileEntityInventory implements IEnergySink
HydrotransportPulpRegeneratorTileEntity hprte = (HydrotransportPulpRegeneratorTileEntity) te;
if(hprte.getActive())
{
- ArrayList<ItemStack> drops1 = new ArrayList();
+ ArrayList<ItemStack> drops1 = new ArrayList<ItemStack>();
Iterator<ItemStack> dropsIterator = drops.iterator();
while(dropsIterator.hasNext())
{
diff --git a/ihl/tunneling_shield/HorizontalMiningPipe.java b/ihl/tunneling_shield/HorizontalMiningPipe.java
index 8048d45..9409d27 100644
--- a/ihl/tunneling_shield/HorizontalMiningPipe.java
+++ b/ihl/tunneling_shield/HorizontalMiningPipe.java
@@ -23,7 +23,7 @@ import net.minecraft.world.World;
public class HorizontalMiningPipe extends Block {
- public static ArrayList<DriverTileEntity> teList = new ArrayList();
+ public static ArrayList<DriverTileEntity> teList = new ArrayList<DriverTileEntity>();
public HorizontalMiningPipe() {
super(Material.iron);
diff --git a/ihl/tunneling_shield/HydrotransportPulpRegeneratorContainer.java b/ihl/tunneling_shield/HydrotransportPulpRegeneratorContainer.java
index fade7a0..82445d7 100644
--- a/ihl/tunneling_shield/HydrotransportPulpRegeneratorContainer.java
+++ b/ihl/tunneling_shield/HydrotransportPulpRegeneratorContainer.java
@@ -10,7 +10,7 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fluids.FluidStack;
-public class HydrotransportPulpRegeneratorContainer extends ContainerBase {
+public class HydrotransportPulpRegeneratorContainer extends ContainerBase<HydrotransportPulpRegeneratorTileEntity> {
protected HydrotransportPulpRegeneratorTileEntity tileEntity;
public int lastFluidAmount = -1;
@@ -18,6 +18,7 @@ public class HydrotransportPulpRegeneratorContainer extends ContainerBase {
public short lastProgress = -1;
public short lastTemperature = -1;
private int lastEnergy = -1;
+ @SuppressWarnings("unused")
private List<FluidStack> fluidTankFluidList;
private final static int height=166;
@@ -39,7 +40,7 @@ public class HydrotransportPulpRegeneratorContainer extends ContainerBase {
}
this.addSlotToContainer(new SlotInvSlot(tileEntity1.drainInputSlot, 0, 32, 13));
this.addSlotToContainer(new SlotInvSlot(tileEntity1.emptyFluidItemsSlot, 0, 32, 51));
- this.addSlotToContainer(new SlotInvSlot(tileEntity1.engine, 0, 8, 32));
+ this.addSlotToContainer(new SlotInvSlot(tileEntity1.dischargeSlot, 0, 8, 32));
for(col=0;col<4;col++)
{
for(row=0;row<3;row++)
diff --git a/ihl/tunneling_shield/HydrotransportPulpRegeneratorGui.java b/ihl/tunneling_shield/HydrotransportPulpRegeneratorGui.java
index 263d2e1..bd86dd7 100644
--- a/ihl/tunneling_shield/HydrotransportPulpRegeneratorGui.java
+++ b/ihl/tunneling_shield/HydrotransportPulpRegeneratorGui.java
@@ -44,10 +44,6 @@ public class HydrotransportPulpRegeneratorGui extends GuiContainer {
IHLRenderUtils.instance.renderIHLFluidTank(this.container.tileEntity.fluidTank, 57, 16, 69, 63, zLevel, par1, par2, xOffset, yOffset);
}
this.mc.renderEngine.bindTexture(background);
- if(!this.container.tileEntity.engine.correctContent())
- {
- IHLRenderUtils.instance.drawMissingEngineTooltip(this, par1, par2, 26, 33, xOffset, yOffset);
- }
}
@Override
diff --git a/ihl/tunneling_shield/HydrotransportPulpRegeneratorTileEntity.java b/ihl/tunneling_shield/HydrotransportPulpRegeneratorTileEntity.java
index e1d2b39..dc5e114 100644
--- a/ihl/tunneling_shield/HydrotransportPulpRegeneratorTileEntity.java
+++ b/ihl/tunneling_shield/HydrotransportPulpRegeneratorTileEntity.java
@@ -40,7 +40,6 @@ public class HydrotransportPulpRegeneratorTileEntity extends BasicElectricMotorT
this.drainInputSlot = new InvSlotConsumableLiquidIHL(this, "drainInput", -1, InvSlot.Access.I, 1, InvSlot.InvSide.TOP, InvSlotConsumableLiquid.OpType.Drain);
this.emptyFluidItemsSlot = new InvSlotOutput(this, "fluidCellsOutput", 2, 1);
this.outputSlot = new InvSlotOutput(this, "output", 3, 12);
- this.isGuiScreenOpened=true;
this.operationLength=26;
}
@@ -211,9 +210,10 @@ public class HydrotransportPulpRegeneratorTileEntity extends BasicElectricMotorT
private boolean isMachineOperational()
{
- return this.engine.correctContent() && this.energy>=this.energyConsume/this.engine.getEfficiency();
+ return this.energy>=this.energyConsume;
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public List[] getInput()
{
diff --git a/ihl/tunneling_shield/MultiBlockSpacerBlock.java b/ihl/tunneling_shield/MultiBlockSpacerBlock.java
index 511d8cd..79e5955 100644
--- a/ihl/tunneling_shield/MultiBlockSpacerBlock.java
+++ b/ihl/tunneling_shield/MultiBlockSpacerBlock.java
@@ -22,7 +22,7 @@ import net.minecraft.world.World;
public class MultiBlockSpacerBlock extends Block {
- public static Set<IMultiBlock> teList = new HashSet();
+ public static Set<IMultiBlock> teList = new HashSet<IMultiBlock>();
public MultiBlockSpacerBlock()
{
@@ -37,7 +37,12 @@ public class MultiBlockSpacerBlock extends Block {
{
return -2;
}
-
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world,int x, int y, int z, int meta, int flag)
+ {
+ return new ArrayList<ItemStack>();
+ }
@Override
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion)
{
@@ -100,14 +105,6 @@ public class MultiBlockSpacerBlock extends Block {
return null;
}
- @Override
- public ArrayList<ItemStack> getDrops(World world,int x, int y, int z, int meta, int flag)
- {
- ArrayList<ItemStack> nothing = new ArrayList();
- nothing.clear();
- return nothing;
- }
-
/**
* Is this block (a) opaque and (B) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
diff --git a/ihl/utils/EntityIHLExplosion.java b/ihl/utils/EntityIHLExplosion.java
deleted file mode 100644
index df0dc18..0000000
--- a/ihl/utils/EntityIHLExplosion.java
+++ /dev/null
@@ -1,187 +0,0 @@
-package ihl.utils;
-
-import ihl.IHLMod;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.Entity;
-import net.minecraft.init.Blocks;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.Explosion;
-import net.minecraft.world.World;
-
-public class EntityIHLExplosion extends Entity {
- private Explosion explosion;
- private boolean explosionDone=false;
- public Set<Long> effectBorderBlocks;
- public Set<Long> effectBorderBlocksWithLowPosition;
- public Set<Long> blocksConnectedWithBedrock;
- public Set<Long> blocksNotConnectedWithBedrock;
- public int explosionPower;
- public int x;
- public int y;
- public int z;
- private Map<Long,Entity> entityCache = new HashMap();
-
- public EntityIHLExplosion(World world,int x1,int y1,int z1, int explosionPower1) {
- super(world);
- this.effectBorderBlocks=new HashSet();
- this.effectBorderBlocksWithLowPosition=new HashSet();
- this.blocksConnectedWithBedrock=new HashSet();
- this.blocksNotConnectedWithBedrock=new HashSet();
- this.isImmuneToFire=true;
- this.noClip=true;
- this.setSize(0F, 0F);
- this.x=x1;
- this.y=y1;
- this.z=z1;
- this.setPosition(x+0.5d, y+0.5d, z+0.5d);
- this.explosionPower = explosionPower1;
- }
-
-
-
- @Override
- public void onUpdate()
- {
- if(!worldObj.isRemote)
- {
- if(!effectBorderBlocks.isEmpty())
- {
- boolean hasSomeBlocksStickedToAir=false;
- Iterator<Long> ebbi = effectBorderBlocks.iterator();
- while(ebbi.hasNext())
- {
- long longNumber = ebbi.next();
- int[] xyz = IHLUtils.decodeXYZ(longNumber);
- Block block = worldObj.getBlock(x+xyz[0], y+xyz[1], z+xyz[2]);
- if(block!=Blocks.air && !block.isAir(worldObj, x+xyz[0], y+xyz[1], z+xyz[2]))
- {
- if(block.getMaterial().isLiquid())
- {
- block.onNeighborBlockChange(worldObj, x+xyz[0], y+xyz[1], z+xyz[2], block);
- }
- else if(!this.isBlockConnectedWithBedrock(longNumber))
- {
- hasSomeBlocksStickedToAir=true;
- }
- }
- }
- Iterator<Long> bnctbi = this.blocksNotConnectedWithBedrock.iterator();
- while(bnctbi.hasNext())
- {
- long longNumber5 = bnctbi.next();
- int[] xyz = IHLUtils.decodeXYZ(longNumber5);
- Block block = worldObj.getBlock(x+xyz[0], y+xyz[1], z+xyz[2]);
- float bh = block.getBlockHardness(worldObj, x+xyz[0], y+xyz[1], z+xyz[2]);
- if(bh>=0f && bh<Float.MAX_VALUE)
- {
- block.onBlockDestroyedByExplosion(worldObj, x+xyz[0], y+xyz[1], z+xyz[2], explosion);
- }
- }
- }
- if(!this.explosionDone)
- {
- IHLMod.explosionHandler.setPower(IHLMod.explosionHandler.startVectors, explosionPower);
- IHLMod.explosionHandler.doExplosion(worldObj, x, y, z, IHLMod.explosionHandler.startVectors);
- this.explosionDone=true;
- }
- }
- }
-
- private boolean isBlockConnectedWithBedrock(long longNumber)
- {
- if(this.blocksNotConnectedWithBedrock.contains(longNumber))
- {
- return false;
- }
- Set<Long> path = new HashSet();
- Iterator<Long> pathi = path.iterator();
- Set<Long> deadlockBlocks = new HashSet();
- int[] xyz = IHLUtils.decodeXYZ(longNumber);
- int absX=x+xyz[0];
- int absY=y+xyz[1];
- int absZ=z+xyz[2];
- path.add(longNumber);
- while(absY>4)
- {
- int xyzi[] = {0,0,-1,0,0,1,0,0};
- Block block;
- int x2,y2,z2;
- boolean deadlock = true;
- for(int i=0;i<=5;i++)
- {
- x2=absX+xyzi[i];
- y2=absY+xyzi[i+2];
- z2=absZ+xyzi[i+1];
- long longNumber2 = IHLUtils.encodeXYZ(x2-x, y2-y, z2-z);
- if(this.blocksConnectedWithBedrock.contains(longNumber2))
- {
- this.blocksConnectedWithBedrock.addAll(path);
- return true;
- }
- if(!path.contains(longNumber2))
- {
- block = worldObj.getBlock(x2,y2,z2);
- if(block!=Blocks.air && !block.isAir(worldObj, x2,y2,z2) && !block.getMaterial().isLiquid())
- {
- absX=x2;
- absY=y2;
- absZ=z2;
- path.add(longNumber2);
- if(absY<=4)
- {
- this.blocksConnectedWithBedrock.addAll(path);
- return true;
- }
- deadlock = false;
- break;
- }
- }
- }
- if(deadlock)
- {
- long longNumber3 = IHLUtils.encodeXYZ(absX-x, absY-y, absZ-z);
- deadlockBlocks.add(longNumber3);
- boolean deadEnd=true;
- while(pathi.hasNext())
- {
- long longNumber4 = pathi.next();
- if(!deadlockBlocks.contains(longNumber4))
- {
- int[] xyz2 = IHLUtils.decodeXYZ(longNumber4);
- absX=x+xyz2[0];
- absY=y+xyz2[1];
- absZ=z+xyz2[2];
- deadEnd=false;
- break;
- }
- }
- if(deadEnd)
- {
- this.blocksNotConnectedWithBedrock.addAll(path);
- return false;
- }
- }
- }
- this.blocksConnectedWithBedrock.addAll(path);
- return true;
- }
-
-
- @Override
- protected void entityInit() {}
-
- @Override
- protected void readEntityFromNBT(NBTTagCompound arg0) {}
-
- @Override
- protected void writeEntityToNBT(NBTTagCompound arg0) {}
-
-
-}
diff --git a/ihl/utils/ExplosionVector.java b/ihl/utils/ExplosionVector.java
deleted file mode 100644
index d341fd3..0000000
--- a/ihl/utils/ExplosionVector.java
+++ /dev/null
@@ -1,453 +0,0 @@
-package ihl.utils;
-
-import ihl.IHLMod;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.network.play.server.S26PacketMapChunkBulk;
-import net.minecraft.util.DamageSource;
-import net.minecraft.world.ChunkCoordIntPair;
-import net.minecraft.world.Explosion;
-import net.minecraft.world.World;
-import net.minecraft.world.chunk.Chunk;
-import net.minecraft.world.chunk.NibbleArray;
-import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
-
-public class ExplosionVector
-{
- public Set<Long> startVectors = new HashSet();
- private Set<Long> sv;
- private Set<Chunk> chunksToUpdate=new HashSet(64);
- public Map<Long,Set<Long>> vectors = new HashMap(32786);
- public Map<Long,Explosion> explosions = new HashMap();
- public Map<Long,Integer> explosionPower = new HashMap();
- public Map<Long,Float> explosionPowerDampingFactor = new HashMap(32786);
- public Map<Long,ExtendedBlockStorage> cachedEBS = new HashMap(128);
- public Map<Long,Integer> cachedEBSHardness = new HashMap(128);
- public Map<Long,Map<Long,Integer>> cachedEBSDrops = new HashMap(128);
- public Map<Long,List<Entity>> cachedEBSEntity = new HashMap(128);
- public Map<Integer,WorldSavedDataBlastWave> blastWaveByDimensionId = new HashMap();
-
- private Random random = new Random();
-
- public ExplosionVector()
- {
- this.precalculateExplosion();
- }
-
- public void precalculateExplosion()
- {
- int maxExplosionRadius=32;
- for(int levelRadius=1; levelRadius<maxExplosionRadius; levelRadius++)
- {
- for(int ix=-levelRadius;ix<=levelRadius;ix++)
- {
- for(int iy=-levelRadius;iy<=levelRadius;iy++)
- {
- for(int iz=-levelRadius;iz<=levelRadius;iz++)
- {
- {
- long coordinateKey = IHLUtils.encodeXYZ(ix,iy,iz);
- if(!vectors.containsKey(coordinateKey))
- {
- int prevX=ix;
- int prevY=iy;
- int prevZ=iz;
- if(Math.abs(ix)+Math.abs(iy)+Math.abs(iz)>Math.round(levelRadius*1.8f))
- {
- prevX=IHLUtils.reduceVariableByAbsoluteValue(prevX);
- prevY=IHLUtils.reduceVariableByAbsoluteValue(prevY);
- prevZ=IHLUtils.reduceVariableByAbsoluteValue(prevZ);
- }
- else if(Math.abs(ix)<=Math.abs(iy) && Math.abs(ix)<=Math.abs(iz))
- {
- prevY=IHLUtils.reduceVariableByAbsoluteValue(prevY);
- prevZ=IHLUtils.reduceVariableByAbsoluteValue(prevZ);
- }
- else if(Math.abs(iy)<=Math.abs(ix) && Math.abs(iy)<=Math.abs(iz))
- {
- prevX=IHLUtils.reduceVariableByAbsoluteValue(prevX);
- prevZ=IHLUtils.reduceVariableByAbsoluteValue(prevZ);
- }
- else if(Math.abs(iz)<=Math.abs(ix) && Math.abs(iz)<=Math.abs(iy))
- {
- prevY=IHLUtils.reduceVariableByAbsoluteValue(prevY);
- prevX=IHLUtils.reduceVariableByAbsoluteValue(prevX);
- }
- long prevKey = IHLUtils.encodeXYZ(prevX,prevY,prevZ);
- if(prevX==ix && prevY==iy && prevZ==iz && levelRadius>1)
- {
- IHLMod.log.error("Was:"+ix+"/" +iy+"/" +iz+"/");
- IHLMod.log.error("Now:"+prevX+"/" +prevY+"/" +prevZ+"/");
- throw new ArithmeticException("Variables are out of expected range. \n Expected are not equal: "+ix+"="+prevX+" "+iy+"="+prevY+" "+iz+"="+prevZ);
- }
- if(levelRadius==1)
- {
- startVectors.add(coordinateKey);
- this.addElement(coordinateKey, prevX, prevY, prevZ, ix, iy, iz);
- }
- else if(vectors.containsKey(prevKey))
- {
- //prevKey=this.getParentWithLowestDescendantsRate(prevKey, prevX, prevY, prevZ, levelRadius);
- vectors.get(prevKey).add(coordinateKey);
- this.addElement(coordinateKey, prevX, prevY, prevZ, ix, iy, iz);
- }
- else
- {
- IHLMod.log.error("Was:"+ix+"/" +iy+"/" +iz+"/");
- IHLMod.log.error("Now:"+prevX+"/" +prevY+"/" +prevZ+"/");
- IHLMod.log.info("ExplosionVector is missing parent! Help him!");
- }
- }
- }
- }
- }
- }
- }
- }
-
- private void addElement(long coordinateKey, int prevX, int prevY, int prevZ, int ix, int iy, int iz)
- {
- vectors.put(coordinateKey, new HashSet());
- float df = (float)(prevX*prevX+prevY*prevY+prevZ*prevZ+1)/(float)(ix*ix+iy*iy+iz*iz+1);
- explosionPowerDampingFactor.put(coordinateKey,df);
- }
-
- public void setPower(Set<Long> sv2, int power1)
- {
- for(long ev:sv2)
- {
- this.setPower(ev, power1);
- }
- }
-
- public void setPower(Long ev, int power1) {
- this.explosionPower.put(ev, power1);
- }
-/*
- public Set<Long> breakBlocksAndGetDescendants(World world, EntityIHLExplosion exploder, Explosion explosion, long longNumber)
- {
- int multiplier = exploder.multiplier;
- int[] xyz = IHLUtils.decodeXYZ(longNumber);
- int power1 = explosionPower.get(longNumber);
- int repeat=0;
- //System.out.println("Power before " + power1);
- if(Math.abs(xyz[0])>=Math.abs(xyz[1]) && Math.abs(xyz[0])>=Math.abs(xyz[2]))
- {
- for(int ix=xyz[0]>0?0:multiplier-1;ix<multiplier && ix>=0;ix=xyz[0]>0?ix+1:ix-1)
- {
- for(int iy=xyz[1]>0?0:multiplier-1;iy<multiplier && iy>=0;iy=xyz[1]>0?iy+1:iy-1)
- {
- for(int iz=xyz[2]>0?0:multiplier-1;iz<multiplier && iz>=0;iz=xyz[2]>0?iz+1:iz-1)
- {
- power1 = this.getNewPowerAndProcessBlocks(world, exploder, explosion, xyz, multiplier, ix, iy, iz, power1);
- }
- }
- }
- }
- else if(Math.abs(xyz[1])>=Math.abs(xyz[0]) && Math.abs(xyz[1])>=Math.abs(xyz[2]))
- {
- for(int iy=xyz[1]>0?0:multiplier-1;iy<multiplier && iy>=0;iy=xyz[1]>0?iy+1:iy-1)
- {
- for(int ix=xyz[0]>0?0:multiplier-1;ix<multiplier && ix>=0;ix=xyz[0]>0?ix+1:ix-1)
- {
- for(int iz=xyz[2]>0?0:multiplier-1;iz<multiplier && iz>=0;iz=xyz[2]>0?iz+1:iz-1)
- {
- power1 = this.getNewPowerAndProcessBlocks(world, exploder, explosion, xyz, multiplier, ix, iy, iz, power1);
- }
- }
- }
- }
- else
- {
- for(int iz=xyz[2]>0?0:multiplier-1;iz<multiplier && iz>=0;iz=xyz[2]>0?iz+1:iz-1)
- {
- for(int ix=xyz[0]>0?0:multiplier-1;ix<multiplier && ix>=0;ix=xyz[0]>0?ix+1:ix-1)
- {
- for(int iy=xyz[1]>0?0:multiplier-1;iy<multiplier && iy>=0;iy=xyz[1]>0?iy+1:iy-1)
- {
- power1 = this.getNewPowerAndProcessBlocks(world, exploder, explosion, xyz, multiplier, ix, iy, iz, power1);
- }
- }
- }
- }
- power1=Math.round(power1*explosionPowerDampingFactor.get(longNumber)-0.5f);
- //System.out.println("Power after " + power1 + " \n repeats "+repeat);
- if(power1<=1 || !vectors.containsKey(longNumber)|| vectors.get(longNumber).isEmpty())
- {
- exploder.effectBorderBlocks.add(longNumber);
- if(xyz[1]<0 || (exploder.y<=6 && xyz[1]<=6))
- {
- exploder.effectBorderBlocksWithLowPosition.add(longNumber);
- }
- return null;
- }
- else
- {
- for(long d1:vectors.get(longNumber))
- {
- explosionPower.put(d1, power1);
- }
- return vectors.get(longNumber);
- }
- }
- */
-
- public Set<Long> breakBlocksAndGetDescendantsForEBS(World world, int sourceX,int sourceY,int sourceZ, Explosion explosion, long longNumber)
- {
- int[] xyz = IHLUtils.decodeXYZ(longNumber);
- int power1 = explosionPower.remove(longNumber);
- power1 = this.getNewPowerAndProcessBlocksEBS(world, longNumber, sourceX, sourceY, sourceZ, explosion, xyz, power1);
- power1=Math.round(power1*explosionPowerDampingFactor.get(longNumber)-0.5f);
- if(power1<=1 || !vectors.containsKey(longNumber)|| vectors.get(longNumber).isEmpty())
- {
- return null;
- }
- else
- {
- for(long d1:vectors.get(longNumber))
- {
- explosionPower.put(d1, power1);
- }
- return vectors.get(longNumber);
- }
-
- }
-/*
- private int getNewPowerAndProcessBlocks(World world, EntityIHLExplosion exploder, Explosion explosion, int xyz[], int multiplier, int ix, int iy, int iz, int power2)
- {
- int power1=power2;
- int x = exploder.x+xyz[0]*multiplier+ix;
- int y = exploder.y+xyz[1]*multiplier+iy;
- int z = exploder.z+xyz[2]*multiplier+iz;
- if(y<=4 || y>256)
- {
- return 0;
- }
- Block block = exploder.getBlock(x, y, z);
- int explosionResistance = Math.round(block.getExplosionResistance(exploder, world, x, y, z, exploder.x, exploder.y, exploder.z)*10f);
- if(explosionResistance>=power1)
- {
- power1=0;
- }
- else
- {
- power1-=Math.round(block.getExplosionResistance(exploder, world, x, y, z, exploder.x, exploder.y, exploder.z)*10f);
- Entity entity = exploder.getEntity(x, y, z);
- if(entity!=null)
- {
- entity.attackEntityFrom(exploder.damageSource, power1/10f);
- }
- block.onBlockDestroyedByExplosion(world, x, y, z, explosion);
- exploder.setBlockToAir(x, y, z);
- }
- return power1;
- }
- */
- private int getNewPowerAndProcessBlocksEBS(World world, long longNumber, int sourceX, int sourceY, int sourceZ, Explosion explosion, int xyz[], int power2)
- {
- int power1=power2;
- int absEBSX = xyz[0] + (sourceX>>4);
- int absEBSY = xyz[1] + (sourceY>>4);
- int absEBSZ = xyz[2] + (sourceZ>>4);
- long chunkXZKey = ChunkCoordIntPair.chunkXZ2Int(absEBSX, absEBSZ);
- if(absEBSY<0 || absEBSY>=16)
- {
- return 0;
- }
- if(world.getChunkProvider().chunkExists(absEBSX, absEBSZ))
- {
- long absEBShash = IHLUtils.getXYZHash(absEBSX, absEBSY, absEBSZ);
- int explosionResistance = this.getEBSResistance(world, absEBShash, absEBSX, absEBSY, absEBSZ, sourceX, sourceY, sourceZ);
- if(explosionResistance>=power1)
- {
- power1=0;
- }
- else
- {
- power1-=explosionResistance;
- if(this.cachedEBSEntity.containsKey(absEBShash))
- {
- List<Entity> entityList = this.cachedEBSEntity.get(absEBShash);
- for(Object entity:entityList.toArray())
- {
- if(entity!=null)
- {
- ((Entity) entity).attackEntityFrom(DamageSource.setExplosionSource(explosion), power1/10f);
- }
- }
- }
- this.onEBSDestroy(world, absEBShash, absEBSX, absEBSY, absEBSZ);
- }
- }
- else
- {
- WorldSavedDataBlastWave blastWave = null;
- int dimensionId = world.provider.dimensionId;
- if(this.blastWaveByDimensionId.containsKey(dimensionId))
- {
- blastWave=this.blastWaveByDimensionId.get(dimensionId);
- }
- else
- {
- blastWave=new WorldSavedDataBlastWave("blastWave");
- this.blastWaveByDimensionId.put(dimensionId, blastWave);
- }
- blastWave.scheduleExplosionEffectsOnChunkLoad(chunkXZKey, longNumber, sourceX, sourceY, sourceZ, power1, absEBSY);
- }
- return power1;
- }
-
- public int getEBSResistance(World world, long absEBShash, int absEBSX, int absEBSY, int absEBSZ, int sourceX, int sourceY, int sourceZ)
- {
-
- if(this.cachedEBSHardness.containsKey(absEBShash))
- {
- return this.cachedEBSHardness.get(absEBShash);
- }
- else
- {
- this.precacheChunk(world, absEBSX,absEBSZ, sourceX, sourceY, sourceZ);
- return this.cachedEBSHardness.containsKey(absEBShash)?this.cachedEBSHardness.get(absEBShash):0;
- }
- }
-
- public void precacheChunk(World world, int absEBSX, int absEBSZ, int sourceX, int sourceY, int sourceZ)
- {
- Chunk chunk = world.getChunkProvider().provideChunk(absEBSX, absEBSZ);
- ExtendedBlockStorage[] ebsA = chunk.getBlockStorageArray();
- for(int y3=0;y3<ebsA.length;y3++)
- {
- ExtendedBlockStorage ebs = ebsA[y3];
- int ebsHardness = 0;
- long absEBShash1 = IHLUtils.getXYZHash(absEBSX, y3, absEBSZ);
- if(ebs!=null && !ebs.isEmpty())
- {
- byte[] lbsArray = ebs.getBlockLSBArray();
- Map<Long,Integer> drops = new HashMap();
- for(int i4=0;i4<lbsArray.length;i4++)
- {
- int var4 = lbsArray[i4] & 255;
- if (ebs.getBlockMSBArray() != null)
- {
- var4 |= ebs.getBlockMSBArray().get(i4 & 15, (i4>>8) & 15, (i4>>4) & 15) << 8;
- }
- int blockWorldX = (i4 & 15)+(absEBSX<<4);
- int blockWorldY = ((i4>>8) & 15)+(y3<<4);
- int blockWorldZ = ((i4>>4) & 15)+(absEBSZ<<4);
- Block block = Block.getBlockById(var4);
- List<ItemStack> dropsList = (block.getDrops(world, blockWorldX, blockWorldY, blockWorldZ, ebs.getExtBlockMetadata(i4 & 15, (i4>>8) & 15, (i4>>4) & 15), 0));
- if(dropsList!=null)
- {
- for(ItemStack drop:dropsList)
- {
- long key = (Item.getIdFromItem(drop.getItem())<<16)|drop.getItemDamage();
- if(drops.containsKey(key))
- {
- int ss = drops.get(key);
- drops.put(key, drop.stackSize+ss);
- }
- else
- {
- drops.put(key, drop.stackSize);
- }
- }
- }
- if(block.getBlockHardness(world, blockWorldX, blockWorldY, blockWorldZ)<0)
- {
- ebsHardness=Integer.MAX_VALUE;
- break;
- }
- else
- {
- ebsHardness+=Math.round(block.getExplosionResistance(null, world, blockWorldX, blockWorldY, blockWorldZ, sourceX, sourceY, sourceZ)*10f);
- }
- }
- this.cachedEBSDrops.put(absEBShash1, drops);
- this.cachedEBSEntity.put(absEBShash1, chunk.entityLists[y3]);
- this.cachedEBSHardness.put(absEBShash1, ebsHardness);
- this.cachedEBS.put(absEBShash1, ebs);
- }
- }
- }
-
- public void onEBSDestroy(World world,long absEBShash,int absEBSX,int absEBSY,int absEBSZ)
- {
- if(this.cachedEBS.containsKey(absEBShash))
- {
- ExtendedBlockStorage ebs = this.cachedEBS.get(absEBShash);
- ebs.setBlockMSBArray(new NibbleArray(4096, 4));
- ebs.setBlockLSBArray(new byte[4096]);
- this.cachedEBS.remove(absEBShash);
- this.cachedEBSDrops.remove(absEBShash);
- this.cachedEBSEntity.remove(absEBShash);
- this.cachedEBSHardness.remove(absEBShash);
- this.chunksToUpdate.add(world.getChunkProvider().provideChunk(absEBSX, absEBSZ));
- }
- }
-
- public void sendChunkUpdateToPlayersInExplosionAffectedZone(World world)
- {
- for(Object player:world.playerEntities)
- {
- if(player instanceof EntityPlayerMP)
- {
- EntityPlayerMP playerMP = (EntityPlayerMP)player;
- List chunks = new ArrayList();
- chunks.addAll(this.chunksToUpdate);
- playerMP.playerNetServerHandler.sendPacket(new S26PacketMapChunkBulk(chunks));
- this.chunksToUpdate.clear();
- }
- }
- }
-
- public void doExplosion(World world, int sourceX, int sourceY, int sourceZ, Set<Long> startVectors1)
- {
- boolean doExplosion=true;
- long sourceHash = IHLUtils.getXYZHash(sourceX, sourceY, sourceZ);
- Explosion explosion = new Explosion(world, null, sourceX, sourceY, sourceZ, 100f);
- explosions.put(sourceHash, explosion);
- while(doExplosion)
- {
- Set<Long> sv2=new HashSet();
- if(sv==null)
- {
- sv = startVectors1;
- }
- for(long ev:sv)
- {
- Set<Long> sv3 = this.breakBlocksAndGetDescendantsForEBS(world, sourceX, sourceY, sourceZ, explosion, ev);
- if(sv3!=null)
- {
- sv2.addAll(sv3);
- }
- }
- if(sv2.isEmpty())
- {
- doExplosion=false;
- sv = null;
- sendChunkUpdateToPlayersInExplosionAffectedZone(world);
- break;
- }
- else
- {
- sv=sv2;
- }
- }
-
-
- }
-
-
-}
diff --git a/ihl/utils/FluidDictionary.java b/ihl/utils/FluidDictionary.java
index fa5b96a..8dcd18f 100644
--- a/ihl/utils/FluidDictionary.java
+++ b/ihl/utils/FluidDictionary.java
@@ -10,8 +10,8 @@ import net.minecraftforge.fluids.FluidStack;
public class FluidDictionary
{
- private Map<String,List<FluidStack>> nameToStack = new HashMap();
- private Map<Fluid,String> fluidToName = new HashMap();
+ private Map<String,List<FluidStack>> nameToStack = new HashMap<String,List<FluidStack>>();
+ private Map<Fluid,String> fluidToName = new HashMap<Fluid,String>();
public FluidDictionary(){}
public List<FluidStack> getFluids(String fdName)
@@ -27,7 +27,7 @@ public class FluidDictionary
}
else
{
- List<FluidStack> list = new ArrayList();
+ List<FluidStack> list = new ArrayList<FluidStack>();
list.add(fstack);
nameToStack.put(fdName, list);
}
diff --git a/ihl/utils/IHLFluidTank.java b/ihl/utils/IHLFluidTank.java
index aef2b46..21eb5b7 100644
--- a/ihl/utils/IHLFluidTank.java
+++ b/ihl/utils/IHLFluidTank.java
@@ -20,7 +20,6 @@ public class IHLFluidTank implements IFluidTank
{
private final List<FluidStack> fluidList = new ArrayList<FluidStack>();
private final int capacity;
- private boolean isOpenVessel=false;
private int temperature=293;
public IHLFluidTank(int capacity)
@@ -30,7 +29,6 @@ public class IHLFluidTank implements IFluidTank
public IHLFluidTank(int capacity, boolean isOpenVessel1)
{
- this.isOpenVessel=isOpenVessel1;
this.capacity = capacity;
}
@@ -295,7 +293,7 @@ public class IHLFluidTank implements IFluidTank
public void sortFluidsByDensity()
{
- Map<Integer, FluidStack> sortMap = new HashMap();
+ Map<Integer, FluidStack> sortMap = new HashMap<Integer, FluidStack>();
int[] keysArray = new int[fluidList.size()];
Iterator<FluidStack> fli = fluidList.iterator();
while(fli.hasNext())
@@ -357,11 +355,11 @@ public class IHLFluidTank implements IFluidTank
return this.fluidList;
}
- public void drain(List fluidInputs, boolean doDrain)
+ public void drain(List<?> fluidInputs, boolean doDrain)
{
if(fluidInputs!=null && !fluidInputs.isEmpty())
{
- Iterator fsi = fluidInputs.iterator();
+ Iterator<?> fsi = fluidInputs.iterator();
while(fsi.hasNext())
{
this.drain(fsi.next(), doDrain);
diff --git a/ihl/utils/IHLItemRenderer.java b/ihl/utils/IHLItemRenderer.java
index caed0a3..38e98b2 100644
--- a/ihl/utils/IHLItemRenderer.java
+++ b/ihl/utils/IHLItemRenderer.java
@@ -30,9 +30,9 @@ public class IHLItemRenderer {
public IHLItemRenderer(){}
- public IHLItemRenderer(boolean b)
+ public IHLItemRenderer(boolean noRotation1)
{
- noRotation=b;
+ noRotation=noRotation1;
}
public void doRender(RenderManager renderManager, ItemStack stack, double x, double y, double z)
diff --git a/ihl/utils/IHLMathUtils.java b/ihl/utils/IHLMathUtils.java
index cfd6931..1200fd5 100644
--- a/ihl/utils/IHLMathUtils.java
+++ b/ihl/utils/IHLMathUtils.java
@@ -3,8 +3,9 @@ package ihl.utils;
public class IHLMathUtils
{
private final static int accuracy_level=65536;
- private static float[] sin_table=new float[accuracy_level];
- private static float[] atan_table=new float[accuracy_level];
+ private final static float[] sin_table=new float[accuracy_level];
+ private final static float[] atan_table=new float[accuracy_level];
+ private final static float[] sqrt_table=new float[accuracy_level];
private final static float PI=(float)Math.PI;
public static float sin(float angle)
@@ -17,6 +18,18 @@ public class IHLMathUtils
return sin_table[(int)(angle1*accuracy_level/2/PI)];
}
+ public static float sqrt(float value)
+ {
+ float value1 = value;
+ int multiplier = 2;
+ while(value1 >= 1.0f)
+ {
+ multiplier*=multiplier;
+ value1 /=multiplier*multiplier;
+ }
+ return ((multiplier>2)?multiplier:1)*sqrt_table[(int)(value1*accuracy_level)];
+ }
+
public static float atan(float tan_value)
{
if(tan_value<-32f)
@@ -32,7 +45,54 @@ public class IHLMathUtils
return atan_table[(int)((tan_value+32f)*accuracy_level/64f)];
}
}
+
+ public static float[] vector_vector_multiply(float[] v1, float[] v2)
+ {
+ float c_x = v1[1]*v2[2] - v2[1]*v1[2];
+ float c_y = v2[0]*v1[2] - v1[0]*v2[2];
+ float c_z = v1[0]*v2[1] - v2[0]*v1[1];
+ return new float[] {c_x,c_y,c_z};
+ }
+
+ public static void normalize_vector(float[] v1)
+ {
+ float d = (float)Math.sqrt(v1[0]*v1[0]+v1[1]*v1[1]+v1[2]*v1[2]);
+ if(d == 0)
+ { // Nothing can we do. Create new vector towards up direction.
+ v1[0]=0;
+ v1[1]=1;
+ v1[2]=0;
+ }
+ else
+ {
+ v1[0]/=d;
+ v1[1]/=d;
+ v1[2]/=d;
+ }
+ }
+ public static void scale_vector_to_value(float[] v1, float v2)
+ {
+ float d = (float)Math.sqrt(v1[0]*v1[0]+v1[1]*v1[1]+v1[2]*v1[2]);
+ if(d == 0)
+ { // Nothing can we do. Create new vector towards up direction.
+ v1[0]=0;
+ v1[1]=v2;
+ v1[2]=0;
+ }
+ else
+ {
+ v1[0]=v1[0]*v2/d;
+ v1[1]=v1[1]*v2/d;
+ v1[2]=v1[2]*v2/d;
+ }
+ }
+
+ public static void vector_add(float[] fs, float x, float y, float z) {
+ fs[0]+=x;
+ fs[1]+=y;
+ fs[2]+=z;
+ }
static
{
@@ -44,5 +104,49 @@ public class IHLMathUtils
{
atan_table[i]=(float) Math.atan(-32d+64d*i/accuracy_level);
}
+ for(int i=0;i<accuracy_level;i++)
+ {
+ sqrt_table[i]=(float) Math.sqrt((double)i/accuracy_level);
+ }
+ }
+
+ public static float[] vector_return_difference(double[] v1, double[] v2) {
+ return new float[] {
+ (float)(v1[0]-v2[0]),
+ (float)(v1[1]-v2[1]),
+ (float)(v1[2]-v2[2])};
+ }
+
+ public static float[] vector_return_difference(float[] v1, double[] v2) {
+ return new float[] {
+ (float)(v1[0]-v2[0]),
+ (float)(v1[1]-v2[1]),
+ (float)(v1[2]-v2[2])};
}
+
+ public static float[] vector_return_difference(int[] v1, double[] v2) {
+ return new float[] {
+ (float)(v1[0]-v2[0]),
+ (float)(v1[1]-v2[1]),
+ (float)(v1[2]-v2[2])};
+ }
+
+ public static void multiply_vector_to_value(float[] v1, float v2) {
+ v1[0]*=v2;
+ v1[1]*=v2;
+ v1[2]*=v2;
+ }
+
+ public static void vector_add(double[] v1, float[] v2) {
+ v1[0]+=v2[0];
+ v1[1]+=v2[1];
+ v1[2]+=v2[2];
+ }
+
+ public static float[] get_triangle_normal(double[][] triangle1) {
+ float[] v1 = vector_return_difference(triangle1[1],triangle1[0]);
+ float[] v2 = vector_return_difference(triangle1[2],triangle1[0]);
+ return vector_vector_multiply(v1,v2);
+ }
+
}
diff --git a/ihl/utils/IHLRenderUtils.java b/ihl/utils/IHLRenderUtils.java
index 6cf8fa8..af5fe2a 100644
--- a/ihl/utils/IHLRenderUtils.java
+++ b/ihl/utils/IHLRenderUtils.java
@@ -44,15 +44,12 @@ public class IHLRenderUtils
private final int guiContainerHeight = 176;
private float lastPlayerYaw;
private float lastPlayerPitch;
- private double lastPlayerPosY;
- private double lastPlayerPosZ;
- private double lastPlayerPosX;
- private double renderMinX=0d;
- private double renderMaxX=1d;
- private double renderMinY=0d;
- private double renderMaxY=1d;
- private double renderMinZ=0d;
- private double renderMaxZ=1d;
+ public double renderMinX=0d;
+ public double renderMaxX=1d;
+ public double renderMinY=0d;
+ public double renderMaxY=1d;
+ public double renderMinZ=0d;
+ public double renderMaxZ=1d;
public boolean renderFromInside=false;
private float rotationPointX;
private float rotationPointY;
@@ -77,7 +74,7 @@ public class IHLRenderUtils
{
instance=this;
colorBuffer = GLAllocation.createDirectFloatBuffer(16);
- frameTooltipMap = new HashMap();
+ frameTooltipMap = new HashMap<Long, Integer>();
}
public void renderIHLFluidTank(IHLFluidTank fluidTank, int x1, int y1, int x2, int y2, float zLevel, int par1, int par2, int xOffset, int yOffset)
@@ -323,9 +320,6 @@ public class IHLRenderUtils
{
lastPlayerYaw = Minecraft.getMinecraft().renderViewEntity.prevRotationYaw;
lastPlayerPitch = Minecraft.getMinecraft().renderViewEntity.prevRotationPitch;
- lastPlayerPosX = Minecraft.getMinecraft().renderViewEntity.prevPosX;
- lastPlayerPosY = Minecraft.getMinecraft().renderViewEntity.prevPosY;
- lastPlayerPosZ = Minecraft.getMinecraft().renderViewEntity.prevPosZ;
}
public void drawKnee(double xPos, double yPos, double zPos, ForgeDirection direction12, ForgeDirection direction22, double radius1, double radius2, IIcon icon)
@@ -539,7 +533,6 @@ public class IHLRenderUtils
public void drawSquare(double xPos, double yPos, double zPos, double[][] vertexes, IIcon icon)
{
- Tessellator var9 = Tessellator.instance;
double u1 = icon.getInterpolatedU(this.renderMinZ * 16.0D);
double u2 = icon.getInterpolatedU(this.renderMaxZ * 16.0D);
double v2 = icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D);
@@ -554,16 +547,23 @@ public class IHLRenderUtils
v2 = icon.getMinV();
v1 = icon.getMaxV();
}
+ this.drawSquare(xPos, yPos, zPos, u1, u2, v1, v2, vertexes);
+ }
+
+
+ public void drawSquare(double xPos, double yPos, double zPos, double u1, double u2, double v1, double v2, double[][] vertexes)
+ {
+ Tessellator var9 = Tessellator.instance;
double[] us = new double[]{u1,u1,u2,u2};
double[] vs = new double[]{v1,v2,v2,v1};
double xDelta=this.renderMaxX-this.renderMinX;
double yDelta=this.renderMaxY-this.renderMinY;
double zDelta=this.renderMaxZ-this.renderMinZ;
int startFrom=0;
- int endTo=3;
+ int endTo=vertexes.length-1;
if(this.renderFromInside)
{
- startFrom=3;
+ startFrom=vertexes.length-1;
endTo=0;
}
for(int i=startFrom;(i<=endTo&&!this.renderFromInside)||(i>=endTo&&this.renderFromInside);i+=(endTo-startFrom)/3)
@@ -617,6 +617,7 @@ public class IHLRenderUtils
var9.addVertexWithUV(xPos+vX, yPos+vY, zPos+vZ, us[i], vs[i]);
}
}
+
public void setRenderBounds(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
{
@@ -735,9 +736,6 @@ public class IHLRenderUtils
{
this.rotationZ=rotationZ1;
}
-// this.rotationX=rotationX1;
- // this.rotationY=rotationY1;
- //this.rotationZ=rotationZ1;
}
public void reset()
@@ -762,10 +760,9 @@ public class IHLRenderUtils
public List<String> splitStringByWidth(String string, int stringWidth)
{
- List<String> output = new ArrayList();
+ List<String> output = new ArrayList<String>();
StringBuffer sb = new StringBuffer();
String[] splittedBySpaces = string.split(" ");
- int arrayIndex=0;
for(String word:splittedBySpaces)
{
if(!word.contains("/n") && getStringWidth(sb)+getStringWidth(word)<stringWidth)
@@ -777,7 +774,6 @@ public class IHLRenderUtils
{
output.add(sb.toString());
sb.delete(0, sb.length());
- arrayIndex++;
if(!word.contains("/n"))
{
sb.append(word);
diff --git a/ihl/utils/IHLUtils.java b/ihl/utils/IHLUtils.java
index b4ec4de..5099727 100644
--- a/ihl/utils/IHLUtils.java
+++ b/ihl/utils/IHLUtils.java
@@ -8,9 +8,6 @@ import ic2.core.BasicMachineRecipeManager;
import ic2.core.IC2;
import ic2.core.block.invslot.InvSlotOutput;
import ihl.IHLMod;
-import ihl.flexible_cable.AnchorTileEntity;
-import ihl.flexible_cable.SubAnchorEnergyNetNode;
-import ihl.interfaces.ICableHolder;
import ihl.interfaces.IEnergyNetNode;
import ihl.interfaces.IMultiPowerCableHolder;
import ihl.interfaces.IWire;
@@ -18,6 +15,13 @@ import ihl.metallurgy.constants.*;
import ihl.processing.invslots.InvSlotConsumableLiquidIHL;
import ihl.recipes.IRecipeInputFluid;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -44,6 +48,9 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
+import net.minecraft.world.chunk.Chunk;
+import net.minecraft.world.chunk.NibbleArray;
+import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidTank;
@@ -51,7 +58,7 @@ import net.minecraftforge.oredict.OreDictionary;
public class IHLUtils
{
- private static Map<String,ItemStack> ihlItemStackRegistry = new HashMap();
+ private static Map<String,ItemStack> ihlItemStackRegistry = new HashMap<String, ItemStack>();
private static final String Digits = "(\\p{Digit}+)";
private static final String HexDigits = "(\\p{XDigit}+)";
private static final String Exp = "[eE][+-]?"+Digits;
@@ -159,10 +166,10 @@ public class IHLUtils
}
}
- public static ItemStack getOtherModItemStackWithDamage(String modname, String name,int damage) {
+ public static ItemStack getOtherModItemStackWithDamage(String modname, String name, int damage, int quantity) {
if(GameRegistry.findItem(modname, name)!=null)
{
- return new ItemStack(GameRegistry.findItem(modname, name),1,damage);
+ return new ItemStack(GameRegistry.findItem(modname, name),quantity,damage);
}
else if(GameRegistry.findBlock(modname, name)==null)
{
@@ -170,7 +177,7 @@ public class IHLUtils
}
else
{
- return new ItemStack(GameRegistry.findBlock(modname, name),1,damage);
+ return new ItemStack(GameRegistry.findBlock(modname, name),quantity,damage);
}
}
@@ -477,6 +484,20 @@ public class IHLUtils
//IHLMod.log.info("IC2 metal former (rolling) recipe for "+input+" already exist. Skipped.");
}
}
+
+ public static void addIC2ExtrudingRecipe(ItemStack input, ItemStack output)
+ {
+ if(Recipes.metalformerExtruding.getOutputFor(input, false)==null)
+ {
+ NBTTagCompound tag = new NBTTagCompound();
+ Recipes.metalformerExtruding.addRecipe(new RecipeInputItemStack(input), tag, output);
+ }
+ else
+ {
+ //IHLMod.log.info("IC2 metal former (rolling) recipe for "+input+" already exist. Skipped.");
+ }
+ }
+
public static void addIC2CentrifugeRecipe(String input, ItemStack output, ItemStack output2)
{
@@ -536,7 +557,7 @@ public class IHLUtils
public static int getDamageValueViaNBTTag(ItemStack stack)
{
NBTTagCompound gtTagCompound = null;
- if(stack!=null && stack.stackTagCompound.hasKey("GT.ToolStats"))
+ if(stack!=null && stack.stackTagCompound!=null && stack.stackTagCompound.hasKey("GT.ToolStats"))
{
gtTagCompound = stack.stackTagCompound.getCompoundTag("GT.ToolStats");
}
@@ -557,7 +578,7 @@ public class IHLUtils
public static int getMaxDamageValueViaNBTTag(ItemStack stack)
{
NBTTagCompound gtTagCompound = null;
- if(stack!=null && stack.stackTagCompound.hasKey("GT.ToolStats"))
+ if(stack!=null && stack.stackTagCompound!=null && stack.stackTagCompound.hasKey("GT.ToolStats"))
{
gtTagCompound = stack.stackTagCompound.getCompoundTag("GT.ToolStats");
}
@@ -641,28 +662,28 @@ public class IHLUtils
public static void handleFluidSlotsBehaviour(InvSlotConsumableLiquidIHL fillInputSlot, InvSlotConsumableLiquidIHL drainInputSlot, InvSlotOutput emptyFluidItemsSlot, IFluidTank fluidTank)
{
- MutableObject output;
+ MutableObject<ItemStack> output;
if (drainInputSlot!=null && !drainInputSlot.isEmpty())
{
- output = new MutableObject();
- if(fluidTank.fill(drainInputSlot.drain(null, fluidTank.getCapacity()-fluidTank.getFluidAmount(), output, true),false)>0 && (output.getValue() == null || emptyFluidItemsSlot.canAdd((ItemStack)output.getValue())))
+ output = new MutableObject<ItemStack>();
+ if(fluidTank.fill(drainInputSlot.drain(null, fluidTank.getCapacity()-fluidTank.getFluidAmount(), output, true),false)>0 && (output.getValue() == null || emptyFluidItemsSlot.canAdd(output.getValue())))
{
fluidTank.fill(drainInputSlot.drain(null, fluidTank.getCapacity()-fluidTank.getFluidAmount(), output, false),true);
if(output.getValue()!=null)
{
- emptyFluidItemsSlot.add((ItemStack)output.getValue());
+ emptyFluidItemsSlot.add(output.getValue());
}
}
}
if (fillInputSlot!=null && !fillInputSlot.isEmpty())
{
- output = new MutableObject();
- if (fillInputSlot.transferFromTank(fluidTank, output, true) && (output.getValue() == null || emptyFluidItemsSlot.canAdd((ItemStack)output.getValue())))
+ output = new MutableObject<ItemStack>();
+ if (fillInputSlot.transferFromTank(fluidTank, output, true) && (output.getValue() == null || emptyFluidItemsSlot.canAdd(output.getValue())))
{
fillInputSlot.transferFromTank(fluidTank, output, false);
if(output.getValue()!=null)
{
- emptyFluidItemsSlot.add((ItemStack)output.getValue());
+ emptyFluidItemsSlot.add(output.getValue());
}
}
}
@@ -788,7 +809,7 @@ public class IHLUtils
public static List<ItemStack> convertRecipeInputToItemStackList(List<IRecipeInput> input)
{
Iterator<IRecipeInput> irii=input.iterator();
- List<ItemStack> output = new ArrayList();
+ List<ItemStack> output = new ArrayList<ItemStack>();
while(irii.hasNext())
{
IRecipeInput iri = irii.next();
@@ -801,7 +822,7 @@ public class IHLUtils
public static List<FluidStack> convertRecipeInputToFluidStackList(List<IRecipeInputFluid> input) {
Iterator<IRecipeInputFluid> irii=input.iterator();
- List<FluidStack> output = new ArrayList();
+ List<FluidStack> output = new ArrayList<FluidStack>();
while(irii.hasNext())
{
IRecipeInputFluid iri = irii.next();
@@ -840,7 +861,8 @@ public class IHLUtils
public static long getXYZHash(int x,int y,int z)
{
- return ((x&0x1FFFFF)<<42)|((y&0x1FFFFF)<<21)|(z&0x1FFFFF);
+ int sign_bits = (x & 0x80000000) >> 29 | (y & 0x80000000) >> 30 | (z & 0x80000000) >> 31;
+ return (long)x<<31 ^ (long)y<<17 ^ (long)z<<3 ^ sign_bits;
}
public static String trim(String str)
@@ -1105,6 +1127,118 @@ public class IHLUtils
else {
return useSafeValue;
}
+ }
+
+ public static int parseIntSafe(String string, int useSafeValue)
+ {
+ if (Pattern.matches(fpRegex, string))
+ return Integer.valueOf(string);
+ else {
+ return useSafeValue;
+ }
+ }
+
+ public static boolean isBlockRegisteredInOreDictionaryAs(Block block, String string) {
+ Iterator<ItemStack> isoi = OreDictionary.getOres(string).iterator();
+ while(isoi.hasNext())
+ {
+ if(Block.getBlockFromItem(isoi.next().getItem())==block)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static void setBlockAndTileEntityRaw(World world, int x, int y, int z, Block block, TileEntity te)
+ {
+ Chunk chunk = world.getChunkProvider().provideChunk(x>>4, z>>4);
+ ExtendedBlockStorage[] ebsA = chunk.getBlockStorageArray();
+ ExtendedBlockStorage ebs = ebsA[y>>4];
+ if(ebs==null)
+ {
+ ebs = new ExtendedBlockStorage(y, true);
+ ebsA[y>>4] = ebs;
+ }
+ setBlockRaw(ebs,x & 15,y & 15,z & 15,block);
+ te.xCoord=x;
+ te.yCoord=y;
+ te.zCoord=z;
+ te.setWorldObj(world);
+ chunk.addTileEntity(te);
}
+
+ public static void setBlockRaw(ExtendedBlockStorage ebs, int x, int y, int z, Block block)
+ {
+ int l = ebs.blockLSBArray[y << 8 | z << 4 | x] & 255;
+
+ if (ebs.blockMSBArray != null)
+ {
+ l |= ebs.blockMSBArray.get(x, y, z) << 8;
+ }
+
+ Block block1 = Block.getBlockById(l);
+
+ if (block1 != Blocks.air)
+ {
+ --ebs.blockRefCount;
+
+ if (block1.getTickRandomly())
+ {
+ --ebs.tickRefCount;
+ }
+ }
+
+ if (block != Blocks.air)
+ {
+ ++ebs.blockRefCount;
+
+ if (block.getTickRandomly())
+ {
+ ++ebs.tickRefCount;
+ }
+ }
+
+ int i1 = Block.getIdFromBlock(block);
+ ebs.blockLSBArray[y << 8 | z << 4 | x] = (byte)(i1 & 255);
+
+ if (i1 > 255)
+ {
+ if (ebs.blockMSBArray == null)
+ {
+ ebs.blockMSBArray = new NibbleArray(ebs.blockLSBArray.length, 4);
+ }
+
+ ebs.blockMSBArray.set(x, y, z, (i1 & 3840) >> 8);
+ }
+ else if (ebs.blockMSBArray != null)
+ {
+ ebs.blockMSBArray.set(x, y, z, 0);
+ }
+ }
+
+ public static void dumpToFile(Set<String> unlocalisedNames, String filename) {
+ try {
+ OutputStreamWriter osWriter = new OutputStreamWriter(new FileOutputStream(getFile(filename)), "UTF-8");
+ BufferedWriter writer = new BufferedWriter(osWriter);
+ for(String string:unlocalisedNames)
+ {
+ writer.append(string);
+ writer.newLine();
+ }
+ writer.close();
+ osWriter.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private static File getFile(String filename)
+ {
+ File folder = new File(IHLMod.proxy.getMinecraftDir(), "logs");
+ folder.mkdirs();
+ return new File(folder, filename);
+ }
+
}
diff --git a/ihl/utils/IHLXMLParser.java b/ihl/utils/IHLXMLParser.java
index 67d246b..8073542 100644
--- a/ihl/utils/IHLXMLParser.java
+++ b/ihl/utils/IHLXMLParser.java
@@ -3,15 +3,7 @@ package ihl.utils;
import ihl.IHLMod;
import ihl.guidebook.IHLGuidebookGui;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.io.OutputStreamWriter;
-import java.net.URL;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -20,9 +12,6 @@ import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
-import com.google.common.io.Files;
-
-
public class IHLXMLParser {
public DocumentBuilderFactory dbf;
@@ -55,7 +44,7 @@ public class IHLXMLParser {
else if(e.getTagName().equals("itemstack"))
{
String[] innername = IHLUtils.trim(e.getTextContent()).split(":");
- ihlGuidebookGui.addItemStack(IHLUtils.getOtherModItemStackWithDamage(innername[0], innername[1], Integer.parseInt(e.getAttribute("damage"))));
+ ihlGuidebookGui.addItemStack(IHLUtils.getOtherModItemStackWithDamage(innername[0], innername[1], Integer.parseInt(e.getAttribute("damage")),1));
}
else if(e.getTagName().equals("text"))
{
@@ -100,42 +89,4 @@ public class IHLXMLParser {
Document doc = db.parse(IHLMod.class.getResourceAsStream("/assets/ihl/config/ihl-guidebook.xml"));
visit(doc, 0, sectionNumber, ihlGuidebookGui);
}
-
- private File getGuidebookFile() throws IOException
- {
- File folder = new File(IHLMod.proxy.getMinecraftDir(), "config");
- folder.mkdirs();
- File file = new File(folder, "ihl-guidebook.xml");
- if(!file.exists())
- {
- InputStream in = IHLMod.class.getResourceAsStream("/assets/ihl/config/ihl-guidebook.xml");
- InputStreamReader isReader = new InputStreamReader(in, "UTF-8");
- LineNumberReader reader = new LineNumberReader(isReader);
- OutputStreamWriter osWriter = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
- BufferedWriter writer = new BufferedWriter(osWriter);
- String line;
- while ((line = reader.readLine()) != null)
- {
- writer.append(line);
- writer.newLine();
- }
- writer.close();
- osWriter.close();
- in = IHLMod.class.getResourceAsStream("/assets/ihl/config/adress.xsd");
- isReader = new InputStreamReader(in, "UTF-8");
- reader = new LineNumberReader(isReader);
- file = new File(folder, "adress.xsd");
- osWriter = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
- writer = new BufferedWriter(osWriter);
- while ((line = reader.readLine()) != null)
- {
- writer.append(line);
- writer.newLine();
- }
- writer.close();
- osWriter.close();
- }
- return file;
- }
-
}
diff --git a/ihl/utils/WorldSavedDataBlastWave.java b/ihl/utils/WorldSavedDataBlastWave.java
deleted file mode 100644
index 06e1b41..0000000
--- a/ihl/utils/WorldSavedDataBlastWave.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package ihl.utils;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.world.WorldSavedData;
-
-public class WorldSavedDataBlastWave extends WorldSavedData {
- Map<Long,Long[][]> data = new HashMap(256);
- public static long memoryUsage=0L;
-
- public WorldSavedDataBlastWave(String name)
- {
- super(name);
- }
-
- @Override
- public void readFromNBT(NBTTagCompound nbt)
- {
- if(nbt.hasKey("entryList"))
- {
- NBTTagList entryList=nbt.getTagList("entryList", 10);
- for(int i=0;i<entryList.tagCount();i++)
- {
- NBTTagCompound chunk = entryList.getCompoundTagAt(i);
- long chunkHash = chunk.getLong("chunkHash");
- NBTTagList blastWaveList = chunk.getTagList("blastWaveList", 10);
- Long[][] blastWaveArray= new Long[16][5];
- for(int i1=0;i1<16 || i1<blastWaveList.tagCount();i1++)
- {
- NBTTagCompound blastWave = blastWaveList.getCompoundTagAt(i1);
- blastWaveArray[i1][0]=blastWave.getLong("longNumber");
- blastWaveArray[i1][1]=(long) blastWave.getInteger("sourceX");
- blastWaveArray[i1][2]=(long) blastWave.getInteger("sourceY");
- blastWaveArray[i1][3]=(long) blastWave.getInteger("sourceZ");
- blastWaveArray[i1][4]=(long) blastWave.getInteger("power");
- }
- data.put(chunkHash, blastWaveArray);
- }
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound nbt)
- {
- NBTTagList entryList = new NBTTagList();
- Iterator<Entry<Long, Long[][]>> dataESI = data.entrySet().iterator();
- while(dataESI.hasNext())
- {
- Entry<Long, Long[][]> dataEntry = dataESI.next();
- Long[][] bwArray = dataEntry.getValue();
- NBTTagCompound chunk = new NBTTagCompound();
- NBTTagList blastWaveList = new NBTTagList();
- for(int i1=0;i1<16;i1++)
- {
- NBTTagCompound blastWave = new NBTTagCompound();
- blastWave.setLong("longNumber", bwArray[i1][0]);
- blastWave.setInteger("sourceX", bwArray[i1][1].intValue());
- blastWave.setInteger("sourceY", bwArray[i1][2].intValue());
- blastWave.setInteger("sourceZ", bwArray[i1][3].intValue());
- blastWave.setInteger("power", bwArray[i1][4].intValue());
- blastWaveList.appendTag(blastWave);
- }
- chunk.setTag("blastWaveList", blastWaveList);
- chunk.setLong("chunkHash", dataEntry.getKey());
- entryList.appendTag(chunk);
- }
- nbt.setTag("entryList", entryList);
- }
-
- public void scheduleExplosionEffectsOnChunkLoad(long chunkXZKey, long longNumber, int sourceX, int sourceY, int sourceZ, int power1, int absEBSY)
- {
- Long[][] waves;
- if(data.containsKey(chunkXZKey))
- {
- waves=data.get(chunkXZKey);
- }
- else
- {
- waves=new Long[16][5];
- data.put(chunkXZKey, waves);
- }
- waves[absEBSY][0]=longNumber;
- waves[absEBSY][1]=(long)sourceX;
- waves[absEBSY][2]=(long)sourceY;
- waves[absEBSY][3]=(long)sourceZ;
- waves[absEBSY][4]=(long)power1;
- }
-}
diff --git a/ihl/worldgen/IHLWorldGenerator.java b/ihl/worldgen/IHLWorldGenerator.java
index 71478b3..7a5c83d 100644
--- a/ihl/worldgen/IHLWorldGenerator.java
+++ b/ihl/worldgen/IHLWorldGenerator.java
@@ -36,9 +36,9 @@ public class IHLWorldGenerator implements IWorldGenerator {
saltwaterGenerator,
bischofiteGenerator;
private WorldGenMinableMeta currentGenerator;
- protected final Map<Long,Set<int[]>> oreCoordinatesToChunkCoordinates = new HashMap();
- protected final Map<Long,WorldGenMinableMeta> blockToOreCoordinates = new HashMap();
- public final Set<Long> precalculatedChunkChache = new HashSet();
+ protected final Map<Long,Set<int[]>> oreCoordinatesToChunkCoordinates = new HashMap<Long,Set<int[]>>();
+ protected final Map<Long,WorldGenMinableMeta> blockToOreCoordinates = new HashMap<Long,WorldGenMinableMeta>();
+ public final Set<Long> precalculatedChunkChache = new HashSet<Long>();
public static IHLWorldGenerator instance;
@@ -67,7 +67,6 @@ public class IHLWorldGenerator implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
- int x1 = 0,y1 = 0,z1 = 0;
for(int ix=-16+chunkX;ix<=16+chunkX;ix++)
{
for(int iz=-16+chunkZ;iz<=16+chunkZ;iz++)
@@ -104,10 +103,7 @@ public class IHLWorldGenerator implements IWorldGenerator {
int y0 = oreCoordinate[1];
int z0 = oreCoordinate[2];
long oreCoordinatesKey = (x0<<30)+(y0<<15)+z0;
- if(this.blockToOreCoordinates.get(oreCoordinatesKey).generate(world, random, x0, y0, z0))
- {
- x1=x0;y1=y0;z1=z0;
- }
+ this.blockToOreCoordinates.get(oreCoordinatesKey).generate(world, random, x0, y0, z0);
}
}
}
diff --git a/ihl/worldgen/WorldGenMinableMeta.java b/ihl/worldgen/WorldGenMinableMeta.java
index 3c5f094..f80edba 100644
--- a/ihl/worldgen/WorldGenMinableMeta.java
+++ b/ihl/worldgen/WorldGenMinableMeta.java
@@ -16,7 +16,7 @@ import net.minecraftforge.common.util.ForgeDirection;
public class WorldGenMinableMeta extends WorldGenerator {
protected final Block mineableBlock;
- protected final Set<Block> replaceableBlocks=new HashSet();
+ protected final Set<Block> replaceableBlocks=new HashSet<Block>();
protected final Block liquidBedBlock;
protected final int mineableBlockMeta;
protected final int numberOfBlocks;
@@ -54,7 +54,6 @@ public class WorldGenMinableMeta extends WorldGenerator {
@Override
public boolean generate(World world, Random random, int x, int y, int z)
{
- boolean success=false;
int chunkX = x>>4;
int chunkZ = z>>4;
int xyz[] = {0,0,1,0,0,-1,0,0};
@@ -68,7 +67,6 @@ public class WorldGenMinableMeta extends WorldGenerator {
if(replaceableBlocks.contains(world.getBlock(x0, y0, z0)))
{
world.setBlock(x0, y0, z0, mineableBlock, mineableBlockMeta, 2);
- success=true;
}
}
}
@@ -119,7 +117,7 @@ public class WorldGenMinableMeta extends WorldGenerator {
}
else
{
- Set<int[]> oreCoordinatesS = new HashSet();
+ Set<int[]> oreCoordinatesS = new HashSet<int[]>();
oreCoordinatesS.add(oreCoordinates);
this.oreCoordinatesToChunkCoordinates.put(chunkKey, oreCoordinatesS);
}
diff --git a/ihl/worldgen/ores/BlockOre.java b/ihl/worldgen/ores/BlockOre.java
index a88f3b7..4b0c7a7 100644
--- a/ihl/worldgen/ores/BlockOre.java
+++ b/ihl/worldgen/ores/BlockOre.java
@@ -24,8 +24,8 @@ import net.minecraftforge.oredict.OreDictionary;
public class BlockOre extends Block
{
private Type type;
- private static List<BlockOre> instances = new ArrayList();
- private static Map<Type, IIcon> iconMap = new HashMap();
+ private static List<BlockOre> instances = new ArrayList<BlockOre>();
+ private static Map<Type, IIcon> iconMap = new HashMap<Type, IIcon>();
public BlockOre(Type type1)
{
diff --git a/ihl/worldgen/ores/DebugScannerContainer.java b/ihl/worldgen/ores/DebugScannerContainer.java
index 52d4990..1413ddb 100644
--- a/ihl/worldgen/ores/DebugScannerContainer.java
+++ b/ihl/worldgen/ores/DebugScannerContainer.java
@@ -5,7 +5,7 @@ import ic2.core.slot.SlotInvSlot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
-public class DebugScannerContainer extends ContainerBase {
+public class DebugScannerContainer extends ContainerBase<DebugScannerTileEntity> {
protected DebugScannerTileEntity tileEntity;
public int lastFluidAmount = -1;
diff --git a/ihl/worldgen/ores/DebugScannerGui.java b/ihl/worldgen/ores/DebugScannerGui.java
index 9d379fe..2d79300 100644
--- a/ihl/worldgen/ores/DebugScannerGui.java
+++ b/ihl/worldgen/ores/DebugScannerGui.java
@@ -24,8 +24,6 @@ public class DebugScannerGui extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- int xOffset = (this.width - xSize) / 2;
- int yOffset = (this.height - ySize) / 2;
List<String> ode = container.tileEntity.oreDictionaryEntries;
int verticalOffset = 31;
for(int i=0;i<ode.size();i++)
diff --git a/ihl/worldgen/ores/DebugScannerTileEntity.java b/ihl/worldgen/ores/DebugScannerTileEntity.java
index 2102cf0..99778a9 100644
--- a/ihl/worldgen/ores/DebugScannerTileEntity.java
+++ b/ihl/worldgen/ores/DebugScannerTileEntity.java
@@ -24,7 +24,7 @@ public class DebugScannerTileEntity extends TileEntityInventory implements IHasG
{
public final InvSlot itemsSlot;
private ItemStack lastItem;
- public List<String> oreDictionaryEntries = new ArrayList();
+ public List<String> oreDictionaryEntries = new ArrayList<String>();
public DebugScannerTileEntity()
{
@@ -54,7 +54,7 @@ public class DebugScannerTileEntity extends TileEntityInventory implements IHasG
if(this.itemsSlot.get().stackTagCompound!=null)
{
this.oreDictionaryEntries.add("NBT keys:");
- Iterator iterator = this.itemsSlot.get().stackTagCompound.func_150296_c().iterator();
+ Iterator<?> iterator = this.itemsSlot.get().stackTagCompound.func_150296_c().iterator();
while(iterator.hasNext())
{
String entry = (String) iterator.next();
@@ -65,7 +65,7 @@ public class DebugScannerTileEntity extends TileEntityInventory implements IHasG
if(ct!=null && ct.func_150296_c()!=null && !ct.func_150296_c().isEmpty())
{
this.oreDictionaryEntries.add(" -NBT compound tag subkeys:");
- Iterator stIterator = ct.func_150296_c().iterator();
+ Iterator<?> stIterator = ct.func_150296_c().iterator();
while(stIterator.hasNext())
{
String entry2 = (String) stIterator.next();
@@ -138,7 +138,7 @@ public class DebugScannerTileEntity extends TileEntityInventory implements IHasG
}
@Override
- public ContainerBase getGuiContainer(EntityPlayer entityPlayer)
+ public ContainerBase<?> getGuiContainer(EntityPlayer entityPlayer)
{
return new DebugScannerContainer(entityPlayer, this);
}
diff --git a/ihl/worldgen/ores/IHLFluid.java b/ihl/worldgen/ores/IHLFluid.java
index 804a52c..beab11b 100644
--- a/ihl/worldgen/ores/IHLFluid.java
+++ b/ihl/worldgen/ores/IHLFluid.java
@@ -16,7 +16,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialLiquid;
-import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBucket;
@@ -29,11 +28,11 @@ import net.minecraftforge.fluids.FluidStack;
public class IHLFluid extends Fluid
{
private IHLFluidType type;
- private static List<Fluid> fluidInstances = new ArrayList();
- private static Map<String, IHLFluidType> localFluidRegistry = new HashMap();
- private static Map<String, Float> realDensityMap = new HashMap();
- private static Map<String, String> condensationMap = new HashMap();
- private static Map<String, List<String>> solutionMap = new HashMap();
+ private static List<Fluid> fluidInstances = new ArrayList<Fluid>();
+ private static Map<String, IHLFluidType> localFluidRegistry = new HashMap<String, IHLFluidType>();
+ private static Map<String, Float> realDensityMap = new HashMap<String, Float>();
+ private static Map<String, String> condensationMap = new HashMap<String, String>();
+ private static Map<String, List<String>> solutionMap = new HashMap<String, List<String>>();
public static final int maxGaseousStateVapoursDensity = 40;
public IHLFluid(IHLFluidType type1) {
@@ -42,8 +41,8 @@ public class IHLFluid extends Fluid
this.setTemperature(type.temperature);
this.setDensity(Math.round(type.density));
realDensityMap.put(type1.fluidRegistryName, type.density);
- this.setGaseous(type.isGaseous);
this.setUnlocalizedName(type.fluidRegistryName.replaceFirst("fluid", ""));
+ this.setGaseous(type.isGaseous);
Fluid instance = this;
if (!FluidRegistry.registerFluid(instance))
{
@@ -53,6 +52,7 @@ public class IHLFluid extends Fluid
{
instance.setBlock(new IHLFluidBlock(instance, type.blockMaterial, type.textureName, "fluid"+type.fluidName.replaceFirst("fluid", "")).setFlammable(type.flammable).setBlockName("block"+type.fluidName).setCreativeTab(IHLCreativeTab.tab));
}
+ instance.setGaseous(type.isGaseous);
if(type.haveBucket)
{
Item bucket = new ItemBucket(block).setTextureName(IHLModInfo.MODID+":bucket_"+type.fluidName).setUnlocalizedName("bucket_"+type.fluidName).setCreativeTab(IHLCreativeTab.tab);
@@ -151,6 +151,11 @@ public class IHLFluid extends Fluid
public enum IHLFluidType
{
//Methane("Methane","fluidAcetylene",10047, 293, 249, 373, 1150, "methane", Material.water, false, false, false, false),
+ Ammonia("Ammonia", 10051, 273, 273-78, 273-33, 0.772F, "ammonia", new MaterialLiquid(MapColor.airColor), false, false, true),
+ Acetaldehyde("Acetaldehyde",10050, 273, 273-123, 294, 784, "acetaldehyde", Material.water, false, false, false),
+ Formaldehyde("Formaldehyde",10049, 254, 273-118, 254, 815, "formaldehyde", Material.water, false, false, false),
+ TarWater("TarWater",10048, 293, 176, 338, 1032, "tarwater", Material.water, false, false, false),
+ Methanol("Methanol",10047, 293, 176, 338, 792, "methanol", Material.water, true, false, false),
LithiumChloride("LithiumChlorideDissolvedInWater",10046, 293, 249, 373, 1530, "solution.lithiumchloride", Material.water, false, false, false),
CalciumChloride("CalciumChlorideDissolvedInWater",10045, 293, 249, 373, 1630, "solution.calciumchloride", Material.water, false, false, false),
ZeolitePulp("ZeolitePulp","fluidPulpZeolite",10044, 293, 249, 373, 1150, "pulp.sodiumzeolite", Material.water, false, false, false),
@@ -165,11 +170,11 @@ public class IHLFluid extends Fluid
Fuel("Fuel", 10035, 293, 268, 633, 840, "fuel", Material.water, true, false, true),
MineralOil("MineralOil", 10034, 293, 238, 704, 845, "mineraloil", Material.water, true, false, true),
FuelOil("FuelOil", 10033, 293, 293, 693, 991, "fueloil", Material.water, true, false, true),
- Oil("Oil", 10032, 293, 284, 773, 850, "oil", Material.water, true, false, true),
+ Oil("Oil","fluidOil", 10032, 293, 284, 773, 850f, "oil", Material.water, true, false, true, false),
Mercury("Mercury", 10031, 293, 234, 630, 13546),
VapourMercury("VapourMercury",10030, 630, 234, 630, 9.229F, "vapour.mercury", new MaterialLiquid(MapColor.cyanColor), false, false, false),
Hydrogen("Hydrogen", 10029, 293, 14, 20, 0.046F, "hydrogen", new MaterialLiquid(MapColor.blueColor), true, false, true),
- SaltWater("SaltWater", 10028, 293, 253, 373, 1360),
+ SaltWater("SaltWater","fluidSaltWater", 10028, 293, 253, 373, 1360f,"saltwater", Material.water, true, false, false, false),
HydrogenChloride("HydrogenChloride", 10027, 293, 159, 188, 1.477F, "hydrogenchloride", new MaterialLiquid(MapColor.yellowColor), true, false, true),
NatriumTungstate("NatriumTungstateDissolvedInWater",10026, 293, 249, 373, 1730, "solution.natriumtungstate", Material.water, true, false, false),
Turpentine("Turpentine",10025, 293, 217, 453, 1470, "turpentine", Material.water, true, false, true),
@@ -192,7 +197,9 @@ public class IHLFluid extends Fluid
NickelSulfateDissolvedInWater("NickelSulfateDissolvedInWater",10009, 293, 253, 373, 1220, "solution.nickelsulfate", Material.water, true, false, false),
BlueVitriolDissolvedInWater("BlueVitriolDissolvedInWater",10008, 293, 253, 373, 1180, "solution.bluevitriol", Material.water, true, false, false),
MoltenRubberWithSulfur("MoltenRubberWithSulfur",10007, 600, 600, 1000, 1200, "molten.rubber", Material.lava, false, false, true),
+ MoltenPotassium("MoltenPotassium","fluidMolten",10042, 336, 336, 1047, 856, "molten.potassium", Material.lava, false, false, false, true),
MoltenLithium("MoltenLithium","fluidMolten",10042, 454, 454, 1613, 512, "molten.lithium", Material.lava, false, false, false),
+ MoltenPotassiumChloride("MoltenPotassiumChloride","fluidMolten",10006, 776+273, 776+273, 1407+273, 1556, "molten.potassiumchloride", Material.lava, false, false, false, true),
MoltenSodiumChloride("MoltenSodiumChloride","fluidMolten",10006, 1273, 1273, 1740, 1556, "molten.sodiumchloride", Material.lava, false, false, false),
MoltenGlass("MoltenGlass","fluidMolten",10048, 600, 600, 1950, 2270, "molten.glass", Material.lava, false, false, false, true),
MoltenMagnesium("MoltenMagnesium","fluidMolten",10006, 923, 923, 1623, 1584, "molten.magnesium", Material.lava, false, false, false),
@@ -295,7 +302,7 @@ public class IHLFluid extends Fluid
float density;
boolean isGaseous;
boolean flammable=false;
- boolean noBlock=false;
+ boolean noBlock=true;
boolean haveBucket;
Material blockMaterial = Material.water;
int meltingPoint;
@@ -306,6 +313,7 @@ public class IHLFluid extends Fluid
public final int damage;
}
+ @SuppressWarnings("deprecation")
public static FluidStack getCondensationResult(FluidStack condensatedGas)
{
String fluidname = condensationMap.get(condensatedGas.getFluid().getName());