aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/block/ModBlocks.java56
-rw-r--r--src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java38
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BasicBlock.java80
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java196
-rw-r--r--src/Java/gtPlusPlus/core/block/base/MetaBlock.java36
-rw-r--r--src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java47
-rw-r--r--src/Java/gtPlusPlus/core/block/general/LightGlass.java152
-rw-r--r--src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java488
-rw-r--r--src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java78
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java35
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java131
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java131
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java3
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java133
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java94
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java279
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java69
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java111
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java88
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java854
-rw-r--r--src/Java/gtPlusPlus/core/commands/CommandMath.java235
-rw-r--r--src/Java/gtPlusPlus/core/commands/CommandUtils.java8
-rw-r--r--src/Java/gtPlusPlus/core/common/CommonProxy.java138
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java28
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java10
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java316
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java10
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java21
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java84
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java23
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java12
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java12
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java12
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java46
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_BackpackBase.java231
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_Charger.java71
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_NHG.java104
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_Workbench.java581
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java512
-rw-r--r--src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java36
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java2
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java5
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java2
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java2
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java2
-rw-r--r--src/Java/gtPlusPlus/core/entity/EntityTeleportFX.java444
-rw-r--r--src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java165
-rw-r--r--src/Java/gtPlusPlus/core/fluids/FluidRegistryHandler.java80
-rw-r--r--src/Java/gtPlusPlus/core/fluids/GenericFluid.java115
-rw-r--r--src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java67
-rw-r--r--src/Java/gtPlusPlus/core/gui/beta/Gui_Types.java12
-rw-r--r--src/Java/gtPlusPlus/core/gui/beta/MU_GuiId.java51
-rw-r--r--src/Java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java153
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java73
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java74
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_Workbench.java90
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java36
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java187
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java25
-rw-r--r--src/Java/gtPlusPlus/core/handler/CraftingManager.java14
-rw-r--r--src/Java/gtPlusPlus/core/handler/GuiHandler.java188
-rw-r--r--src/Java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java30
-rw-r--r--src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java33
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java136
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java74
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java179
-rw-r--r--src/Java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java207
-rw-r--r--src/Java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java44
-rw-r--r--src/Java/gtPlusPlus/core/interfaces/IGuiManager.java8
-rw-r--r--src/Java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java3
-rw-r--r--src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java74
-rw-r--r--src/Java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java255
-rw-r--r--src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java231
-rw-r--r--src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java260
-rw-r--r--src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloCrafting.java180
-rw-r--r--src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloSlots.java344
-rw-r--r--src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java232
-rw-r--r--src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java234
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java744
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseEuItem.java920
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java106
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java108
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java194
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemGeneric.java29
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemLoot.java135
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java67
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java27
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java435
-rw-r--r--src/Java/gtPlusPlus/core/item/base/CoreItem.java132
-rw-r--r--src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java43
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java326
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java40
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java126
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java54
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java54
-rw-r--r--src/Java/gtPlusPlus/core/item/base/foods/BaseItemFood.java33
-rw-r--r--src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java87
-rw-r--r--src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java6
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java127
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java66
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBase.java21
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java84
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java59
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java19
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockTileEntity.java46
-rw-r--r--src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java6
-rw-r--r--src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java15
-rw-r--r--src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java10
-rw-r--r--src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java25
-rw-r--r--src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java45
-rw-r--r--src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java25
-rw-r--r--src/Java/gtPlusPlus/core/item/effects/RarityEffect.java22
-rw-r--r--src/Java/gtPlusPlus/core/item/effects/RarityEpic.java18
-rw-r--r--src/Java/gtPlusPlus/core/item/effects/RarityRare.java18
-rw-r--r--src/Java/gtPlusPlus/core/item/effects/RarityUncommon.java14
-rw-r--r--src/Java/gtPlusPlus/core/item/general/BedLocator_Base.java107
-rw-r--r--src/Java/gtPlusPlus/core/item/general/BufferCore.java100
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java384
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java308
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java276
-rw-r--r--src/Java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java331
-rw-r--r--src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java378
-rw-r--r--src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java300
-rw-r--r--src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/init/ItemsFoods.java66
-rw-r--r--src/Java/gtPlusPlus/core/item/materials/MaterialHandler.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java73
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java260
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java134
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java519
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java526
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java483
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java187
-rw-r--r--src/Java/gtPlusPlus/core/lib/LoadedMods.java264
-rw-r--r--src/Java/gtPlusPlus/core/material/ALLOY.java1268
-rw-r--r--src/Java/gtPlusPlus/core/material/ELEMENT.java171
-rw-r--r--src/Java/gtPlusPlus/core/material/Material.java606
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialGenerator.java88
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialStack.java101
-rw-r--r--src/Java/gtPlusPlus/core/proxy/ClientProxy.java108
-rw-r--r--src/Java/gtPlusPlus/core/proxy/ServerProxy.java18
-rw-r--r--src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java144
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java612
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_General.java60
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java39
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java217
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java627
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java1259
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java61
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java317
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java69
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java218
-rw-r--r--src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java39
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotBlueprint.java22
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotCrafting.java290
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotFrame.java14
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotGeneric.java12
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotGtTool.java22
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java74
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java9
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotNoInput.java12
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotOutput.java94
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotRTG.java12
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java22
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java33
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java469
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java215
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java715
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java201
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java300
-rw-r--r--src/Java/gtPlusPlus/core/util/BaseHandler.java8
-rw-r--r--src/Java/gtPlusPlus/core/util/ClassUtils.java83
-rw-r--r--src/Java/gtPlusPlus/core/util/Log.java41
-rw-r--r--src/Java/gtPlusPlus/core/util/LoggingUtils.java60
-rw-r--r--src/Java/gtPlusPlus/core/util/Quality.java87
-rw-r--r--src/Java/gtPlusPlus/core/util/Utils.java741
-rw-r--r--src/Java/gtPlusPlus/core/util/UtilsChatFormatting.java271
-rw-r--r--src/Java/gtPlusPlus/core/util/UtilsRarity.java29
-rw-r--r--src/Java/gtPlusPlus/core/util/UtilsText.java24
-rw-r--r--src/Java/gtPlusPlus/core/util/array/ArrayUtils.java16
-rw-r--r--src/Java/gtPlusPlus/core/util/array/Pair.java28
-rw-r--r--src/Java/gtPlusPlus/core/util/array/Triplet.java38
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_BLOCK_ShapeSpawner.java145
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_INIT.java29
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java51
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java1722
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java60
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java71
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java853
-rw-r--r--src/Java/gtPlusPlus/core/util/entity/EntityUtils.java92
-rw-r--r--src/Java/gtPlusPlus/core/util/fluid/FluidGT6.java42
-rw-r--r--src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java539
-rw-r--r--src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java74
-rw-r--r--src/Java/gtPlusPlus/core/util/item/ItemUtils.java681
-rw-r--r--src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java343
-rw-r--r--src/Java/gtPlusPlus/core/util/math/MathUtils.java376
-rw-r--r--src/Java/gtPlusPlus/core/util/networking/NetworkUtils.java50
-rw-r--r--src/Java/gtPlusPlus/core/util/particles/EntityParticleFXMysterious.java19
-rw-r--r--src/Java/gtPlusPlus/core/util/player/PlayerCache.java282
-rw-r--r--src/Java/gtPlusPlus/core/util/player/PlayerUtils.java179
-rw-r--r--src/Java/gtPlusPlus/core/util/player/UtilsMining.java204
-rw-r--r--src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java648
-rw-r--r--src/Java/gtPlusPlus/core/util/recipe/shapeless/ShapelessUtils.java46
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/ClientProxyFinder.java43
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java81
-rw-r--r--src/Java/gtPlusPlus/core/util/wrapper/var.java116
209 files changed, 17350 insertions, 18262 deletions
diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java
index 69ecb9ed5b..3b6f061ca7 100644
--- a/src/Java/gtPlusPlus/core/block/ModBlocks.java
+++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java
@@ -1,60 +1,60 @@
package gtPlusPlus.core.block;
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.block.general.LightGlass;
import gtPlusPlus.core.block.machine.Machine_Workbench;
import gtPlusPlus.core.block.machine.Machine_WorkbenchAdvanced;
import gtPlusPlus.core.fluids.FluidRegistryHandler;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks2;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.Fluid;
+import cpw.mods.fml.common.registry.GameRegistry;
public final class ModBlocks {
- public static Block blockWorkbench;
- public static Block blockWorkbenchAdvanced;
- // Blocks
- // public static Block blockBloodSteel;
- // public static Block blockStaballoy;
+ public static Block blockWorkbench;
+ public static Block blockWorkbenchAdvanced;
+ //Blocks
+ //public static Block blockBloodSteel;
+ //public static Block blockStaballoy;
// WIP TODO public static Block blockToolBuilder;
- public static Block blockGriefSaver;
- public static Block blockCasingsMisc;
- public static Block blockMetaTileEntity;
- public static Block blockHeliumGenerator;
- public static Block blockNHG;
- public static Block blockCharger;
+ public static Block blockGriefSaver;
+ public static Block blockCasingsMisc;
+ public static Block blockMetaTileEntity;
+ public static Block blockHeliumGenerator;
+ public static Block blockNHG;
+ public static Block blockCharger;
+
+ public static Block MatterFabricatorEffectBlock;
+
+ public static Fluid fluidJackDaniels = new Fluid("fluidJackDaniels");
+ public static Block blockFluidJackDaniels;
+ public static Block blockCasings2Misc;
- public static Block MatterFabricatorEffectBlock;
- public static Fluid fluidJackDaniels = new Fluid("fluidJackDaniels");
- public static Block blockFluidJackDaniels;
- public static Block blockCasings2Misc;
public static void init() {
Utils.LOG_INFO("Initializing Blocks.");
- // blockGriefSaver = new
- // TowerDevice().setBlockName("blockGriefSaver").setCreativeTab(AddToCreativeTab.tabBlock).setBlockTextureName("blockDefault");
+ //blockGriefSaver = new TowerDevice().setBlockName("blockGriefSaver").setCreativeTab(AddToCreativeTab.tabBlock).setBlockTextureName("blockDefault");
- ModBlocks.registerBlocks();
+ registerBlocks();
}
- public static void registerBlocks() {
+ public static void registerBlocks(){
Utils.LOG_INFO("Registering Blocks.");
- GameRegistry.registerBlock(
- ModBlocks.MatterFabricatorEffectBlock = new LightGlass(Material.glass, false).setHardness(0.1F)
- .setBlockTextureName(CORE.MODID + ":" + "blockMFEffect").setStepSound(Block.soundTypeGlass),
- "blockMFEffect");
+ GameRegistry.registerBlock(MatterFabricatorEffectBlock = new LightGlass(Material.glass, false).setHardness(0.1F).setBlockTextureName(CORE.MODID + ":" + "blockMFEffect").setStepSound(Block.soundTypeGlass), "blockMFEffect");
- // Fluids
+ //Fluids
FluidRegistryHandler.registerFluids();
- // Workbench
- ModBlocks.blockWorkbench = new Machine_Workbench().setHardness(1.5F);
- ModBlocks.blockWorkbenchAdvanced = new Machine_WorkbenchAdvanced().setHardness(2.5F);
+ //Workbench
+ blockWorkbench = new Machine_Workbench().setHardness(1.5F);
+ blockWorkbenchAdvanced = new Machine_WorkbenchAdvanced().setHardness(2.5F);
+
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java b/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java
index 0160da883f..b7ac24a71b 100644
--- a/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java
+++ b/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java
@@ -9,25 +9,23 @@ import net.minecraft.world.World;
public class AdvancedBlock extends Block {
- protected AdvancedBlock(final String unlocalizedName, final Material material, final CreativeTabs x,
- final float blockHardness, final float blockResistance, final float blockLightLevel,
- final String blockHarvestTool, final int blockHarvestLevel, final SoundType BlockSound) {
- super(material);
- this.setBlockName(unlocalizedName);
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(x);
- this.setHardness(blockHardness); // block Hardness
- this.setResistance(blockResistance);
- this.setLightLevel(blockLightLevel);
- this.setHarvestLevel(blockHarvestTool, blockHarvestLevel);
- this.setStepSound(BlockSound);
- }
-
- @Override
- public boolean onBlockActivated(final World p_149727_1_, final int p_149727_2_, final int p_149727_3_,
- final int p_149727_4_, final EntityPlayer p_149727_5_, final int p_149727_6_, final float p_149727_7_,
- final float p_149727_8_, final float p_149727_9_) {
- return false;
- }
+ protected AdvancedBlock(String unlocalizedName, Material material, CreativeTabs x, float blockHardness, float blockResistance, float blockLightLevel,
+ String blockHarvestTool, int blockHarvestLevel, SoundType BlockSound) {
+ super(material);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(x);
+ this.setHardness(blockHardness); //block Hardness
+ this.setResistance(blockResistance);
+ this.setLightLevel(blockLightLevel);
+ this.setHarvestLevel(blockHarvestTool, blockHarvestLevel);
+ this.setStepSound(BlockSound);
+ }
+
+ @Override
+ public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
+ {
+ return false;
+ }
}
diff --git a/src/Java/gtPlusPlus/core/block/base/BasicBlock.java b/src/Java/gtPlusPlus/core/block/base/BasicBlock.java
index 64ee68224e..c95f37d9c5 100644
--- a/src/Java/gtPlusPlus/core/block/base/BasicBlock.java
+++ b/src/Java/gtPlusPlus/core/block/base/BasicBlock.java
@@ -8,43 +8,45 @@ import net.minecraft.block.material.Material;
public class BasicBlock extends Block {
- public static enum BlockTypes {
- STANDARD("blockBlock", "pickaxe", Block.soundTypeStone), FRAME("blockFrameGt", "wrench", Block.soundTypeMetal);
-
- private String TEXTURE_NAME;
- private String HARVEST_TOOL;
- private SoundType soundOfBlock;
-
- private BlockTypes(final String textureName, final String harvestTool, final SoundType blockSound) {
- this.TEXTURE_NAME = textureName;
- this.HARVEST_TOOL = harvestTool;
- this.soundOfBlock = blockSound;
- }
-
- public SoundType getBlockSoundType() {
- return this.soundOfBlock;
- }
-
- public String getHarvestTool() {
- return this.HARVEST_TOOL;
- }
-
- public String getTexture() {
- return this.TEXTURE_NAME;
- }
-
- }
-
- public BasicBlock(final String unlocalizedName, final Material material) {
- super(material);
- this.setBlockName(Utils.sanitizeString(unlocalizedName));
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setHardness(2.0F);
- this.setResistance(6.0F);
- this.setLightLevel(0.0F);
- this.setHarvestLevel("pickaxe", 2);
- this.setStepSound(Block.soundTypeMetal);
- }
-
+ public BasicBlock(final String unlocalizedName, final Material material) {
+ super(material);
+ this.setBlockName(Utils.sanitizeString(unlocalizedName));
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setHardness(2.0F);
+ this.setResistance(6.0F);
+ this.setLightLevel(0.0F);
+ this.setHarvestLevel("pickaxe", 2);
+ this.setStepSound(soundTypeMetal);
+ }
+
+
+ public static enum BlockTypes {
+ STANDARD("blockBlock", "pickaxe", soundTypeStone),
+ FRAME("blockFrameGt", "wrench", soundTypeMetal);
+
+ private String TEXTURE_NAME;
+ private String HARVEST_TOOL;
+ private SoundType soundOfBlock;
+ private BlockTypes (final String textureName, final String harvestTool, final SoundType blockSound)
+ {
+ this.TEXTURE_NAME = textureName;
+ this.HARVEST_TOOL = harvestTool;
+ this.soundOfBlock = blockSound;
+ }
+
+ public String getTexture() {
+ return TEXTURE_NAME;
+ }
+
+ public String getHarvestTool(){
+ return HARVEST_TOOL;
+ }
+
+ public SoundType getBlockSoundType(){
+ return soundOfBlock;
+ }
+
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
index f389f5bf32..a2d2589f5e 100644
--- a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
+++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.block.base;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.common.registry.LanguageRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.base.itemblock.ItemBlockGtBlock;
import gtPlusPlus.core.item.base.itemblock.ItemBlockGtFrameBox;
import gtPlusPlus.core.lib.CORE;
@@ -12,142 +8,142 @@ import gtPlusPlus.core.util.math.MathUtils;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.world.IBlockAccess;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.common.registry.LanguageRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class BlockBaseModular extends BasicBlock {
+public class BlockBaseModular extends BasicBlock{
- protected int blockColour;
- protected BlockTypes thisBlock;
- protected String thisBlockMaterial;
- protected final String thisBlockType;
+ protected int blockColour;
+ protected BlockTypes thisBlock;
+ protected String thisBlockMaterial;
+ protected final String thisBlockType;
- public BlockBaseModular(final String unlocalizedName, final String blockMaterial, final BlockTypes blockType,
- final int colour) {
- super(blockType.getTexture() + unlocalizedName, Material.iron);
+ public BlockBaseModular(String unlocalizedName, String blockMaterial, BlockTypes blockType, int colour) {
+ super(blockType.getTexture()+unlocalizedName, Material.iron);
this.setHarvestLevel(blockType.getHarvestTool(), 2);
- this.setBlockTextureName(CORE.MODID + ":" + blockType.getTexture());
+ this.setBlockTextureName(CORE.MODID+":"+blockType.getTexture());
this.blockColour = colour;
this.thisBlock = blockType;
this.thisBlockMaterial = blockMaterial;
this.thisBlockType = blockType.name().toUpperCase();
- this.setBlockName(this.GetProperName());
-
- if (!CORE.DEBUG) {
- // Utils.LOG_INFO("=============Block Info Dump=============");
- // Utils.LOG_INFO("thisBlock.name().toLowerCase() -
- // "+thisBlock.name().toLowerCase());
- // Utils.LOG_INFO("This Blocks Type - "+thisBlockType);
- // Utils.LOG_INFO("BlockTypes.STANDARD.name().toLowerCase() -
- // "+BlockTypes.STANDARD.name().toLowerCase());
- // Utils.LOG_INFO("BlockTypes.FRAME.name().toLowerCase() -
- // "+BlockTypes.FRAME.name().toLowerCase());
- // Utils.LOG_INFO("blockMaterial - "+blockMaterial);
- // Utils.LOG_INFO("==========================================");
+ this.setBlockName(GetProperName());
+
+ if (!CORE.DEBUG){
+ //Utils.LOG_INFO("=============Block Info Dump=============");
+ //Utils.LOG_INFO("thisBlock.name().toLowerCase() - "+thisBlock.name().toLowerCase());
+ //Utils.LOG_INFO("This Blocks Type - "+thisBlockType);
+ //Utils.LOG_INFO("BlockTypes.STANDARD.name().toLowerCase() - "+BlockTypes.STANDARD.name().toLowerCase());
+ //Utils.LOG_INFO("BlockTypes.FRAME.name().toLowerCase() - "+BlockTypes.FRAME.name().toLowerCase());
+ //Utils.LOG_INFO("blockMaterial - "+blockMaterial);
+ //Utils.LOG_INFO("==========================================");
}
-
- if (this.thisBlockType == BlockTypes.STANDARD.name().toUpperCase()) {
- LanguageRegistry.addName(this, "Block of " + blockMaterial);
- // Utils.LOG_INFO("Registered Block in Language Registry as:
- // "+"Block of "+blockMaterial);
+
+ if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){
+ LanguageRegistry.addName(this, "Block of "+blockMaterial);
+ //Utils.LOG_INFO("Registered Block in Language Registry as: "+"Block of "+blockMaterial);
}
- else if (this.thisBlockType == BlockTypes.FRAME.name().toUpperCase()) {
- LanguageRegistry.addName(this, blockMaterial + " Frame Box");
- // Utils.LOG_INFO("Registered Block in Language Registry as:
- // "+blockMaterial+ " Frame Box");
+ else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){
+ LanguageRegistry.addName(this, blockMaterial+ " Frame Box");
+ //Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial+ " Frame Box");
}
else {
LanguageRegistry.addName(this, blockMaterial);
- // Utils.LOG_INFO("Registered Block in Language Registry as:
- // "+blockMaterial);
- }
-
- // setOreDict(unlocalizedName, blockType);
- if (this.thisBlockType == BlockTypes.STANDARD.name().toUpperCase()) {
- GameRegistry.registerBlock(this, ItemBlockGtBlock.class,
- Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
- // Utils.LOG_INFO("Registered Block in Block Registry as: "+"Block
- // of "+blockMaterial);
+ //Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial);
+ }
+
+ //setOreDict(unlocalizedName, blockType);
+ if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){
+ GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
+ //Utils.LOG_INFO("Registered Block in Block Registry as: "+"Block of "+blockMaterial);
}
- else if (this.thisBlockType == BlockTypes.FRAME.name().toUpperCase()) {
- GameRegistry.registerBlock(this, ItemBlockGtFrameBox.class,
- Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
- // Utils.LOG_INFO("Registered Block in Block Registry as:
- // "+blockMaterial+" Frame Box");
+ else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){
+ GameRegistry.registerBlock(this, ItemBlockGtFrameBox.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
+ //Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial+" Frame Box");
}
else {
- GameRegistry.registerBlock(this, ItemBlockGtBlock.class,
- Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
- // Utils.LOG_INFO("Registered Block in Block Registry as:
- // "+blockMaterial);
+ GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
+ //Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial);
}
-
+
+
}
+ /**
+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
+ */
@Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
-
- if (this.blockColour == 0) {
- return MathUtils.generateSingularRandomHexValue();
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass()
+ {
+ if (thisBlock == BlockTypes.FRAME){
+ return 1;
}
-
- return this.blockColour;
+ return 0;
}
+
+ /*@Override
+ public String getLocalizedName() {
+ String tempIngot;
+ if (thisBlock == BlockTypes.STANDARD){
+ tempIngot = "Block of "+thisBlockMaterial;
+ }
+ else if (thisBlock == BlockTypes.FRAME){
+ tempIngot = thisBlockMaterial + " Frame Box";
+ }
+ else {
- /*
- * @Override public String getLocalizedName() { String tempIngot; if
- * (thisBlock == BlockTypes.STANDARD){ tempIngot = "Block of "
- * +thisBlockMaterial; } else if (thisBlock == BlockTypes.FRAME){ tempIngot
- * = thisBlockMaterial + " Frame Box"; } else {
- *
- * tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot"); }
- * return tempIngot; }
- */
-
+ tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot");
+ }
+ return tempIngot;
+ }*/
+
public String GetProperName() {
- String tempIngot;
- if (this.thisBlock == BlockTypes.STANDARD) {
- tempIngot = "Block of " + this.thisBlockMaterial;
+ String tempIngot;
+ if (thisBlock == BlockTypes.STANDARD){
+ tempIngot = "Block of "+thisBlockMaterial;
}
- else if (this.thisBlock == BlockTypes.FRAME) {
- tempIngot = this.thisBlockMaterial + " Frame Box";
+ else if (thisBlock == BlockTypes.FRAME){
+ tempIngot = thisBlockMaterial + " Frame Box";
}
else {
- tempIngot = this.getUnlocalizedName().replace("tile.blockGt", "ingot");
+ tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot");
}
return tempIngot;
}
- /**
- * Returns which pass should this block be rendered on. 0 for solids and 1
- * for alpha
- */
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
@Override
@SideOnly(Side.CLIENT)
- public int getRenderBlockPass() {
- if (this.thisBlock == BlockTypes.FRAME) {
- return 1;
- }
- return 0;
+ public void registerBlockIcons(IIconRegister iIcon)
+ {
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + thisBlock.getTexture());
}
@Override
- public int getRenderColor(final int aMeta) {
- if (this.blockColour == 0) {
+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4){
+
+ if (this.blockColour == 0){
return MathUtils.generateSingularRandomHexValue();
}
-
+
return this.blockColour;
}
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon) {
- this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture());
- }
+
+ @Override
+ public int getRenderColor(int aMeta) {
+ if (this.blockColour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+
+ return this.blockColour;
+ }
}
diff --git a/src/Java/gtPlusPlus/core/block/base/MetaBlock.java b/src/Java/gtPlusPlus/core/block/base/MetaBlock.java
index 3763b71448..4009c36726 100644
--- a/src/Java/gtPlusPlus/core/block/base/MetaBlock.java
+++ b/src/Java/gtPlusPlus/core/block/base/MetaBlock.java
@@ -7,22 +7,22 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-public class MetaBlock extends MultiTextureBlock {
+public class MetaBlock extends MultiTextureBlock {
- protected MetaBlock(final String unlocalizedName, final Material material, final SoundType soundType) {
- super(unlocalizedName, material, soundType);
- }
-
- @Override
- public int damageDropped(final int meta) {
- return meta;
- }
-
- @Override
- public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
- for (int i = 0; i < 6; i++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
-} \ No newline at end of file
+ protected MetaBlock(String unlocalizedName, Material material, SoundType soundType) {
+ super(unlocalizedName, material, soundType);
+ }
+
+ @Override
+ public int damageDropped(int meta) {
+ return meta;
+ }
+
+ @Override
+ public void getSubBlocks(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 6; i ++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java b/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java
index 9953dfa991..4f022bae6d 100644
--- a/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java
+++ b/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java
@@ -7,29 +7,30 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
-public class MultiTextureBlock extends Block {
+public class MultiTextureBlock extends Block {
public IIcon[] icons = new IIcon[6];
-
- protected MultiTextureBlock(final String unlocalizedName, final Material material, final SoundType blockSound) {
- super(material);
- this.setBlockName(unlocalizedName);
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setHardness(2.0F);
- this.setResistance(6.0F);
- this.setStepSound(blockSound);
- }
-
- @Override
- public IIcon getIcon(final int side, final int meta) {
- return this.icons[side];
- }
-
- @Override
- public void registerBlockIcons(final IIconRegister reg) {
- for (int i = 0; i < 6; i++) {
- this.icons[i] = reg.registerIcon(this.textureName + "_" + i);
- }
- }
+
+ protected MultiTextureBlock(String unlocalizedName, Material material, SoundType blockSound)
+ {
+ super(material);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setHardness(2.0F);
+ this.setResistance(6.0F);
+ this.setStepSound(blockSound);
+ }
+
+ @Override
+ public void registerBlockIcons(IIconRegister reg) {
+ for (int i = 0; i < 6; i ++) {
+ this.icons[i] = reg.registerIcon(this.textureName + "_" + i);
+ }
+ }
+
+ @Override
+ public IIcon getIcon(int side, int meta) {
+ return this.icons[side];
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/general/LightGlass.java b/src/Java/gtPlusPlus/core/block/general/LightGlass.java
index 9b4d8bf1b8..5aa9f5b818 100644
--- a/src/Java/gtPlusPlus/core/block/general/LightGlass.java
+++ b/src/Java/gtPlusPlus/core/block/general/LightGlass.java
@@ -1,27 +1,30 @@
package gtPlusPlus.core.block.general;
-import java.util.Random;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
+
+import java.util.Random;
+
import net.minecraft.block.BlockBreakable;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class LightGlass extends BlockBreakable {
- private int state = 0;
- private final int a = 255;
- private int r = 255;
- private int g = 0;
- private int b = 0;
- private int hex;
+public class LightGlass extends BlockBreakable
+{
+ private int state = 0;
+ private int a = 255;
+ private int r = 255;
+ private int g = 0;
+ private int b = 0;
+ private int hex;
- public LightGlass(final Material mat, final boolean bool) {
+ public LightGlass(Material mat, boolean bool)
+ {
super("blockMFEffect", mat, bool);
this.setCreativeTab(AddToCreativeTab.tabBlock);
this.setBlockName("blockMFEffect");
@@ -32,99 +35,94 @@ public class LightGlass extends BlockBreakable {
}
/**
- * Return true if a player with Silk Touch can harvest this block directly,
- * and not its normal drops.
+ * Returns the quantity of items to drop on block destruction.
*/
@Override
- protected boolean canSilkHarvest() {
- return false;
- }
-
- @Override
- // http://stackoverflow.com/questions/31784658/how-can-i-loop-through-all-rgb-combinations-in-rainbow-order-in-java
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
- if (this.state == 0) {
- this.g++;
- if (this.g == 255) {
- this.state = 1;
- }
- }
- if (this.state == 1) {
- this.r--;
- if (this.r == 0) {
- this.state = 2;
- }
- }
- if (this.state == 2) {
- this.b++;
- if (this.b == 255) {
- this.state = 3;
- }
- }
- if (this.state == 3) {
- this.g--;
- if (this.g == 0) {
- this.state = 4;
- }
- }
- if (this.state == 4) {
- this.r++;
- if (this.r == 255) {
- this.state = 5;
- }
- }
- if (this.state == 5) {
- this.b--;
- if (this.b == 0) {
- this.state = 0;
- }
- }
- this.hex = (this.a << 24) + (this.r << 16) + (this.g << 8) + this.b;
- return this.hex;
+ public int quantityDropped(Random rand)
+ {
+ return 0;
}
/**
- * Returns which pass should this block be rendered on. 0 for solids and 1
- * for alpha
+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
*/
@Override
@SideOnly(Side.CLIENT)
- public int getRenderBlockPass() {
+ public int getRenderBlockPass()
+ {
return 0;
}
/**
- * Returns the quantity of items to drop on block destruction.
+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
@Override
- public int quantityDropped(final Random rand) {
- return 0;
+ public boolean renderAsNormalBlock()
+ {
+ return true;
}
/**
- * A randomly called display update to be able to add particles or other
- * items for display
+ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops.
*/
@Override
- @SideOnly(Side.CLIENT)
- public void randomDisplayTick(final World world, final int posX, final int posY, final int posZ,
- final Random random) {
- Utils.spawnFX(world, posX, posY, posZ, "smoke", "cloud");
-
+ protected boolean canSilkHarvest()
+ {
+ return false;
}
@Override
@SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon) {
+ public void registerBlockIcons(IIconRegister iIcon)
+ {
this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockMFEffect");
}
+ @Override
+ //http://stackoverflow.com/questions/31784658/how-can-i-loop-through-all-rgb-combinations-in-rainbow-order-in-java
+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
+ {
+ if(state == 0){
+ g++;
+ if(g == 255)
+ state = 1;
+ }
+ if(state == 1){
+ r--;
+ if(r == 0)
+ state = 2;
+ }
+ if(state == 2){
+ b++;
+ if(b == 255)
+ state = 3;
+ }
+ if(state == 3){
+ g--;
+ if(g == 0)
+ state = 4;
+ }
+ if(state == 4){
+ r++;
+ if(r == 255)
+ state = 5;
+ }
+ if(state == 5){
+ b--;
+ if(b == 0)
+ state = 0;
+ }
+ hex = (a << 24) + (r << 16) + (g << 8) + (b);
+ return hex;
+ }
+
/**
- * If this block doesn't render as an ordinary block it will return False
- * (examples: signs, buttons, stairs, etc)
+ * A randomly called display update to be able to add particles or other items for display
*/
@Override
- public boolean renderAsNormalBlock() {
- return true;
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(World world, int posX, int posY, int posZ, Random random){
+ Utils.spawnFX(world, posX, posY, posZ, "smoke", "cloud");
+
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java
index 2f659b7806..7fa890b6c8 100644
--- a/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java
+++ b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java
@@ -1,15 +1,14 @@
package gtPlusPlus.core.block.general.antigrief;
-import java.util.List;
-import java.util.Random;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.block.ModBlocks;
+import static gtPlusPlus.core.block.ModBlocks.blockGriefSaver;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.general.TileEntityReverter;
import gtPlusPlus.core.util.Utils;
+
+import java.util.List;
+import java.util.Random;
+
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -24,241 +23,254 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class TowerDevice extends Block {
- private static IIcon TEX_ANTIBUILDER;
- public static final int META_ANTIBUILDER = 9;
- public static boolean areNearbyLockBlocks(final World world, final int x, final int y, final int z) {
- boolean locked = false;
- for (int dx = x - 2; dx <= x + 2; dx++) {
- for (int dy = y - 2; dy <= y + 2; dy++) {
- for (int dz = z - 2; dz <= z + 2; dz++) {
- if (world.getBlock(dx, dy, dz) == ModBlocks.blockGriefSaver
- && world.getBlockMetadata(dx, dy, dz) == 4) {
- locked = true;
- }
- }
- }
- }
- return locked;
- }
-
- public static void changeToActiveVanishBlock(final World par1World, final int x, final int y, final int z,
- final int meta) {
- TowerDevice.changeToBlockMeta(par1World, x, y, z, meta);
- par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.pop", 0.3F, 0.6F);
-
- final Block thereBlockID = par1World.getBlock(x, y, z);
- par1World.scheduleBlockUpdate(x, y, z, thereBlockID,
- TowerDevice.getTickRateFor(thereBlockID, meta, par1World.rand));
- }
-
- private static void changeToBlockMeta(final World par1World, final int x, final int y, final int z,
- final int meta) {
- final Block thereBlockID = par1World.getBlock(x, y, z);
- if (thereBlockID == ModBlocks.blockGriefSaver) {
- par1World.setBlock(x, y, z, thereBlockID, meta, 3);
- par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
- par1World.notifyBlocksOfNeighborChange(x, y, z, thereBlockID);
- }
- }
-
- public static void checkAndActivateVanishBlock(final World world, final int x, final int y, final int z) {
- final Block thereID = world.getBlock(x, y, z);
- final int thereMeta = world.getBlockMetadata(x, y, z);
- }
-
- private static int getTickRateFor(final Block thereBlockID, final int meta, final Random rand) {
- return 15;
- }
-
- public static void unlockBlock(final World par1World, final int x, final int y, final int z) {
- final Block thereBlockID = par1World.getBlock(x, y, z);
- final int thereBlockMeta = par1World.getBlockMetadata(x, y, z);
- if (thereBlockID == ModBlocks.blockGriefSaver || thereBlockMeta == 4) {
- TowerDevice.changeToBlockMeta(par1World, x, y, z, 5);
- par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.click", 0.3F, 0.6F);
- }
- }
-
- private boolean bUnbreakable;
-
- public TowerDevice() {
- super(Material.wood);
- this.setHardness(10.0F);
- this.setResistance(35.0F);
- this.setStepSound(Block.soundTypeWood);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- @Override
- public TileEntity createTileEntity(final World world, final int metadata) {
- if (metadata == 0) {
- Utils.LOG_INFO("I have been created. [Antigriefer]" + this.getLocalizedName());
- return new TileEntityReverter();
- }
- return null;
- }
-
- @Override
- public int damageDropped(final int meta) {
- return meta;
- }
-
- @Override
- public float getBlockHardness(final World world, final int x, final int y, final int z) {
- final int meta = world.getBlockMetadata(x, y, z);
- return super.getBlockHardness(world, x, y, z);
- }
-
- @Override
- public float getExplosionResistance(final Entity par1Entity, final World world, final int x, final int y,
- final int z, final double explosionX, final double explosionY, final double explosionZ) {
- final int meta = world.getBlockMetadata(x, y, z);
- return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ);
- }
-
- @Override
- public IIcon getIcon(final int side, final int meta) {
- return TowerDevice.TEX_ANTIBUILDER;
- }
-
- @Override
- public Item getItemDropped(final int meta, final Random par2Random, final int par3) {
- switch (meta) {
- case 0:
- return null;
- }
- return Item.getItemFromBlock(this);
- }
-
- @Override
- public int getLightValue(final IBlockAccess world, final int x, final int y, final int z) {
- final Block blockID = world.getBlock(x, y, z);
- final int meta = world.getBlockMetadata(x, y, z);
- if (blockID != this) {
- return 0;
- }
- return 10;
- }
-
- @Override
- public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
- par3List.add(new ItemStack(par1, 1, 9));
- }
-
- @Override
- public boolean hasTileEntity(final int metadata) {
- return metadata == 0;
- }
-
- private boolean isInactiveTrapCharged(final World par1World, final int x, final int y, final int z) {
- return false;
- }
-
- private boolean isReactorReady(final World world, final int x, final int y, final int z) {
- if (world.getBlock(x, y + 1, z) != Blocks.redstone_block || world.getBlock(x, y - 1, z) != Blocks.redstone_block
- || world.getBlock(x + 1, y, z) != Blocks.redstone_block
- || world.getBlock(x - 1, y, z) != Blocks.redstone_block
- || world.getBlock(x, y, z + 1) != Blocks.redstone_block
- || world.getBlock(x, y, z - 1) != Blocks.redstone_block) {
- return false;
- }
- return true;
- }
-
- private void letsBuild(final World par1World, final int x, final int y, final int z) {
-
- }
-
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.bUnbreakable = aNBT.getBoolean("bUnbreakable");
- }
-
- @Override
- public boolean onBlockActivated(final World par1World, final int x, final int y, final int z,
- final EntityPlayer par5EntityPlayer, final int par6, final float par7, final float par8, final float par9) {
- final int meta = par1World.getBlockMetadata(x, y, z);
- return false;
- }
-
- @Override
- public void onBlockAdded(final World par1World, final int x, final int y, final int z) {
- final int meta = par1World.getBlockMetadata(x, y, z);
- if (!par1World.isRemote) {
-
- }
- }
-
- @Override
- public void onNeighborBlockChange(final World par1World, final int x, final int y, final int z,
- final Block myBlockID) {
- final int meta = par1World.getBlockMetadata(x, y, z);
- if (!par1World.isRemote) {
-
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void randomDisplayTick(final World par1World, final int x, final int y, final int z,
- final Random par5Random) {
- final int meta = par1World.getBlockMetadata(x, y, z);
- if (meta == 3 || meta == 1 || meta == 9) {
- for (int i = 0; i < 1; i++) {
- this.sparkle(par1World, x, y, z, par5Random);
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister par1IconRegister) {
- TowerDevice.TEX_ANTIBUILDER = par1IconRegister.registerIcon(CORE.MODID + ":" + "blockAntiGrief");
- }
-
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setBoolean("bUnbreakable", this.bUnbreakable);
- }
-
- public void sparkle(final World world, final int x, final int y, final int z, final Random rand) {
- final double offset = 0.0625D;
- for (int side = 0; side < 6; side++) {
- double rx = x + rand.nextFloat();
- double ry = y + rand.nextFloat();
- double rz = z + rand.nextFloat();
- if (side == 0 && !world.getBlock(x, y + 1, z).isOpaqueCube()) {
- ry = y + 1 + offset;
- }
- if (side == 1 && !world.getBlock(x, y - 1, z).isOpaqueCube()) {
- ry = y + 0 - offset;
- }
- if (side == 2 && !world.getBlock(x, y, z + 1).isOpaqueCube()) {
- rz = z + 1 + offset;
- }
- if (side == 3 && !world.getBlock(x, y, z - 1).isOpaqueCube()) {
- rz = z + 0 - offset;
- }
- if (side == 4 && !world.getBlock(x + 1, y, z).isOpaqueCube()) {
- rx = x + 1 + offset;
- }
- if (side == 5 && !world.getBlock(x - 1, y, z).isOpaqueCube()) {
- rx = x + 0 - offset;
- }
- if (rx < x || rx > x + 1 || ry < 0.0D || ry > y + 1 || rz < z || rz > z + 1) {
- world.spawnParticle("reddust", rx, ry, rz, 0.0D, 0.0D, 0.0D);
- }
- }
- }
-
- public int tickRate() {
- return 15;
+ private static IIcon TEX_ANTIBUILDER;
+ public static final int META_ANTIBUILDER = 9;
+ private boolean bUnbreakable;
+
+ public TowerDevice()
+ {
+ super(Material.wood);
+ setHardness(10.0F);
+ setResistance(35.0F);
+ setStepSound(Block.soundTypeWood);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ public int tickRate()
+ {
+ return 15;
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("bUnbreakable", bUnbreakable);
}
- @Override
- public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random) {
- if (!par1World.isRemote) {
- final int meta = par1World.getBlockMetadata(x, y, z);
- }
+ public void loadNBTData(NBTTagCompound aNBT) {
+ bUnbreakable = aNBT.getBoolean("bUnbreakable");
}
+
+ public IIcon getIcon(int side, int meta)
+ {
+ return TEX_ANTIBUILDER;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister par1IconRegister)
+ {
+ TEX_ANTIBUILDER = par1IconRegister.registerIcon(CORE.MODID + ":" + "blockAntiGrief");
+ }
+
+ public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
+ {
+ par3List.add(new ItemStack(par1, 1, 9));
+ }
+
+ public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
+ {
+ int meta = par1World.getBlockMetadata(x, y, z);
+ return false;
+ }
+
+ public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ)
+ {
+ int meta = world.getBlockMetadata(x, y, z);
+ return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ);
+ }
+
+ public float getBlockHardness(World world, int x, int y, int z)
+ {
+ int meta = world.getBlockMetadata(x, y, z);
+ return super.getBlockHardness(world, x, y, z);
+ }
+
+ public static boolean areNearbyLockBlocks(World world, int x, int y, int z)
+ {
+ boolean locked = false;
+ for (int dx = x - 2; dx <= x + 2; dx++) {
+ for (int dy = y - 2; dy <= y + 2; dy++) {
+ for (int dz = z - 2; dz <= z + 2; dz++) {
+ if ((world.getBlock(dx, dy, dz) == blockGriefSaver) && (world.getBlockMetadata(dx, dy, dz) == 4)) {
+ locked = true;
+ }
+ }
+ }
+ }
+ return locked;
+ }
+
+ public static void unlockBlock(World par1World, int x, int y, int z)
+ {
+ Block thereBlockID = par1World.getBlock(x, y, z);
+ int thereBlockMeta = par1World.getBlockMetadata(x, y, z);
+ if ((thereBlockID == blockGriefSaver) || (thereBlockMeta == 4))
+ {
+ changeToBlockMeta(par1World, x, y, z, 5);
+ par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.click", 0.3F, 0.6F);
+ }
+ }
+
+ private static void changeToBlockMeta(World par1World, int x, int y, int z, int meta)
+ {
+ Block thereBlockID = par1World.getBlock(x, y, z);
+ if ((thereBlockID == blockGriefSaver))
+ {
+ par1World.setBlock(x, y, z, thereBlockID, meta, 3);
+ par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
+ par1World.notifyBlocksOfNeighborChange(x, y, z, thereBlockID);
+ }
+ }
+
+ public void onBlockAdded(World par1World, int x, int y, int z)
+ {
+ int meta = par1World.getBlockMetadata(x, y, z);
+ if (!par1World.isRemote) {
+
+ }
+ }
+
+ public void onNeighborBlockChange(World par1World, int x, int y, int z, Block myBlockID)
+ {
+ int meta = par1World.getBlockMetadata(x, y, z);
+ if (!par1World.isRemote)
+ {
+
+ }
+ }
+
+ public void updateTick(World par1World, int x, int y, int z, Random par5Random)
+ {
+ if (!par1World.isRemote)
+ {
+ int meta = par1World.getBlockMetadata(x, y, z);
+ }
+ }
+
+ private void letsBuild(World par1World, int x, int y, int z)
+ {
+
+ }
+
+ private boolean isInactiveTrapCharged(World par1World, int x, int y, int z)
+ {
+ return false;
+ }
+
+ private boolean isReactorReady(World world, int x, int y, int z)
+ {
+ if ((world.getBlock(x, y + 1, z) != Blocks.redstone_block) ||
+ (world.getBlock(x, y - 1, z) != Blocks.redstone_block) ||
+ (world.getBlock(x + 1, y, z) != Blocks.redstone_block) ||
+ (world.getBlock(x - 1, y, z) != Blocks.redstone_block) ||
+ (world.getBlock(x, y, z + 1) != Blocks.redstone_block) ||
+ (world.getBlock(x, y, z - 1) != Blocks.redstone_block)) {
+ return false;
+ }
+ return true;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(World par1World, int x, int y, int z, Random par5Random)
+ {
+ int meta = par1World.getBlockMetadata(x, y, z);
+ if ((meta == 3) || (meta == 1) || (meta == 9)) {
+ for (int i = 0; i < 1; i++) {
+ sparkle(par1World, x, y, z, par5Random);
+ }
+ }
+ }
+
+ public void sparkle(World world, int x, int y, int z, Random rand)
+ {
+ double offset = 0.0625D;
+ for (int side = 0; side < 6; side++)
+ {
+ double rx = x + rand.nextFloat();
+ double ry = y + rand.nextFloat();
+ double rz = z + rand.nextFloat();
+ if ((side == 0) && (!world.getBlock(x, y + 1, z).isOpaqueCube())) {
+ ry = y + 1 + offset;
+ }
+ if ((side == 1) && (!world.getBlock(x, y - 1, z).isOpaqueCube())) {
+ ry = y + 0 - offset;
+ }
+ if ((side == 2) && (!world.getBlock(x, y, z + 1).isOpaqueCube())) {
+ rz = z + 1 + offset;
+ }
+ if ((side == 3) && (!world.getBlock(x, y, z - 1).isOpaqueCube())) {
+ rz = z + 0 - offset;
+ }
+ if ((side == 4) && (!world.getBlock(x + 1, y, z).isOpaqueCube())) {
+ rx = x + 1 + offset;
+ }
+ if ((side == 5) && (!world.getBlock(x - 1, y, z).isOpaqueCube())) {
+ rx = x + 0 - offset;
+ }
+ if ((rx < x) || (rx > x + 1) || (ry < 0.0D) || (ry > y + 1) || (rz < z) || (rz > z + 1)) {
+ world.spawnParticle("reddust", rx, ry, rz, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+
+ public static void checkAndActivateVanishBlock(World world, int x, int y, int z)
+ {
+ Block thereID = world.getBlock(x, y, z);
+ int thereMeta = world.getBlockMetadata(x, y, z);
+ }
+
+ public static void changeToActiveVanishBlock(World par1World, int x, int y, int z, int meta)
+ {
+ changeToBlockMeta(par1World, x, y, z, meta);
+ par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.pop", 0.3F, 0.6F);
+
+ Block thereBlockID = par1World.getBlock(x, y, z);
+ par1World.scheduleBlockUpdate(x, y, z, thereBlockID, getTickRateFor(thereBlockID, meta, par1World.rand));
+ }
+
+ private static int getTickRateFor(Block thereBlockID, int meta, Random rand)
+ {
+ return 15;
+ }
+
+ public int getLightValue(IBlockAccess world, int x, int y, int z)
+ {
+ Block blockID = world.getBlock(x, y, z);
+ int meta = world.getBlockMetadata(x, y, z);
+ if (blockID != this) {
+ return 0;
+ }
+ return 10;
+ }
+
+ public boolean hasTileEntity(int metadata)
+ {
+ return (metadata == 0);
+ }
+
+ public TileEntity createTileEntity(World world, int metadata)
+ {
+ if (metadata == 0) {
+ Utils.LOG_INFO("I have been created. [Antigriefer]"+this.getLocalizedName());
+ return new TileEntityReverter();
+ }
+ return null;
+ }
+
+ public Item getItemDropped(int meta, Random par2Random, int par3)
+ {
+ switch (meta)
+ {
+ case 0:
+ return null;
+ }
+ return Item.getItemFromBlock(this);
+ }
+
+ public int damageDropped(int meta)
+ {
+ return meta;
+ }
}
diff --git a/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java b/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java
index 768822dd6e..6096da7054 100644
--- a/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java
+++ b/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.block.general.fluids;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.material.Material;
@@ -11,45 +9,43 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockFluidJackDaniels extends BlockFluidClassic {
- @SideOnly(Side.CLIENT)
- protected IIcon stillIcon;
- @SideOnly(Side.CLIENT)
- protected IIcon flowingIcon;
-
- public BlockFluidJackDaniels(final Fluid fluid, final Material material) {
- super(fluid, material);
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- }
-
- @Override
- public boolean canDisplace(final IBlockAccess world, final int x, final int y, final int z) {
- if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
- return false;
- }
- return super.canDisplace(world, x, y, z);
- }
-
- @Override
- public boolean displaceIfPossible(final World world, final int x, final int y, final int z) {
- if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
- return false;
- }
- return super.displaceIfPossible(world, x, y, z);
- }
-
- @Override
- public IIcon getIcon(final int side, final int meta) {
- return side == 0 || side == 1 ? this.stillIcon : this.flowingIcon;
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons(final IIconRegister register) {
- this.stillIcon = register.registerIcon(CORE.MODID + ":fluids/fluid.jackdaniels");
- this.flowingIcon = register.registerIcon(CORE.MODID + ":fluids/fluid.jackdaniels");
- }
-
-}
+ @SideOnly(Side.CLIENT)
+ protected IIcon stillIcon;
+ @SideOnly(Side.CLIENT)
+ protected IIcon flowingIcon;
+
+ public BlockFluidJackDaniels(Fluid fluid, Material material) {
+ super(fluid, material);
+ setCreativeTab(AddToCreativeTab.tabMisc);
+ }
+
+ @Override
+ public IIcon getIcon(int side, int meta) {
+ return (side == 0 || side == 1)? stillIcon : flowingIcon;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(IIconRegister register) {
+ stillIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels");
+ flowingIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels");
+ }
+
+ @Override
+ public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
+ return super.canDisplace(world, x, y, z);
+ }
+
+ @Override
+ public boolean displaceIfPossible(World world, int x, int y, int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
+ return super.displaceIfPossible(world, x, y, z);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java b/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java
index dbbc91c902..2832d4d0a4 100644
--- a/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java
+++ b/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java
@@ -1,33 +1,34 @@
package gtPlusPlus.core.block.machine;
-import gtPlusPlus.core.block.base.BasicBlock.BlockTypes;
import gtPlusPlus.core.block.base.MetaBlock;
+import gtPlusPlus.core.block.base.BasicBlock.BlockTypes;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
public class BlockGtFrameBox extends MetaBlock {
- private int[] colours;
- private int totalColours;
-
- public BlockGtFrameBox(final String unlocalizedName, final Material material, final BlockTypes blockTypeENUM,
- final boolean recolour, final int... colour) {
+ private int[] colours;
+ private int totalColours;
+
+ public BlockGtFrameBox(
+ String unlocalizedName, Material material,
+ BlockTypes blockTypeENUM, boolean recolour, int... colour) {
super(unlocalizedName, material, blockTypeENUM.getBlockSoundType());
- this.setBlockTextureName(CORE.MODID + ":" + "blockGtFrame");
- this.setHarvestLevel(blockTypeENUM.getHarvestTool(), 2);
- if (recolour && colour != null && colour.length > 0) {
- this.colours = colour;
- this.totalColours = this.colours.length;
- }
+ this.setBlockTextureName(CORE.MODID + ":" + "blockGtFrame");
+ this.setHarvestLevel(blockTypeENUM.getHarvestTool(), 2);
+ if (recolour && (colour != null && colour.length > 0)){
+ colours = colour;
+ totalColours = colours.length;
+ }
}
@Override
- public int colorMultiplier(final IBlockAccess p_149720_1_, final int p_149720_2_, final int p_149720_3_,
- final int p_149720_4_) {
- for (final int i : this.colours) {
-
- }
+ public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_,
+ int p_149720_3_, int p_149720_4_) {
+ for (int i : colours){
+
+ }
return super.colorMultiplier(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_);
}
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java
index e88c5c5b6b..4f426b99c9 100644
--- a/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java
+++ b/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java
@@ -1,11 +1,12 @@
package gtPlusPlus.core.block.machine;
-import java.util.ArrayList;
-
import gtPlusPlus.GTplusplus;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.machines.TileEntityCharger;
+
+import java.util.ArrayList;
+
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -16,67 +17,67 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import scala.util.Random;
-public class Machine_Charger extends BlockContainer {
- private static final String name = "Charging Machine";
-
- private final Random rand = new Random();
-
- public Machine_Charger(final String unlocalizedName) {
- super(Material.iron);
- // GameRegistry.registerBlock(this, unlocalizedName);
- this.setBlockName(unlocalizedName);
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- @Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block,
- final int par6) {
- if (world.isRemote) {
- return;
- }
-
- final ArrayList drops = new ArrayList();
-
- final TileEntity teRaw = world.getTileEntity(x, y, z);
-
- if (teRaw != null && teRaw instanceof TileEntityCharger) {
- final TileEntityCharger te = (TileEntityCharger) teRaw;
-
- for (int i = 0; i < te.getSizeInventory(); i++) {
- final ItemStack stack = te.getStackInSlot(i);
-
- if (stack != null) {
- drops.add(stack.copy());
- }
- }
- }
-
- for (int i = 0; i < drops.size(); i++) {
- final EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i));
- item.setVelocity((this.rand.nextDouble() - 0.5) * 0.25, this.rand.nextDouble() * 0.5 * 0.25,
- (this.rand.nextDouble() - 0.5) * 0.25);
- world.spawnEntityInWorld(item);
- }
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int par2) {
- return new TileEntityCharger();
- }
-
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
- final int side, final float lx, final float ly, final float lz) {
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if (te != null && te instanceof TileEntityCharger) {
- player.openGui(GTplusplus.instance, 1, world, x, y, z);
- return true;
- }
- return false;
- }
+public class Machine_Charger extends BlockContainer
+{
+ private static final String name = "Charging Machine";
+
+ private final Random rand = new Random();
+
+ public Machine_Charger(String unlocalizedName)
+ {
+ super(Material.iron);
+ //GameRegistry.registerBlock(this, unlocalizedName);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @Override
+ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz)
+ {
+ if (world.isRemote) return true;
+
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te != null && te instanceof TileEntityCharger)
+ {
+ player.openGui(GTplusplus.instance, 1, world, x, y, z);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void breakBlock(World world, int x, int y, int z, Block block, int par6)
+ {
+ if (world.isRemote) return;
+
+ ArrayList drops = new ArrayList();
+
+ TileEntity teRaw = world.getTileEntity(x, y, z);
+
+ if (teRaw != null && teRaw instanceof TileEntityCharger)
+ {
+ TileEntityCharger te = (TileEntityCharger) teRaw;
+
+ for (int i = 0; i < te.getSizeInventory(); i++)
+ {
+ ItemStack stack = te.getStackInSlot(i);
+
+ if (stack != null) drops.add(stack.copy());
+ }
+ }
+
+ for (int i = 0;i < drops.size();i++)
+ {
+ EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i));
+ item.setVelocity((rand.nextDouble() - 0.5) * 0.25, rand.nextDouble() * 0.5 * 0.25, (rand.nextDouble() - 0.5) * 0.25);
+ world.spawnEntityInWorld(item);
+ }
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int par2)
+ {
+ return new TileEntityCharger();
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java b/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java
index cfad3006b9..011e293000 100644
--- a/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java
+++ b/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java
@@ -1,11 +1,12 @@
package gtPlusPlus.core.block.machine;
-import java.util.ArrayList;
-
import gtPlusPlus.GTplusplus;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.machines.TileEntityNHG;
+
+import java.util.ArrayList;
+
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -16,67 +17,67 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import scala.util.Random;
-public class Machine_NHG extends BlockContainer {
- private static final String name = "Nuclear Fueled Helium Generator";
-
- private final Random rand = new Random();
-
- public Machine_NHG(final String unlocalizedName) {
- super(Material.iron);
- // GameRegistry.registerBlock(this, unlocalizedName);
- this.setBlockName(unlocalizedName);
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- @Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block,
- final int par6) {
- if (world.isRemote) {
- return;
- }
-
- final ArrayList drops = new ArrayList();
-
- final TileEntity teRaw = world.getTileEntity(x, y, z);
-
- if (teRaw != null && teRaw instanceof TileEntityNHG) {
- final TileEntityNHG te = (TileEntityNHG) teRaw;
-
- for (int i = 0; i < te.getSizeInventory(); i++) {
- final ItemStack stack = te.getStackInSlot(i);
-
- if (stack != null) {
- drops.add(stack.copy());
- }
- }
- }
-
- for (int i = 0; i < drops.size(); i++) {
- final EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i));
- item.setVelocity((this.rand.nextDouble() - 0.5) * 0.25, this.rand.nextDouble() * 0.5 * 0.25,
- (this.rand.nextDouble() - 0.5) * 0.25);
- world.spawnEntityInWorld(item);
- }
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int par2) {
- return new TileEntityNHG();
- }
-
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
- final int side, final float lx, final float ly, final float lz) {
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if (te != null && te instanceof TileEntityNHG) {
- player.openGui(GTplusplus.instance, 0, world, x, y, z);
- return true;
- }
- return false;
- }
+public class Machine_NHG extends BlockContainer
+{
+ private static final String name = "Nuclear Fueled Helium Generator";
+
+ private final Random rand = new Random();
+
+ public Machine_NHG(String unlocalizedName)
+ {
+ super(Material.iron);
+ //GameRegistry.registerBlock(this, unlocalizedName);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @Override
+ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz)
+ {
+ if (world.isRemote) return true;
+
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te != null && te instanceof TileEntityNHG)
+ {
+ player.openGui(GTplusplus.instance, 0, world, x, y, z);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void breakBlock(World world, int x, int y, int z, Block block, int par6)
+ {
+ if (world.isRemote) return;
+
+ ArrayList drops = new ArrayList();
+
+ TileEntity teRaw = world.getTileEntity(x, y, z);
+
+ if (teRaw != null && teRaw instanceof TileEntityNHG)
+ {
+ TileEntityNHG te = (TileEntityNHG) teRaw;
+
+ for (int i = 0; i < te.getSizeInventory(); i++)
+ {
+ ItemStack stack = te.getStackInSlot(i);
+
+ if (stack != null) drops.add(stack.copy());
+ }
+ }
+
+ for (int i = 0;i < drops.size();i++)
+ {
+ EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i));
+ item.setVelocity((rand.nextDouble() - 0.5) * 0.25, rand.nextDouble() * 0.5 * 0.25, (rand.nextDouble() - 0.5) * 0.25);
+ world.spawnEntityInWorld(item);
+ }
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int par2)
+ {
+ return new TileEntityNHG();
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java b/src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java
index e881d40d35..e964a9da01 100644
--- a/src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java
+++ b/src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java
@@ -1,6 +1,5 @@
package gtPlusPlus.core.block.machine;
-public class Machine_WireiusDeletus { // A Block that removes GT Cable and Wire
- // from it's inventory.
+public class Machine_WireiusDeletus { //A Block that removes GT Cable and Wire from it's inventory.
}
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java
index 1921aa8000..ed986b756e 100644
--- a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java
+++ b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java
@@ -1,11 +1,5 @@
package gtPlusPlus.core.block.machine;
-import buildcraft.api.tools.IToolWrench;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.common.registry.LanguageRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import crazypants.enderio.api.tool.ITool;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
@@ -21,85 +15,96 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import buildcraft.api.tools.IToolWrench;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.common.registry.LanguageRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import crazypants.enderio.api.tool.ITool;
-public class Machine_Workbench extends BlockContainer {
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
+public class Machine_Workbench extends BlockContainer
+{
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
- @SuppressWarnings("deprecation")
- public Machine_Workbench() {
- super(Material.iron);
- this.setBlockName("blockWorkbenchGT");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, "blockWorkbenchGT");
+ @SuppressWarnings("deprecation")
+ public Machine_Workbench()
+ {
+ super(Material.iron);
+ this.setBlockName("blockWorkbenchGT");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, "blockWorkbenchGT");
LanguageRegistry.addName(this, "Bronze Workbench");
+
+ }
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityWorkbench();
- }
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(int p_149691_1_, int p_149691_2_)
+ {
+ return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : (p_149691_1_ != 2 && p_149691_1_ != 4 ? this.blockIcon : this.textureFront));
+ }
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
+ @Override
@SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
- return p_149691_1_ == 1 ? this.textureTop
- : p_149691_1_ == 0 ? this.textureBottom
- : p_149691_1_ != 2 && p_149691_1_ != 4 ? this.blockIcon : this.textureFront;
- }
+ public void registerBlockIcons(IIconRegister p_149651_1_)
+ {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_top_crafting");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet");
+ }
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
- final int side, final float lx, final float ly, final float lz) {
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz)
+ {
ItemStack heldItem = null;
- if (world.isRemote) {
- heldItem = PlayerUtils.getItemStackInPlayersHand();
- }
+ if (world.isRemote){
+ heldItem = PlayerUtils.getItemStackInPlayersHand();
+ }
boolean holdingWrench = false;
- if (heldItem != null) {
- if (heldItem.getItem() instanceof ItemToolWrench) {
+ if (heldItem != null){
+ if (heldItem.getItem() instanceof ItemToolWrench){
holdingWrench = true;
}
- else if (heldItem.getItem() instanceof IToolWrench) {
+ else if (heldItem.getItem() instanceof IToolWrench){
holdingWrench = true;
}
- else if (heldItem.getItem() instanceof ITool) {
+ else if (heldItem.getItem() instanceof ITool){
holdingWrench = true;
}
- /*
- * else if (heldItem.getItem() instanceof GT_MetaGenerated_Tool){
- * GT_MetaGenerated_Tool testTool = (GT_MetaGenerated_Tool)
- * heldItem.getItem(); if (testTool.canWrench(player, x, y, z)){
- * holdingWrench = true; } }
- */
+ /*else if (heldItem.getItem() instanceof GT_MetaGenerated_Tool){
+ GT_MetaGenerated_Tool testTool = (GT_MetaGenerated_Tool) heldItem.getItem();
+ if (testTool.canWrench(player, x, y, z)){
+ holdingWrench = true;
+ }
+ }*/
else {
holdingWrench = false;
}
}
- if (world.isRemote) {
- return true;
- }
+ if (world.isRemote) return true;
- final TileEntity te = world.getTileEntity(x, y, z);
- if (te != null && te instanceof TileEntityWorkbench) {
- if (!holdingWrench) {
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te != null && te instanceof TileEntityWorkbench)
+ {
+ if (!holdingWrench){
player.openGui(GTplusplus.instance, 3, world, x, y, z);
- return true;
+ return true;
}
Utils.LOG_INFO("Holding a Wrench, doing wrench things instead.");
}
@@ -107,11 +112,7 @@ public class Machine_Workbench extends BlockContainer {
}
@Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_) {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_top_crafting");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet");
+ public TileEntity createNewTileEntity(World world, int p_149915_2_) {
+ return new TileEntityWorkbench();
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java b/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java
index 20d6c8601c..2f061ea298 100644
--- a/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java
+++ b/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java
@@ -1,11 +1,5 @@
package gtPlusPlus.core.block.machine;
-import buildcraft.api.tools.IToolWrench;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.common.registry.LanguageRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import crazypants.enderio.api.tool.ITool;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
@@ -21,17 +15,25 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import buildcraft.api.tools.IToolWrench;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.common.registry.LanguageRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import crazypants.enderio.api.tool.ITool;
-public class Machine_WorkbenchAdvanced extends BlockContainer {
+public class Machine_WorkbenchAdvanced extends BlockContainer
+{
@SideOnly(Side.CLIENT)
- private IIcon textureTop;
+ private IIcon textureTop;
@SideOnly(Side.CLIENT)
- private IIcon textureBottom;
+ private IIcon textureBottom;
@SideOnly(Side.CLIENT)
- private IIcon textureFront;
+ private IIcon textureFront;
@SuppressWarnings("deprecation")
- public Machine_WorkbenchAdvanced() {
+ public Machine_WorkbenchAdvanced()
+ {
super(Material.iron);
this.setBlockName("blockWorkbenchGTAdvanced");
this.setCreativeTab(AddToCreativeTab.tabMachines);
@@ -40,61 +42,65 @@ public class Machine_WorkbenchAdvanced extends BlockContainer {
}
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityWorkbenchAdvanced(128000, 2);
- }
-
/**
* Gets the block's texture. Args: side, meta
*/
@Override
@SideOnly(Side.CLIENT)
- public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
- return p_149691_1_ == 1 ? this.textureTop
- : p_149691_1_ == 0 ? this.textureBottom
- : p_149691_1_ != 2 && p_149691_1_ != 4 ? this.blockIcon : this.textureFront;
+ public IIcon getIcon(int p_149691_1_, int p_149691_2_)
+ {
+ return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : (p_149691_1_ != 2 && p_149691_1_ != 4 ? this.blockIcon : this.textureFront));
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister p_149651_1_)
+ {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "cover_crafting");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
}
/**
* Called upon block activation (right click on the block.)
*/
@Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
- final int side, final float lx, final float ly, final float lz) {
+ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz)
+ {
- final ItemStack heldItem = PlayerUtils.getItemStackInPlayersHand(player);
- if (world.isRemote) {
- return true;
- }
+ ItemStack heldItem = PlayerUtils.getItemStackInPlayersHand(player);
+ if (world.isRemote) return true;
boolean holdingWrench = false;
- if (heldItem != null) {
- if (heldItem.getItem() instanceof ItemToolWrench) {
+ if (heldItem != null){
+ if (heldItem.getItem() instanceof ItemToolWrench){
holdingWrench = true;
}
- else if (heldItem.getItem() instanceof IToolWrench) {
+ else if (heldItem.getItem() instanceof IToolWrench){
holdingWrench = true;
}
- else if (heldItem.getItem() instanceof ITool) {
+ else if (heldItem.getItem() instanceof ITool){
holdingWrench = true;
}
- /*
- * else if (heldItem.getItem() instanceof GT_MetaGenerated_Tool){
- * GT_MetaGenerated_Tool testTool = (GT_MetaGenerated_Tool)
- * heldItem.getItem(); if (testTool.canWrench(player, x, y, z)){
- * holdingWrench = true; } }
- */
+ /*else if (heldItem.getItem() instanceof GT_MetaGenerated_Tool){
+ GT_MetaGenerated_Tool testTool = (GT_MetaGenerated_Tool) heldItem.getItem();
+ if (testTool.canWrench(player, x, y, z)){
+ holdingWrench = true;
+ }
+ }*/
else {
holdingWrench = false;
}
}
- final TileEntity te = world.getTileEntity(x, y, z);
- if (te != null && te instanceof TileEntityWorkbenchAdvanced) {
- if (!holdingWrench) {
+
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te != null && te instanceof TileEntityWorkbenchAdvanced)
+ {
+ if (!holdingWrench){
player.openGui(GTplusplus.instance, 4, world, x, y, z);
- return true;
+ return true;
}
Utils.LOG_INFO("Holding a Wrench, doing wrench things instead.");
}
@@ -102,11 +108,7 @@ public class Machine_WorkbenchAdvanced extends BlockContainer {
}
@Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_) {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "cover_crafting");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
+ public TileEntity createNewTileEntity(World world, int p_149915_2_) {
+ return new TileEntityWorkbenchAdvanced(128000, 2);
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java
index 19e9b09e8f..7a76b09cca 100644
--- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java
@@ -1,13 +1,12 @@
package gtPlusPlus.core.block.machine.heliumgen.block;
-import java.util.Random;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
+
+import java.util.Random;
+
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -22,145 +21,145 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class HeliumGenerator extends BlockContainer {
- private IIcon top, sides, front;
- private final Random randy = new Random();
-
- public HeliumGenerator() {
- super(Material.iron);
- this.setStepSound(Block.soundTypeMetal);
- this.setHardness(20.0F);
- this.setBlockName("helium_collector");
- this.setHarvestLevel("pickaxe", 3);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- @Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int wut) {
- final TileEntityHeliumGenerator collector = (TileEntityHeliumGenerator) world.getTileEntity(x, y, z);
-
- if (collector != null) {
- int i = 0;
- for (i = 0; i < collector.getSizeInventory(); i++) {
-
- final ItemStack itemstack = collector.getStackInSlot(i);
-
- if (itemstack != null) {
- final float f = this.randy.nextFloat() * 0.8F + 0.1F;
- final float f1 = this.randy.nextFloat() * 0.8F + 0.1F;
- final float f2 = this.randy.nextFloat() * 0.8F + 0.1F;
-
- while (itemstack.stackSize > 0) {
- int j1 = this.randy.nextInt(21) + 10;
-
- if (j1 > itemstack.stackSize) {
- j1 = itemstack.stackSize;
- }
-
- itemstack.stackSize -= j1;
- final EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2,
- new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
-
- if (itemstack.hasTagCompound()) {
- entityitem.getEntityItem()
- .setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
- }
-
- final float f3 = 0.05F;
- entityitem.motionX = (float) this.randy.nextGaussian() * f3;
- entityitem.motionY = (float) this.randy.nextGaussian() * f3 + 0.2F;
- entityitem.motionZ = (float) this.randy.nextGaussian() * f3;
- world.spawnEntityInWorld(entityitem);
- }
- }
-
- world.func_147453_f(x, y, z, block);
- }
- }
-
- super.breakBlock(world, x, y, z, block, wut);
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int meta) {
- return new TileEntityHeliumGenerator();
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
- if (side == 1) {
- return this.top;
- }
- int facing = 2;
- final TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator) world.getTileEntity(x, y, z);
- if (machine != null) {
- facing = machine.getFacing();
- }
- if (side == facing) {
- return this.front;
- }
- else {
- return this.sides;
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int side, final int metadata) {
- if (side == 1) {
- return this.top;
- }
- if (side == 3) {
- return this.front;
- }
- return this.sides;
- }
-
- @Override
- public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
- final int par6, final float par7, final float par8, final float par9) {
- if (world.isRemote) {
- return true;
- }
+ private IIcon top, sides, front;
+ private Random randy = new Random();
+
+ public HeliumGenerator(){
+ super(Material.iron);
+ setStepSound(Block.soundTypeMetal);
+ setHardness(20.0F);
+ setBlockName("helium_collector");
+ setHarvestLevel("pickaxe", 3);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons (IIconRegister iconRegister)
+ {
+ this.top = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_SIDE");
+ this.sides = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_SIDE");
+ this.front = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_FRONT");
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
+ if(side == 1)
+ return top;
+ int facing = 2;
+ TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator)world.getTileEntity(x, y, z);
+ if(machine != null)
+ facing = machine.getFacing();
+ if(side == facing)
+ return front;
+ else
+ return sides;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon (int side, int metadata)
+ {
+ if(side == 1)
+ return top;
+ if(side == 3)
+ return front;
+ return sides;
+ }
+
+ @Override
+ public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
+ {
+ if (world.isRemote)
+ {
+ return true;
+ }
player.openGui(GTplusplus.instance, 2, world, x, y, z);
return true;
- }
-
- @Override
- public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase player,
- final ItemStack item) {
- final TileEntity tile = world.getTileEntity(x, y, z);
- if (tile instanceof TileEntityHeliumGenerator) {
- final TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator) tile;
- final int l = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
-
- if (l == 0) {
- machine.setFacing((short) 2);
- }
-
- if (l == 1) {
- machine.setFacing((short) 5);
- }
-
- if (l == 2) {
- machine.setFacing((short) 3);
- }
-
- if (l == 3) {
- machine.setFacing((short) 4);
- }
- }
-
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons(final IIconRegister iconRegister) {
- this.top = iconRegister.registerIcon(CORE.MODID + ":blockHeliumCollector_SIDE");
- this.sides = iconRegister.registerIcon(CORE.MODID + ":blockHeliumCollector_SIDE");
- this.front = iconRegister.registerIcon(CORE.MODID + ":blockHeliumCollector_FRONT");
- }
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int meta)
+ {
+ return new TileEntityHeliumGenerator();
+ }
+
+ @Override
+ public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack item)
+ {
+ TileEntity tile = world.getTileEntity(x, y, z);
+ if(tile instanceof TileEntityHeliumGenerator) {
+ TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator)tile;
+ int l = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
+
+ if (l == 0)
+ machine.setFacing((short) 2);
+
+ if (l == 1)
+ machine.setFacing((short) 5);
+
+ if (l == 2)
+ machine.setFacing((short) 3);
+
+ if (l == 3)
+ machine.setFacing((short) 4);
+ }
+
+ }
+
+ @Override
+ public void breakBlock(World world, int x, int y, int z, Block block, int wut)
+ {
+ TileEntityHeliumGenerator collector = (TileEntityHeliumGenerator)world.getTileEntity(x, y, z);
+
+ if (collector != null)
+ {
+ int i = 0;
+ for (i = 0; i < collector.getSizeInventory(); i++){
+
+ ItemStack itemstack = collector.getStackInSlot(i);
+
+ if (itemstack != null)
+ {
+ float f = this.randy.nextFloat() * 0.8F + 0.1F;
+ float f1 = this.randy.nextFloat() * 0.8F + 0.1F;
+ float f2 = this.randy.nextFloat() * 0.8F + 0.1F;
+
+ while (itemstack.stackSize > 0)
+ {
+ int j1 = this.randy.nextInt(21) + 10;
+
+ if (j1 > itemstack.stackSize)
+ {
+ j1 = itemstack.stackSize;
+ }
+
+ itemstack.stackSize -= j1;
+ EntityItem entityitem = new EntityItem(world, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
+
+ if (itemstack.hasTagCompound())
+ {
+ entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
+ }
+
+ float f3 = 0.05F;
+ entityitem.motionX = (double)((float)this.randy.nextGaussian() * f3);
+ entityitem.motionY = (double)((float)this.randy.nextGaussian() * f3 + 0.2F);
+ entityitem.motionZ = (double)((float)this.randy.nextGaussian() * f3);
+ world.spawnEntityInWorld(entityitem);
+ }
+ }
+
+ world.func_147453_f(x, y, z, block);
+ }
+ }
+
+ super.breakBlock(world, x, y, z, block, wut);
+ }
}
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java
index a05eeeccbb..d701f6f125 100644
--- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java
@@ -1,70 +1,75 @@
package gtPlusPlus.core.block.machine.heliumgen.container;
-import java.util.List;
-
import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator;
import ic2.core.ContainerBase;
import ic2.core.slot.SlotInvSlot;
+
+import java.util.List;
+
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.SlotFurnace;
-public class ContainerHeliumGenerator extends ContainerBase<TileEntityHeliumGenerator> {
+public class ContainerHeliumGenerator
+extends ContainerBase<TileEntityHeliumGenerator>
+{
public short size;
- public ContainerHeliumGenerator(final InventoryPlayer player, final TileEntityHeliumGenerator machine) {
+ public ContainerHeliumGenerator(InventoryPlayer player, TileEntityHeliumGenerator machine)
+ {
super(machine);
- // Utils.LOG_WARNING("containerHeliumGenerator");
- final short sr = machine.getReactorSize();
+ //Utils.LOG_WARNING("containerHeliumGenerator");
+ short sr = machine.getReactorSize();
this.addSlotToContainer(new SlotFurnace(player.player, machine, 2, 80, 35));
this.size = sr;
int startX = 16;
int startY = 16;
int i = 0;
- for (i = 0; i < 9; i++) {
- final int x = i % this.size;
- final int y = i / this.size;
+ for (i = 0; i < 9; i++)
+ {
+ int x = i % this.size;
+ int y = i / this.size;
- this.addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
+ addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
}
startX = 108;
startY = 16;
- for (i = 9; i < 18; i++) {
- final int x = i % this.size;
- final int y = (i - 9) / this.size;
+ for (i = 9; i < 18; i++)
+ {
+ int x = i % this.size;
+ int y = (i-9) / this.size;
- this.addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
+ addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
}
- for (i = 0; i < 3; ++i) {
- for (int j = 0; j < 9; ++j) {
+ for (i = 0; i < 3; ++i)
+ {
+ for (int j = 0; j < 9; ++j)
+ {
this.addSlotToContainer(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
- for (i = 0; i < 9; ++i) {
+ for (i = 0; i < 9; ++i)
+ {
this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 142));
}
- // addSlotToContainer(new SlotInvSlot(machine.coolantinputSlot, 0, 8,
- // 25));
- // addSlotToContainer(new SlotInvSlot(machine.hotcoolinputSlot, 0, 188,
- // 25));
- // addSlotToContainer(new SlotInvSlot(machine.coolantoutputSlot, 0, 8,
- // 115));
- // addSlotToContainer(new SlotInvSlot(machine.hotcoolantoutputSlot, 0,
- // 188, 115));
+ // addSlotToContainer(new SlotInvSlot(machine.coolantinputSlot, 0, 8, 25));
+ //addSlotToContainer(new SlotInvSlot(machine.hotcoolinputSlot, 0, 188, 25));
+ //addSlotToContainer(new SlotInvSlot(machine.coolantoutputSlot, 0, 8, 115));
+ //addSlotToContainer(new SlotInvSlot(machine.hotcoolantoutputSlot, 0, 188, 115));
}
@Override
- public List<String> getNetworkedFields() {
- final List<String> ret = super.getNetworkedFields();
+ public List<String> getNetworkedFields()
+ {
+ List<String> ret = super.getNetworkedFields();
ret.add("heat");
ret.add("maxHeat");
ret.add("EmitHeat");
- /*
- * ret.add("inputTank"); ret.add("outputTank");
- * ret.add("fluidcoolreactor");
- */
+ /*ret.add("inputTank");
+ ret.add("outputTank");
+ ret.add("fluidcoolreactor");*/
return ret;
- }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java
index 707f1b8944..2106f144be 100644
--- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.block.machine.heliumgen.gui;
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.block.machine.heliumgen.container.ContainerHeliumGenerator;
import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator;
import gtPlusPlus.core.lib.CORE;
@@ -12,62 +8,65 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
-@SideOnly(Side.CLIENT)
-public class GUIHeliumGenerator extends GuiContainer {
- private static final ResourceLocation collectorGuiTexture = new ResourceLocation(CORE.MODID,
- "textures/gui/helium_collector_gui.png");
-
- public GUIHeliumGenerator(final InventoryPlayer player, final TileEntityHeliumGenerator machine) {
- super(new ContainerHeliumGenerator(player, machine));
- }
+import org.lwjgl.opengl.GL11;
- @Override
- protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_,
- final int p_146976_3_) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(GUIHeliumGenerator.collectorGuiTexture);
- final int k = (this.width - this.xSize) / 2;
- final int l = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
- }
+@SideOnly(Side.CLIENT)
+public class GUIHeliumGenerator extends GuiContainer
+{
+ private static final ResourceLocation collectorGuiTexture = new ResourceLocation(CORE.MODID, "textures/gui/helium_collector_gui.png");
- /**
- * Draw the foreground layer for the GuiContainer (everything in front of
- * the items)
- */
- @Override
- protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
- final String s = StatCollector.translateToLocal("Helium Collector");
- this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
- this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2,
- 4210752);
+ public GUIHeliumGenerator(InventoryPlayer player, TileEntityHeliumGenerator machine)
+ {
+ super(new ContainerHeliumGenerator(player, machine));
+ }
- this.fontRendererObj.drawString(StatCollector.translateToLocal("|" + -1), 80, 35, 2);
+ /**
+ * Draw the foreground layer for the GuiContainer (everything in front of the items)
+ */
+ @Override
+ protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
+ {
+ String s = StatCollector.translateToLocal("Helium Collector");
+ this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
+
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("|"+-1), 80, 35, 2);
+
+ short sr = 3;
+ int size = sr;
+ int startX = 16;
+ int startY = 16;
+ int i = 0;
+ for (i = 0; i < 9; i++)
+ {
+ int x = i % size;
+ int y = i / size;
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("|"+i), startX + 18 * x, startY + 18 * y, 4210752);
+ //addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
+ }
+ startX = 108;
+ startY = 16;
+ for (i = 9; i < 18; i++)
+ {
+ int x = i % size;
+ int y = (i-9) / size;
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("|"+i), startX + 18 * x, startY + 18 * y, 4210752);
+ // addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
+ }
+
+ }
- final short sr = 3;
- final int size = sr;
- int startX = 16;
- int startY = 16;
- int i = 0;
- for (i = 0; i < 9; i++) {
- final int x = i % size;
- final int y = i / size;
- this.fontRendererObj.drawString(StatCollector.translateToLocal("|" + i), startX + 18 * x, startY + 18 * y,
- 4210752);
- // addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX
- // + 18 * x, startY + 18 * y));
- }
- startX = 108;
- startY = 16;
- for (i = 9; i < 18; i++) {
- final int x = i % size;
- final int y = (i - 9) / size;
- this.fontRendererObj.drawString(StatCollector.translateToLocal("|" + i), startX + 18 * x, startY + 18 * y,
- 4210752);
- // addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX
- // + 18 * x, startY + 18 * y));
- }
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
+ {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(collectorGuiTexture);
+ int k = (this.width - this.xSize) / 2;
+ int l = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
- }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java
index b5eb8b7898..86507a2d64 100644
--- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java
@@ -4,65 +4,75 @@ import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenera
import ic2.core.block.invslot.InvSlot;
import net.minecraft.item.ItemStack;
-public class InvSlotRadiation extends InvSlot {
- private final int rows = 6;
-
- private final int maxCols = 9;
-
- public InvSlotRadiation(final TileEntityHeliumGenerator base, final String name1, final int oldStartIndex1,
- final int count) {
+public class InvSlotRadiation extends InvSlot
+{
+ public InvSlotRadiation(TileEntityHeliumGenerator base, String name1, int oldStartIndex1, int count)
+ {
super(base, name1, oldStartIndex1, InvSlot.Access.IO, count);
- this.setStackSizeLimit(1);
+ setStackSizeLimit(1);
}
@Override
- public boolean accepts(final ItemStack itemStack) {
- return ((TileEntityHeliumGenerator) this.base).isUsefulItem(itemStack, true);
+ public boolean accepts(ItemStack itemStack)
+ {
+ return ((TileEntityHeliumGenerator)this.base).isUsefulItem(itemStack, true);
}
@Override
- public ItemStack get(final int index) {
- return super.get(this.mapIndex(index));
+ public int size()
+ {
+ //Utils.LOG_INFO("InvSlotRadiation/Size");
+ return 3 * 6;
}
- public ItemStack get(final int x, final int y) {
+ public int rawSize()
+ {
+ return super.size();
+ }
+
+ @Override
+ public ItemStack get(int index)
+ {
+ return super.get(mapIndex(index));
+ }
+
+ public ItemStack get(int x, int y)
+ {
return super.get(y * 9 + x);
}
- private int mapIndex(int index) {
- final int size = this.size();
- final int cols = size / 6;
- if (index < size) {
- final int row = index / cols;
- final int col = index % cols;
+ @Override
+ public void put(int index, ItemStack content)
+ {
+ super.put(mapIndex(index), content);
+ }
+
+ public void put(int x, int y, ItemStack content)
+ {
+ super.put(y * 9 + x, content);
+ }
+
+ private int mapIndex(int index)
+ {
+ int size = size();
+ int cols = size / 6;
+ if (index < size)
+ {
+ int row = index / cols;
+ int col = index % cols;
return row * 9 + col;
}
index -= size;
- final int remCols = 9 - cols;
+ int remCols = 9 - cols;
- final int row = index / remCols;
- final int col = cols + index % remCols;
+ int row = index / remCols;
+ int col = cols + index % remCols;
return row * 9 + col;
}
- public void put(final int x, final int y, final ItemStack content) {
- super.put(y * 9 + x, content);
- }
-
- @Override
- public void put(final int index, final ItemStack content) {
- super.put(this.mapIndex(index), content);
- }
-
- public int rawSize() {
- return super.size();
- }
- @Override
- public int size() {
- // Utils.LOG_INFO("InvSlotRadiation/Size");
- return 3 * 6;
- }
+ private final int rows = 6;
+ private final int maxCols = 9;
}
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java
index 16c66d6802..5ffd70efc4 100644
--- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.block.machine.heliumgen.tileentity;
-import java.util.List;
-
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.block.machine.heliumgen.slots.InvSlotRadiation;
import gtPlusPlus.core.item.ModItems;
@@ -11,11 +9,17 @@ import ic2.api.Direction;
import ic2.api.reactor.IReactor;
import ic2.api.reactor.IReactorComponent;
import ic2.api.tile.IWrenchable;
-import ic2.core.*;
+import ic2.core.IC2;
+import ic2.core.IC2DamageSource;
+import ic2.core.Ic2Items;
import ic2.core.block.TileEntityInventory;
import ic2.core.init.MainConfig;
import ic2.core.item.reactor.ItemReactorHeatStorage;
+import ic2.core.network.NetworkManager;
import ic2.core.util.ConfigUtil;
+
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
@@ -35,386 +39,433 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
-public class TileEntityHeliumGenerator extends TileEntityInventory implements IInventory, IReactor, IWrenchable {
-
- private ItemStack heliumStack;
- private int facing = 2;
- private int progress;
-
- public Block[][][] surroundings = new Block[5][5][5];
-
- public final InvSlotRadiation reactorSlot;
-
- public float output = 0.0F;
-
- /*
- * @Override public void readCustomNBT(NBTTagCompound tag) {
- * this.heliumStack =
- * ItemStack.loadItemStackFromNBT(tag.getCompoundTag("Helium"));
- * this.progress = tag.getInteger("Progress"); this.facing =
- * tag.getShort("Facing"); this.heat = tag.getInteger("heat");
- * this.prevActive = (this.active = tag.getBoolean("active")); }
- *
- * @Override public void writeCustomNBT(NBTTagCompound tag) {
- * tag.setInteger("Progress", this.progress); tag.setShort("Facing", (short)
- * this.facing); tag.setInteger("heat", this.heat); tag.setBoolean("active",
- * this.active); if(heliumStack != null) { NBTTagCompound produce = new
- * NBTTagCompound(); heliumStack.writeToNBT(produce); tag.setTag("Helium",
- * produce); } else tag.removeTag("Helium"); }
- */
-
- public int updateTicker;
-
- public int heat = 5000;
+public class TileEntityHeliumGenerator extends TileEntityInventory implements IInventory ,IReactor, IWrenchable {
- public int maxHeat = 100000;
+ private ItemStack heliumStack;
+ private int facing = 2;
+ private int progress;
- public float hem = 1.0F;
+
+ public void update2Entity(){
+ Utils.LOG_WARNING("updateEntity");
+ if(++progress >= 40){
+ //if(++progress >= 300){
+ if(heliumStack == null)
+ heliumStack = ItemUtils.getSimpleStack(ModItems.itemHeliumBlob);
+ else if(heliumStack.getItem() == ModItems.itemHeliumBlob && heliumStack.stackSize < 64)
+ heliumStack.stackSize++;
+ progress = 0;
+ markDirty();
+ }
+ }
- private int EmitHeatbuffer = 0;
+ @Override
+ public short getFacing(){
+ return (short) facing;
+ }
- public int EmitHeat = 0;
+ @Override
+ public void setFacing(short dir){
+ facing = dir;
+ }
- private boolean redstone = false;
+ /*@Override
+ public void readCustomNBT(NBTTagCompound tag)
+ {
+ this.heliumStack = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("Helium"));
+ this.progress = tag.getInteger("Progress");
+ this.facing = tag.getShort("Facing");
+ this.heat = tag.getInteger("heat");
+ this.prevActive = (this.active = tag.getBoolean("active"));
+ }
- private final boolean fluidcoolreactor = false;
+ @Override
+ public void writeCustomNBT(NBTTagCompound tag)
+ {
+ tag.setInteger("Progress", this.progress);
+ tag.setShort("Facing", (short) this.facing);
+ tag.setInteger("heat", this.heat);
+ tag.setBoolean("active", this.active);
+ if(heliumStack != null) {
+ NBTTagCompound produce = new NBTTagCompound();
+ heliumStack.writeToNBT(produce);
+ tag.setTag("Helium", produce);
+ }
+ else
+ tag.removeTag("Helium");
+ }*/
- private boolean active = true;
- public boolean prevActive = false;
+ @Override
+ public void readFromNBT(NBTTagCompound nbttagcompound)
+ {
+ super.readFromNBT(nbttagcompound);
- public TileEntityHeliumGenerator() {
- this.updateTicker = IC2.random.nextInt(this.getTickRate());
- this.reactorSlot = new InvSlotRadiation(this, "helium_collector", 0, 54); // TODO
+ //this.heliumStack = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("Helium"));
+ NBTTagList list = nbttagcompound.getTagList("Items", 10);
+ for (int i = 0; i < list.tagCount(); ++i) {
+ NBTTagCompound stackTag = list.getCompoundTagAt(i);
+ int slot = stackTag.getByte("Slot") & 255;
+ this.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(stackTag));
+ }
+ this.progress = nbttagcompound.getInteger("Progress");
+ this.facing = nbttagcompound.getShort("Facing");
+ this.heat = nbttagcompound.getInteger("heat");
+ this.output = nbttagcompound.getShort("output");
+ this.prevActive = (this.active = nbttagcompound.getBoolean("active"));
}
@Override
- public void addEmitHeat(final int heat) {
- this.EmitHeatbuffer += heat;
+ public void writeToNBT(NBTTagCompound nbttagcompound)
+ {
+ super.writeToNBT(nbttagcompound);
+
+ nbttagcompound.setInteger("Progress", this.progress);
+ nbttagcompound.setShort("Facing", (short) this.facing);
+ nbttagcompound.setInteger("heat", this.heat);
+ nbttagcompound.setShort("output", (short)(int)getReactorEnergyOutput());
+ nbttagcompound.setBoolean("active", this.active);
+ /*if(heliumStack != null) {
+ NBTTagCompound produce = new NBTTagCompound();
+ heliumStack.writeToNBT(produce);
+ nbttagcompound.setTag("Helium", produce);
+ }
+ else
+ nbttagcompound.removeTag("Helium");*/
+ NBTTagList list = new NBTTagList();
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ if (this.getStackInSlot(i) != null) {
+ NBTTagCompound stackTag = new NBTTagCompound();
+ stackTag.setByte("Slot", (byte) i);
+ this.getStackInSlot(i).writeToNBT(stackTag);
+ list.appendTag(stackTag);
+ }
+ }
+ nbttagcompound.setTag("Items", list);
}
+
@Override
- public int addHeat(final int amount) {
- this.heat += amount;
- return this.heat;
+ public Packet getDescriptionPacket() {
+ NBTTagCompound tag = new NBTTagCompound();
+ writeToNBT(tag);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, tag);
}
@Override
- public float addOutput(final float energy) {
- return this.output += energy;
+ public void onDataPacket(net.minecraft.network.NetworkManager net, S35PacketUpdateTileEntity packet) {
+ super.onDataPacket(net, packet);
+ readFromNBT(packet.func_148857_g());
}
- public boolean calculateHeatEffects() {
- Utils.LOG_WARNING("calculateHeatEffects");
- if (this.heat < 8000 || !IC2.platform.isSimulating()
- || ConfigUtil.getFloat(MainConfig.get(), "protection/reactorExplosionPowerLimit") <= 0.0F) {
- return false;
- }
- final float power = this.heat / this.maxHeat;
- if (power >= 1.0F) {
- this.explode();
- return true;
- }
- if (power >= 0.85F && this.worldObj.rand.nextFloat() <= 0.2F * this.hem) {
- final int[] coord = this.getRandCoord(2);
- if (coord != null) {
- final Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]);
- if (block.isAir(this.worldObj, coord[0], coord[1], coord[2])) {
- this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7);
- }
- else if (block.getBlockHardness(this.worldObj, coord[0], coord[1], coord[2]) >= 0.0F
- && this.worldObj.getTileEntity(coord[0], coord[1], coord[2]) == null) {
- final Material mat = block.getMaterial();
- if (mat == Material.rock || mat == Material.iron || mat == Material.lava || mat == Material.ground
- || mat == Material.clay) {
- this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.flowing_lava, 15, 7);
- }
- else {
- this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7);
- }
- }
- }
- }
- if (power >= 0.7F) {
- final List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class,
- AxisAlignedBB.getBoundingBox(this.xCoord - 3, this.yCoord - 3, this.zCoord - 3, this.xCoord + 4,
- this.yCoord + 4, this.zCoord + 4));
- for (int l = 0; l < list1.size(); l++) {
- final Entity ent = (Entity) list1.get(l);
- ent.attackEntityFrom(IC2DamageSource.radiation, (int) (this.worldObj.rand.nextInt(4) * this.hem));
- }
- }
- if (power >= 0.5F && this.worldObj.rand.nextFloat() <= this.hem) {
- final int[] coord = this.getRandCoord(2);
- if (coord != null) {
- final Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]);
- if (block.getMaterial() == Material.water) {
- this.worldObj.setBlockToAir(coord[0], coord[1], coord[2]);
- }
- }
- }
- if (power >= 0.4F && this.worldObj.rand.nextFloat() <= this.hem) {
- final int[] coord = this.getRandCoord(2);
- if (coord != null && this.worldObj.getTileEntity(coord[0], coord[1], coord[2]) == null) {
- final Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]);
- final Material mat = block.getMaterial();
- if (mat == Material.wood || mat == Material.leaves || mat == Material.cloth) {
- this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7);
- }
- }
- }
- return false;
- }
@Override
- public void closeInventory() {
+ public int getSizeInventory()
+ {
+ return 19;
}
- // IC2 Nuclear Code
+ @Override
+ public ItemStack getStackInSlot(int slot){
+ return heliumStack;
+ }
@Override
- public ItemStack decrStackSize(final int slot, final int decrement) {
+ public ItemStack decrStackSize(int slot, int decrement){
Utils.LOG_WARNING("decrStackSize");
- if (this.heliumStack == null) {
+ if(heliumStack == null)
return null;
- }
- if (decrement < this.heliumStack.stackSize) {
- final ItemStack take = this.heliumStack.splitStack(decrement);
- if (this.heliumStack.stackSize <= 0) {
- this.heliumStack = null;
- }
+ if(decrement < heliumStack.stackSize){
+ ItemStack take = heliumStack.splitStack(decrement);
+ if(heliumStack.stackSize <= 0)
+ heliumStack = null;
return take;
}
- final ItemStack take = this.heliumStack;
- this.heliumStack = null;
+ ItemStack take = heliumStack;
+ heliumStack = null;
return take;
}
- public void dropAllUnfittingStuff() {
- Utils.LOG_WARNING("dropAllUnfittingStuff");
- for (int i = 0; i < this.reactorSlot.size(); i++) {
- final ItemStack stack = this.reactorSlot.get(i);
- if (stack != null && !this.isUsefulItem(stack, false)) {
- this.reactorSlot.put(i, null);
- this.eject(stack);
- }
- }
- for (int i = this.reactorSlot.size(); i < this.reactorSlot.rawSize(); i++) {
- final ItemStack stack = this.reactorSlot.get(i);
- this.reactorSlot.put(i, null);
- this.eject(stack);
- }
- }
- public void eject(final ItemStack drop) {
- Utils.LOG_WARNING("eject");
- if (!IC2.platform.isSimulating() || drop == null) {
- return;
- }
- final float f = 0.7F;
- final double d = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
- final double d1 = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
- final double d2 = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
- final EntityItem entityitem = new EntityItem(this.worldObj, this.xCoord + d, this.yCoord + d1, this.zCoord + d2,
- drop);
- entityitem.delayBeforeCanPickup = 10;
- this.worldObj.spawnEntityInWorld(entityitem);
- }
@Override
- public void explode() {
- Utils.LOG_WARNING("Explosion");
- // TODO
+ public void openInventory() {}
+ @Override
+ public void closeInventory() {}
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer player)
+ {
+ return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) == this && player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
}
+
@Override
- public Packet getDescriptionPacket() {
- final NBTTagCompound tag = new NBTTagCompound();
- this.writeToNBT(tag);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, -999, tag);
+ public boolean isItemValidForSlot(int slot, ItemStack stack){
+ return false;
}
+
@Override
- public short getFacing() {
- return (short) this.facing;
+ public int getInventoryStackLimit(){
+ return 64;
}
+
@Override
- public int getHeat() {
- return this.heat;
+ public void setInventorySlotContents(int slot, ItemStack stack){
+ heliumStack = stack;
}
+
@Override
- public float getHeatEffectModifier() {
- return this.hem;
+ public ItemStack getStackInSlotOnClosing(int slot){
+ return null;
}
+
/**
* Returns the name of the inventory
*/
@Override
- public String getInventoryName() {
- // return "container.helium_collector";
- return "container.helium_collector";
- }
- @Override
- public int getInventoryStackLimit() {
- return 64;
- }
- @Override
- public ItemStack getItemAt(final int x, final int y) {
- Utils.LOG_WARNING("getItemAt");
- if (x < 0 || x >= this.getReactorSize() || y < 0 || y >= 6) {
- return null;
- }
- return this.reactorSlot.get(x, y);
- }
- @Override
- public int getMaxHeat() {
- return this.maxHeat;
- }
- public double getOfferedEnergy() {
- return this.getReactorEnergyOutput() * 5.0F * 1.0F;
+ public String getInventoryName()
+ {
+ //return "container.helium_collector";
+ return "container.helium_collector";
}
+ /**
+ * Returns if the inventory is named
+ */
@Override
- public ChunkCoordinates getPosition() {
- return new ChunkCoordinates(this.xCoord, this.yCoord, this.zCoord);
+ public boolean hasCustomInventoryName()
+ {
+ return false;
}
- public int[] getRandCoord(final int radius) {
- if (radius <= 0) {
- return null;
- }
- final int[] c = new int[3];
- c[0] = this.xCoord + this.worldObj.rand.nextInt(2 * radius + 1) - radius;
- c[1] = this.yCoord + this.worldObj.rand.nextInt(2 * radius + 1) - radius;
- c[2] = this.zCoord + this.worldObj.rand.nextInt(2 * radius + 1) - radius;
- if (c[0] == this.xCoord && c[1] == this.yCoord && c[2] == this.zCoord) {
- return null;
- }
- return c;
- }
+ //IC2 Nuclear Code
- @Override
- public float getReactorEnergyOutput() {
- return this.output;
- }
- @Override
- public double getReactorEUEnergyOutput() {
- return this.getOfferedEnergy();
- }
+ public Block[][][] surroundings = new Block[5][5][5];
+ public final InvSlotRadiation reactorSlot;
+ public float output = 0.0F;
+ public int updateTicker;
+ public int heat = 5000;
+ public int maxHeat = 100000;
+ public float hem = 1.0F;
+ private int EmitHeatbuffer = 0;
+ public int EmitHeat = 0;
+ private boolean redstone = false;
+ private boolean fluidcoolreactor = false;
+ private boolean active = true;
+ public boolean prevActive = false;
- public short getReactorSize() {
- // Utils.LOG_WARNING("getReactorSize");
+
+ public short getReactorSize()
+ {
+ //Utils.LOG_WARNING("getReactorSize");
if (this.worldObj == null) {
Utils.LOG_WARNING("getReactorSize == 9");
return 9;
}
short cols = 3;
- // Utils.LOG_WARNING("getReactorSize == "+cols);
- for (final Direction direction : Direction.directions) {
- final TileEntity target = direction.applyToTileEntity(this);
- if (target instanceof TileEntityHeliumGenerator) {
- cols = (short) (cols + 1);
- Utils.LOG_WARNING("getReactorSize =1= " + cols);
+ //Utils.LOG_WARNING("getReactorSize == "+cols);
+ for (Direction direction : Direction.directions)
+ {
+ TileEntity target = direction.applyToTileEntity(this);
+ if ((target instanceof TileEntityHeliumGenerator)) {
+ cols = (short)(cols + 1);
+ Utils.LOG_WARNING("getReactorSize =1= "+cols);
}
}
- // Utils.LOG_WARNING("getReactorSize == "+cols);
+ //Utils.LOG_WARNING("getReactorSize == "+cols);
return cols;
}
- @Override
- public int getSizeInventory() {
- return 19;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.heliumStack;
- }
+ protected void updateEntityServer()
+ {
+ Utils.LOG_WARNING("updateEntityServer");
+ super.updateEntity();
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- return null;
- }
+ if (this.updateTicker++ % getTickRate() != 0) {
+ return;
+ }
+ if (!this.worldObj.doChunksNearChunkExist(this.xCoord, this.yCoord, this.zCoord, 2))
+ {
+ this.output = 0.0F;
+ }
+ else
+ {
- @Override
- public int getTickRate() {
- return 20;
- }
+ dropAllUnfittingStuff();
- @Override
- public World getWorld() {
- return this.worldObj;
- }
+ this.output = 0.0F;
+ this.maxHeat = 10000;
+ this.hem = 1.0F;
- @Override
- public ItemStack getWrenchDrop(final EntityPlayer entityPlayer) {
- return new ItemStack(ModBlocks.blockHeliumGenerator, 1);
- }
+ processChambers();
+ this.EmitHeatbuffer = 0;
+ if (calculateHeatEffects()) {
+ return;
+ }
+ setActive((this.heat >= 1000) || (this.output > 0.0F));
- @Override
- public float getWrenchDropRate() {
- return 1F;
+ markDirty();
+ }
+ ((NetworkManager)IC2.network.get()).updateTileEntityField(this, "output");
}
- /**
- * Returns if the inventory is named
- */
@Override
- public boolean hasCustomInventoryName() {
- return false;
+ public void setActive(boolean active1)
+ {
+ Utils.LOG_WARNING("setActive");
+ this.active = active1;
+ if (this.prevActive != active1) {
+ ((NetworkManager)IC2.network.get()).updateTileEntityField(this, "active");
+ }
+ this.prevActive = active1;
}
- @Override
- public boolean isFluidCooled() {
- Utils.LOG_WARNING("isFluidCooled");
- return false;
- }
+ public void dropAllUnfittingStuff()
+ {
+ Utils.LOG_WARNING("dropAllUnfittingStuff");
+ for (int i = 0; i < this.reactorSlot.size(); i++)
+ {
+ ItemStack stack = this.reactorSlot.get(i);
+ if ((stack != null) && (!isUsefulItem(stack, false)))
+ {
+ this.reactorSlot.put(i, null);
+ eject(stack);
+ }
+ }
+ for (int i = this.reactorSlot.size(); i < this.reactorSlot.rawSize(); i++)
+ {
+ ItemStack stack = this.reactorSlot.get(i);
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack stack) {
- return false;
+ this.reactorSlot.put(i, null);
+ eject(stack);
+ }
}
- @Override
- public boolean isUseableByPlayer(final EntityPlayer player) {
- return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) == this
- && player.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D;
+ public void eject(ItemStack drop)
+ {
+ Utils.LOG_WARNING("eject");
+ if ((!IC2.platform.isSimulating()) || (drop == null)) {
+ return;
+ }
+ float f = 0.7F;
+ double d = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
+ double d1 = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
+ double d2 = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
+ EntityItem entityitem = new EntityItem(this.worldObj, this.xCoord + d, this.yCoord + d1, this.zCoord + d2, drop);
+ entityitem.delayBeforeCanPickup = 10;
+ this.worldObj.spawnEntityInWorld(entityitem);
}
- public boolean isUsefulItem(final ItemStack stack, final boolean forInsertion) {
- // Utils.LOG_WARNING("isUsefulItem");
- final Item item = stack.getItem();
- if (forInsertion && this.fluidcoolreactor && item instanceof ItemReactorHeatStorage
- && ((ItemReactorHeatStorage) item).getCustomDamage(stack) > 0) {
+ public boolean isUsefulItem(ItemStack stack, boolean forInsertion)
+ {
+ //Utils.LOG_WARNING("isUsefulItem");
+ Item item = stack.getItem();
+ if ((forInsertion) && (this.fluidcoolreactor) &&
+ ((item instanceof ItemReactorHeatStorage)) &&
+ (((ItemReactorHeatStorage)item).getCustomDamage(stack) > 0)) {
return false;
}
- if (item instanceof IReactorComponent) {
+ if ((item instanceof IReactorComponent)) {
return true;
}
- return item == Ic2Items.TritiumCell.getItem() || item == Ic2Items.reactorDepletedUraniumSimple.getItem()
- || item == Ic2Items.reactorDepletedUraniumDual.getItem()
- || item == Ic2Items.reactorDepletedUraniumQuad.getItem()
- || item == Ic2Items.reactorDepletedMOXSimple.getItem()
- || item == Ic2Items.reactorDepletedMOXDual.getItem()
- || item == Ic2Items.reactorDepletedMOXQuad.getItem();
+ return (item == Ic2Items.TritiumCell.getItem()) || (item == Ic2Items.reactorDepletedUraniumSimple.getItem()) || (item == Ic2Items.reactorDepletedUraniumDual.getItem()) || (item == Ic2Items.reactorDepletedUraniumQuad.getItem()) || (item == Ic2Items.reactorDepletedMOXSimple.getItem()) || (item == Ic2Items.reactorDepletedMOXDual.getItem()) || (item == Ic2Items.reactorDepletedMOXQuad.getItem());
}
- @Override
- public void onDataPacket(final net.minecraft.network.NetworkManager net, final S35PacketUpdateTileEntity packet) {
- super.onDataPacket(net, packet);
- this.readFromNBT(packet.func_148857_g());
+ public boolean calculateHeatEffects()
+ {
+ Utils.LOG_WARNING("calculateHeatEffects");
+ if ((this.heat < 8000) || (!IC2.platform.isSimulating()) || (ConfigUtil.getFloat(MainConfig.get(), "protection/reactorExplosionPowerLimit") <= 0.0F)) {
+ return false;
+ }
+ float power = this.heat / this.maxHeat;
+ if (power >= 1.0F)
+ {
+ explode();
+ return true;
+ }
+ if ((power >= 0.85F) && (this.worldObj.rand.nextFloat() <= 0.2F * this.hem))
+ {
+ int[] coord = getRandCoord(2);
+ if (coord != null)
+ {
+ Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]);
+ if (block.isAir(this.worldObj, coord[0], coord[1], coord[2]))
+ {
+ this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7);
+ }
+ else if ((block.getBlockHardness(this.worldObj, coord[0], coord[1], coord[2]) >= 0.0F) && (this.worldObj.getTileEntity(coord[0], coord[1], coord[2]) == null))
+ {
+ Material mat = block.getMaterial();
+ if ((mat == Material.rock) || (mat == Material.iron) || (mat == Material.lava) || (mat == Material.ground) || (mat == Material.clay)) {
+ this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.flowing_lava, 15, 7);
+ } else {
+ this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7);
+ }
+ }
+ }
+ }
+ if (power >= 0.7F)
+ {
+ List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(this.xCoord - 3, this.yCoord - 3, this.zCoord - 3, this.xCoord + 4, this.yCoord + 4, this.zCoord + 4));
+ for (int l = 0; l < list1.size(); l++)
+ {
+ Entity ent = (Entity)list1.get(l);
+ ent.attackEntityFrom(IC2DamageSource.radiation, (int)(this.worldObj.rand.nextInt(4) * this.hem));
+ }
+ }
+ if ((power >= 0.5F) && (this.worldObj.rand.nextFloat() <= this.hem))
+ {
+ int[] coord = getRandCoord(2);
+ if (coord != null)
+ {
+ Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]);
+ if (block.getMaterial() == Material.water) {
+ this.worldObj.setBlockToAir(coord[0], coord[1], coord[2]);
+ }
+ }
+ }
+ if ((power >= 0.4F) && (this.worldObj.rand.nextFloat() <= this.hem))
+ {
+ int[] coord = getRandCoord(2);
+ if ((coord != null) &&
+ (this.worldObj.getTileEntity(coord[0], coord[1], coord[2]) == null))
+ {
+ Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]);
+ Material mat = block.getMaterial();
+ if ((mat == Material.wood) || (mat == Material.leaves) || (mat == Material.cloth)) {
+ this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7);
+ }
+ }
+ }
+ return false;
}
- @Override
- public void openInventory() {
+ public int[] getRandCoord(int radius)
+ {
+ if (radius <= 0) {
+ return null;
+ }
+ int[] c = new int[3];
+ c[0] = (this.xCoord + this.worldObj.rand.nextInt(2 * radius + 1) - radius);
+ c[1] = (this.yCoord + this.worldObj.rand.nextInt(2 * radius + 1) - radius);
+ c[2] = (this.zCoord + this.worldObj.rand.nextInt(2 * radius + 1) - radius);
+ if ((c[0] == this.xCoord) && (c[1] == this.yCoord) && (c[2] == this.zCoord)) {
+ return null;
+ }
+ return c;
}
- public void processChambers() {
+ public void processChambers()
+ {
Utils.LOG_WARNING("processChambers");
- final int size = this.getReactorSize();
+ int size = getReactorSize();
for (int pass = 0; pass < 6; pass++) {
for (int y = 0; y < 3; y++) {
- for (int x = 0; x < size; x++) {
- final ItemStack stack = this.reactorSlot.get(x, y);
- if (stack != null && stack.getItem() instanceof IReactorComponent) {
- final IReactorComponent comp = (IReactorComponent) stack.getItem();
+ for (int x = 0; x < size; x++)
+ {
+ ItemStack stack = this.reactorSlot.get(x, y);
+ if ((stack != null) && ((stack.getItem() instanceof IReactorComponent)))
+ {
+ IReactorComponent comp = (IReactorComponent)stack.getItem();
comp.processChamber(this, stack, x, y, pass == 0);
}
}
@@ -423,170 +474,175 @@ public class TileEntityHeliumGenerator extends TileEntityInventory implements II
}
@Override
- public boolean produceEnergy() {
- Utils.LOG_WARNING("produceEnergy");
- return this.receiveredstone()
- && ConfigUtil.getFloat(MainConfig.get(), "balance/energy/generator/generator") > 0.0F;
+ public ChunkCoordinates getPosition()
+ {
+ return new ChunkCoordinates(this.xCoord, this.yCoord, this.zCoord);
}
@Override
- public void readFromNBT(final NBTTagCompound nbttagcompound) {
- super.readFromNBT(nbttagcompound);
+ public World getWorld() {
+ return this.worldObj;
+ }
- // this.heliumStack =
- // ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("Helium"));
- final NBTTagList list = nbttagcompound.getTagList("Items", 10);
- for (int i = 0; i < list.tagCount(); ++i) {
- final NBTTagCompound stackTag = list.getCompoundTagAt(i);
- final int slot = stackTag.getByte("Slot") & 255;
- this.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(stackTag));
- }
- this.progress = nbttagcompound.getInteger("Progress");
- this.facing = nbttagcompound.getShort("Facing");
- this.heat = nbttagcompound.getInteger("heat");
- this.output = nbttagcompound.getShort("output");
- this.prevActive = this.active = nbttagcompound.getBoolean("active");
+ @Override
+ public int getHeat() {
+ return this.heat;
}
- public boolean receiveredstone() {
- Utils.LOG_WARNING("receiveRedstone");
- if (this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord) || this.redstone) {
- this.decrStackSize(-1, 1);
- return true;
- }
- return false;
+ @Override
+ public void setHeat(int heat1)
+ {
+ this.heat = heat1;
}
@Override
- public void setActive(final boolean active1) {
- Utils.LOG_WARNING("setActive");
- this.active = active1;
- if (this.prevActive != active1) {
- IC2.network.get().updateTileEntityField(this, "active");
- }
- this.prevActive = active1;
+ public int addHeat(int amount)
+ {
+ this.heat += amount;
+ return this.heat;
}
@Override
- public void setFacing(final short dir) {
- this.facing = dir;
+ public int getMaxHeat()
+ {
+ return this.maxHeat;
}
@Override
- public void setHeat(final int heat1) {
- this.heat = heat1;
+ public void setMaxHeat(int newMaxHeat)
+ {
+ this.maxHeat = newMaxHeat;
}
@Override
- public void setHeatEffectModifier(final float newHEM) {
- this.hem = newHEM;
+ public void addEmitHeat(int heat)
+ {
+ this.EmitHeatbuffer += heat;
}
@Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.heliumStack = stack;
+ public float getHeatEffectModifier()
+ {
+ return this.hem;
}
@Override
- public void setItemAt(final int x, final int y, final ItemStack item) {
- Utils.LOG_WARNING("setItemAt");
- if (x < 0 || x >= this.getReactorSize() || y < 0 || y >= 6) {
- return;
- }
- this.reactorSlot.put(x, y, item);
+ public void setHeatEffectModifier(float newHEM)
+ {
+ this.hem = newHEM;
}
@Override
- public void setMaxHeat(final int newMaxHeat) {
- this.maxHeat = newMaxHeat;
+ public float getReactorEnergyOutput()
+ {
+ return this.output;
}
@Override
- public void setRedstoneSignal(final boolean redstone) {
- this.redstone = redstone;
+ public double getReactorEUEnergyOutput()
+ {
+ return getOfferedEnergy();
}
- public void update2Entity() {
- Utils.LOG_WARNING("updateEntity");
- if (++this.progress >= 40) {
- // if(++progress >= 300){
- if (this.heliumStack == null) {
- this.heliumStack = ItemUtils.getSimpleStack(ModItems.itemHeliumBlob);
- }
- else if (this.heliumStack.getItem() == ModItems.itemHeliumBlob && this.heliumStack.stackSize < 64) {
- this.heliumStack.stackSize++;
- }
- this.progress = 0;
- this.markDirty();
- }
+ public double getOfferedEnergy()
+ {
+ return getReactorEnergyOutput() * 5.0F * 1.0F;
}
@Override
- protected void updateEntityServer() {
- Utils.LOG_WARNING("updateEntityServer");
- super.updateEntity();
+ public float addOutput(float energy)
+ {
+ return this.output += energy;
+ }
- if (this.updateTicker++ % this.getTickRate() != 0) {
- return;
+ @Override
+ public ItemStack getItemAt(int x, int y)
+ {
+ Utils.LOG_WARNING("getItemAt");
+ if ((x < 0) || (x >= getReactorSize()) || (y < 0) || (y >= 6)) {
+ return null;
}
- if (!this.worldObj.doChunksNearChunkExist(this.xCoord, this.yCoord, this.zCoord, 2)) {
- this.output = 0.0F;
+ return this.reactorSlot.get(x, y);
+ }
+
+ @Override
+ public void setItemAt(int x, int y, ItemStack item)
+ {
+ Utils.LOG_WARNING("setItemAt");
+ if ((x < 0) || (x >= getReactorSize()) || (y < 0) || (y >= 6)) {
+ return;
}
- else {
+ this.reactorSlot.put(x, y, item);
+ }
- this.dropAllUnfittingStuff();
+ public TileEntityHeliumGenerator() {
+ this.updateTicker = IC2.random.nextInt(getTickRate());
+ this.reactorSlot = new InvSlotRadiation(this, "helium_collector", 0, 54); //TODO
+ }
- this.output = 0.0F;
- this.maxHeat = 10000;
- this.hem = 1.0F;
+ @Override
+ public void explode() {
+ Utils.LOG_WARNING("Explosion");
+ //TODO
+ }
- this.processChambers();
- this.EmitHeatbuffer = 0;
- if (this.calculateHeatEffects()) {
- return;
- }
- this.setActive(this.heat >= 1000 || this.output > 0.0F);
+ @Override
+ public int getTickRate()
+ {
+ return 20;
+ }
- this.markDirty();
+ public boolean receiveredstone()
+ {
+ Utils.LOG_WARNING("receiveRedstone");
+ if ((this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord)) || (this.redstone)) {
+ decrStackSize(-1, 1);
+ return true;
}
- IC2.network.get().updateTileEntityField(this, "output");
+ return false;
+ }
+
+ @Override
+ public boolean produceEnergy()
+ {
+ Utils.LOG_WARNING("produceEnergy");
+ return (receiveredstone()) && (ConfigUtil.getFloat(MainConfig.get(), "balance/energy/generator/generator") > 0.0F);
}
@Override
- public boolean wrenchCanRemove(final EntityPlayer entityPlayer) {
+ public void setRedstoneSignal(boolean redstone)
+ {
+ this.redstone = redstone;
+ }
+
+ @Override
+ public boolean isFluidCooled() {
+ Utils.LOG_WARNING("isFluidCooled");
+ return false;
+ }
+
+ @Override
+ public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
+ {
return true;
}
@Override
- public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final int side) {
+ public boolean wrenchCanRemove(EntityPlayer entityPlayer)
+ {
return true;
}
@Override
- public void writeToNBT(final NBTTagCompound nbttagcompound) {
- super.writeToNBT(nbttagcompound);
+ public float getWrenchDropRate()
+ {
+ return 1F;
+ }
- nbttagcompound.setInteger("Progress", this.progress);
- nbttagcompound.setShort("Facing", (short) this.facing);
- nbttagcompound.setInteger("heat", this.heat);
- nbttagcompound.setShort("output", (short) (int) this.getReactorEnergyOutput());
- nbttagcompound.setBoolean("active", this.active);
- /*
- * if(heliumStack != null) { NBTTagCompound produce = new
- * NBTTagCompound(); heliumStack.writeToNBT(produce);
- * nbttagcompound.setTag("Helium", produce); } else
- * nbttagcompound.removeTag("Helium");
- */
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < this.getSizeInventory(); ++i) {
- if (this.getStackInSlot(i) != null) {
- final NBTTagCompound stackTag = new NBTTagCompound();
- stackTag.setByte("Slot", (byte) i);
- this.getStackInSlot(i).writeToNBT(stackTag);
- list.appendTag(stackTag);
- }
- }
- nbttagcompound.setTag("Items", list);
+ @Override
+ public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
+ {
+ return new ItemStack(ModBlocks.blockHeliumGenerator, 1);
}
}
diff --git a/src/Java/gtPlusPlus/core/commands/CommandMath.java b/src/Java/gtPlusPlus/core/commands/CommandMath.java
index 97391f3c77..01091d84e3 100644
--- a/src/Java/gtPlusPlus/core/commands/CommandMath.java
+++ b/src/Java/gtPlusPlus/core/commands/CommandMath.java
@@ -1,10 +1,11 @@
package gtPlusPlus.core.commands;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.player.PlayerUtils;
+
import java.util.ArrayList;
import java.util.List;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.player.PlayerUtils;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.Entity;
@@ -13,136 +14,117 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
-public class CommandMath implements ICommand {
- private final List<String> aliases;
- protected String fullEntityName;
- protected Entity conjuredEntity;
+public class CommandMath implements ICommand
+{
+ private final List<String> aliases;
- public CommandMath() {
- this.aliases = new ArrayList<String>();
+ protected String fullEntityName;
+ protected Entity conjuredEntity;
- this.aliases.add("hometele");
+ public CommandMath()
+ {
+ aliases = new ArrayList<String>();
- this.aliases.add("warphome");
+ aliases.add("hometele");
- }
+ aliases.add("warphome");
- @Override
- public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2) {
- // TODO Auto-generated method stub
+ }
- return null;
+ @Override
+ public int compareTo(Object o)
+ {
+ return 0;
- }
+ }
- @Override
- public boolean canCommandSenderUseCommand(final ICommandSender var1) {
- return true;
+ @Override
+ public String getCommandName()
+ {
+ return "bed";
- }
+ }
- @Override
- public int compareTo(final Object o) {
- return 0;
+ @Override
+ public String getCommandUsage(ICommandSender var1)
+ {
+ return "/bed [Teleports you to your bed for XP]";
- }
+ }
- @Override
- public List<String> getCommandAliases() {
+ @Override
+ public List<String> getCommandAliases()
+ {
return this.aliases;
- }
-
- @Override
- public String getCommandName() {
- return "bed";
-
- }
-
- @Override
- public String getCommandUsage(final ICommandSender var1) {
- return "/bed [Teleports you to your bed for XP]";
-
- }
-
- @Override
- public boolean isUsernameIndex(final String[] var1, final int var2) {
- // TODO Auto-generated method stub
-
- return false;
-
- }
-
- public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost) {
-
- return true;
- }
+ }
- @Override
- public void processCommand(final ICommandSender S, final String[] argString) {
- final World W = S.getEntityWorld();
- final CommandUtils C = new CommandUtils();
- final EntityPlayer P = C.getPlayer(S);
- // System.out.println(P.getCommandSenderName());
- // System.out.println(P.getDisplayName());
- if (W.isRemote)
+ public void processCommand(ICommandSender S, String[] argString)
+ {
+ World W = S.getEntityWorld();
+ CommandUtils C = new CommandUtils();
+ EntityPlayer P = C.getPlayer(S);
+ //System.out.println(P.getCommandSenderName());
+ //System.out.println(P.getDisplayName());
+ if (W.isRemote)
- {
+ {
- System.out.println("Not processing on Client side");
+ System.out.println("Not processing on Client side");
- }
+ }
- else
+ else
- {
+ {
- System.out.println("Processing on Server side - Home Teleport engaged by: " + P.getDisplayName());
+ System.out.println("Processing on Server side - Home Teleport engaged by: "+P.getDisplayName());
- final int XP_TOTAL = P.experienceTotal;
+ int XP_TOTAL = P.experienceTotal;
Utils.LOG_WARNING("Total Xp:" + XP_TOTAL);
- final ChunkCoordinates X = P.getPlayerCoordinates();
- Utils.LOG_WARNING("Player Location: " + X);
+ ChunkCoordinates X = P.getPlayerCoordinates();
+ Utils.LOG_WARNING("Player Location: "+X);
ChunkCoordinates Y = null;
- Utils.LOG_WARNING("Bed Location: " + Y);
+ Utils.LOG_WARNING("Bed Location: "+Y);
try {
- if (P.getBedLocation(0).equals(null)) {
+ if (P.getBedLocation(0).equals(null)){
Y = W.getSpawnPoint();
- Utils.LOG_WARNING("Spawn Location: " + Y);
- }
- else if (!P.getBedLocation(0).equals(null)) {
+ Utils.LOG_WARNING("Spawn Location: "+Y);
+ }
+ else if (!P.getBedLocation(0).equals(null)){
Y = P.getBedLocation(0);
- Utils.LOG_WARNING("Bed Location: " + Y);
+ Utils.LOG_WARNING("Bed Location: "+Y);
}
else {
Y = W.getSpawnPoint();
- Utils.LOG_WARNING("Spawn Location: " + Y);
+ Utils.LOG_WARNING("Spawn Location: "+Y);
}
}
- catch (final NullPointerException e) {
- PlayerUtils.messagePlayer(P, "You do not have a spawn, so...");
+ catch(NullPointerException e) {
+ PlayerUtils.messagePlayer(P, "You do not have a spawn, so...");
}
if (Y == null || Y.equals(null)) {
Y = W.getSpawnPoint();
- Utils.LOG_WARNING("Spawn Location: " + Y);
+ Utils.LOG_WARNING("Spawn Location: "+Y);
}
- final int x1 = X.posX;
- Utils.LOG_WARNING("X1: " + x1);
- final int x2 = Y.posX;
- Utils.LOG_WARNING("X2: " + x2);
- final int y1 = X.posY;
- Utils.LOG_WARNING("Y1: " + y1);
- final int y2 = Y.posY;
- Utils.LOG_WARNING("Y2: " + y2);
- final int z1 = X.posZ;
- Utils.LOG_WARNING("Z1: " + z1);
- final int z2 = Y.posZ;
- Utils.LOG_WARNING("Z2: " + z2);
-
- final double d = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1) + (z2 - z1) * (z2 - z1));
- final String xpCost = String.valueOf((int) (d * 0.15));
+ int x1 = X.posX;
+ Utils.LOG_WARNING("X1: "+x1);
+ int x2 = Y.posX;
+ Utils.LOG_WARNING("X2: "+x2);
+ int y1 = X.posY;
+ Utils.LOG_WARNING("Y1: "+y1);
+ int y2 = Y.posY;
+ Utils.LOG_WARNING("Y2: "+y2);
+ int z1 = X.posZ;
+ Utils.LOG_WARNING("Z1: "+z1);
+ int z2 = Y.posZ;
+ Utils.LOG_WARNING("Z2: "+z2);
+
+
+ double d = Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)+(z2-z1)*(z2-z1));
+ String xpCost = String.valueOf((int)(d*0.15));
Utils.LOG_WARNING("d:" + d);
Utils.LOG_WARNING("-----------------------------------------");
@@ -150,36 +132,34 @@ public class CommandMath implements ICommand {
Utils.LOG_WARNING(String.valueOf(d));
Utils.LOG_WARNING("-----------------------------------------");
Utils.LOG_WARNING("Xp Cost based on answer B.");
- Utils.LOG_WARNING(String.valueOf(d * 0.15) + " | " + String.valueOf(xpCost));
+ Utils.LOG_WARNING(String.valueOf(d*0.15) + " | " + String.valueOf(xpCost));
Utils.LOG_WARNING("-----------------------------------------");
Utils.LOG_WARNING("Xp Total");
Utils.LOG_WARNING(String.valueOf(XP_TOTAL));
Utils.LOG_WARNING("-----------------------------------------");
- if (XP_TOTAL - Float.valueOf(xpCost) > 0) {
- final EntityXPOrb E = new EntityXPOrb(W, P.posX, P.posY + 1.62D - P.yOffset, P.posZ, 1);
- // E.moveTowards((double) Y.posX + 0.5D, (int) Y.posY + 3,
- // (double) Y.posZ + 0.5D);
- E.setVelocity(Y.posX + 0.5D, Y.posY + 0.1, Y.posZ + 0.5D);
+
+
+ if ((XP_TOTAL-Float.valueOf(xpCost)) > 0){
+ EntityXPOrb E = new EntityXPOrb(W, P.posX, P.posY + 1.62D - (double) P.yOffset, P.posZ, 1);
+ //E.moveTowards((double) Y.posX + 0.5D, (int) Y.posY + 3, (double) Y.posZ + 0.5D);
+ E.setVelocity((double) Y.posX + 0.5D, (int) Y.posY + 0.1, (double) Y.posZ + 0.5D);
W.spawnEntityInWorld(E);
W.playAuxSFXAtEntity((EntityPlayer) null, 1002, (int) P.posX, (int) P.posY, (int) P.posZ, 0);
- P.setPositionAndUpdate(x2, y2 + 1, z2);
+ P.setPositionAndUpdate(x2, y2+1, z2);
- // gregtech.api.util.GT_Utility.sendChatToPlayer(P, "Movement |
- // X:"+x2+" | Y:"+y2+" | Z:"+z2);
- gregtech.api.util.GT_Utility.sendChatToPlayer(P,
- "Distance Traveled | " + String.valueOf((int) d) + " Blocks & " + xpCost + "xp");
+ //gregtech.api.util.GT_Utility.sendChatToPlayer(P, "Movement | X:"+x2+" | Y:"+y2+" | Z:"+z2);
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, "Distance Traveled | "+String.valueOf((int)(d)) + " Blocks & " + xpCost + "xp");
gregtech.api.util.GT_Utility.sendChatToPlayer(P, "You suddenly feel at home.");
- P.experienceTotal = (int) (XP_TOTAL - Float.valueOf(xpCost));
- if (!xpCost.equals("0") && Float.valueOf(xpCost) > 0) {
- gregtech.api.util.GT_Utility.sendChatToPlayer(P, "...At the loss of " + xpCost + " xp.");
+ P.experienceTotal = (int) (XP_TOTAL-Float.valueOf(xpCost));
+ if (!xpCost.equals("0") && Float.valueOf(xpCost) > 0){
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, "...At the loss of "+xpCost+" xp.");
}
- else if (xpCost.equals("0")) {
+ else if (xpCost.equals("0")){
gregtech.api.util.GT_Utility.sendChatToPlayer(P, "...At the loss of very little xp.");
}
else {
- gregtech.api.util.GT_Utility.sendChatToPlayer(P,
- "Something went wrong with the math, have this one on the house. :)");
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, "Something went wrong with the math, have this one on the house. :)");
}
}
@@ -188,6 +168,39 @@ public class CommandMath implements ICommand {
}
}
+ }
+
+ @Override
+ public boolean canCommandSenderUseCommand(ICommandSender var1)
+ {
+ return true;
+
+ }
+
+ @Override
+ public List<?> addTabCompletionOptions(ICommandSender var1, String[] var2)
+ {
+ // TODO Auto-generated method stub
+
+ return null;
+
+ }
+
+ @Override
+ public boolean isUsernameIndex(String[] var1, int var2)
+ {
+ // TODO Auto-generated method stub
+
+ return false;
+
+ }
+
+ public boolean playerUsesCommand(World W, EntityPlayer P, int cost)
+ {
+
+
+ return true;
}
}
+
diff --git a/src/Java/gtPlusPlus/core/commands/CommandUtils.java b/src/Java/gtPlusPlus/core/commands/CommandUtils.java
index cbeaf6c369..32e7a75370 100644
--- a/src/Java/gtPlusPlus/core/commands/CommandUtils.java
+++ b/src/Java/gtPlusPlus/core/commands/CommandUtils.java
@@ -5,16 +5,16 @@ import net.minecraft.entity.player.EntityPlayer;
public class CommandUtils {
- public EntityPlayer getPlayer(final ICommandSender icommandsender) {
+ public EntityPlayer getPlayer(ICommandSender icommandsender){
EntityPlayer player;
- if (icommandsender instanceof EntityPlayer) {
- player = (EntityPlayer) icommandsender;
+ if(icommandsender instanceof EntityPlayer){
+ player = (EntityPlayer)icommandsender;
return player;
}
else {
return null;
}
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java
index afaf055da3..53c4256ed6 100644
--- a/src/Java/gtPlusPlus/core/common/CommonProxy.java
+++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java
@@ -1,12 +1,11 @@
package gtPlusPlus.core.common;
-import java.util.Iterator;
-
-import cpw.mods.fml.common.FMLCommonHandler;
-import cpw.mods.fml.common.event.*;
+import static gtPlusPlus.core.lib.CORE.DEBUG;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.handler.*;
+import gtPlusPlus.core.handler.COMPAT_HANDLER;
+import gtPlusPlus.core.handler.COMPAT_IntermodStaging;
+import gtPlusPlus.core.handler.GuiHandler;
import gtPlusPlus.core.handler.events.PickaxeBlockBreakEventHandler;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
@@ -17,110 +16,119 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.debug.DEBUG_INIT;
import gtPlusPlus.core.util.player.PlayerCache;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+
+import java.util.Iterator;
+
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.oredict.OreDictionary;
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.event.FMLServerStartingEvent;
public class CommonProxy {
-
- private static void handleGtIntegrationInit() {
- Utils.LOG_INFO("Setting up our own GT_Proxy.");
- final Meta_GT_Proxy GtProxy = new Meta_GT_Proxy();
- for (final String tOreName : OreDictionary.getOreNames()) {
- ItemStack tOreStack;
- Utils.LOG_INFO("Iterating list of GT materials for custom tool parts.");
- for (final Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); GtProxy
- .registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
- Utils.LOG_INFO("Iterating Material");
- tOreStack = (ItemStack) i$.next();
- }
- }
- }
-
- public CommonProxy() {
- // Should Register Gregtech Materials I've Made
+
+ public CommonProxy(){
+ //Should Register Gregtech Materials I've Made
MinecraftForge.EVENT_BUS.register(this);
FMLCommonHandler.instance().bus().register(this);
- if (LoadedMods.Gregtech) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ if (LoadedMods.Gregtech){
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
Utils.LOG_INFO("We're using Gregtech 5.09 Experimental.");
}
else {
Utils.LOG_INFO("We're using Gregtech 5.08 or an equivalent fork.");
}
- CommonProxy.handleGtIntegrationInit();
+ handleGtIntegrationInit();
}
}
-
- @SuppressWarnings("static-method")
- public int addArmor(final String armor) {
- return 0;
+ private static void handleGtIntegrationInit(){
+ Utils.LOG_INFO("Setting up our own GT_Proxy.");
+ Meta_GT_Proxy GtProxy = new Meta_GT_Proxy();
+ for (String tOreName : OreDictionary.getOreNames()) {
+ ItemStack tOreStack;
+ Utils.LOG_INFO("Iterating list of GT materials for custom tool parts.");
+ for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); GtProxy.registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
+ Utils.LOG_INFO("Iterating Material");
+ tOreStack = (ItemStack) i$.next();
+ }
+ }
}
- public void generateMysteriousParticles(final Entity theEntity) {
+ public void preInit(FMLPreInitializationEvent e) {
+ Utils.LOG_INFO("Doing some house cleaning.");
+ LoadedMods.checkLoaded();
+ Utils.LOG_INFO("Making sure we're ready to party!");
+
+
+ if (!DEBUG){
+ Utils.LOG_WARNING("Development mode not enabled.");
+ }
+ else if (DEBUG){
+ Utils.LOG_INFO("Development mode enabled.");
+ }
+ else {
+ Utils.LOG_WARNING("Development mode not set.");
+ }
+ AddToCreativeTab.initialiseTabs();
+ COMPAT_IntermodStaging.preInit();
+ //Apparently I should do this here. Might put it in Init for a test.
+ //Growthcraft_Handler.run();
}
- public void init(final FMLInitializationEvent e) {
- // Debug Loading
- if (CORE.DEBUG) {
- DEBUG_INIT.registerHandlers();
- }
+ public void init(FMLInitializationEvent e) {
+ //Debug Loading
+ if (CORE.DEBUG){
+ DEBUG_INIT.registerHandlers();
+ }
ModItems.init();
ModBlocks.init();
RECIPE_CONSTANTS.initialise();
MinecraftForge.EVENT_BUS.register(new PickaxeBlockBreakEventHandler());
-
- // Compat Handling
+
+ //Compat Handling
COMPAT_HANDLER.registerMyModsOreDictEntries();
COMPAT_HANDLER.intermodOreDictionarySupport();
COMPAT_IntermodStaging.init();
}
- public void postInit(final FMLPostInitializationEvent e) {
+ public void postInit(FMLPostInitializationEvent e) {
Utils.LOG_INFO("Cleaning up, doing postInit.");
- PlayerCache.initCache();
- // Compat Handling
+ PlayerCache.initCache();
+ //Compat Handling
COMPAT_HANDLER.InitialiseHandlerThenAddRecipes();
COMPAT_HANDLER.RemoveRecipesFromOtherMods();
COMPAT_HANDLER.startLoadingGregAPIBasedRecipes();
COMPAT_IntermodStaging.postInit();
}
-
- public void preInit(final FMLPreInitializationEvent e) {
- Utils.LOG_INFO("Doing some house cleaning.");
- LoadedMods.checkLoaded();
- Utils.LOG_INFO("Making sure we're ready to party!");
-
- if (!CORE.DEBUG) {
- Utils.LOG_WARNING("Development mode not enabled.");
- }
- else if (CORE.DEBUG) {
- Utils.LOG_INFO("Development mode enabled.");
- }
- else {
- Utils.LOG_WARNING("Development mode not set.");
- }
- AddToCreativeTab.initialiseTabs();
- COMPAT_IntermodStaging.preInit();
- // Apparently I should do this here. Might put it in Init for a test.
- // Growthcraft_Handler.run();
+
+
+ public void serverStarting(FMLServerStartingEvent e)
+ {
+ COMPAT_HANDLER.InitialiseLateHandlerThenAddRecipes();
}
- public void registerNetworkStuff() {
+ public void registerNetworkStuff(){
GuiHandler.init();
}
+ public void registerTileEntities(){
+ ModTileEntities.init();
+ }
+
public void registerRenderThings() {
}
- public void registerTileEntities() {
- ModTileEntities.init();
+ @SuppressWarnings("static-method")
+ public int addArmor(String armor) {
+ return 0;
}
+
+ public void generateMysteriousParticles(Entity theEntity) { }
- public void serverStarting(final FMLServerStartingEvent e) {
- COMPAT_HANDLER.InitialiseLateHandlerThenAddRecipes();
- }
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
index ad253d116f..634fbe47d2 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
@@ -8,24 +8,24 @@ import gtPlusPlus.core.util.Utils;
public class COMPAT_Baubles {
- public static void baublesLoaded() {
+ public static void run(){
+ if (LoadedMods.Baubles){
+ baublesLoaded();
+ }
+ else {
+ baublesNotLoaded();
+ }
+ }
+
+ public static void baublesLoaded(){
Utils.LOG_INFO("Baubles Found - Loading Wearables.");
ModItems.itemPersonalCloakingDevice = new ItemCloakingDevice(0);
- // itemPersonalCloakingDeviceCharged = new ItemCloakingDevice(0).set;
+ //itemPersonalCloakingDeviceCharged = new ItemCloakingDevice(0).set;
ModItems.itemPersonalHealingDevice = new ItemHealingDevice();
}
-
- public static void baublesNotLoaded() {
+
+ public static void baublesNotLoaded(){
Utils.LOG_INFO("Baubles Not Found - Skipping Resources.");
}
-
- public static void run() {
- if (LoadedMods.Baubles) {
- COMPAT_Baubles.baublesLoaded();
- }
- else {
- COMPAT_Baubles.baublesNotLoaded();
- }
- }
-
+
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java
index 76b229f315..7f4aa0541a 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java
@@ -6,14 +6,14 @@ import net.minecraft.item.ItemStack;
public class COMPAT_BigReactors {
- public static void OreDict() {
- COMPAT_BigReactors.run();
+ public static void OreDict(){
+ run();
}
-
- private static final void run() {
+
+ private static final void run(){
GT_OreDictUnificator.registerOre("plateBlutonium", new ItemStack(ModItems.itemPlateBlutonium));
GT_OreDictUnificator.registerOre("plateCyanite", new ItemStack(ModItems.itemPlateCyanite));
GT_OreDictUnificator.registerOre("plateLudicrite", new ItemStack(ModItems.itemPlateLudicrite));
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java
index 26ee8cd3c1..c64e332c50 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java
@@ -1,171 +1,171 @@
package gtPlusPlus.core.common.compat;
-import gtPlusPlus.core.handler.COMPAT_HANDLER;
+import static gtPlusPlus.core.handler.COMPAT_HANDLER.AddRecipeQueue;
+import static gtPlusPlus.core.handler.COMPAT_HANDLER.RemoveRecipeQueue;
import gtPlusPlus.core.recipe.ShapedRecipeObject;
import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.item.ItemStack;
+
+
public class COMPAT_CompactWindmills {
- // Change IC2 Upgrades
- public static ItemStack kineticWind = ItemUtils.simpleMetaStack("IC2:blockKineticGenerator", 0, 1);
- public static ItemStack shaftIron = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 11, 1);
- public static ItemStack cableCopper = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 1367,
- 1);
- public static String plateRubber = "ore:plateRubber";
-
- // Machine Casings
- public static ItemStack elvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 0, 1);
- public static ItemStack lvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 1, 1);
- public static ItemStack mvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 2, 1);
- public static ItemStack hvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 3, 1);
- public static ItemStack evCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 4, 1);
- public static ItemStack ivCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 5, 1);
-
- // GT Transformers
- public static ItemStack elvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 20, 1);
- public static ItemStack lvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 21, 1);
- public static ItemStack mvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 22, 1);
- public static ItemStack hvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 23, 1);
- public static ItemStack evTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 24, 1);
-
- // Compact Windmills
- public static ItemStack elvWindmill = ItemUtils
- .simpleMetaStack("CompactWindmills:blockCompactWindmill", 0, 1);
- public static ItemStack lvWindmill = ItemUtils
- .simpleMetaStack("CompactWindmills:blockCompactWindmill", 1, 1);
- public static ItemStack mvWindmill = ItemUtils
- .simpleMetaStack("CompactWindmills:blockCompactWindmill", 2, 1);
- public static ItemStack hvWindmill = ItemUtils
- .simpleMetaStack("CompactWindmills:blockCompactWindmill", 3, 1);
- public static ItemStack evWindmill = ItemUtils
- .simpleMetaStack("CompactWindmills:blockCompactWindmill", 4, 1);
-
- // Compact Rotors
- public static ItemStack rotor2 = ItemUtils.getItemStack("CompactWindmills:WOOL", 1);
- public static ItemStack rotor1 = ItemUtils.getItemStack("CompactWindmills:WOOD", 1);
- public static ItemStack rotor3 = ItemUtils.getItemStack("CompactWindmills:ALLOY", 1);
- public static ItemStack rotor4 = ItemUtils.getItemStack("CompactWindmills:CARBON", 1);
- public static ItemStack rotor5 = ItemUtils.getItemStack("CompactWindmills:IRIDIUM", 1);
-
- // IC2 Rotors
- public static ItemStack rotorIC1 = ItemUtils.getItemStack("IC2:itemwoodrotor", 1);
- public static ItemStack rotorIC2 = ItemUtils.getItemStack("IC2:itemironrotor", 1);
- public static ItemStack rotorIC3 = ItemUtils.getItemStack("IC2:itemsteelrotor", 1);
- public static ItemStack rotorIC4 = ItemUtils.getItemStack("IC2:itemwcarbonrotor", 1);
- public static ItemStack rotorBlade1 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 7, 1);
- public static ItemStack rotorBlade2 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 8, 1);
- public static ItemStack rotorBlade3 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 10, 1);
- public static ItemStack rotorBlade4 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 9, 1);
-
- // Plates
- public static String plateTier1 = "ore:plateMagnalium";
- public static String plateTier2 = "ore:plateStainlessSteel";
- public static String plateTier3 = "ore:plateTitanium";
- public static String plateTier4 = "ore:plateTungstenSteel";
- public static String plateTier5 = "ore:plateNichrome";
- public static String plateCarbon = "ore:plateAlloyCarbon";
- public static String plateAlloy = "ore:plateAlloyAdvanced";
-
- // Circuits
- public static String circuitTier1 = "ore:circuitGood";
- public static String circuitTier2 = "ore:circuitAdvanced";
- public static String circuitTier3 = "ore:circuitData";
- public static String circuitTier4 = "ore:circuitElite";
- public static String circuitTier5 = "ore:circuitMaster";
-
- // Wooden Rotor
- public static ShapedRecipeObject Wooden_Rotor = new ShapedRecipeObject(COMPAT_CompactWindmills.rotorBlade1,
- "ore:plateAnyIron", "ore:plateAnyIron", "ore:screwAluminium", COMPAT_CompactWindmills.rotorIC1,
- "ore:screwAluminium", COMPAT_CompactWindmills.rotorBlade1, "plateAnyIron",
- COMPAT_CompactWindmills.rotorBlade1, COMPAT_CompactWindmills.rotor1);
- // Alloy Rotor
- public static ShapedRecipeObject Alloy_Rotor = new ShapedRecipeObject(COMPAT_CompactWindmills.plateAlloy,
- COMPAT_CompactWindmills.plateAlloy, COMPAT_CompactWindmills.plateAlloy, COMPAT_CompactWindmills.plateAlloy,
- COMPAT_CompactWindmills.rotorIC3, COMPAT_CompactWindmills.plateAlloy, COMPAT_CompactWindmills.plateAlloy,
- COMPAT_CompactWindmills.plateAlloy, COMPAT_CompactWindmills.plateAlloy, COMPAT_CompactWindmills.rotor3);
- // Carbon Rotor
- public static ShapedRecipeObject Carbon_Rotor = new ShapedRecipeObject(COMPAT_CompactWindmills.plateCarbon,
- COMPAT_CompactWindmills.rotorBlade4, COMPAT_CompactWindmills.plateCarbon,
- COMPAT_CompactWindmills.rotorBlade4, COMPAT_CompactWindmills.rotor3, COMPAT_CompactWindmills.rotorBlade4,
- COMPAT_CompactWindmills.plateCarbon, COMPAT_CompactWindmills.rotorBlade4,
- COMPAT_CompactWindmills.plateCarbon, COMPAT_CompactWindmills.rotor4);
-
- // Kinetic Wind Turbine
- public static ShapedRecipeObject KWT = new ShapedRecipeObject(COMPAT_CompactWindmills.plateCarbon,
- COMPAT_CompactWindmills.shaftIron, COMPAT_CompactWindmills.plateCarbon, COMPAT_CompactWindmills.cableCopper,
- COMPAT_CompactWindmills.mvCasing, COMPAT_CompactWindmills.cableCopper, COMPAT_CompactWindmills.plateRubber,
- COMPAT_CompactWindmills.plateCarbon, COMPAT_CompactWindmills.plateRubber,
- COMPAT_CompactWindmills.kineticWind);
-
- // ELV Windmill
- public static ShapedRecipeObject WM_ELV = new ShapedRecipeObject(
-
- COMPAT_CompactWindmills.circuitTier1, COMPAT_CompactWindmills.elvTransformer,
- COMPAT_CompactWindmills.circuitTier1, COMPAT_CompactWindmills.plateTier1, COMPAT_CompactWindmills.lvCasing,
- COMPAT_CompactWindmills.plateTier1, COMPAT_CompactWindmills.plateTier1, COMPAT_CompactWindmills.rotor1,
- COMPAT_CompactWindmills.plateTier1, COMPAT_CompactWindmills.elvWindmill);
-
- // LV Windmill
- public static ShapedRecipeObject WM_LV = new ShapedRecipeObject(COMPAT_CompactWindmills.circuitTier2,
- COMPAT_CompactWindmills.lvTransformer, COMPAT_CompactWindmills.circuitTier2,
- COMPAT_CompactWindmills.plateTier2, COMPAT_CompactWindmills.mvCasing, COMPAT_CompactWindmills.plateTier2,
- COMPAT_CompactWindmills.plateTier2, COMPAT_CompactWindmills.rotor2, COMPAT_CompactWindmills.plateTier2,
- COMPAT_CompactWindmills.lvWindmill);
-
- // MV Windmill
- public static ShapedRecipeObject WM_MV = new ShapedRecipeObject(COMPAT_CompactWindmills.circuitTier3,
- COMPAT_CompactWindmills.mvTransformer, COMPAT_CompactWindmills.circuitTier3,
- COMPAT_CompactWindmills.plateTier3, COMPAT_CompactWindmills.hvCasing, COMPAT_CompactWindmills.plateTier3,
- COMPAT_CompactWindmills.plateTier3, COMPAT_CompactWindmills.rotor3, COMPAT_CompactWindmills.plateTier3,
- COMPAT_CompactWindmills.mvWindmill);
-
- // HV Windmill
- public static ShapedRecipeObject WM_HV = new ShapedRecipeObject(COMPAT_CompactWindmills.circuitTier4,
- COMPAT_CompactWindmills.hvTransformer, COMPAT_CompactWindmills.circuitTier4,
- COMPAT_CompactWindmills.plateTier4, COMPAT_CompactWindmills.evCasing, COMPAT_CompactWindmills.plateTier4,
- COMPAT_CompactWindmills.plateTier4, COMPAT_CompactWindmills.rotor4, COMPAT_CompactWindmills.plateTier4,
- COMPAT_CompactWindmills.hvWindmill);
-
- // EV Windmill
- public static ShapedRecipeObject WM_EV = new ShapedRecipeObject(COMPAT_CompactWindmills.circuitTier5,
- COMPAT_CompactWindmills.evTransformer, COMPAT_CompactWindmills.circuitTier5,
- COMPAT_CompactWindmills.plateTier5, COMPAT_CompactWindmills.ivCasing, COMPAT_CompactWindmills.plateTier5,
- COMPAT_CompactWindmills.plateTier5, COMPAT_CompactWindmills.rotor5, COMPAT_CompactWindmills.plateTier5,
- COMPAT_CompactWindmills.evWindmill);
-
- public static void OreDict() {
- COMPAT_CompactWindmills.run();
+ //Change IC2 Upgrades
+ public static ItemStack kineticWind = ItemUtils.simpleMetaStack("IC2:blockKineticGenerator", 0, 1);
+ public static ItemStack shaftIron = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 11, 1);
+ public static ItemStack cableCopper = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 1367, 1);
+ public static String plateRubber = "ore:plateRubber";
+
+ //Machine Casings
+ public static ItemStack elvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 0, 1);
+ public static ItemStack lvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 1, 1);
+ public static ItemStack mvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 2, 1);
+ public static ItemStack hvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 3, 1);
+ public static ItemStack evCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 4, 1);
+ public static ItemStack ivCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 5, 1);
+
+ //GT Transformers
+ public static ItemStack elvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 20, 1);
+ public static ItemStack lvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 21, 1);
+ public static ItemStack mvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 22, 1);
+ public static ItemStack hvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 23, 1);
+ public static ItemStack evTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 24, 1);
+
+ //Compact Windmills
+ public static ItemStack elvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 0, 1);
+ public static ItemStack lvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 1, 1);
+ public static ItemStack mvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 2, 1);
+ public static ItemStack hvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 3, 1);
+ public static ItemStack evWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 4, 1);
+
+ //Compact Rotors
+ public static ItemStack rotor2 = ItemUtils.getItemStack("CompactWindmills:WOOL", 1);
+ public static ItemStack rotor1 = ItemUtils.getItemStack("CompactWindmills:WOOD", 1);
+ public static ItemStack rotor3 = ItemUtils.getItemStack("CompactWindmills:ALLOY", 1);
+ public static ItemStack rotor4 = ItemUtils.getItemStack("CompactWindmills:CARBON", 1);
+ public static ItemStack rotor5 = ItemUtils.getItemStack("CompactWindmills:IRIDIUM", 1);
+
+ //IC2 Rotors
+ public static ItemStack rotorIC1 = ItemUtils.getItemStack("IC2:itemwoodrotor", 1);
+ public static ItemStack rotorIC2 = ItemUtils.getItemStack("IC2:itemironrotor", 1);
+ public static ItemStack rotorIC3 = ItemUtils.getItemStack("IC2:itemsteelrotor", 1);
+ public static ItemStack rotorIC4 = ItemUtils.getItemStack("IC2:itemwcarbonrotor", 1);
+ public static ItemStack rotorBlade1 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 7, 1);
+ public static ItemStack rotorBlade2 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 8, 1);
+ public static ItemStack rotorBlade3 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 10, 1);
+ public static ItemStack rotorBlade4 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 9, 1);
+
+ //Plates
+ public static String plateTier1 = "ore:plateMagnalium";
+ public static String plateTier2 = "ore:plateStainlessSteel";
+ public static String plateTier3 = "ore:plateTitanium";
+ public static String plateTier4 = "ore:plateTungstenSteel";
+ public static String plateTier5 = "ore:plateNichrome";
+ public static String plateCarbon = "ore:plateAlloyCarbon";
+ public static String plateAlloy = "ore:plateAlloyAdvanced";
+
+ //Circuits
+ public static String circuitTier1 = "ore:circuitGood";
+ public static String circuitTier2 = "ore:circuitAdvanced";
+ public static String circuitTier3 = "ore:circuitData";
+ public static String circuitTier4 = "ore:circuitElite";
+ public static String circuitTier5 = "ore:circuitMaster";
+
+ //Wooden Rotor
+ public static ShapedRecipeObject Wooden_Rotor = new ShapedRecipeObject(
+ rotorBlade1, "ore:plateAnyIron", "ore:plateAnyIron",
+ "ore:screwAluminium", rotorIC1, "ore:screwAluminium",
+ rotorBlade1, "plateAnyIron", rotorBlade1,
+ rotor1);
+ //Alloy Rotor
+ public static ShapedRecipeObject Alloy_Rotor = new ShapedRecipeObject(
+ plateAlloy, plateAlloy, plateAlloy,
+ plateAlloy, rotorIC3, plateAlloy,
+ plateAlloy,plateAlloy, plateAlloy,
+ rotor3);
+ //Carbon Rotor
+ public static ShapedRecipeObject Carbon_Rotor = new ShapedRecipeObject(
+ plateCarbon, rotorBlade4, plateCarbon,
+ rotorBlade4, rotor3, rotorBlade4,
+ plateCarbon, rotorBlade4, plateCarbon,
+ rotor4);
+
+ //Kinetic Wind Turbine
+ public static ShapedRecipeObject KWT = new ShapedRecipeObject(
+ plateCarbon, shaftIron, plateCarbon,
+ cableCopper, mvCasing, cableCopper,
+ plateRubber, plateCarbon, plateRubber,
+ kineticWind);
+
+ //ELV Windmill
+ public static ShapedRecipeObject WM_ELV = new ShapedRecipeObject(
+
+ circuitTier1, elvTransformer, circuitTier1,
+ plateTier1, lvCasing, plateTier1,
+ plateTier1, rotor1, plateTier1,
+ elvWindmill);
+
+
+ //LV Windmill
+ public static ShapedRecipeObject WM_LV = new ShapedRecipeObject(
+ circuitTier2, lvTransformer, circuitTier2,
+ plateTier2, mvCasing, plateTier2,
+ plateTier2, rotor2, plateTier2,
+ lvWindmill);
+
+ //MV Windmill
+ public static ShapedRecipeObject WM_MV = new ShapedRecipeObject(
+ circuitTier3, mvTransformer, circuitTier3,
+ plateTier3, hvCasing, plateTier3,
+ plateTier3, rotor3, plateTier3,
+ mvWindmill);
+
+ //HV Windmill
+ public static ShapedRecipeObject WM_HV = new ShapedRecipeObject(
+ circuitTier4, hvTransformer, circuitTier4,
+ plateTier4, evCasing, plateTier4,
+ plateTier4, rotor4, plateTier4,
+ hvWindmill);
+
+ //EV Windmill
+ public static ShapedRecipeObject WM_EV = new ShapedRecipeObject(
+ circuitTier5, evTransformer, circuitTier5,
+ plateTier5, ivCasing, plateTier5,
+ plateTier5, rotor5, plateTier5,
+ evWindmill);
+
+ public static void OreDict(){
+ run();
}
- private static final void run() {
- // RemoveRecipeQueue.add("CompactWindmills:WOOL");
- // RemoveRecipeQueue.add("CompactWindmills:WOOD");
- // RemoveRecipeQueue.add("CompactWindmills:ALLOY");
- // RemoveRecipeQueue.add("CompactWindmills:CARBON");
- // RemoveRecipeQueue.add("CompactWindmills:IRIDIUM");
-
- // Remove Recipes
- COMPAT_HANDLER.RemoveRecipeQueue.add(COMPAT_CompactWindmills.kineticWind);
- COMPAT_HANDLER.RemoveRecipeQueue.add(COMPAT_CompactWindmills.elvWindmill);
- COMPAT_HANDLER.RemoveRecipeQueue.add(COMPAT_CompactWindmills.lvWindmill);
- COMPAT_HANDLER.RemoveRecipeQueue.add(COMPAT_CompactWindmills.mvWindmill);
- COMPAT_HANDLER.RemoveRecipeQueue.add(COMPAT_CompactWindmills.hvWindmill);
- COMPAT_HANDLER.RemoveRecipeQueue.add(COMPAT_CompactWindmills.evWindmill);
- COMPAT_HANDLER.RemoveRecipeQueue.add(COMPAT_CompactWindmills.rotor1);
- COMPAT_HANDLER.RemoveRecipeQueue.add(COMPAT_CompactWindmills.rotor3);
- COMPAT_HANDLER.RemoveRecipeQueue.add(COMPAT_CompactWindmills.rotor4);
-
- // Add Recipes
- COMPAT_HANDLER.AddRecipeQueue.add(COMPAT_CompactWindmills.Wooden_Rotor);
- COMPAT_HANDLER.AddRecipeQueue.add(COMPAT_CompactWindmills.Alloy_Rotor);
- COMPAT_HANDLER.AddRecipeQueue.add(COMPAT_CompactWindmills.Carbon_Rotor);
- COMPAT_HANDLER.AddRecipeQueue.add(COMPAT_CompactWindmills.KWT);
- COMPAT_HANDLER.AddRecipeQueue.add(COMPAT_CompactWindmills.WM_ELV);
- COMPAT_HANDLER.AddRecipeQueue.add(COMPAT_CompactWindmills.WM_LV);
- COMPAT_HANDLER.AddRecipeQueue.add(COMPAT_CompactWindmills.WM_MV);
- COMPAT_HANDLER.AddRecipeQueue.add(COMPAT_CompactWindmills.WM_HV);
- COMPAT_HANDLER.AddRecipeQueue.add(COMPAT_CompactWindmills.WM_EV);
+ private static final void run(){
+ //RemoveRecipeQueue.add("CompactWindmills:WOOL");
+ //RemoveRecipeQueue.add("CompactWindmills:WOOD");
+ //RemoveRecipeQueue.add("CompactWindmills:ALLOY");
+ //RemoveRecipeQueue.add("CompactWindmills:CARBON");
+ //RemoveRecipeQueue.add("CompactWindmills:IRIDIUM");
+
+ //Remove Recipes
+ RemoveRecipeQueue.add(kineticWind);
+ RemoveRecipeQueue.add(elvWindmill);
+ RemoveRecipeQueue.add(lvWindmill);
+ RemoveRecipeQueue.add(mvWindmill);
+ RemoveRecipeQueue.add(hvWindmill);
+ RemoveRecipeQueue.add(evWindmill);
+ RemoveRecipeQueue.add(rotor1);
+ RemoveRecipeQueue.add(rotor3);
+ RemoveRecipeQueue.add(rotor4);
+
+ //Add Recipes
+ AddRecipeQueue.add(Wooden_Rotor);
+ AddRecipeQueue.add(Alloy_Rotor);
+ AddRecipeQueue.add(Carbon_Rotor);
+ AddRecipeQueue.add(KWT);
+ AddRecipeQueue.add(WM_ELV);
+ AddRecipeQueue.add(WM_LV);
+ AddRecipeQueue.add(WM_MV);
+ AddRecipeQueue.add(WM_HV);
+ AddRecipeQueue.add(WM_EV);
}
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java
index a53369335d..7a5389e37c 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java
@@ -7,11 +7,11 @@ import net.minecraft.item.ItemStack;
public class COMPAT_EnderIO {
- public static void OreDict() {
- COMPAT_EnderIO.run();
+ public static void OreDict(){
+ run();
}
-
- private static final void run() {
+
+ private static final void run(){
ItemUtils.getItemForOreDict("EnderIO:itemAlloy", "ingotVibrantAlloy", "Vibrant Alloy Ingot", 2);
GT_OreDictUnificator.registerOre("plateConductiveIron", new ItemStack(ModItems.itemPlateConductiveIron));
GT_OreDictUnificator.registerOre("plateDarkSteel", new ItemStack(ModItems.itemPlateDarkSteel));
@@ -22,5 +22,5 @@ public class COMPAT_EnderIO {
GT_OreDictUnificator.registerOre("plateSoularium", new ItemStack(ModItems.itemPlateSoularium));
GT_OreDictUnificator.registerOre("plateVibrantAlloy", new ItemStack(ModItems.itemPlateVibrantAlloy));
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java
index 983000ab7d..d8ff219db7 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java
@@ -8,22 +8,23 @@ import net.minecraft.item.ItemStack;
public class COMPAT_ExtraUtils {
- public static void OreDict() {
+ public static void OreDict(){
RECIPES_Tools.RECIPE_DivisionSigil = new ItemStack(ItemUtils.getItem("ExtraUtilities:divisionSigil"));
- COMPAT_ExtraUtils.run();
+ run();
}
- private static final void run() {
+ private static final void run(){
ItemUtils.getItemForOreDict("ExtraUtilities:bedrockiumIngot", "ingotBedrockium", "Bedrockium Ingot", 0);
- // GT_OreDictUnificator.registerOre("plateBedrockium", new
- // ItemStack(ModItems.itemPlateBedrockium));
+ //GT_OreDictUnificator.registerOre("plateBedrockium", new ItemStack(ModItems.itemPlateBedrockium));
- if (configSwitches.enableAlternativeDivisionSigilRecipe) {
- // Division Sigil
- RecipeUtils.recipeBuilder("plateNetherStar", "gemIridium", "plateNetherStar", "plateIridium",
- RECIPES_Tools.craftingToolHardHammer, "plateIridium", "plateNetherStar", "gemIridium",
- "plateNetherStar", RECIPES_Tools.RECIPE_DivisionSigil);
+ if (configSwitches.enableAlternativeDivisionSigilRecipe){
+ //Division Sigil
+ RecipeUtils.recipeBuilder(
+ "plateNetherStar", "gemIridium", "plateNetherStar",
+ "plateIridium", RECIPES_Tools.craftingToolHardHammer, "plateIridium",
+ "plateNetherStar", "gemIridium", "plateNetherStar",
+ RECIPES_Tools.RECIPE_DivisionSigil);
}
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java
index ab0afe762f..c1546bba63 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java
@@ -1,52 +1,60 @@
package gtPlusPlus.core.common.compat;
-import gtPlusPlus.core.handler.COMPAT_HANDLER;
-import gtPlusPlus.core.lib.CORE.configSwitches;
+
+import static gtPlusPlus.core.handler.COMPAT_HANDLER.RemoveRecipeQueue;
import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.lib.CORE.configSwitches;
import gtPlusPlus.core.recipe.ShapedRecipeObject;
import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.item.ItemStack;
+
public class COMPAT_IC2 {
- private static ItemStack itemCropnalyzer = ItemUtils.simpleMetaStack("IC2:itemCropnalyzer", 0, 1);
- private static ItemStack itemSolarHelmet = ItemUtils.simpleMetaStack("IC2:itemSolarHelmet", 0, 1);
-
- public static ShapedRecipeObject Cropnalyzer = new ShapedRecipeObject("ore:cableGt02Copper",
- "ore:cableGt02Copper", null, "minecraft:redstone", "ore:blockGlass", "minecraft:redstone",
- "minecraft:redstone", "ore:circuitBasic", "minecraft:redstone", COMPAT_IC2.itemCropnalyzer);
- public static ShapedRecipeObject SolarHelmet = new ShapedRecipeObject("ore:plateIron", "ore:plateIron",
- "ore:plateIron", "ore:plateIron", "gregtech:gt.metaitem.01:32750", "ore:plateIron",
- "ore:craftingWireCopper", "ore:craftingWireCopper", "ore:craftingWireCopper", COMPAT_IC2.itemSolarHelmet);
-
- public static void OreDict() {
- // Get ItemStacks for results
- /*
- * itemCropnalyzer = UtilsItems.getItemStack("IC2:itemCropnalyzer", 1);
- * itemSolarHelmet = UtilsItems.getItemStack("IC2:itemSolarHelmet", 1);
- */
- COMPAT_IC2.run();
+ private static ItemStack itemCropnalyzer = ItemUtils.simpleMetaStack("IC2:itemCropnalyzer", 0, 1);
+ private static ItemStack itemSolarHelmet = ItemUtils.simpleMetaStack("IC2:itemSolarHelmet", 0, 1);
+
+ public static ShapedRecipeObject Cropnalyzer = new ShapedRecipeObject(
+ "ore:cableGt02Copper", "ore:cableGt02Copper", null,
+ "minecraft:redstone", "ore:blockGlass", "minecraft:redstone",
+ "minecraft:redstone", "ore:circuitBasic", "minecraft:redstone",
+ itemCropnalyzer);
+ public static ShapedRecipeObject SolarHelmet = new ShapedRecipeObject(
+ "ore:plateIron", "ore:plateIron", "ore:plateIron",
+ "ore:plateIron", "gregtech:gt.metaitem.01:32750", "ore:plateIron",
+ "ore:craftingWireCopper", "ore:craftingWireCopper", "ore:craftingWireCopper",
+ itemSolarHelmet);
+
+
+
+ public static void OreDict(){
+ //Get ItemStacks for results
+ /*itemCropnalyzer = UtilsItems.getItemStack("IC2:itemCropnalyzer", 1);
+ itemSolarHelmet = UtilsItems.getItemStack("IC2:itemSolarHelmet", 1); */
+ run();
}
- private static final void run() {
-
- if (configSwitches.disableIC2Recipes) {
-
- if (LoadedMods.Gregtech) {
- // Fuck these right off.
- COMPAT_HANDLER.RemoveRecipeQueue.add("IC2:itemCable");
- COMPAT_HANDLER.RemoveRecipeQueue.add("IC2:itemCable:1");
- COMPAT_HANDLER.RemoveRecipeQueue.add("IC2:itemCable:2");
- COMPAT_HANDLER.RemoveRecipeQueue.add("IC2:itemCable:3");
- COMPAT_HANDLER.RemoveRecipeQueue.add("IC2:itemCable:5");
- COMPAT_HANDLER.RemoveRecipeQueue.add("IC2:itemCable:6");
- COMPAT_HANDLER.RemoveRecipeQueue.add("IC2:itemCable:10");
- COMPAT_HANDLER.RemoveRecipeQueue.add("IC2:itemCable:13");
- // RemoveRecipeQueue.add(itemCropnalyzer);
- // RemoveRecipeQueue.add(itemSolarHelmet);
-
- // AddRecipeQueue.add(Cropnalyzer);
- // AddRecipeQueue.add(SolarHelmet);
+ private static final void run(){
+
+ if (configSwitches.disableIC2Recipes){
+
+
+
+ if (LoadedMods.Gregtech){
+ //Fuck these right off.
+ RemoveRecipeQueue.add("IC2:itemCable");
+ RemoveRecipeQueue.add("IC2:itemCable:1");
+ RemoveRecipeQueue.add("IC2:itemCable:2");
+ RemoveRecipeQueue.add("IC2:itemCable:3");
+ RemoveRecipeQueue.add("IC2:itemCable:5");
+ RemoveRecipeQueue.add("IC2:itemCable:6");
+ RemoveRecipeQueue.add("IC2:itemCable:10");
+ RemoveRecipeQueue.add("IC2:itemCable:13");
+ //RemoveRecipeQueue.add(itemCropnalyzer);
+ //RemoveRecipeQueue.add(itemSolarHelmet);
+
+ //AddRecipeQueue.add(Cropnalyzer);
+ //AddRecipeQueue.add(SolarHelmet);
}
}
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java
index c9d26f03c2..9e29458bce 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java
@@ -4,12 +4,13 @@ import gtPlusPlus.core.util.item.ItemUtils;
public class COMPAT_MorePlanets {
- public static void OreDict() {
- COMPAT_MorePlanets.run();
+
+ public static void OreDict(){
+ run();
}
-
- private final static void run() {
- // Metals
+
+ private final static void run(){
+ //Metals
ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotFrozenIron", "Frozen Iron Ingot", 0);
ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotAnyIron", "Frozen Iron Ingot", 0);
ItemUtils.getItemForOreDict("MorePlanet:polongnius_item", "ingotPalladium", "Palladium Ingot", 5);
@@ -19,20 +20,18 @@ public class COMPAT_MorePlanets {
ItemUtils.getItemForOreDict("MorePlanet:diona_item", "ingotQuontonium", "Quontonium Ingot", 0);
ItemUtils.getItemForOreDict("MorePlanet:diona_item", "ingotFronisium", "Fronisium Ingot", 1);
ItemUtils.getItemForOreDict("MorePlanet:sirius-b_item", "ingotSulfur", "Sulfur Ingot", 3);
- ItemUtils.getItemForOreDict("MorePlanet:koentus_item", "ingotKoentusMeteoricIron",
- "Koentus Meteoric Iron Ingot", 4);
+ ItemUtils.getItemForOreDict("MorePlanet:koentus_item", "ingotKoentusMeteoricIron", "Koentus Meteoric Iron Ingot", 4);
ItemUtils.getItemForOreDict("MorePlanet:mercury_item", "ingotMetallic", "Metallic Ingot", 2);
- ItemUtils.getItemForOreDict("MorePlanet:polongnius_item", "ingotPolongiusMeteoricIron",
- "Polongius Meteoric Iron Ingot", 4);
+ ItemUtils.getItemForOreDict("MorePlanet:polongnius_item", "ingotPolongiusMeteoricIron", "Polongius Meteoric Iron Ingot", 4);
ItemUtils.getItemForOreDict("MorePlanet:mercury_item", "ingotMeteoricSteel", "Meteoric Steel Ingot", 3);
ItemUtils.getItemForOreDict("MorePlanet:sirius-b_item", "dustSulfur", "Sulfur Dust", 2);
-
- // Gems
+
+ //Gems
ItemUtils.getItemForOreDict("MorePlanet:fronos_item", "gemBlackDiamond", "Black Diamond Gem", 2);
ItemUtils.getItemForOreDict("MorePlanet:koentus_item", "gemWhiteCrystal", "White Crystal", 0);
ItemUtils.getItemForOreDict("MorePlanet:nibiru_item", "gemRedCrystal", "Red Crystal", 0);
ItemUtils.getItemForOreDict("MorePlanet:pluto_item", "gemXeonius", "Xeonius Gem", 0);
ItemUtils.getItemForOreDict("MorePlanet:kapteyn-b_item", "gemUranium", "Uranium Gem", 1);
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java
index eaa86ec8d7..d471535e81 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java
@@ -6,12 +6,12 @@ import net.minecraft.item.ItemStack;
public class COMPAT_PneumaticCraft {
- public static void OreDict() {
- COMPAT_PneumaticCraft.run();
+ public static void OreDict(){
+ run();
}
-
- private static final void run() {
- GT_OreDictUnificator.registerOre("plateCompressedIron", new ItemStack(ModItems.itemPlateCompressedIron));
+
+ private static final void run(){
+ GT_OreDictUnificator.registerOre("plateCompressedIron", new ItemStack(ModItems.itemPlateCompressedIron));
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java
index 95d92cdc0f..4db8006a89 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java
@@ -6,13 +6,13 @@ import net.minecraft.item.ItemStack;
public class COMPAT_RFTools {
- public static void OreDict() {
- COMPAT_RFTools.run();
+ public static void OreDict(){
+ run();
}
-
- private static final void run() {
+
+ private static final void run(){
GT_OreDictUnificator.registerOre("plateDimensionShard", new ItemStack(ModItems.itemPlateDimensionShard));
-
+
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java
index 637c2aa23e..6d7f08b55d 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java
@@ -6,13 +6,13 @@ import net.minecraft.item.ItemStack;
public class COMPAT_SimplyJetpacks {
- public static void OreDict() {
- COMPAT_SimplyJetpacks.run();
+ public static void OreDict(){
+ run();
}
-
- private static final void run() {
+
+ private static final void run(){
GT_OreDictUnificator.registerOre("plateEnrichedSoularium", new ItemStack(ModItems.itemPlateEnrichedSoularium));
-
+
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java
index 6eb96f74ed..b1b7464dd2 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java
@@ -7,41 +7,37 @@ import gtPlusPlus.core.util.item.ItemUtils;
public class COMPAT_Thaumcraft {
- public static void OreDict() {
-
- if (configSwitches.enableThaumcraftShardUnification) {
- COMPAT_Thaumcraft.run();
+ public static void OreDict(){
+
+ if (configSwitches.enableThaumcraftShardUnification){
+ run();
}
}
- private static final void run() {
+ private static final void run(){
- for (int i = 0; i <= 6; i++) {
- // Utils.LOG_INFO(""+i);
- ItemUtils.getItemForOreDict("Thaumcraft:ItemShard", "shardAny", "TC Shard " + i, i);
- GT_OreDictUnificator.registerOre("shardAny", ItemUtils.getItemStack("Thaumcraft:ItemShard:" + i, 1));
- ItemUtils.getItemForOreDict("Thaumcraft:ItemShard", "gemInfusedAnything", "TC Shard " + i, i);
- GT_OreDictUnificator.registerOre("gemInfusedAnything",
- ItemUtils.getItemStack("Thaumcraft:ItemShard:" + i, 1));
- // System.out.println("TC Shard registration count is: "+i);
+ for(int i=0; i<=6; i++){
+ //Utils.LOG_INFO(""+i);
+ ItemUtils.getItemForOreDict("Thaumcraft:ItemShard", "shardAny", "TC Shard "+i, i);
+ GT_OreDictUnificator.registerOre("shardAny", ItemUtils.getItemStack("Thaumcraft:ItemShard:"+i, 1));
+ ItemUtils.getItemForOreDict("Thaumcraft:ItemShard", "gemInfusedAnything", "TC Shard "+i, i);
+ GT_OreDictUnificator.registerOre("gemInfusedAnything", ItemUtils.getItemStack("Thaumcraft:ItemShard:"+i, 1));
+ //System.out.println("TC Shard registration count is: "+i);
}
- if (LoadedMods.ForbiddenMagic) {
- for (int i = 0; i <= 6; i++) {
- // Utils.LOG_INFO(""+i);
- ItemUtils.getItemForOreDict("ForbiddenMagic:NetherShard", "shardAny", "FM Shard " + i, i);
- GT_OreDictUnificator.registerOre("shardAny",
- ItemUtils.getItemStack("ForbiddenMagic:NetherShard:" + i, 1));
- ItemUtils.getItemForOreDict("ForbiddenMagic:NetherShard", "gemInfusedAnything", "FM Shard " + i, i);
- GT_OreDictUnificator.registerOre("gemInfusedAnything",
- ItemUtils.getItemStack("ForbiddenMagic:NetherShard:" + i, 1));
- // System.out.println("TC Shard registration count is: "+i);
+ if (LoadedMods.ForbiddenMagic){
+ for(int i=0; i<=6; i++){
+ //Utils.LOG_INFO(""+i);
+ ItemUtils.getItemForOreDict("ForbiddenMagic:NetherShard", "shardAny", "FM Shard "+i, i);
+ GT_OreDictUnificator.registerOre("shardAny", ItemUtils.getItemStack("ForbiddenMagic:NetherShard:"+i, 1));
+ ItemUtils.getItemForOreDict("ForbiddenMagic:NetherShard", "gemInfusedAnything", "FM Shard "+i, i);
+ GT_OreDictUnificator.registerOre("gemInfusedAnything", ItemUtils.getItemStack("ForbiddenMagic:NetherShard:"+i, 1));
+ //System.out.println("TC Shard registration count is: "+i);
}
ItemUtils.getItemForOreDict("ForbiddenMagic:GluttonyShard", "shardAny", "FM Gluttony Shard", 0);
GT_OreDictUnificator.registerOre("shardAny", ItemUtils.getItemStack("ForbiddenMagic:GluttonyShard", 1));
ItemUtils.getItemForOreDict("ForbiddenMagic:GluttonyShard", "gemInfusedAnything", "FM Gluttony Shard", 0);
- GT_OreDictUnificator.registerOre("gemInfusedAnything",
- ItemUtils.getItemStack("ForbiddenMagic:GluttonyShard", 1));
+ GT_OreDictUnificator.registerOre("gemInfusedAnything", ItemUtils.getItemStack("ForbiddenMagic:GluttonyShard", 1));
}
}
diff --git a/src/Java/gtPlusPlus/core/container/Container_BackpackBase.java b/src/Java/gtPlusPlus/core/container/Container_BackpackBase.java
index e3d936a315..f156f6dcaf 100644
--- a/src/Java/gtPlusPlus/core/container/Container_BackpackBase.java
+++ b/src/Java/gtPlusPlus/core/container/Container_BackpackBase.java
@@ -8,188 +8,179 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class Container_BackpackBase extends Container {
- /**
- * Using these will make transferStackInSlot easier to understand and
- * implement INV_START is the index of the first slot in the Player's
- * Inventory, so our BaseInventoryBackpack's number of slots (e.g. 5 slots
- * is array indices 0-4, so start at 5) Notice how we don't have to remember
- * how many slots we made? We can just use BaseInventoryBackpack.INV_SIZE
- * and if we ever change it, the Container updates automatically.
- */
- private static final int INV_START = BaseInventoryBackpack.INV_SIZE,
- INV_END = Container_BackpackBase.INV_START + 26, HOTBAR_START = Container_BackpackBase.INV_END + 1,
- HOTBAR_END = Container_BackpackBase.HOTBAR_START + 8;
-
- /**
- * The Item Inventory for this Container, only needed if you want to
- * reference isUseableByPlayer
- */
- public final BaseInventoryBackpack inventory;
+public class Container_BackpackBase extends Container
+{
+ /** The Item Inventory for this Container, only needed if you want to reference isUseableByPlayer */
+ public final BaseInventoryBackpack inventory;
+
+ /** Using these will make transferStackInSlot easier to understand and implement
+ * INV_START is the index of the first slot in the Player's Inventory, so our
+ * BaseInventoryBackpack's number of slots (e.g. 5 slots is array indices 0-4, so start at 5)
+ * Notice how we don't have to remember how many slots we made? We can just use
+ * BaseInventoryBackpack.INV_SIZE and if we ever change it, the Container updates automatically. */
+ private static final int INV_START = BaseInventoryBackpack.INV_SIZE, INV_END = INV_START+26,
+ HOTBAR_START = INV_END+1, HOTBAR_END = HOTBAR_START+8;
// If you're planning to add armor slots, put those first like this:
// ARMOR_START = BaseInventoryBackpack.INV_SIZE, ARMOR_END = ARMOR_START+3,
// INV_START = ARMOR_END+1, and then carry on like above.
- public Container_BackpackBase(final EntityPlayer par1Player, final InventoryPlayer inventoryPlayer,
- final BaseInventoryBackpack inventoryItem) {
+ public Container_BackpackBase(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, BaseInventoryBackpack inventoryItem)
+ {
this.inventory = inventoryItem;
int i;
- // ITEM INVENTORY - you'll need to adjust the slot locations to match
- // your texture file
- // I have them set vertically in columns of 4 to the right of the player
- // model
- for (i = 0; i < BaseInventoryBackpack.INV_SIZE; ++i) {
+ // ITEM INVENTORY - you'll need to adjust the slot locations to match your texture file
+ // I have them set vertically in columns of 4 to the right of the player model
+ for (i = 0; i < BaseInventoryBackpack.INV_SIZE; ++i)
+ {
// You can make a custom Slot if you need different behavior,
// such as only certain item types can be put into this slot
// We made a custom slot to prevent our inventory-storing item
- // from being stored within itself, but if you want to allow that
- // and
+ // from being stored within itself, but if you want to allow that and
// you followed my advice at the end of the above step, then you
// could get away with using the vanilla Slot class
- this.addSlotToContainer(new SlotItemBackpackInv(this.inventory, i, 80 + 18 * (i / 4), 8 + 18 * (i % 4)));
+ this.addSlotToContainer(new SlotItemBackpackInv(this.inventory, i, 80 + (18 * (int)(i/4)), 8 + (18*(i%4))));
}
// If you want, you can add ARMOR SLOTS here as well, but you need to
- // make a public version of SlotArmor. I won't be doing that in this
- // tutorial.
+ // make a public version of SlotArmor. I won't be doing that in this tutorial.
/*
- * for (i = 0; i < 4; ++i) { // These are the standard positions for
- * survival inventory layout this.addSlotToContainer(new
- * SlotArmor(this.player, inventoryPlayer,
- * inventoryPlayer.getSizeInventory() - 1 - i, 8, 8 + i * 18, i)); }
- */
-
- // PLAYER INVENTORY - uses default locations for standard inventory
- // texture file
- for (i = 0; i < 3; ++i) {
- for (int j = 0; j < 9; ++j) {
+ for (i = 0; i < 4; ++i)
+ {
+ // These are the standard positions for survival inventory layout
+ this.addSlotToContainer(new SlotArmor(this.player, inventoryPlayer, inventoryPlayer.getSizeInventory() - 1 - i, 8, 8 + i * 18, i));
+ }
+ */
+
+ // PLAYER INVENTORY - uses default locations for standard inventory texture file
+ for (i = 0; i < 3; ++i)
+ {
+ for (int j = 0; j < 9; ++j)
+ {
this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
- // PLAYER ACTION BAR - uses default locations for standard action bar
- // texture file
- for (i = 0; i < 9; ++i) {
+ // PLAYER ACTION BAR - uses default locations for standard action bar texture file
+ for (i = 0; i < 9; ++i)
+ {
this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
}
}
@Override
- public boolean canInteractWith(final EntityPlayer entityplayer) {
+ public boolean canInteractWith(EntityPlayer entityplayer)
+ {
// be sure to return the inventory's isUseableByPlayer method
// if you defined special behavior there:
- return this.inventory.isUseableByPlayer(entityplayer);
- }
-
- /**
- * You should override this method to prevent the player from moving the
- * stack that opened the inventory, otherwise if the player moves it, the
- * inventory will not be able to save properly
- */
- @Override
- public ItemStack slotClick(final int slot, final int button, final int flag, final EntityPlayer player) {
- // this will prevent the player from interacting with the item that
- // opened the inventory:
- if (slot >= 0 && this.getSlot(slot) != null && this.getSlot(slot).getStack() == player.getHeldItem()) {
- return null;
- }
- return super.slotClick(slot, button, flag, player);
+ return inventory.isUseableByPlayer(entityplayer);
}
/**
- * Called when a player shift-clicks on a slot. You must override this or
- * you will crash when someone does that.
+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
*/
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int index) {
+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int index)
+ {
ItemStack itemstack = null;
- final Slot slot = (Slot) this.inventorySlots.get(index);
+ Slot slot = (Slot) this.inventorySlots.get(index);
- if (slot != null && slot.getHasStack()) {
- final ItemStack itemstack1 = slot.getStack();
+ if (slot != null && slot.getHasStack())
+ {
+ ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
// If item is in our custom Inventory or armor slot
- if (index < Container_BackpackBase.INV_START) {
+ if (index < INV_START)
+ {
// try to place in player inventory / action bar
- if (!this.mergeItemStack(itemstack1, Container_BackpackBase.INV_START,
- Container_BackpackBase.HOTBAR_END + 1, true)) {
+ if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END+1, true))
+ {
return null;
}
slot.onSlotChange(itemstack1, itemstack);
}
- // Item is in inventory / hotbar, try to place in custom inventory
- // or armor slots
- else {
+ // Item is in inventory / hotbar, try to place in custom inventory or armor slots
+ else
+ {
/*
- * If your inventory only stores certain instances of Items, you
- * can implement shift-clicking to your inventory like this:
- *
- * // Check that the item is the right type if
- * (itemstack1.getItem() instanceof ItemCustom) { // Try to
- * merge into your custom inventory slots // We use
- * 'BaseInventoryBackpack.INV_SIZE' instead of INV_START just in
- * case // you also add armor or other custom slots if
- * (!this.mergeItemStack(itemstack1, 0,
- * BaseInventoryBackpack.INV_SIZE, false)) { return null; } } //
- * If you added armor slots, check them here as well: // Item
- * being shift-clicked is armor - try to put in armor slot if
- * (itemstack1.getItem() instanceof ItemArmor) { int type =
- * ((ItemArmor) itemstack1.getItem()).armorType; if
- * (!this.mergeItemStack(itemstack1, ARMOR_START + type,
- * ARMOR_START + type + 1, false)) { return null; } } Otherwise,
- * you have basically 2 choices: 1. shift-clicking between
- * player inventory and custom inventory 2. shift-clicking
- * between action bar and inventory
- *
- * Be sure to choose only ONE of the following
- * implementations!!!
- */
+ If your inventory only stores certain instances of Items,
+ you can implement shift-clicking to your inventory like this:
+
+ // Check that the item is the right type
+ if (itemstack1.getItem() instanceof ItemCustom)
+ {
+ // Try to merge into your custom inventory slots
+ // We use 'BaseInventoryBackpack.INV_SIZE' instead of INV_START just in case
+ // you also add armor or other custom slots
+ if (!this.mergeItemStack(itemstack1, 0, BaseInventoryBackpack.INV_SIZE, false))
+ {
+ return null;
+ }
+ }
+ // If you added armor slots, check them here as well:
+ // Item being shift-clicked is armor - try to put in armor slot
+ if (itemstack1.getItem() instanceof ItemArmor)
+ {
+ int type = ((ItemArmor) itemstack1.getItem()).armorType;
+ if (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START + type + 1, false))
+ {
+ return null;
+ }
+ }
+ Otherwise, you have basically 2 choices:
+ 1. shift-clicking between player inventory and custom inventory
+ 2. shift-clicking between action bar and inventory
+
+ Be sure to choose only ONE of the following implementations!!!
+ */
/**
- * Implementation number 1: Shift-click into your custom
- * inventory
+ * Implementation number 1: Shift-click into your custom inventory
*/
- if (index >= Container_BackpackBase.INV_START) {
+ if (index >= INV_START)
+ {
// place in custom inventory
- if (!this.mergeItemStack(itemstack1, 0, Container_BackpackBase.INV_START, false)) {
+ if (!this.mergeItemStack(itemstack1, 0, INV_START, false))
+ {
return null;
}
}
-
+
/**
- * Implementation number 2: Shift-click items between action bar
- * and inventory
+ * Implementation number 2: Shift-click items between action bar and inventory
*/
// item is in player's inventory, but not in action bar
- if (index >= Container_BackpackBase.INV_START && index < Container_BackpackBase.HOTBAR_START) {
+ if (index >= INV_START && index < HOTBAR_START)
+ {
// place in action bar
- if (!this.mergeItemStack(itemstack1, Container_BackpackBase.HOTBAR_START,
- Container_BackpackBase.HOTBAR_END + 1, false)) {
+ if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END+1, false))
+ {
return null;
}
}
// item in action bar - place in player inventory
- else if (index >= Container_BackpackBase.HOTBAR_START
- && index < Container_BackpackBase.HOTBAR_END + 1) {
- if (!this.mergeItemStack(itemstack1, Container_BackpackBase.INV_START,
- Container_BackpackBase.INV_END + 1, false)) {
+ else if (index >= HOTBAR_START && index < HOTBAR_END+1)
+ {
+ if (!this.mergeItemStack(itemstack1, INV_START, INV_END+1, false))
+ {
return null;
}
}
}
- if (itemstack1.stackSize == 0) {
+ if (itemstack1.stackSize == 0)
+ {
slot.putStack((ItemStack) null);
}
- else {
+ else
+ {
slot.onSlotChanged();
}
- if (itemstack1.stackSize == itemstack.stackSize) {
+ if (itemstack1.stackSize == itemstack.stackSize)
+ {
return null;
}
@@ -198,4 +189,18 @@ public class Container_BackpackBase extends Container {
return itemstack;
}
+
+ /**
+ * You should override this method to prevent the player from moving the stack that
+ * opened the inventory, otherwise if the player moves it, the inventory will not
+ * be able to save properly
+ */
+ @Override
+ public ItemStack slotClick(int slot, int button, int flag, EntityPlayer player) {
+ // this will prevent the player from interacting with the item that opened the inventory:
+ if (slot >= 0 && getSlot(slot) != null && getSlot(slot).getStack() == player.getHeldItem()) {
+ return null;
+ }
+ return super.slotClick(slot, button, flag, player);
+ }
}
diff --git a/src/Java/gtPlusPlus/core/container/Container_Charger.java b/src/Java/gtPlusPlus/core/container/Container_Charger.java
index 89dc8904d8..4b6c43ada6 100644
--- a/src/Java/gtPlusPlus/core/container/Container_Charger.java
+++ b/src/Java/gtPlusPlus/core/container/Container_Charger.java
@@ -6,61 +6,76 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class Container_Charger extends Container {
- public static final int INPUT_1 = 0;
+public class Container_Charger extends Container
+{
+ private TileEntityCharger te;
- private final TileEntityCharger te;
+ public static final int INPUT_1 = 0;
- private int slotID = 0;
+ private int slotID = 0;
- public Container_Charger(final TileEntityCharger te, final EntityPlayer player) {
+ public Container_Charger(TileEntityCharger te, EntityPlayer player)
+ {
this.te = te;
- // Fuel Slot A
- this.addSlotToContainer(new Slot(te, this.slotID++, 80, 53));
+ //Fuel Slot A
+ addSlotToContainer(new Slot(te, slotID++, 80, 53));
- // Inventory
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 9; j++) {
- this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
+
+
+ //Inventory
+ for (int i = 0; i < 3; i++)
+ {
+ for (int j = 0; j < 9; j++)
+ {
+ addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
// Hotbar
- for (int i = 0; i < 9; i++) {
- this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
+ for (int i = 0; i < 9; i++)
+ {
+ addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
- public boolean canInteractWith(final EntityPlayer player) {
- return this.te.isUseableByPlayer(player);
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer player, final int slotRaw) {
+ public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw)
+ {
ItemStack stack = null;
- final Slot slot = (Slot) this.inventorySlots.get(slotRaw);
+ Slot slot = (Slot)inventorySlots.get(slotRaw);
- if (slot != null && slot.getHasStack()) {
- final ItemStack stackInSlot = slot.getStack();
+ if (slot != null && slot.getHasStack())
+ {
+ ItemStack stackInSlot = slot.getStack();
stack = stackInSlot.copy();
- if (slotRaw < 3 * 9) {
- if (!this.mergeItemStack(stackInSlot, 3 * 9, this.inventorySlots.size(), true)) {
+ if (slotRaw < 3 * 9)
+ {
+ if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true))
+ {
return null;
}
}
- else if (!this.mergeItemStack(stackInSlot, 0, 3 * 9, false)) {
+ else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false))
+ {
return null;
}
- if (stackInSlot.stackSize == 0) {
- slot.putStack((ItemStack) null);
+ if (stackInSlot.stackSize == 0)
+ {
+ slot.putStack((ItemStack)null);
}
- else {
+ else
+ {
slot.onSlotChanged();
}
}
return stack;
}
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player)
+ {
+ return te.isUseableByPlayer(player);
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/container/Container_NHG.java b/src/Java/gtPlusPlus/core/container/Container_NHG.java
index 35e82162c1..64a84ce680 100644
--- a/src/Java/gtPlusPlus/core/container/Container_NHG.java
+++ b/src/Java/gtPlusPlus/core/container/Container_NHG.java
@@ -2,79 +2,103 @@ package gtPlusPlus.core.container;
import gtPlusPlus.core.tileentities.machines.TileEntityNHG;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.*;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.Slot;
+import net.minecraft.inventory.SlotFurnace;
import net.minecraft.item.ItemStack;
-public class Container_NHG extends Container {
- public static final int INPUT_1 = 0, INPUT_2 = 1, INPUT_3 = 2, INPUT_4 = 3, INPUT_5 = 4, INPUT_6 = 5,
- INPUT_7 = 6, INPUT_8 = 7, INPUT_9 = 8, INPUT_10 = 9, INPUT_11 = 10, INPUT_12 = 11, INPUT_13 = 12,
- INPUT_14 = 13, INPUT_15 = 14, INPUT_16 = 15, INPUT_17 = 16, INPUT_18 = 17, OUTPUT = 18;
+public class Container_NHG extends Container
+{
+ private TileEntityNHG te;
- private final TileEntityNHG te;
+ public static final int INPUT_1 = 0, INPUT_2 = 1, INPUT_3 = 2,
+ INPUT_4 = 3, INPUT_5 = 4, INPUT_6 = 5,
+ INPUT_7 = 6, INPUT_8 = 7, INPUT_9 = 8,
+ INPUT_10 = 9, INPUT_11 = 10, INPUT_12 = 11,
+ INPUT_13 = 12, INPUT_14 = 13, INPUT_15 = 14,
+ INPUT_16 = 15, INPUT_17 = 16, INPUT_18 = 17,
+ OUTPUT = 18;
+
+ private int slotID = 0;
- private int slotID = 0;
-
- public Container_NHG(final TileEntityNHG te, final EntityPlayer player) {
+ public Container_NHG(TileEntityNHG te, EntityPlayer player)
+ {
this.te = te;
- // Fuel Rods A
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 3; j++) {
- this.addSlotToContainer(new Slot(te, this.slotID++, 8 + j * 18, 17 + i * 18));
+
+ //Fuel Rods A
+ for (int i = 0; i < 3; i++)
+ {
+ for (int j = 0; j < 3; j++)
+ {
+ addSlotToContainer(new Slot(te, slotID++, 8 + j * 18, 17 + i * 18));
}
}
- // Fuel Rods B
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 3; j++) {
- this.addSlotToContainer(new Slot(te, this.slotID++, 116 + j * 18, 17 + i * 18));
+ //Fuel Rods B
+ for (int i = 0; i < 3; i++)
+ {
+ for (int j = 0; j < 3; j++)
+ {
+ addSlotToContainer(new Slot(te, slotID++, 116 + j * 18, 17 + i * 18));
}
}
- // Output
- this.addSlotToContainer(new SlotFurnace(player, te, Container_NHG.OUTPUT, 80, 53));
+ //Output
+ addSlotToContainer(new SlotFurnace(player, te, OUTPUT, 80, 53));
- // Inventory
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 9; j++) {
- this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
+ //Inventory
+ for (int i = 0; i < 3; i++)
+ {
+ for (int j = 0; j < 9; j++)
+ {
+ addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
// Hotbar
- for (int i = 0; i < 9; i++) {
- this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
+ for (int i = 0; i < 9; i++)
+ {
+ addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
- public boolean canInteractWith(final EntityPlayer player) {
- return this.te.isUseableByPlayer(player);
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer player, final int slotRaw) {
+ public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw)
+ {
ItemStack stack = null;
- final Slot slot = (Slot) this.inventorySlots.get(slotRaw);
+ Slot slot = (Slot)inventorySlots.get(slotRaw);
- if (slot != null && slot.getHasStack()) {
- final ItemStack stackInSlot = slot.getStack();
+ if (slot != null && slot.getHasStack())
+ {
+ ItemStack stackInSlot = slot.getStack();
stack = stackInSlot.copy();
- if (slotRaw < 3 * 9) {
- if (!this.mergeItemStack(stackInSlot, 3 * 9, this.inventorySlots.size(), true)) {
+ if (slotRaw < 3 * 9)
+ {
+ if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true))
+ {
return null;
}
}
- else if (!this.mergeItemStack(stackInSlot, 0, 3 * 9, false)) {
+ else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false))
+ {
return null;
}
- if (stackInSlot.stackSize == 0) {
- slot.putStack((ItemStack) null);
+ if (stackInSlot.stackSize == 0)
+ {
+ slot.putStack((ItemStack)null);
}
- else {
+ else
+ {
slot.onSlotChanged();
}
}
return stack;
}
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player)
+ {
+ return te.isUseableByPlayer(player);
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/container/Container_Workbench.java b/src/Java/gtPlusPlus/core/container/Container_Workbench.java
index 9f58fcdad8..c814f8815e 100644
--- a/src/Java/gtPlusPlus/core/container/Container_Workbench.java
+++ b/src/Java/gtPlusPlus/core/container/Container_Workbench.java
@@ -3,83 +3,92 @@ package gtPlusPlus.core.container;
import gregtech.api.gui.GT_Slot_Holo;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.interfaces.IItemBlueprint;
-import gtPlusPlus.core.inventories.*;
+import gtPlusPlus.core.inventories.InventoryWorkbenchChest;
+import gtPlusPlus.core.inventories.InventoryWorkbenchHoloCrafting;
+import gtPlusPlus.core.inventories.InventoryWorkbenchHoloSlots;
+import gtPlusPlus.core.inventories.InventoryWorkbenchTools;
import gtPlusPlus.core.item.general.ItemBlueprint;
-import gtPlusPlus.core.slots.*;
+import gtPlusPlus.core.slots.SlotBlueprint;
+import gtPlusPlus.core.slots.SlotGtTool;
+import gtPlusPlus.core.slots.SlotNoInput;
+import gtPlusPlus.core.slots.SlotOutput;
import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.*;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.InventoryCrafting;
+import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.world.World;
public class Container_Workbench extends Container {
- public static int HoloSlotNumber = 6;
- public static int InputSlotNumber = 9; // Number
- // of
- // Slots
- // in
- // the
- // Crafting
- // Grid
- public static int StorageSlotNumber = 16; // Number
- // of
- // slots
- // in
- // storage
- // area
- public static int ToolSlotNumber = 5; // Number
- // of
- // slots
- // in
- // the
- // tool
- // area
- // up
- // top
- public static int InOutputSlotNumber = Container_Workbench.InputSlotNumber
- + Container_Workbench.StorageSlotNumber + Container_Workbench.ToolSlotNumber
- + Container_Workbench.HoloSlotNumber; // Same
- // plus
- // Output
- // Slot
- public static int InventorySlotNumber = 36; // Inventory
-
- // Slots
- // (Inventory
- // and
- // Hotbar)
- public static int InventoryOutSlotNumber = Container_Workbench.InventorySlotNumber + 1; // Inventory
- // Slot
- // Number
- // +
- // Output
- public static int FullSlotNumber = Container_Workbench.InventorySlotNumber
- + Container_Workbench.InOutputSlotNumber; // All
- // slots
- protected TileEntityWorkbench tile_entity;
- public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
-
- public final InventoryWorkbenchChest inventoryChest;
- public final InventoryWorkbenchTools inventoryTool;
- public final InventoryWorkbenchHoloSlots inventoryHolo;
- public final InventoryWorkbenchHoloCrafting inventoryCrafting;
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- private final int slotOutput = 0;
- private final int[] slotHolo = new int[5];
- private final int[] slotCrafting = new int[9];
- private final int[] slotStorage = new int[16];
- private final int[] slotTools = new int[5];
-
- public Container_Workbench(final InventoryPlayer inventory, final TileEntityWorkbench tile) {
+ protected TileEntityWorkbench tile_entity;
+ public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
+ public final InventoryWorkbenchChest inventoryChest;
+ public final InventoryWorkbenchTools inventoryTool;
+ public final InventoryWorkbenchHoloSlots inventoryHolo;
+ public final InventoryWorkbenchHoloCrafting inventoryCrafting;
+
+ private World worldObj;
+ private int posX;
+ private int posY;
+ private int posZ;
+
+ public static int HoloSlotNumber = 6;
+ public static int InputSlotNumber = 9; //Number of Slots in the Crafting Grid
+ public static int StorageSlotNumber = 16; //Number of slots in storage area
+ public static int ToolSlotNumber = 5; // Number of slots in the tool area up top
+ public static int InOutputSlotNumber = InputSlotNumber + StorageSlotNumber + ToolSlotNumber + HoloSlotNumber; //Same plus Output Slot
+ public static int InventorySlotNumber = 36; //Inventory Slots (Inventory and Hotbar)
+ public static int InventoryOutSlotNumber = InventorySlotNumber + 1; //Inventory Slot Number + Output
+ public static int FullSlotNumber = InventorySlotNumber + InOutputSlotNumber; //All slots
+
+ private int slotOutput = 0;
+ private int[] slotHolo = new int[5];
+ private int[] slotCrafting = new int[9];
+ private int[] slotStorage = new int[16];
+ private int[] slotTools = new int[5];
+
+ public void moveCraftingToChest(){
+ //Check Chest Space
+ for (int i=0;i<9;i++){
+ if (craftMatrix.getStackInSlot(i) != null){
+ for (int r=0;r<16;r++){
+ if (inventoryChest.getStackInSlot(r) == null || (inventoryChest.getStackInSlot(r).getItem() == craftMatrix.getStackInSlot(i).getItem() && (64-craftMatrix.getStackInSlot(i).stackSize) <= (64-craftMatrix.getStackInSlot(i).stackSize))){
+ inventoryChest.setInventorySlotContents(r, craftMatrix.getStackInSlot(i));
+ craftMatrix.setInventorySlotContents(i, null);
+ break;
+ }
+ }
+ }
+ }
+ //For Each Space or already existing itemstack, move one itemstack or fill current partial stack
+ //Remove old itemstack or partial stack from crafting grid
+ }
+
+ public void moveChestToCrafting(){
+ //Check Crafting items and slots
+ for (int i=0;i<9;i++){
+ if (craftMatrix.getStackInSlot(i) == null || craftMatrix.getStackInSlot(i).stackSize > 0){
+ for (int r=0;r<16;r++){
+ if (inventoryChest.getStackInSlot(r) != null){
+ craftMatrix.setInventorySlotContents(i, craftMatrix.getStackInSlot(r));
+ inventoryChest.setInventorySlotContents(r, null);
+ }
+ }
+ }
+ }
+ //For Each already existing itemstack, fill current partial stack
+ //Remove partial stack from chest area
+ }
+
+
+ public Container_Workbench(InventoryPlayer inventory, TileEntityWorkbench tile){
this.tile_entity = tile;
this.inventoryChest = tile.inventoryChest;
this.inventoryTool = tile.inventoryTool;
@@ -88,329 +97,308 @@ public class Container_Workbench extends Container {
int var6;
int var7;
- this.worldObj = tile.getWorldObj();
- this.posX = tile.xCoord;
- this.posY = tile.yCoord;
- this.posZ = tile.zCoord;
-
- int o = 0;
-
- // Output slot
- this.addSlotToContainer(
- new SlotOutput(inventory.player, this.craftMatrix, tile.inventoryCraftResult, 0, 136, 64));
- // Util Slots
- this.addSlotToContainer(new SlotBlueprint(this.inventoryHolo, 1, 136, 28)); // Blueprint
- this.addSlotToContainer(new SlotNoInput(this.inventoryHolo, 2, 154, 28)); // Hopper
- this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 3, 154, 64, false, false, 64)); // Parking
- // Holo Slots
- this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 4, 154, 46, false, false, 1));
- this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 5, 136, 46, false, false, 1));
-
- for (int i = 1; i < 6; i++) {
- this.slotHolo[o] = o + 1;
+ worldObj = tile.getWorldObj();
+ posX = tile.xCoord;
+ posY = tile.yCoord;
+ posZ = tile.zCoord;
+
+ int o=0;
+
+ //Output slot
+ addSlotToContainer(new SlotOutput(inventory.player, this.craftMatrix, tile.inventoryCraftResult, 0, 136, 64));
+ //Util Slots
+ addSlotToContainer(new SlotBlueprint(inventoryHolo, 1, 136, 28)); //Blueprint
+ addSlotToContainer(new SlotNoInput(inventoryHolo, 2, 154, 28)); //Hopper
+ addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 3, 154, 64, false, false, 64)); //Parking
+ //Holo Slots
+ addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 4, 154, 46, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 5, 136, 46, false, false, 1));
+
+ for (int i=1; i<6; i++){
+ slotHolo[o] = o+1;
o++;
}
- o = 0;
+ o=0;
- this.updateCraftingMatrix();
+ updateCraftingMatrix();
- // Crafting Grid
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 3; ++var7) {
+ //Crafting Grid
+ for (var6 = 0; var6 < 3; ++var6)
+ {
+ for (var7 = 0; var7 < 3; ++var7)
+ {
this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 82 + var7 * 18, 28 + var6 * 18));
- /*
- * if (this.inventoryCrafting.getStackInSlot(o) != null){
- * this.craftMatrix.setInventorySlotContents(o,
- * inventoryCrafting.getStackInSlot(o));
- * this.inventoryCrafting.setInventorySlotContents(o, null); }
- */
- this.slotCrafting[o] = o + 6;
+ /*if (this.inventoryCrafting.getStackInSlot(o) != null){
+ this.craftMatrix.setInventorySlotContents(o, inventoryCrafting.getStackInSlot(o));
+ this.inventoryCrafting.setInventorySlotContents(o, null);
+ } */
+ slotCrafting[o] = o+6;
o++;
}
}
- o = 0;
+ o=0;
- // Storage Side
- for (var6 = 0; var6 < 4; ++var6) {
- for (var7 = 0; var7 < 4; ++var7) {
- // Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+"
- // x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18));
- this.addSlotToContainer(new Slot(this.inventoryChest, var7 + var6 * 4, 8 + var7 * 18, 7 + var6 * 18));
- this.slotStorage[o] = o + 15;
+ //Storage Side
+ for (var6 = 0; var6 < 4; ++var6)
+ {
+ for (var7 = 0; var7 < 4; ++var7)
+ {
+ //Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18));
+ this.addSlotToContainer(new Slot(inventoryChest, var7 + var6 * 4, 8 + var7 * 18, 7 + var6 * 18));
+ slotStorage[o] = o+15;
o++;
}
}
- o = 0;
+ o=0;
- // Tool Slots
- for (var6 = 0; var6 < 1; ++var6) {
- for (var7 = 0; var7 < 5; ++var7) {
- this.addSlotToContainer(
- new SlotGtTool(this.inventoryTool, var7 + var6 * 3, 82 + var7 * 18, 8 + var6 * 18));
- this.slotTools[o] = o + 31;
+ //Tool Slots
+ for (var6 = 0; var6 < 1; ++var6)
+ {
+ for (var7 = 0; var7 < 5; ++var7)
+ {
+ this.addSlotToContainer(new SlotGtTool(inventoryTool, var7 + var6 * 3, 82 + var7 * 18, 8 + var6 * 18));
+ slotTools[o] = o+31;
o++;
}
- }
+ }
- // Player Inventory
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 9; ++var7) {
+ //Player Inventory
+ for (var6 = 0; var6 < 3; ++var6)
+ {
+ for (var7 = 0; var7 < 9; ++var7)
+ {
this.addSlotToContainer(new Slot(inventory, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18));
}
}
- // Player Hotbar
- for (var6 = 0; var6 < 9; ++var6) {
+ //Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6)
+ {
this.addSlotToContainer(new Slot(inventory, var6, 8 + var6 * 18, 142));
}
- this.onCraftMatrixChanged(this.craftMatrix);
+ this.onCraftMatrixChanged(this.craftMatrix);
}
@Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockWorkbench) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- // Can merge Slot
- @Override
- public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
- return p_94530_2_.inventory != this.tile_entity.inventoryCraftResult
- && super.func_94530_a(p_94530_1_, p_94530_2_);
- }
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer){
- public void moveChestToCrafting() {
- // Check Crafting items and slots
- for (int i = 0; i < 9; i++) {
- if (this.craftMatrix.getStackInSlot(i) == null || this.craftMatrix.getStackInSlot(i).stackSize > 0) {
- for (int r = 0; r < 16; r++) {
- if (this.inventoryChest.getStackInSlot(r) != null) {
- this.craftMatrix.setInventorySlotContents(i, this.craftMatrix.getStackInSlot(r));
- this.inventoryChest.setInventorySlotContents(r, null);
- }
- }
+ if (!aPlayer.worldObj.isRemote){
+ if (aSlotIndex == 999 || aSlotIndex == -999){
+ //Utils.LOG_WARNING("??? - "+aSlotIndex);
}
- }
- // For Each already existing itemstack, fill current partial stack
- // Remove partial stack from chest area
- }
-
- public void moveCraftingToChest() {
- // Check Chest Space
- for (int i = 0; i < 9; i++) {
- if (this.craftMatrix.getStackInSlot(i) != null) {
- for (int r = 0; r < 16; r++) {
- if (this.inventoryChest.getStackInSlot(r) == null || this.inventoryChest.getStackInSlot(r)
- .getItem() == this.craftMatrix.getStackInSlot(i).getItem()
- && 64 - this.craftMatrix.getStackInSlot(i).stackSize <= 64
- - this.craftMatrix.getStackInSlot(i).stackSize) {
- this.inventoryChest.setInventorySlotContents(r, this.craftMatrix.getStackInSlot(i));
- this.craftMatrix.setInventorySlotContents(i, null);
- break;
- }
- }
- }
- }
- // For Each Space or already existing itemstack, move one itemstack or
- // fill current partial stack
- // Remove old itemstack or partial stack from crafting grid
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
- super.onContainerClosed(par1EntityPlayer);
- this.saveCraftingMatrix();
- }
-
- @Override
- public void onCraftMatrixChanged(final IInventory iiventory) {
- this.tile_entity.inventoryCraftResult.setInventorySlotContents(0,
- CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
- }
-
- private void saveCraftingMatrix() {
- for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) {
- this.tile_entity.inventoryCrafting.setInventorySlotContents(i, this.craftMatrix.getStackInSlot(i));
- }
- }
- /*
- * @Override public void onCraftMatrixChanged(IInventory par1IInventory){
- * //Custom Recipe Handler //craftResult.setInventorySlotContents(0,
- * Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix,
- * worldObj));
- *
- * //Vanilla CraftingManager Utils.LOG_WARNING(
- * "checking crafting grid for a valid output."); ItemStack temp =
- * CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj);
- * if (temp != null){ Utils.LOG_WARNING("Output found. "
- * +temp.getDisplayName()+" x"+temp.stackSize);
- * craftResult.setInventorySlotContents(slotOutput, temp); } else {
- * Utils.LOG_WARNING("No Valid output found.");
- * craftResult.setInventorySlotContents(slotOutput, null); } }
- */
-
- /*
- * @Override public void onContainerClosed(EntityPlayer par1EntityPlayer) {
- * for (int o=0; o<craftMatrix.getSizeInventory(); o++){
- * this.inventoryCrafting.setInventorySlotContents(o,
- * craftMatrix.getStackInSlot(o));
- * this.craftMatrix.setInventorySlotContents(o, null); }
- */
-
- // super.onContainerClosed(par1EntityPlayer);
-
- /*
- * if (worldObj.isRemote) { return; }
- *
- * for (int i = 0; i < InputSlotNumber; i++) { ItemStack itemstack =
- * craftMatrix.getStackInSlotOnClosing(i);
- *
- * if (itemstack != null) {
- * par1EntityPlayer.dropPlayerItemWithRandomChoice(itemstack, false); } }
- */
-
- @Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold,
- final EntityPlayer aPlayer) {
-
- if (!aPlayer.worldObj.isRemote) {
- if (aSlotIndex == 999 || aSlotIndex == -999) {
- // Utils.LOG_WARNING("??? - "+aSlotIndex);
- }
-
- if (aSlotIndex == this.slotOutput) {
+ if (aSlotIndex == slotOutput){
Utils.LOG_WARNING("Player Clicked on the output slot");
- // TODO
+ //TODO
}
- for (final int x : this.slotHolo) {
- if (aSlotIndex == x) {
- Utils.LOG_WARNING("Player Clicked slot " + aSlotIndex + " in the Holo Grid");
- if (x == 1) {
- Utils.LOG_WARNING("Player Clicked Blueprint slot in the Holo Grid");
+ for (int x : slotHolo){
+ if (aSlotIndex == x){
+ Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Holo Grid");
+ if (x == 1){
+ Utils.LOG_WARNING("Player Clicked Blueprint slot in the Holo Grid");
}
- else if (x == 2) {
+ else if (x == 2){
Utils.LOG_WARNING("Player Clicked Right Arrow slot in the Holo Grid");
- if (this.inventoryHolo.getStackInSlot(1) != null) {
+ if (inventoryHolo.getStackInSlot(1) != null){
Utils.LOG_WARNING("Found an ItemStack.");
- if (this.inventoryHolo.getStackInSlot(1).getItem() instanceof IItemBlueprint) {
+ if (inventoryHolo.getStackInSlot(1).getItem() instanceof IItemBlueprint){
Utils.LOG_WARNING("Found a blueprint.");
- final ItemStack tempBlueprint = this.inventoryHolo.getStackInSlot(1);
- final ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem();
- if (this.inventoryHolo.getStackInSlot(0) != null
- && !tempItemBlueprint.hasBlueprint(tempBlueprint)) {
+ ItemStack tempBlueprint = inventoryHolo.getStackInSlot(1);
+ ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem();
+ if (inventoryHolo.getStackInSlot(0) != null && !tempItemBlueprint.hasBlueprint(tempBlueprint)){
Utils.LOG_WARNING("Output slot was not empty.");
- Utils.LOG_WARNING(
- "Trying to manipulate NBT data on the blueprint stack, then replace it with the new one.");
- tempItemBlueprint.setBlueprint(this.inventoryHolo.getStackInSlot(1),
- this.craftMatrix, this.inventoryHolo.getStackInSlot(0));
- final ItemStack newTempBlueprint = ItemUtils.getSimpleStack(tempItemBlueprint);
- this.inventoryHolo.setInventorySlotContents(1, newTempBlueprint);
- Utils.LOG_WARNING(ItemUtils
- .getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint)));
+ Utils.LOG_WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one.");
+ tempItemBlueprint.setBlueprint(inventoryHolo.getStackInSlot(1), craftMatrix, inventoryHolo.getStackInSlot(0));
+ ItemStack newTempBlueprint = ItemUtils.getSimpleStack(tempItemBlueprint);
+ inventoryHolo.setInventorySlotContents(1, newTempBlueprint);
+ Utils.LOG_WARNING(ItemUtils.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint)));
}
else {
- if (tempItemBlueprint.hasBlueprint(tempBlueprint)) {
+ if (tempItemBlueprint.hasBlueprint(tempBlueprint)){
Utils.LOG_WARNING("Blueprint already holds a recipe.");
}
else {
- Utils.LOG_WARNING("Output slot was empty.");
+ Utils.LOG_WARNING("Output slot was empty.");
}
}
}
else {
- Utils.LOG_WARNING("ItemStack found was not a blueprint.");
+ Utils.LOG_WARNING("ItemStack found was not a blueprint.");
}
}
else {
Utils.LOG_WARNING("No ItemStack found in Blueprint slot.");
}
}
- else if (x == 3) {
- Utils.LOG_WARNING("Player Clicked Big [P] slot in the Holo Grid");
+ else if (x == 3){
+ Utils.LOG_WARNING("Player Clicked Big [P] slot in the Holo Grid");
}
- else if (x == 4) {
- Utils.LOG_WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid");
+ else if (x == 4){
+ Utils.LOG_WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid");
}
- else if (x == 5) {
- Utils.LOG_WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid");
+ else if (x == 5){
+ Utils.LOG_WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid");
}
}
}
- for (final int x : this.slotCrafting) {
- if (aSlotIndex == x) {
- Utils.LOG_WARNING("Player Clicked slot " + aSlotIndex + " in the crafting Grid");
+ for (int x : slotCrafting){
+ if (aSlotIndex == x){
+ Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the crafting Grid");
}
}
- for (final int x : this.slotStorage) {
- if (aSlotIndex == x) {
- Utils.LOG_WARNING("Player Clicked slot " + aSlotIndex + " in the storage Grid");
+ for (int x : slotStorage){
+ if (aSlotIndex == x){
+ Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the storage Grid");
}
}
- for (final int x : this.slotTools) {
- if (aSlotIndex == x) {
- Utils.LOG_WARNING("Player Clicked slot " + aSlotIndex + " in the tool Grid");
+ for (int x : slotTools){
+ if (aSlotIndex == x){
+ Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the tool Grid");
}
}
}
- // Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
+ //Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
+ private void updateCraftingMatrix() {
+ for (int i = 0; i < craftMatrix.getSizeInventory(); i++) {
+ craftMatrix.setInventorySlotContents(i, tile_entity.inventoryCrafting.getStackInSlot(i));
+ }
+ }
+
+ @Override
+ public void onCraftMatrixChanged(IInventory iiventory) {
+ tile_entity.inventoryCraftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj));
+ }
+
@Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+ public void onContainerClosed(EntityPlayer par1EntityPlayer)
+ {
+ super.onContainerClosed(par1EntityPlayer);
+ saveCraftingMatrix();
+ }
+
+ private void saveCraftingMatrix() {
+ for (int i = 0; i < craftMatrix.getSizeInventory(); i++) {
+ tile_entity.inventoryCrafting.setInventorySlotContents(i, craftMatrix.getStackInSlot(i));
+ }
+ }
+
+
+
+
+ /*@Override
+ public void onCraftMatrixChanged(IInventory par1IInventory){
+ //Custom Recipe Handler
+ //craftResult.setInventorySlotContents(0, Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix, worldObj));
+
+ //Vanilla CraftingManager
+ Utils.LOG_WARNING("checking crafting grid for a valid output.");
+ ItemStack temp = CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj);
+ if (temp != null){
+ Utils.LOG_WARNING("Output found. "+temp.getDisplayName()+" x"+temp.stackSize);
+ craftResult.setInventorySlotContents(slotOutput, temp);
+ }
+ else {
+ Utils.LOG_WARNING("No Valid output found.");
+ craftResult.setInventorySlotContents(slotOutput, null);
+ }
+ }*/
+
+ /*@Override
+ public void onContainerClosed(EntityPlayer par1EntityPlayer)
+ {
+ for (int o=0; o<craftMatrix.getSizeInventory(); o++){
+ this.inventoryCrafting.setInventorySlotContents(o, craftMatrix.getStackInSlot(o));
+ this.craftMatrix.setInventorySlotContents(o, null);
+ }*/
+
+ //super.onContainerClosed(par1EntityPlayer);
+
+ /*if (worldObj.isRemote)
+ {
+ return;
+ }
+
+ for (int i = 0; i < InputSlotNumber; i++)
+ {
+ ItemStack itemstack = craftMatrix.getStackInSlotOnClosing(i);
+
+ if (itemstack != null)
+ {
+ par1EntityPlayer.dropPlayerItemWithRandomChoice(itemstack, false);
+ }
+ }*/
+
+ @Override
+ public boolean canInteractWith(EntityPlayer par1EntityPlayer){
+ if (worldObj.getBlock(posX, posY, posZ) != ModBlocks.blockWorkbench){
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq((double)posX + 0.5D, (double)posY + 0.5D, (double)posZ + 0.5D) <= 64D;
+ }
+
+
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
+ {
ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
+ Slot var4 = (Slot)this.inventorySlots.get(par2);
- if (var4 != null && var4.getHasStack()) {
- final ItemStack var5 = var4.getStack();
+ if (var4 != null && var4.getHasStack())
+ {
+ ItemStack var5 = var4.getStack();
var3 = var5.copy();
- if (par2 == 0) {
- if (!this.mergeItemStack(var5, Container_Workbench.InOutputSlotNumber,
- Container_Workbench.FullSlotNumber, true)) {
+ if (par2 == 0)
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true))
+ {
return null;
}
var4.onSlotChange(var5, var3);
}
- else if (par2 >= Container_Workbench.InOutputSlotNumber
- && par2 < Container_Workbench.InventoryOutSlotNumber) {
- if (!this.mergeItemStack(var5, Container_Workbench.InventoryOutSlotNumber,
- Container_Workbench.FullSlotNumber, false)) {
+ else if (par2 >= InOutputSlotNumber && par2 < InventoryOutSlotNumber)
+ {
+ if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false))
+ {
return null;
}
}
- else if (par2 >= Container_Workbench.InventoryOutSlotNumber && par2 < Container_Workbench.FullSlotNumber) {
- if (!this.mergeItemStack(var5, Container_Workbench.InOutputSlotNumber,
- Container_Workbench.InventoryOutSlotNumber, false)) {
+ else if (par2 >= InventoryOutSlotNumber && par2 < FullSlotNumber)
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false))
+ {
return null;
}
}
- else if (!this.mergeItemStack(var5, Container_Workbench.InOutputSlotNumber,
- Container_Workbench.FullSlotNumber, false)) {
+ else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false))
+ {
return null;
}
- if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
+ if (var5.stackSize == 0)
+ {
+ var4.putStack((ItemStack)null);
}
- else {
+ else
+ {
var4.onSlotChanged();
}
- if (var5.stackSize == var3.stackSize) {
+ if (var5.stackSize == var3.stackSize)
+ {
return null;
}
@@ -420,10 +408,11 @@ public class Container_Workbench extends Container {
return var3;
}
- private void updateCraftingMatrix() {
- for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) {
- this.craftMatrix.setInventorySlotContents(i, this.tile_entity.inventoryCrafting.getStackInSlot(i));
- }
+ //Can merge Slot
+ @Override
+ public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) {
+ return p_94530_2_.inventory != tile_entity.inventoryCraftResult && super.func_94530_a(p_94530_1_, p_94530_2_);
}
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java b/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java
index d8481a60d4..f7dc7bb08c 100644
--- a/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java
+++ b/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java
@@ -3,84 +3,58 @@ package gtPlusPlus.core.container;
import gregtech.api.gui.GT_Slot_Holo;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.interfaces.IItemBlueprint;
-import gtPlusPlus.core.inventories.*;
+import gtPlusPlus.core.inventories.InventoryWorkbenchChest;
+import gtPlusPlus.core.inventories.InventoryWorkbenchHoloCrafting;
+import gtPlusPlus.core.inventories.InventoryWorkbenchHoloSlots;
+import gtPlusPlus.core.inventories.InventoryWorkbenchToolsElectric;
import gtPlusPlus.core.item.general.ItemBlueprint;
-import gtPlusPlus.core.slots.*;
+import gtPlusPlus.core.slots.SlotBlueprint;
+import gtPlusPlus.core.slots.SlotGtToolElectric;
+import gtPlusPlus.core.slots.SlotNoInput;
+import gtPlusPlus.core.slots.SlotOutput;
import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.*;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.InventoryCrafting;
+import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.world.World;
public class Container_WorkbenchAdvanced extends Container {
- public static int HoloSlotNumber = 6;
- public static int InputSlotNumber = 9; // Number
- // of
- // Slots
- // in
- // the
- // Crafting
- // Grid
- public static int StorageSlotNumber = 16; // Number
- // of
- // slots
- // in
- // storage
- // area
- public static int ToolSlotNumber = 5; // Number
- // of
- // slots
- // in
- // the
- // tool
- // area
- // up
- // top
- public static int InOutputSlotNumber = Container_WorkbenchAdvanced.InputSlotNumber
- + Container_WorkbenchAdvanced.StorageSlotNumber + Container_WorkbenchAdvanced.ToolSlotNumber
- + Container_WorkbenchAdvanced.HoloSlotNumber; // Same
- // plus
- // Output
- // Slot
- public static int InventorySlotNumber = 36; // Inventory
-
- // Slots
- // (Inventory
- // and
- // Hotbar)
- public static int InventoryOutSlotNumber = Container_WorkbenchAdvanced.InventorySlotNumber
- + 1; // Inventory
- // Slot
- // Number
- // +
- // Output
- public static int FullSlotNumber = Container_WorkbenchAdvanced.InventorySlotNumber
- + Container_WorkbenchAdvanced.InOutputSlotNumber; // All
- // slots
- protected TileEntityWorkbenchAdvanced tile_entity;
- public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
-
- public final InventoryWorkbenchChest inventoryChest;
- public final InventoryWorkbenchToolsElectric inventoryTool;
- public final InventoryWorkbenchHoloSlots inventoryHolo;
- public final InventoryWorkbenchHoloCrafting inventoryCrafting;
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- private final int slotOutput = 0;
- private final int[] slotHolo = new int[5];
- private final int[] slotCrafting = new int[9];
- private final int[] slotStorage = new int[16];
- private final int[] slotTools = new int[5];
-
- public Container_WorkbenchAdvanced(final InventoryPlayer inventory, final TileEntityWorkbenchAdvanced tile) {
+ protected TileEntityWorkbenchAdvanced tile_entity;
+ public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
+ public final InventoryWorkbenchChest inventoryChest;
+ public final InventoryWorkbenchToolsElectric inventoryTool;
+ public final InventoryWorkbenchHoloSlots inventoryHolo;
+ public final InventoryWorkbenchHoloCrafting inventoryCrafting;
+
+ private World worldObj;
+ private int posX;
+ private int posY;
+ private int posZ;
+
+ public static int HoloSlotNumber = 6;
+ public static int InputSlotNumber = 9; //Number of Slots in the Crafting Grid
+ public static int StorageSlotNumber = 16; //Number of slots in storage area
+ public static int ToolSlotNumber = 5; // Number of slots in the tool area up top
+ public static int InOutputSlotNumber = InputSlotNumber + StorageSlotNumber + ToolSlotNumber + HoloSlotNumber; //Same plus Output Slot
+ public static int InventorySlotNumber = 36; //Inventory Slots (Inventory and Hotbar)
+ public static int InventoryOutSlotNumber = InventorySlotNumber + 1; //Inventory Slot Number + Output
+ public static int FullSlotNumber = InventorySlotNumber + InOutputSlotNumber; //All slots
+
+ private int slotOutput = 0;
+ private int[] slotHolo = new int[5];
+ private int[] slotCrafting = new int[9];
+ private int[] slotStorage = new int[16];
+ private int[] slotTools = new int[5];
+
+ public Container_WorkbenchAdvanced(InventoryPlayer inventory, TileEntityWorkbenchAdvanced tile){
this.tile_entity = tile;
this.inventoryChest = tile.inventoryChest;
this.inventoryTool = tile.inventoryTool;
@@ -89,293 +63,308 @@ public class Container_WorkbenchAdvanced extends Container {
int var6;
int var7;
- this.worldObj = tile.getWorldObj();
- this.posX = tile.xCoord;
- this.posY = tile.yCoord;
- this.posZ = tile.zCoord;
-
- int o = 0;
-
- // Output slot
- this.addSlotToContainer(
- new SlotOutput(inventory.player, this.craftMatrix, tile.inventoryCraftResult, 0, 136, 64));
- // Util Slots
- this.addSlotToContainer(new SlotBlueprint(this.inventoryHolo, 1, 136, 28)); // Blueprint
- this.addSlotToContainer(new SlotNoInput(this.inventoryHolo, 2, 154, 28)); // Hopper
- this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 3, 154, 64, false, false, 64)); // Parking
- // Holo Slots
- this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 4, 154, 46, false, false, 1));
- this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 5, 136, 46, false, false, 1));
-
- for (int i = 1; i < 6; i++) {
- this.slotHolo[o] = o + 1;
+ worldObj = tile.getWorldObj();
+ posX = tile.xCoord;
+ posY = tile.yCoord;
+ posZ = tile.zCoord;
+
+ int o=0;
+
+ //Output slot
+ addSlotToContainer(new SlotOutput(inventory.player, this.craftMatrix, tile.inventoryCraftResult, 0, 136, 64));
+ //Util Slots
+ addSlotToContainer(new SlotBlueprint(inventoryHolo, 1, 136, 28)); //Blueprint
+ addSlotToContainer(new SlotNoInput(inventoryHolo, 2, 154, 28)); //Hopper
+ addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 3, 154, 64, false, false, 64)); //Parking
+ //Holo Slots
+ addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 4, 154, 46, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(inventoryHolo, 5, 136, 46, false, false, 1));
+
+ for (int i=1; i<6; i++){
+ slotHolo[o] = o+1;
o++;
}
- o = 0;
+ o=0;
- this.updateCraftingMatrix();
+ updateCraftingMatrix();
- // Crafting Grid
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 3; ++var7) {
+ //Crafting Grid
+ for (var6 = 0; var6 < 3; ++var6)
+ {
+ for (var7 = 0; var7 < 3; ++var7)
+ {
this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 82 + var7 * 18, 28 + var6 * 18));
- /*
- * if (this.inventoryCrafting.getStackInSlot(o) != null){
- * this.craftMatrix.setInventorySlotContents(o,
- * inventoryCrafting.getStackInSlot(o));
- * this.inventoryCrafting.setInventorySlotContents(o, null); }
- */
- this.slotCrafting[o] = o + 6;
+ /*if (this.inventoryCrafting.getStackInSlot(o) != null){
+ this.craftMatrix.setInventorySlotContents(o, inventoryCrafting.getStackInSlot(o));
+ this.inventoryCrafting.setInventorySlotContents(o, null);
+ } */
+ slotCrafting[o] = o+6;
o++;
}
}
- o = 0;
+ o=0;
- // Storage Side
- for (var6 = 0; var6 < 4; ++var6) {
- for (var7 = 0; var7 < 4; ++var7) {
- // Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+"
- // x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18));
- this.addSlotToContainer(new Slot(this.inventoryChest, var7 + var6 * 4, 8 + var7 * 18, 7 + var6 * 18));
- this.slotStorage[o] = o + 15;
+ //Storage Side
+ for (var6 = 0; var6 < 4; ++var6)
+ {
+ for (var7 = 0; var7 < 4; ++var7)
+ {
+ //Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18));
+ this.addSlotToContainer(new Slot(inventoryChest, var7 + var6 * 4, 8 + var7 * 18, 7 + var6 * 18));
+ slotStorage[o] = o+15;
o++;
}
}
- o = 0;
+ o=0;
- // Tool Slots
- for (var6 = 0; var6 < 1; ++var6) {
- for (var7 = 0; var7 < 5; ++var7) {
- this.addSlotToContainer(new SlotGtToolElectric(this.inventoryTool, var7 + var6 * 3, 82 + var7 * 18,
- 8 + var6 * 18, 3, false));
- this.slotTools[o] = o + 31;
+ //Tool Slots
+ for (var6 = 0; var6 < 1; ++var6)
+ {
+ for (var7 = 0; var7 < 5; ++var7)
+ {
+ this.addSlotToContainer(new SlotGtToolElectric(inventoryTool, var7 + var6 * 3, 82 + var7 * 18, 8 + var6 * 18, 3, false));
+ slotTools[o] = o+31;
o++;
}
- }
+ }
- // Player Inventory
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 9; ++var7) {
+ //Player Inventory
+ for (var6 = 0; var6 < 3; ++var6)
+ {
+ for (var7 = 0; var7 < 9; ++var7)
+ {
this.addSlotToContainer(new Slot(inventory, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18));
}
}
- // Player Hotbar
- for (var6 = 0; var6 < 9; ++var6) {
+ //Player Hotbar
+ for (var6 = 0; var6 < 9; ++var6)
+ {
this.addSlotToContainer(new Slot(inventory, var6, 8 + var6 * 18, 142));
}
- this.onCraftMatrixChanged(this.craftMatrix);
-
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockWorkbench) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- // Can merge Slot
- @Override
- public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
- return p_94530_2_.inventory != this.tile_entity.inventoryCraftResult
- && super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
- super.onContainerClosed(par1EntityPlayer);
- this.saveCraftingMatrix();
- }
-
- @Override
- public void onCraftMatrixChanged(final IInventory iiventory) {
- this.tile_entity.inventoryCraftResult.setInventorySlotContents(0,
- CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
- }
+ this.onCraftMatrixChanged(this.craftMatrix);
- private void saveCraftingMatrix() {
- for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) {
- this.tile_entity.inventoryCrafting.setInventorySlotContents(i, this.craftMatrix.getStackInSlot(i));
- }
}
- /*
- * @Override public void onCraftMatrixChanged(IInventory par1IInventory){
- * //Custom Recipe Handler //craftResult.setInventorySlotContents(0,
- * Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix,
- * worldObj));
- *
- * //Vanilla CraftingManager Utils.LOG_WARNING(
- * "checking crafting grid for a valid output."); ItemStack temp =
- * CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj);
- * if (temp != null){ Utils.LOG_WARNING("Output found. "
- * +temp.getDisplayName()+" x"+temp.stackSize);
- * craftResult.setInventorySlotContents(slotOutput, temp); } else {
- * Utils.LOG_WARNING("No Valid output found.");
- * craftResult.setInventorySlotContents(slotOutput, null); } }
- */
-
- /*
- * @Override public void onContainerClosed(EntityPlayer par1EntityPlayer) {
- * for (int o=0; o<craftMatrix.getSizeInventory(); o++){
- * this.inventoryCrafting.setInventorySlotContents(o,
- * craftMatrix.getStackInSlot(o));
- * this.craftMatrix.setInventorySlotContents(o, null); }
- */
-
- // super.onContainerClosed(par1EntityPlayer);
-
- /*
- * if (worldObj.isRemote) { return; }
- *
- * for (int i = 0; i < InputSlotNumber; i++) { ItemStack itemstack =
- * craftMatrix.getStackInSlotOnClosing(i);
- *
- * if (itemstack != null) {
- * par1EntityPlayer.dropPlayerItemWithRandomChoice(itemstack, false); } }
- */
-
@Override
- public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold,
- final EntityPlayer aPlayer) {
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer){
- if (!aPlayer.worldObj.isRemote) {
- if (aSlotIndex == 999 || aSlotIndex == -999) {
- // Utils.LOG_WARNING("??? - "+aSlotIndex);
+ if (!aPlayer.worldObj.isRemote){
+ if (aSlotIndex == 999 || aSlotIndex == -999){
+ //Utils.LOG_WARNING("??? - "+aSlotIndex);
}
- if (aSlotIndex == this.slotOutput) {
+ if (aSlotIndex == slotOutput){
Utils.LOG_WARNING("Player Clicked on the output slot");
- // TODO
+ //TODO
}
- for (final int x : this.slotHolo) {
- if (aSlotIndex == x) {
- Utils.LOG_WARNING("Player Clicked slot " + aSlotIndex + " in the Holo Grid");
- if (x == 1) {
- Utils.LOG_WARNING("Player Clicked Blueprint slot in the Holo Grid");
+ for (int x : slotHolo){
+ if (aSlotIndex == x){
+ Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Holo Grid");
+ if (x == 1){
+ Utils.LOG_WARNING("Player Clicked Blueprint slot in the Holo Grid");
}
- else if (x == 2) {
+ else if (x == 2){
Utils.LOG_WARNING("Player Clicked Right Arrow slot in the Holo Grid");
- if (this.inventoryHolo.getStackInSlot(1) != null) {
+ if (inventoryHolo.getStackInSlot(1) != null){
Utils.LOG_WARNING("Found an ItemStack.");
- if (this.inventoryHolo.getStackInSlot(1).getItem() instanceof IItemBlueprint) {
+ if (inventoryHolo.getStackInSlot(1).getItem() instanceof IItemBlueprint){
Utils.LOG_WARNING("Found a blueprint.");
- final ItemStack tempBlueprint = this.inventoryHolo.getStackInSlot(1);
- final ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem();
- if (this.inventoryHolo.getStackInSlot(0) != null
- && !tempItemBlueprint.hasBlueprint(tempBlueprint)) {
+ ItemStack tempBlueprint = inventoryHolo.getStackInSlot(1);
+ ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem();
+ if (inventoryHolo.getStackInSlot(0) != null && !tempItemBlueprint.hasBlueprint(tempBlueprint)){
Utils.LOG_WARNING("Output slot was not empty.");
- Utils.LOG_WARNING(
- "Trying to manipulate NBT data on the blueprint stack, then replace it with the new one.");
- tempItemBlueprint.setBlueprint(this.inventoryHolo.getStackInSlot(1),
- this.craftMatrix, this.inventoryHolo.getStackInSlot(0));
- final ItemStack newTempBlueprint = ItemUtils.getSimpleStack(tempItemBlueprint);
- this.inventoryHolo.setInventorySlotContents(1, newTempBlueprint);
- Utils.LOG_WARNING(ItemUtils
- .getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint)));
+ Utils.LOG_WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one.");
+ tempItemBlueprint.setBlueprint(inventoryHolo.getStackInSlot(1), craftMatrix, inventoryHolo.getStackInSlot(0));
+ ItemStack newTempBlueprint = ItemUtils.getSimpleStack(tempItemBlueprint);
+ inventoryHolo.setInventorySlotContents(1, newTempBlueprint);
+ Utils.LOG_WARNING(ItemUtils.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint)));
}
else {
- if (tempItemBlueprint.hasBlueprint(tempBlueprint)) {
+ if (tempItemBlueprint.hasBlueprint(tempBlueprint)){
Utils.LOG_WARNING("Blueprint already holds a recipe.");
}
else {
- Utils.LOG_WARNING("Output slot was empty.");
+ Utils.LOG_WARNING("Output slot was empty.");
}
}
}
else {
- Utils.LOG_WARNING("ItemStack found was not a blueprint.");
+ Utils.LOG_WARNING("ItemStack found was not a blueprint.");
}
}
else {
Utils.LOG_WARNING("No ItemStack found in Blueprint slot.");
}
}
- else if (x == 3) {
- Utils.LOG_WARNING("Player Clicked Big [P] slot in the Holo Grid");
+ else if (x == 3){
+ Utils.LOG_WARNING("Player Clicked Big [P] slot in the Holo Grid");
}
- else if (x == 4) {
- Utils.LOG_WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid");
+ else if (x == 4){
+ Utils.LOG_WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid");
}
- else if (x == 5) {
- Utils.LOG_WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid");
+ else if (x == 5){
+ Utils.LOG_WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid");
}
}
}
- for (final int x : this.slotCrafting) {
- if (aSlotIndex == x) {
- Utils.LOG_WARNING("Player Clicked slot " + aSlotIndex + " in the crafting Grid");
+ for (int x : slotCrafting){
+ if (aSlotIndex == x){
+ Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the crafting Grid");
}
}
- for (final int x : this.slotStorage) {
- if (aSlotIndex == x) {
- Utils.LOG_WARNING("Player Clicked slot " + aSlotIndex + " in the storage Grid");
+ for (int x : slotStorage){
+ if (aSlotIndex == x){
+ Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the storage Grid");
}
}
- for (final int x : this.slotTools) {
- if (aSlotIndex == x) {
- Utils.LOG_WARNING("Player Clicked slot " + aSlotIndex + " in the tool Grid");
+ for (int x : slotTools){
+ if (aSlotIndex == x){
+ Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the tool Grid");
}
}
}
- // Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
+ //Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
+ private void updateCraftingMatrix() {
+ for (int i = 0; i < craftMatrix.getSizeInventory(); i++) {
+ craftMatrix.setInventorySlotContents(i, tile_entity.inventoryCrafting.getStackInSlot(i));
+ }
+ }
+
+ @Override
+ public void onCraftMatrixChanged(IInventory iiventory) {
+ tile_entity.inventoryCraftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj));
+ }
+
+ @Override
+ public void onContainerClosed(EntityPlayer par1EntityPlayer)
+ {
+ super.onContainerClosed(par1EntityPlayer);
+ saveCraftingMatrix();
+ }
+
+ private void saveCraftingMatrix() {
+ for (int i = 0; i < craftMatrix.getSizeInventory(); i++) {
+ tile_entity.inventoryCrafting.setInventorySlotContents(i, craftMatrix.getStackInSlot(i));
+ }
+ }
+
+
+
+
+ /*@Override
+ public void onCraftMatrixChanged(IInventory par1IInventory){
+ //Custom Recipe Handler
+ //craftResult.setInventorySlotContents(0, Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix, worldObj));
+
+ //Vanilla CraftingManager
+ Utils.LOG_WARNING("checking crafting grid for a valid output.");
+ ItemStack temp = CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj);
+ if (temp != null){
+ Utils.LOG_WARNING("Output found. "+temp.getDisplayName()+" x"+temp.stackSize);
+ craftResult.setInventorySlotContents(slotOutput, temp);
+ }
+ else {
+ Utils.LOG_WARNING("No Valid output found.");
+ craftResult.setInventorySlotContents(slotOutput, null);
+ }
+ }*/
+
+ /*@Override
+ public void onContainerClosed(EntityPlayer par1EntityPlayer)
+ {
+ for (int o=0; o<craftMatrix.getSizeInventory(); o++){
+ this.inventoryCrafting.setInventorySlotContents(o, craftMatrix.getStackInSlot(o));
+ this.craftMatrix.setInventorySlotContents(o, null);
+ }*/
+
+ //super.onContainerClosed(par1EntityPlayer);
+
+ /*if (worldObj.isRemote)
+ {
+ return;
+ }
+
+ for (int i = 0; i < InputSlotNumber; i++)
+ {
+ ItemStack itemstack = craftMatrix.getStackInSlotOnClosing(i);
+
+ if (itemstack != null)
+ {
+ par1EntityPlayer.dropPlayerItemWithRandomChoice(itemstack, false);
+ }
+ }*/
+
+ @Override
+ public boolean canInteractWith(EntityPlayer par1EntityPlayer){
+ if (worldObj.getBlock(posX, posY, posZ) != ModBlocks.blockWorkbench){
+ return false;
+ }
+
+ return par1EntityPlayer.getDistanceSq((double)posX + 0.5D, (double)posY + 0.5D, (double)posZ + 0.5D) <= 64D;
+ }
+
+
@Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
+ {
ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
+ Slot var4 = (Slot)this.inventorySlots.get(par2);
- if (var4 != null && var4.getHasStack()) {
- final ItemStack var5 = var4.getStack();
+ if (var4 != null && var4.getHasStack())
+ {
+ ItemStack var5 = var4.getStack();
var3 = var5.copy();
- if (par2 == 0) {
- if (!this.mergeItemStack(var5, Container_WorkbenchAdvanced.InOutputSlotNumber,
- Container_WorkbenchAdvanced.FullSlotNumber, true)) {
+ if (par2 == 0)
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true))
+ {
return null;
}
var4.onSlotChange(var5, var3);
}
- else if (par2 >= Container_WorkbenchAdvanced.InOutputSlotNumber
- && par2 < Container_WorkbenchAdvanced.InventoryOutSlotNumber) {
- if (!this.mergeItemStack(var5, Container_WorkbenchAdvanced.InventoryOutSlotNumber,
- Container_WorkbenchAdvanced.FullSlotNumber, false)) {
+ else if (par2 >= InOutputSlotNumber && par2 < InventoryOutSlotNumber)
+ {
+ if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false))
+ {
return null;
}
}
- else if (par2 >= Container_WorkbenchAdvanced.InventoryOutSlotNumber
- && par2 < Container_WorkbenchAdvanced.FullSlotNumber) {
- if (!this.mergeItemStack(var5, Container_WorkbenchAdvanced.InOutputSlotNumber,
- Container_WorkbenchAdvanced.InventoryOutSlotNumber, false)) {
+ else if (par2 >= InventoryOutSlotNumber && par2 < FullSlotNumber)
+ {
+ if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false))
+ {
return null;
}
}
- else if (!this.mergeItemStack(var5, Container_WorkbenchAdvanced.InOutputSlotNumber,
- Container_WorkbenchAdvanced.FullSlotNumber, false)) {
+ else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false))
+ {
return null;
}
- if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
+ if (var5.stackSize == 0)
+ {
+ var4.putStack((ItemStack)null);
}
- else {
+ else
+ {
var4.onSlotChanged();
}
- if (var5.stackSize == var3.stackSize) {
+ if (var5.stackSize == var3.stackSize)
+ {
return null;
}
@@ -385,10 +374,11 @@ public class Container_WorkbenchAdvanced extends Container {
return var3;
}
- private void updateCraftingMatrix() {
- for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) {
- this.craftMatrix.setInventorySlotContents(i, this.tile_entity.inventoryCrafting.getStackInSlot(i));
- }
+ //Can merge Slot
+ @Override
+ public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) {
+ return p_94530_2_.inventory != tile_entity.inventoryCraftResult && super.func_94530_a(p_94530_1_, p_94530_2_);
}
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java b/src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java
index b036a2a959..31613f2b85 100644
--- a/src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java
+++ b/src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java
@@ -1,27 +1,31 @@
package gtPlusPlus.core.creative;
-import gtPlusPlus.core.creative.tabs.*;
+import gtPlusPlus.core.creative.tabs.MiscUtilCreativeTabBlock;
+import gtPlusPlus.core.creative.tabs.MiscUtilCreativeTabMachines;
+import gtPlusPlus.core.creative.tabs.MiscUtilCreativeTabMisc;
+import gtPlusPlus.core.creative.tabs.MiscUtilCreativeTabOther;
+import gtPlusPlus.core.creative.tabs.MiscUtilCreativeTabTools;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.creativetab.CreativeTabs;
public class AddToCreativeTab {
- public static CreativeTabs tabBlock;
- public static CreativeTabs tabMisc;
- public static CreativeTabs tabCombat;
- public static CreativeTabs tabTools;
- public static CreativeTabs tabMachines;
- public static CreativeTabs tabOther;
+ public static CreativeTabs tabBlock;
+ public static CreativeTabs tabMisc;
+ public static CreativeTabs tabCombat;
+ public static CreativeTabs tabTools;
+ public static CreativeTabs tabMachines;
+ public static CreativeTabs tabOther;
- public static void initialiseTabs() {
- AddToCreativeTab.tabBlock = new MiscUtilCreativeTabBlock("MiscUtilBlockTab");
- AddToCreativeTab.tabMisc = new MiscUtilCreativeTabMisc("MiscUtilMiscTab");
- AddToCreativeTab.tabTools = new MiscUtilCreativeTabTools("MiscUtilToolsTab");
- AddToCreativeTab.tabMachines = new MiscUtilCreativeTabMachines("MiscUtilMachineTab");
- AddToCreativeTab.tabOther = new MiscUtilCreativeTabOther("MiscUtilOtherTab");
-
- if (CORE.DEBUG) {
- // tabCombat = new MiscUtilCreativeTabCombat("MiscUtilCombatTab");
+ public static void initialiseTabs(){
+ tabBlock = new MiscUtilCreativeTabBlock("MiscUtilBlockTab");
+ tabMisc = new MiscUtilCreativeTabMisc("MiscUtilMiscTab");
+ tabTools = new MiscUtilCreativeTabTools("MiscUtilToolsTab");
+ tabMachines = new MiscUtilCreativeTabMachines("MiscUtilMachineTab");
+ tabOther = new MiscUtilCreativeTabOther("MiscUtilOtherTab");
+
+ if (CORE.DEBUG){
+ //tabCombat = new MiscUtilCreativeTabCombat("MiscUtilCombatTab");
}
}
}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java
index cd13e8cd6d..1220fb1af8 100644
--- a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java
@@ -6,7 +6,7 @@ import net.minecraft.item.Item;
public class MiscUtilCreativeTabBlock extends CreativeTabs {
- public MiscUtilCreativeTabBlock(final String lable) {
+ public MiscUtilCreativeTabBlock(String lable) {
super(lable);
}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java
index 42a24418cf..932f80ed7f 100644
--- a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java
@@ -6,12 +6,13 @@ import net.minecraft.item.Item;
public class MiscUtilCreativeTabMachines extends CreativeTabs {
- public MiscUtilCreativeTabMachines(final String lable) {
+
+ public MiscUtilCreativeTabMachines(String lable) {
super(lable);
}
@Override
- public Item getTabIconItem() {
+ public Item getTabIconItem() {
return ModItems.itemPLACEHOLDER_Circuit;
}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java
index 2a819865fa..619803e6e1 100644
--- a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java
@@ -6,7 +6,7 @@ import net.minecraft.item.Item;
public class MiscUtilCreativeTabMisc extends CreativeTabs {
- public MiscUtilCreativeTabMisc(final String lable) {
+ public MiscUtilCreativeTabMisc(String lable) {
super(lable);
}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java
index 135a1ce0c9..6b7c55fcb8 100644
--- a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java
@@ -6,7 +6,7 @@ import net.minecraft.item.Item;
public class MiscUtilCreativeTabOther extends CreativeTabs {
- public MiscUtilCreativeTabOther(final String lable) {
+ public MiscUtilCreativeTabOther(String lable) {
super(lable);
}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java
index 738266f381..fe61ea6f11 100644
--- a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java
@@ -6,7 +6,7 @@ import net.minecraft.item.Item;
public class MiscUtilCreativeTabTools extends CreativeTabs {
- public MiscUtilCreativeTabTools(final String lable) {
+ public MiscUtilCreativeTabTools(String lable) {
super(lable);
}
diff --git a/src/Java/gtPlusPlus/core/entity/EntityTeleportFX.java b/src/Java/gtPlusPlus/core/entity/EntityTeleportFX.java
index 519bddc7e3..eff516c289 100644
--- a/src/Java/gtPlusPlus/core/entity/EntityTeleportFX.java
+++ b/src/Java/gtPlusPlus/core/entity/EntityTeleportFX.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.entity;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Items;
@@ -9,222 +7,230 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class EntityTeleportFX extends Entity {
- private static final String __OBFID = "CL_00001716";
- /** 'x' location the eye should float towards. */
- private double targetX;
- /** 'y' location the eye should float towards. */
- private double targetY;
- /** 'z' location the eye should float towards. */
- private double targetZ;
- private int despawnTimer;
- private boolean shatterOrDrop;
-
- public EntityTeleportFX(final World p_i1757_1_) {
- super(p_i1757_1_);
- this.setSize(0.25F, 0.25F);
- }
-
- public EntityTeleportFX(final World p_i1758_1_, final double p_i1758_2_, final double p_i1758_4_,
- final double p_i1758_6_) {
- super(p_i1758_1_);
- this.despawnTimer = 0;
- this.setSize(0.25F, 0.25F);
- this.setPosition(p_i1758_2_, p_i1758_4_, p_i1758_6_);
- this.yOffset = 0.0F;
- }
-
- /**
- * If returns false, the item will not inflict any damage against entities.
- */
- @Override
- public boolean canAttackWithItem() {
- return false;
- }
-
- @Override
- protected void entityInit() {
- }
-
- /**
- * Gets how bright this entity is.
- */
- @Override
- public float getBrightness(final float p_70013_1_) {
- return 1.0F;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getBrightnessForRender(final float p_70070_1_) {
- return 15728880;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public float getShadowSize() {
- return 0.0F;
- }
-
- /**
- * Checks if the entity is in range to render by using the past in distance
- * and comparing it to its average edge length * 64 * renderDistanceWeight
- * Args: distance
- */
- @Override
- @SideOnly(Side.CLIENT)
- public boolean isInRangeToRenderDist(final double p_70112_1_) {
- double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D;
- d1 *= 64.0D;
- return p_70112_1_ < d1 * d1;
- }
-
- /**
- * The location the eye should float/move towards. Currently used for moving
- * towards the nearest stronghold. Args: strongholdX, strongholdY,
- * strongholdZ
- */
- public void moveTowards(final double p_70220_1_, final int p_70220_3_, final double p_70220_4_) {
- final double d2 = p_70220_1_ - this.posX;
- final double d3 = p_70220_4_ - this.posZ;
- final float f = MathHelper.sqrt_double(d2 * d2 + d3 * d3);
-
- if (f > 12.0F) {
- this.targetX = this.posX + d2 / f * 12.0D;
- this.targetZ = this.posZ + d3 / f * 12.0D;
- this.targetY = this.posY + 8.0D;
- }
- else {
- this.targetX = p_70220_1_;
- this.targetY = p_70220_3_;
- this.targetZ = p_70220_4_;
- }
-
- this.despawnTimer = 0;
- this.shatterOrDrop = this.rand.nextInt(5) > 0;
- }
-
- /**
- * Called to update the entity's position/logic.
- */
- @Override
- public void onUpdate() {
- this.lastTickPosX = this.posX;
- this.lastTickPosY = this.posY;
- this.lastTickPosZ = this.posZ;
- super.onUpdate();
- this.posX += this.motionX;
- this.posY += this.motionY;
- this.posZ += this.motionZ;
- final float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
- this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
-
- for (this.rotationPitch = (float) (Math.atan2(this.motionY, f) * 180.0D / Math.PI); this.rotationPitch
- - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
- ;
- }
-
- while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
- this.prevRotationPitch += 360.0F;
- }
-
- while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
- this.prevRotationYaw -= 360.0F;
- }
-
- while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
- this.prevRotationYaw += 360.0F;
- }
-
- this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
- this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
-
- if (!this.worldObj.isRemote) {
- final double d0 = this.targetX - this.posX;
- final double d1 = this.targetZ - this.posZ;
- final float f1 = (float) Math.sqrt(d0 * d0 + d1 * d1);
- final float f2 = (float) Math.atan2(d1, d0);
- double d2 = f + (f1 - f) * 0.0025D;
-
- if (f1 < 1.0F) {
- d2 *= 0.8D;
- this.motionY *= 0.8D;
- }
-
- this.motionX = Math.cos(f2) * d2;
- this.motionZ = Math.sin(f2) * d2;
-
- if (this.posY < this.targetY) {
- this.motionY += (1.0D - this.motionY) * 0.014999999664723873D;
- }
- else {
- this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D;
- }
- }
-
- final float f3 = 0.25F;
-
- if (this.isInWater()) {
- for (int i = 0; i < 4; ++i) {
- this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f3, this.posY - this.motionY * f3,
- this.posZ - this.motionZ * f3, this.motionX, this.motionY, this.motionZ);
- }
- }
- else {
- this.worldObj.spawnParticle("portal", this.posX - this.motionX * f3 + this.rand.nextDouble() * 0.6D - 0.3D,
- this.posY - this.motionY * f3 - 0.5D,
- this.posZ - this.motionZ * f3 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY,
- this.motionZ);
- }
-
- if (!this.worldObj.isRemote) {
- this.setPosition(this.posX, this.posY, this.posZ);
- ++this.despawnTimer;
-
- if (this.despawnTimer > 80 && !this.worldObj.isRemote) {
- this.setDead();
-
- if (this.shatterOrDrop) {
- this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ,
- new ItemStack(Items.ender_eye)));
- }
- else {
- this.worldObj.playAuxSFX(2003, (int) Math.round(this.posX), (int) Math.round(this.posY),
- (int) Math.round(this.posZ), 0);
- }
- }
- }
- }
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- @Override
- public void readEntityFromNBT(final NBTTagCompound p_70037_1_) {
- }
-
- /**
- * Sets the velocity to the args. Args: x, y, z
- */
- @Override
- @SideOnly(Side.CLIENT)
- public void setVelocity(final double p_70016_1_, final double p_70016_3_, final double p_70016_5_) {
- this.motionX = p_70016_1_;
- this.motionY = p_70016_3_;
- this.motionZ = p_70016_5_;
-
- if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
- final float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_);
- this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI);
- this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(p_70016_3_, f) * 180.0D / Math.PI);
- }
- }
-
- /**
- * (abstract) Protected helper method to write subclass entity data to NBT.
- */
- @Override
- public void writeEntityToNBT(final NBTTagCompound p_70014_1_) {
- }
+public class EntityTeleportFX extends Entity
+{
+ /** 'x' location the eye should float towards. */
+ private double targetX;
+ /** 'y' location the eye should float towards. */
+ private double targetY;
+ /** 'z' location the eye should float towards. */
+ private double targetZ;
+ private int despawnTimer;
+ private boolean shatterOrDrop;
+ private static final String __OBFID = "CL_00001716";
+
+ public EntityTeleportFX(World p_i1757_1_)
+ {
+ super(p_i1757_1_);
+ this.setSize(0.25F, 0.25F);
+ }
+
+ protected void entityInit() {}
+
+ /**
+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
+ * length * 64 * renderDistanceWeight Args: distance
+ */
+ @SideOnly(Side.CLIENT)
+ public boolean isInRangeToRenderDist(double p_70112_1_)
+ {
+ double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D;
+ d1 *= 64.0D;
+ return p_70112_1_ < d1 * d1;
+ }
+
+ public EntityTeleportFX(World p_i1758_1_, double p_i1758_2_, double p_i1758_4_, double p_i1758_6_)
+ {
+ super(p_i1758_1_);
+ this.despawnTimer = 0;
+ this.setSize(0.25F, 0.25F);
+ this.setPosition(p_i1758_2_, p_i1758_4_, p_i1758_6_);
+ this.yOffset = 0.0F;
+ }
+
+ /**
+ * The location the eye should float/move towards. Currently used for moving towards the nearest stronghold. Args:
+ * strongholdX, strongholdY, strongholdZ
+ */
+ public void moveTowards(double p_70220_1_, int p_70220_3_, double p_70220_4_)
+ {
+ double d2 = p_70220_1_ - this.posX;
+ double d3 = p_70220_4_ - this.posZ;
+ float f = MathHelper.sqrt_double(d2 * d2 + d3 * d3);
+
+ if (f > 12.0F)
+ {
+ this.targetX = this.posX + d2 / (double)f * 12.0D;
+ this.targetZ = this.posZ + d3 / (double)f * 12.0D;
+ this.targetY = this.posY + 8.0D;
+ }
+ else
+ {
+ this.targetX = p_70220_1_;
+ this.targetY = (double)p_70220_3_;
+ this.targetZ = p_70220_4_;
+ }
+
+ this.despawnTimer = 0;
+ this.shatterOrDrop = this.rand.nextInt(5) > 0;
+ }
+
+ /**
+ * Sets the velocity to the args. Args: x, y, z
+ */
+ @SideOnly(Side.CLIENT)
+ public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_)
+ {
+ this.motionX = p_70016_1_;
+ this.motionY = p_70016_3_;
+ this.motionZ = p_70016_5_;
+
+ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
+ {
+ float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_);
+ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI);
+ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, (double)f) * 180.0D / Math.PI);
+ }
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ public void onUpdate()
+ {
+ this.lastTickPosX = this.posX;
+ this.lastTickPosY = this.posY;
+ this.lastTickPosZ = this.posZ;
+ super.onUpdate();
+ this.posX += this.motionX;
+ this.posY += this.motionY;
+ this.posZ += this.motionZ;
+ float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
+ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
+
+ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
+ {
+ ;
+ }
+
+ while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
+ {
+ this.prevRotationPitch += 360.0F;
+ }
+
+ while (this.rotationYaw - this.prevRotationYaw < -180.0F)
+ {
+ this.prevRotationYaw -= 360.0F;
+ }
+
+ while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
+ {
+ this.prevRotationYaw += 360.0F;
+ }
+
+ this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
+ this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
+
+ if (!this.worldObj.isRemote)
+ {
+ double d0 = this.targetX - this.posX;
+ double d1 = this.targetZ - this.posZ;
+ float f1 = (float)Math.sqrt(d0 * d0 + d1 * d1);
+ float f2 = (float)Math.atan2(d1, d0);
+ double d2 = (double)f + (double)(f1 - f) * 0.0025D;
+
+ if (f1 < 1.0F)
+ {
+ d2 *= 0.8D;
+ this.motionY *= 0.8D;
+ }
+
+ this.motionX = Math.cos((double)f2) * d2;
+ this.motionZ = Math.sin((double)f2) * d2;
+
+ if (this.posY < this.targetY)
+ {
+ this.motionY += (1.0D - this.motionY) * 0.014999999664723873D;
+ }
+ else
+ {
+ this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D;
+ }
+ }
+
+ float f3 = 0.25F;
+
+ if (this.isInWater())
+ {
+ for (int i = 0; i < 4; ++i)
+ {
+ this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ);
+ }
+ }
+ else
+ {
+ this.worldObj.spawnParticle("portal", this.posX - this.motionX * (double)f3 + this.rand.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * (double)f3 - 0.5D, this.posZ - this.motionZ * (double)f3 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ);
+ }
+
+ if (!this.worldObj.isRemote)
+ {
+ this.setPosition(this.posX, this.posY, this.posZ);
+ ++this.despawnTimer;
+
+ if (this.despawnTimer > 80 && !this.worldObj.isRemote)
+ {
+ this.setDead();
+
+ if (this.shatterOrDrop)
+ {
+ this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.ender_eye)));
+ }
+ else
+ {
+ this.worldObj.playAuxSFX(2003, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0);
+ }
+ }
+ }
+ }
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ public void writeEntityToNBT(NBTTagCompound p_70014_1_) {}
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ public void readEntityFromNBT(NBTTagCompound p_70037_1_) {}
+
+ @SideOnly(Side.CLIENT)
+ public float getShadowSize()
+ {
+ return 0.0F;
+ }
+
+ /**
+ * Gets how bright this entity is.
+ */
+ public float getBrightness(float p_70013_1_)
+ {
+ return 1.0F;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public int getBrightnessForRender(float p_70070_1_)
+ {
+ return 15728880;
+ }
+
+ /**
+ * If returns false, the item will not inflict any damage against entities.
+ */
+ public boolean canAttackWithItem()
+ {
+ return false;
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java
index d2774c18d7..52bfa7d2d9 100644
--- a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java
+++ b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.fluids;
-import cpw.mods.fml.common.registry.LanguageRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
@@ -14,99 +11,97 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
+import cpw.mods.fml.common.registry.LanguageRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockFluidBase extends BlockFluidClassic {
- @SideOnly(Side.CLIENT)
- protected IIcon stillIcon;
- @SideOnly(Side.CLIENT)
- protected IIcon flowingIcon;
-
- protected int colour;
- protected Material fluidMaterial;
- final String displayName;
-
- @SuppressWarnings("deprecation")
- public BlockFluidBase(final Fluid fluid, final Material material) {
- super(fluid, net.minecraft.block.material.Material.lava);
- final short[] tempColour = material.getRGBA();
- this.colour = Utils.rgbtoHexValue(tempColour[0], tempColour[1], tempColour[2]);
- this.fluidMaterial = material;
- this.setCreativeTab(AddToCreativeTab.tabOther);
- this.displayName = material.getLocalizedName();
- LanguageRegistry.addName(this, "Molten " + this.displayName + " ["
- + MathUtils.celsiusToKelvin(this.fluidMaterial.getBoilingPointC()) + "K]");
- this.setBlockName(this.GetProperName());
- }
-
- @SuppressWarnings("deprecation")
- public BlockFluidBase(final String fluidName, final Fluid fluid, final short[] colour) {
- super(fluid, net.minecraft.block.material.Material.lava);
- final short[] tempColour = colour;
- this.colour = Utils.rgbtoHexValue(tempColour[0], tempColour[1], tempColour[2]);
- this.setCreativeTab(AddToCreativeTab.tabOther);
- this.displayName = fluidName;
- LanguageRegistry.addName(this, "Molten " + this.displayName);
- this.setBlockName(this.GetProperName());
- }
-
- @Override
- public boolean canDisplace(final IBlockAccess world, final int x, final int y, final int z) {
- if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
- return false;
- }
- return super.canDisplace(world, x, y, z);
- }
+ @SideOnly(Side.CLIENT)
+ protected IIcon stillIcon;
+ @SideOnly(Side.CLIENT)
+ protected IIcon flowingIcon;
+
+ protected int colour;
+ protected Material fluidMaterial;
+ final String displayName;
+
+ @SuppressWarnings("deprecation")
+ public BlockFluidBase(Fluid fluid, Material material) {
+ super(fluid, net.minecraft.block.material.Material.lava);
+ short[] tempColour = material.getRGBA();
+ this.colour = Utils.rgbtoHexValue(tempColour[0], tempColour[1], tempColour[2]);
+ this.fluidMaterial = material;
+ setCreativeTab(AddToCreativeTab.tabOther);
+ this.displayName = material.getLocalizedName();
+ LanguageRegistry.addName(this, "Molten "+displayName+" ["+MathUtils.celsiusToKelvin(fluidMaterial.getBoilingPointC())+"K]");
+ this.setBlockName(GetProperName());
+ }
+
+ @SuppressWarnings("deprecation")
+ public BlockFluidBase(String fluidName, Fluid fluid, short[] colour) {
+ super(fluid, net.minecraft.block.material.Material.lava);
+ short[] tempColour = colour;
+ this.colour = Utils.rgbtoHexValue(tempColour[0], tempColour[1], tempColour[2]);
+ setCreativeTab(AddToCreativeTab.tabOther);
+ this.displayName = fluidName;
+ LanguageRegistry.addName(this, "Molten "+displayName);
+ this.setBlockName(GetProperName());
+ }
+
+ @Override
+ public IIcon getIcon(int side, int meta) {
+ return (side == 0 || side == 1)? stillIcon : flowingIcon;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(IIconRegister register) {
+ stillIcon = register.registerIcon(CORE.MODID+":fluids/fluid.molten.autogenerated");
+ flowingIcon = register.registerIcon(CORE.MODID+":fluids/fluid.molten.autogenerated");
+ }
+
+ @Override
+ public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
+ return super.canDisplace(world, x, y, z);
+ }
+
+ @Override
+ public boolean displaceIfPossible(World world, int x, int y, int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
+ return super.displaceIfPossible(world, x, y, z);
+ }
@Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
-
- if (this.colour == 0) {
+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4){
+
+ if (this.colour == 0){
return MathUtils.generateSingularRandomHexValue();
}
-
+
return this.colour;
}
-
- @Override
- public boolean displaceIfPossible(final World world, final int x, final int y, final int z) {
- if (world.getBlock(x, y, z).getMaterial().isLiquid()) {
- return false;
- }
- return super.displaceIfPossible(world, x, y, z);
- }
-
- public Material getFluidMaterial() {
- return this.fluidMaterial;
- }
-
- @Override
- public IIcon getIcon(final int side, final int meta) {
- return side == 0 || side == 1 ? this.stillIcon : this.flowingIcon;
- }
-
- public String GetProperName() {
- String tempIngot;
-
- tempIngot = "Molten " + this.displayName;
-
- return tempIngot;
- }
-
- @Override
- public int getRenderColor(final int aMeta) {
- if (this.colour == 0) {
+
+ @Override
+ public int getRenderColor(int aMeta) {
+ if (this.colour == 0){
return MathUtils.generateSingularRandomHexValue();
}
-
+
return this.colour;
- }
+ }
+
+ public String GetProperName() {
+ String tempIngot;
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons(final IIconRegister register) {
- this.stillIcon = register.registerIcon(CORE.MODID + ":fluids/fluid.molten.autogenerated");
- this.flowingIcon = register.registerIcon(CORE.MODID + ":fluids/fluid.molten.autogenerated");
- }
+ tempIngot = "Molten "+displayName;
-}
+ return tempIngot;
+ }
+
+ public Material getFluidMaterial(){
+ return fluidMaterial;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/fluids/FluidRegistryHandler.java b/src/Java/gtPlusPlus/core/fluids/FluidRegistryHandler.java
index 22839c3927..477d5da944 100644
--- a/src/Java/gtPlusPlus/core/fluids/FluidRegistryHandler.java
+++ b/src/Java/gtPlusPlus/core/fluids/FluidRegistryHandler.java
@@ -1,54 +1,52 @@
package gtPlusPlus.core.fluids;
-import cpw.mods.fml.common.registry.GameRegistry;
-import gtPlusPlus.core.block.ModBlocks;
+import static gtPlusPlus.core.block.ModBlocks.blockFluidJackDaniels;
+import static gtPlusPlus.core.block.ModBlocks.fluidJackDaniels;
import gtPlusPlus.core.block.general.fluids.BlockFluidJackDaniels;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.FluidRegistry;
+import cpw.mods.fml.common.registry.GameRegistry;
public class FluidRegistryHandler {
+
+ //Fluids
+ /**
+ *
+ * Luminosity .setLuminosity(luminosity)
+ How much light does the fluid emit. Default: 0, Lava uses 15
+ Density .setDensity(density)
+ How dense is the fluid, the only effect is whether or not a fluid replaces another fluid when they flow into each other. Default: 1000, the density of water at 4 degrees Celsius in kg/m³
+ Temperature .setTemperature(temp)
+ How hot, or cold is the fluid. Has currently no effect. Default: 295, the "normal" room temperature in degrees Kelvin, this is approximately 72°F or 22°C.
+ Viscosity .setViscosity(viscosity)
+ How thick the fluid is. Determines how fast it flows. Default: 1000 for water, lava uses 6000
+ Is Gaseous .setGaseous(boolean)
+ Indicates if the fluid is gaseous. Used for rendering. Default: false
+ *
+ */
- private static void fluidJackDaniels() {
- // testFluid
- ModBlocks.fluidJackDaniels.setLuminosity(12);
- ModBlocks.fluidJackDaniels.setDensity(1200);
- ModBlocks.fluidJackDaniels.setTemperature(420);
- ModBlocks.fluidJackDaniels.setViscosity(750);
- ModBlocks.fluidJackDaniels.setGaseous(true);
- ModBlocks.fluidJackDaniels.setUnlocalizedName("fluidJackDaniels");
- FluidRegistry.registerFluid(ModBlocks.fluidJackDaniels);
- ModBlocks.blockFluidJackDaniels = new BlockFluidJackDaniels(ModBlocks.fluidJackDaniels, Material.water)
- .setBlockName("fluidBlockJackDaniels");
- GameRegistry.registerBlock(ModBlocks.blockFluidJackDaniels,
- CORE.MODID + "_" + ModBlocks.blockFluidJackDaniels.getUnlocalizedName().substring(5));
- ModBlocks.fluidJackDaniels.setUnlocalizedName(ModBlocks.blockFluidJackDaniels.getUnlocalizedName());
- }
-
- // Fluids
- /**
- *
- * Luminosity .setLuminosity(luminosity) How much light does the fluid emit.
- * Default: 0, Lava uses 15 Density .setDensity(density) How dense is the
- * fluid, the only effect is whether or not a fluid replaces another fluid
- * when they flow into each other. Default: 1000, the density of water at 4
- * degrees Celsius in kg/m³ Temperature .setTemperature(temp) How hot, or
- * cold is the fluid. Has currently no effect. Default: 295, the "normal"
- * room temperature in degrees Kelvin, this is approximately 72°F or 22°C.
- * Viscosity .setViscosity(viscosity) How thick the fluid is. Determines how
- * fast it flows. Default: 1000 for water, lava uses 6000 Is Gaseous
- * .setGaseous(boolean) Indicates if the fluid is gaseous. Used for
- * rendering. Default: false
- *
- */
-
- public static void registerFluids() {
- FluidRegistryHandler.run();
+ public static void registerFluids(){
+ run();
}
-
+
@SuppressWarnings("unused")
- private static void run() {
- FluidRegistryHandler.fluidJackDaniels();
+ private static void run(){
+ fluidJackDaniels();
}
-
+
+ private static void fluidJackDaniels(){
+ //testFluid
+ fluidJackDaniels.setLuminosity(12);
+ fluidJackDaniels.setDensity(1200);
+ fluidJackDaniels.setTemperature(420);
+ fluidJackDaniels.setViscosity(750);
+ fluidJackDaniels.setGaseous(true);
+ fluidJackDaniels.setUnlocalizedName("fluidJackDaniels");
+ FluidRegistry.registerFluid(fluidJackDaniels);
+ blockFluidJackDaniels = new BlockFluidJackDaniels(fluidJackDaniels, Material.water).setBlockName("fluidBlockJackDaniels");
+ GameRegistry.registerBlock(blockFluidJackDaniels, CORE.MODID + "_" + blockFluidJackDaniels.getUnlocalizedName().substring(5));
+ fluidJackDaniels.setUnlocalizedName(blockFluidJackDaniels.getUnlocalizedName());
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/fluids/GenericFluid.java b/src/Java/gtPlusPlus/core/fluids/GenericFluid.java
index fad8a83d4b..38af8774eb 100644
--- a/src/Java/gtPlusPlus/core/fluids/GenericFluid.java
+++ b/src/Java/gtPlusPlus/core/fluids/GenericFluid.java
@@ -1,81 +1,68 @@
package gtPlusPlus.core.fluids;
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.item.base.itemblock.ItemBlockFluid;
import gtPlusPlus.core.material.Material;
import net.minecraft.block.Block;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class GenericFluid extends Fluid {
-
- protected final String fluidName;
- protected final Fluid fluidFactory;
- protected final Block blockFactory;
- protected final short[] rgba;
-
- public GenericFluid(final Material fluidMaterial, final int luminosity, final int density, final int temperature,
- final int viscosity, final boolean isGas) {
-
- super(fluidMaterial.getUnlocalizedName());
- // IC2_ItemFluidCell fullFluidCell = emptyCell.fill(emptyCell,
- // FluidUtils.getFluidStack(getUnlocalizedName(), 1), true);
-
- this.fluidFactory = this;
- this.rgba = fluidMaterial.getRGBA();
- this.fluidName = fluidMaterial.getUnlocalizedName();
- this.fluidFactory.setLuminosity(luminosity);
- this.fluidFactory.setDensity(density);
- this.fluidFactory.setTemperature(temperature);
- this.fluidFactory.setViscosity(viscosity);
- this.fluidFactory.setGaseous(isGas);
- this.fluidFactory.setUnlocalizedName("fluid" + this.fluidName);
- FluidRegistry.registerFluid(this.fluidFactory);
- this.blockFactory = new BlockFluidBase(this.fluidFactory, fluidMaterial)
- .setBlockName("fluidblock" + this.fluidName);
- GameRegistry.registerBlock(this.blockFactory, ItemBlockFluid.class,
- this.blockFactory.getUnlocalizedName().substring(5));
- this.fluidFactory.setBlock(this.blockFactory);
- // IC2_ItemFluidCell emptyCell = new IC2_ItemFluidCell(fluidName);
- /*
- * if (aFullContainer != null && aEmptyContainer != null &&
- * !FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid,
- * aFluidAmount), aFullContainer, aEmptyContainer)) {
- * GT_Values.RA.addFluidCannerRecipe(aFullContainer,
- * container(aFullContainer, false), null, new FluidStack(rFluid,
- * aFluidAmount)); }
- */
- // fluidFactory.setUnlocalizedName(blockFactory.getUnlocalizedName());
+public class GenericFluid extends Fluid{
- }
-
- public GenericFluid(final String displayName, final String fluidName, final int luminosity, final int density,
- final int temperature, final int viscosity, final boolean isGas, final short[] rgba) {
+ protected final String fluidName;
+ protected final Fluid fluidFactory;
+ protected final Block blockFactory;
+ protected final short[] rgba;
+
+ public GenericFluid(String displayName, String fluidName, int luminosity, int density, int temperature, int viscosity, boolean isGas, short[] rgba) {
super(fluidName);
- this.fluidFactory = this;
+ fluidFactory = this;
this.rgba = rgba;
this.fluidName = fluidName;
- this.fluidFactory.setLuminosity(luminosity);
- this.fluidFactory.setDensity(density);
- this.fluidFactory.setTemperature(temperature);
- this.fluidFactory.setViscosity(viscosity);
- this.fluidFactory.setGaseous(isGas);
- this.fluidFactory.setUnlocalizedName("fluid" + fluidName);
- FluidRegistry.registerFluid(this.fluidFactory);
- this.blockFactory = new BlockFluidBase(displayName, this.fluidFactory, rgba)
- .setBlockName("fluidblock" + fluidName);
- GameRegistry.registerBlock(this.blockFactory, ItemBlockFluid.class,
- this.blockFactory.getUnlocalizedName().substring(5));
- this.fluidFactory.setBlock(this.blockFactory);
-
- // fluidFactory.setUnlocalizedName(blockFactory.getUnlocalizedName());
-
+ fluidFactory.setLuminosity(luminosity);
+ fluidFactory.setDensity(density);
+ fluidFactory.setTemperature(temperature);
+ fluidFactory.setViscosity(viscosity);
+ fluidFactory.setGaseous(isGas);
+ fluidFactory.setUnlocalizedName("fluid"+fluidName);
+ FluidRegistry.registerFluid(fluidFactory);
+ blockFactory = new BlockFluidBase(displayName, fluidFactory, rgba).setBlockName("fluidblock"+fluidName);
+ GameRegistry.registerBlock(blockFactory, ItemBlockFluid.class, blockFactory.getUnlocalizedName().substring(5));
+ fluidFactory.setBlock(blockFactory);
+
+ //fluidFactory.setUnlocalizedName(blockFactory.getUnlocalizedName());
+
}
-
+
+ public GenericFluid(Material fluidMaterial, int luminosity, int density, int temperature, int viscosity, boolean isGas) {
+
+ super(fluidMaterial.getUnlocalizedName());
+ //IC2_ItemFluidCell fullFluidCell = emptyCell.fill(emptyCell, FluidUtils.getFluidStack(getUnlocalizedName(), 1), true);
+
+ fluidFactory = this;
+ this.rgba = fluidMaterial.getRGBA();
+ this.fluidName = fluidMaterial.getUnlocalizedName();
+ fluidFactory.setLuminosity(luminosity);
+ fluidFactory.setDensity(density);
+ fluidFactory.setTemperature(temperature);
+ fluidFactory.setViscosity(viscosity);
+ fluidFactory.setGaseous(isGas);
+ fluidFactory.setUnlocalizedName("fluid"+fluidName);
+ FluidRegistry.registerFluid(fluidFactory);
+ blockFactory = new BlockFluidBase(fluidFactory, fluidMaterial).setBlockName("fluidblock"+fluidName);
+ GameRegistry.registerBlock(blockFactory, ItemBlockFluid.class, blockFactory.getUnlocalizedName().substring(5));
+ fluidFactory.setBlock(blockFactory);
+ //IC2_ItemFluidCell emptyCell = new IC2_ItemFluidCell(fluidName);
+ /*if (aFullContainer != null && aEmptyContainer != null && !FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer)) {
+ GT_Values.RA.addFluidCannerRecipe(aFullContainer, container(aFullContainer, false), null, new FluidStack(rFluid, aFluidAmount));
+ }*/
+ //fluidFactory.setUnlocalizedName(blockFactory.getUnlocalizedName());
+
+ }
+
@Override
public int getColor() {
- return Math.max(0, Math.min(255, this.rgba[0])) << 16 | Math.max(0, Math.min(255, this.rgba[1])) << 8
- | Math.max(0, Math.min(255, this.rgba[2]));
- }
+ return Math.max(0, Math.min(255, this.rgba[0])) << 16 | Math.max(0, Math.min(255, this.rgba[1])) << 8 | Math.max(0, Math.min(255, this.rgba[2]));
+ }
}
diff --git a/src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java b/src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java
index c59d26a1fa..b3531ceb3e 100644
--- a/src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java
+++ b/src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java
@@ -1,38 +1,43 @@
package gtPlusPlus.core.gui.beta;
-import java.util.*;
-
import gtPlusPlus.core.interfaces.IGuiManagerMiscUtils;
-public class Gui_ID_Registry {
- private static final Map<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classMap = new HashMap();
- private static final Map<Integer, MU_GuiId> idMap = new HashMap();
- private static int nextId = 0;
-
- static {
- // registerGuiHandlers(Gui_Types.Tile, Arrays.asList(new Class[]
- // {TileAlveary.class}));
- // registerGuiHandlers(MU_GuiType.Item, Arrays.asList(new Class[] {
- // ItemBackpack.class, ItemBackpackNaturalist.class,
- // ItemBeealyzer.class, ItemCatalogue.class, ItemFlutterlyzer.class,
- // ItemHabitatLocator.class, ItemImprinter.class, ItemInfuser.class,
- // ItemLetter.class, ItemSolderingIron.class, ItemTreealyzer.class }));
- // registerGuiHandlers(MU_GuiType.Entity, Arrays.asList(new Class[] {
- // EntityMinecartApiary.class, EntityMinecartBeehouse.class }));
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class Gui_ID_Registry
+{
+ private static final Map<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classMap = new HashMap();
+ private static final Map<Integer, MU_GuiId> idMap = new HashMap();
+ private static int nextId = 0;
+
+ static
+ {
+ //registerGuiHandlers(Gui_Types.Tile, Arrays.asList(new Class[] {TileAlveary.class}));
+ //registerGuiHandlers(MU_GuiType.Item, Arrays.asList(new Class[] { ItemBackpack.class, ItemBackpackNaturalist.class, ItemBeealyzer.class, ItemCatalogue.class, ItemFlutterlyzer.class, ItemHabitatLocator.class, ItemImprinter.class, ItemInfuser.class, ItemLetter.class, ItemSolderingIron.class, ItemTreealyzer.class }));
+ //registerGuiHandlers(MU_GuiType.Entity, Arrays.asList(new Class[] { EntityMinecartApiary.class, EntityMinecartBeehouse.class }));
}
- public static MU_GuiId getGuiId(final int id) {
- return Gui_ID_Registry.idMap.get(Integer.valueOf(id));
+ private static void registerGuiHandlers(Gui_Types MU_GuiType, List<Class<? extends IGuiManagerMiscUtils>> guiHandlerClasses)
+ {
+ for (Class<? extends IGuiManagerMiscUtils> tileGuiHandlerClass : guiHandlerClasses)
+ {
+ MU_GuiId guiId = new MU_GuiId(nextId++, MU_GuiType, tileGuiHandlerClass);
+ classMap.put(tileGuiHandlerClass, guiId);
+ idMap.put(Integer.valueOf(guiId.getId()), guiId);
+ }
}
- public static MU_GuiId getGuiIdForGuiHandler(final IGuiManagerMiscUtils guiHandler) {
- final Class<? extends IGuiManagerMiscUtils> guiHandlerClass = guiHandler.getClass();
- MU_GuiId guiId = Gui_ID_Registry.classMap.get(guiHandlerClass);
+ public static MU_GuiId getGuiIdForGuiHandler(IGuiManagerMiscUtils guiHandler)
+ {
+ Class<? extends IGuiManagerMiscUtils> guiHandlerClass = guiHandler.getClass();
+ MU_GuiId guiId = (MU_GuiId)classMap.get(guiHandlerClass);
if (guiId == null) {
- for (final Map.Entry<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classGuiIdEntry : Gui_ID_Registry.classMap
- .entrySet()) {
- if (((Class) classGuiIdEntry.getKey()).isAssignableFrom(guiHandlerClass)) {
- guiId = classGuiIdEntry.getValue();
+ for (Map.Entry<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classGuiIdEntry : classMap.entrySet()) {
+ if (((Class)classGuiIdEntry.getKey()).isAssignableFrom(guiHandlerClass))
+ {
+ guiId = (MU_GuiId)classGuiIdEntry.getValue();
break;
}
}
@@ -43,13 +48,9 @@ public class Gui_ID_Registry {
return guiId;
}
- private static void registerGuiHandlers(final Gui_Types MU_GuiType,
- final List<Class<? extends IGuiManagerMiscUtils>> guiHandlerClasses) {
- for (final Class<? extends IGuiManagerMiscUtils> tileGuiHandlerClass : guiHandlerClasses) {
- final MU_GuiId guiId = new MU_GuiId(Gui_ID_Registry.nextId++, MU_GuiType, tileGuiHandlerClass);
- Gui_ID_Registry.classMap.put(tileGuiHandlerClass, guiId);
- Gui_ID_Registry.idMap.put(Integer.valueOf(guiId.getId()), guiId);
- }
+ public static MU_GuiId getGuiId(int id)
+ {
+ return (MU_GuiId)idMap.get(Integer.valueOf(id));
}
}
diff --git a/src/Java/gtPlusPlus/core/gui/beta/Gui_Types.java b/src/Java/gtPlusPlus/core/gui/beta/Gui_Types.java
index 5bf5bc3018..428cae93d5 100644
--- a/src/Java/gtPlusPlus/core/gui/beta/Gui_Types.java
+++ b/src/Java/gtPlusPlus/core/gui/beta/Gui_Types.java
@@ -1,8 +1,8 @@
package gtPlusPlus.core.gui.beta;
-public enum Gui_Types {
- Item, Tile, Entity;
-
- private Gui_Types() {
- }
-} \ No newline at end of file
+public enum Gui_Types
+ {
+ Item, Tile, Entity;
+
+ private Gui_Types() {}
+ } \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/gui/beta/MU_GuiId.java b/src/Java/gtPlusPlus/core/gui/beta/MU_GuiId.java
index 0e1f47d456..7d17870743 100644
--- a/src/Java/gtPlusPlus/core/gui/beta/MU_GuiId.java
+++ b/src/Java/gtPlusPlus/core/gui/beta/MU_GuiId.java
@@ -1,27 +1,32 @@
package gtPlusPlus.core.gui.beta;
-
import gtPlusPlus.core.interfaces.IGuiManagerMiscUtils;
-public class MU_GuiId {
- private final int id;
- private final Gui_Types MU_GuiType;
- private final Class<? extends IGuiManagerMiscUtils> guiHandlerClass;
-
- MU_GuiId(final int id, final Gui_Types MU_GuiType, final Class<? extends IGuiManagerMiscUtils> guiHandlerClass) {
- this.id = id;
- this.MU_GuiType = MU_GuiType;
- this.guiHandlerClass = guiHandlerClass;
- }
-
- public Class<? extends IGuiManagerMiscUtils> getGuiHandlerClass() {
- return this.guiHandlerClass;
- }
-
- public Gui_Types getGuiType() {
- return this.MU_GuiType;
- }
+public class MU_GuiId
+ {
+ private final int id;
+ private final Gui_Types MU_GuiType;
+ private final Class<? extends IGuiManagerMiscUtils> guiHandlerClass;
+
+ MU_GuiId(int id, Gui_Types MU_GuiType, Class<? extends IGuiManagerMiscUtils> guiHandlerClass)
+ {
+ this.id = id;
+ this.MU_GuiType = MU_GuiType;
+ this.guiHandlerClass = guiHandlerClass;
+ }
+
+ public Gui_Types getGuiType()
+ {
+ return this.MU_GuiType;
+ }
+
+ public Class<? extends IGuiManagerMiscUtils> getGuiHandlerClass()
+ {
+ return this.guiHandlerClass;
+ }
+
+ public int getId()
+ {
+ return this.id;
+ }
+ }
- public int getId() {
- return this.id;
- }
-}
diff --git a/src/Java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java b/src/Java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
index 75bc38a57c..cd7b141bd4 100644
--- a/src/Java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
+++ b/src/Java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.gui.item;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL12;
-
import gtPlusPlus.core.container.Container_BackpackBase;
import gtPlusPlus.core.inventories.BaseInventoryBackpack;
import gtPlusPlus.core.lib.CORE;
@@ -14,33 +11,88 @@ import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
-public class GuiBaseBackpack extends GuiContainer {
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+public class GuiBaseBackpack extends GuiContainer
+{
+ /** x and y size of the inventory window in pixels. Defined as float, passed as int
+ * These are used for drawing the player model. */
+ private float xSize_lo;
+ private float ySize_lo;
+
+ /** The FontRenderer used by GuiScreen */
+ protected FontRenderer fontRenderer;
+
+ /** ResourceLocation takes 2 parameters: ModId, path to texture at the location:
+ * "src/minecraft/assets/modid/"
+ *
+ * I have provided a sample texture file that works with this tutorial. Download it
+ * from Forge_Tutorials/textures/gui/
+ */
+ private static final ResourceLocation iconLocation = new ResourceLocation(CORE.MODID, "textures/gui/itemBackpack.png");
+
+ /** The inventory to render on screen */
+ private final BaseInventoryBackpack inventory;
+
+ public GuiBaseBackpack(Container_BackpackBase containerItem)
+ {
+ super(containerItem);
+ this.inventory = containerItem.inventory;
+ }
+
/**
- * ResourceLocation takes 2 parameters: ModId, path to texture at the
- * location: "src/minecraft/assets/modid/"
- *
- * I have provided a sample texture file that works with this tutorial.
- * Download it from Forge_Tutorials/textures/gui/
+ * Draws the screen and all the components in it.
*/
- private static final ResourceLocation iconLocation = new ResourceLocation(CORE.MODID,
- "textures/gui/itemBackpack.png");
+ @Override
+ public void drawScreen(int par1, int par2, float par3)
+ {
+ super.drawScreen(par1, par2, par3);
+ this.xSize_lo = (float)par1;
+ this.ySize_lo = (float)par2;
+ }
+
+ /**
+ * Draw the foreground layer for the GuiContainer (everything in front of the items)
+ */
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ String s = this.inventory.hasCustomInventoryName() ? this.inventory.getInventoryName() : this.inventory.getInventoryName();
+ //this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 0, 4210752);
+ //this.fontRenderer.drawString(I18n.translate("container.inventory"), 26, this.ySize - 96 + 4, 4210752);
+ }
+
+ /**
+ * Draw the background layer for the GuiContainer (everything behind the items)
+ */
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
+ {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(iconLocation);
+ int k = (this.width - this.xSize) / 2;
+ int l = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
+ int i1;
+ drawPlayerModel(k + 51, l + 75, 30, (float)(k + 51) - this.xSize_lo, (float)(l + 75 - 50) - this.ySize_lo, this.mc.thePlayer);
+ }
+
/**
- * This renders the player model in standard inventory position (in later
- * versions of Minecraft / Forge, you can simply call
- * GuiInventory.drawEntityOnScreen directly instead of copying this code)
+ * This renders the player model in standard inventory position (in later versions of Minecraft / Forge, you can
+ * simply call GuiInventory.drawEntityOnScreen directly instead of copying this code)
*/
- public static void drawPlayerModel(final int x, final int y, final int scale, final float yaw, final float pitch,
- final EntityLivingBase entity) {
+ public static void drawPlayerModel(int x, int y, int scale, float yaw, float pitch, EntityLivingBase entity) {
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
GL11.glPushMatrix();
GL11.glTranslatef(x, y, 50.0F);
GL11.glScalef(-scale, scale, scale);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
- final float f2 = entity.renderYawOffset;
- final float f3 = entity.rotationYaw;
- final float f4 = entity.rotationPitch;
- final float f5 = entity.prevRotationYawHead;
- final float f6 = entity.rotationYawHead;
+ float f2 = entity.renderYawOffset;
+ float f3 = entity.rotationYaw;
+ float f4 = entity.rotationPitch;
+ float f5 = entity.prevRotationYawHead;
+ float f6 = entity.rotationYawHead;
GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
RenderHelper.enableStandardItemLighting();
GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
@@ -65,63 +117,4 @@ public class GuiBaseBackpack extends GuiContainer {
GL11.glDisable(GL11.GL_TEXTURE_2D);
OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
-
- /**
- * x and y size of the inventory window in pixels. Defined as float, passed
- * as int These are used for drawing the player model.
- */
- private float xSize_lo;
-
- private float ySize_lo;
-
- /** The FontRenderer used by GuiScreen */
- protected FontRenderer fontRenderer;
-
- /** The inventory to render on screen */
- private final BaseInventoryBackpack inventory;
-
- public GuiBaseBackpack(final Container_BackpackBase containerItem) {
- super(containerItem);
- this.inventory = containerItem.inventory;
- }
-
- /**
- * Draw the background layer for the GuiContainer (everything behind the
- * items)
- */
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(GuiBaseBackpack.iconLocation);
- final int k = (this.width - this.xSize) / 2;
- final int l = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
- final int i1;
- GuiBaseBackpack.drawPlayerModel(k + 51, l + 75, 30, k + 51 - this.xSize_lo, l + 75 - 50 - this.ySize_lo,
- this.mc.thePlayer);
- }
-
- /**
- * Draw the foreground layer for the GuiContainer (everything in front of
- * the items)
- */
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- final String s = this.inventory.hasCustomInventoryName() ? this.inventory.getInventoryName()
- : this.inventory.getInventoryName();
- // this.fontRenderer.drawString(s, this.xSize / 2 -
- // this.fontRenderer.getStringWidth(s) / 2, 0, 4210752);
- // this.fontRenderer.drawString(I18n.translate("container.inventory"),
- // 26, this.ySize - 96 + 4, 4210752);
- }
-
- /**
- * Draws the screen and all the components in it.
- */
- @Override
- public void drawScreen(final int par1, final int par2, final float par3) {
- super.drawScreen(par1, par2, par3);
- this.xSize_lo = par1;
- this.ySize_lo = par2;
- }
}
diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java
index 62e2da7420..c1f687c554 100644
--- a/src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java
+++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.gui.machine;
-import org.lwjgl.opengl.GL11;
-
import gtPlusPlus.core.container.Container_Charger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.machines.TileEntityCharger;
@@ -12,40 +10,41 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
-public class GUI_Charger extends GuiContainer {
- private final ResourceLocation texture = new ResourceLocation(CORE.MODID, "textures/gui/machine_Charger.png");
-
- private final InventoryPlayer inventory;
- private final TileEntityCharger te;
-
- public GUI_Charger(final TileEntityCharger te, final EntityPlayer player) {
- super(new Container_Charger(te, player));
- this.inventory = player.inventory;
- this.te = te;
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- Minecraft.getMinecraft().renderEngine.bindTexture(this.texture);
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
-
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+import org.lwjgl.opengl.GL11;
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(I18n.format(this.te.getInventoryName()),
- this.xSize / 2 - this.fontRendererObj.getStringWidth(I18n.format(this.te.getInventoryName())) / 2, 6,
- 4210752, false);
- // fontRendererObj.drawString(I18n.format(inventory.getInventoryName()),
- // 8, ySize - 96 + 2, 4210752);
- this.fontRendererObj.drawString(I18n.format("Charge:" + this.te.getCharge() + "~"), 8, this.ySize - 96 + 2,
- 4210752);
- this.fontRendererObj.drawString(I18n.format("Progress:" + this.te.getProgress() + "ticks"), 80,
- this.ySize - 96 + 2, 4210752);
- }
+public class GUI_Charger extends GuiContainer
+{
+ private ResourceLocation texture = new ResourceLocation(CORE.MODID, "textures/gui/machine_Charger.png");
+
+ private InventoryPlayer inventory;
+ private TileEntityCharger te;
+
+ public GUI_Charger(TileEntityCharger te, EntityPlayer player)
+ {
+ super(new Container_Charger(te, player));
+ inventory = player.inventory;
+ this.te = te;
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
+ {
+ Minecraft.getMinecraft().renderEngine.bindTexture(texture);
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ fontRendererObj.drawString(I18n.format(te.getInventoryName()), (xSize / 2) - (fontRendererObj.getStringWidth(I18n.format(te.getInventoryName())) / 2), 6, 4210752, false);
+ //fontRendererObj.drawString(I18n.format(inventory.getInventoryName()), 8, ySize - 96 + 2, 4210752);
+ fontRendererObj.drawString(I18n.format("Charge:"+te.getCharge()+"~"), 8, ySize - 96 + 2, 4210752);
+ fontRendererObj.drawString(I18n.format("Progress:"+te.getProgress()+"ticks"), 80, ySize - 96 + 2, 4210752);
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java
index f9346886fd..09b2ee93d8 100644
--- a/src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java
+++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java
@@ -1,7 +1,5 @@
package gtPlusPlus.core.gui.machine;
-import org.lwjgl.opengl.GL11;
-
import gtPlusPlus.core.container.Container_NHG;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.machines.TileEntityNHG;
@@ -12,41 +10,41 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
-public class GUI_NHG extends GuiContainer {
- private final ResourceLocation texture = new ResourceLocation(CORE.MODID,
- "textures/gui/helium_collector_gui_12.png");
-
- private final InventoryPlayer inventory;
- private final TileEntityNHG te;
-
- public GUI_NHG(final TileEntityNHG te, final EntityPlayer player) {
- super(new Container_NHG(te, player));
- this.inventory = player.inventory;
- this.te = te;
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- Minecraft.getMinecraft().renderEngine.bindTexture(this.texture);
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
-
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+import org.lwjgl.opengl.GL11;
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(I18n.format(this.te.getInventoryName()),
- this.xSize / 2 - this.fontRendererObj.getStringWidth(I18n.format(this.te.getInventoryName())) / 2, 6,
- 4210752, false);
- // fontRendererObj.drawString(I18n.format(inventory.getInventoryName()),
- // 8, ySize - 96 + 2, 4210752);
- this.fontRendererObj.drawString(I18n.format("CoreTemp:" + this.te.getCoreTemp() + "K"), 8, this.ySize - 96 + 2,
- 4210752);
- this.fontRendererObj.drawString(I18n.format("Progress:" + this.te.getProgress() + "ticks"), 80,
- this.ySize - 96 + 2, 4210752);
- }
+public class GUI_NHG extends GuiContainer
+{
+ private ResourceLocation texture = new ResourceLocation(CORE.MODID, "textures/gui/helium_collector_gui_12.png");
+
+ private InventoryPlayer inventory;
+ private TileEntityNHG te;
+
+ public GUI_NHG(TileEntityNHG te, EntityPlayer player)
+ {
+ super(new Container_NHG(te, player));
+ inventory = player.inventory;
+ this.te = te;
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
+ {
+ Minecraft.getMinecraft().renderEngine.bindTexture(texture);
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ fontRendererObj.drawString(I18n.format(te.getInventoryName()), (xSize / 2) - (fontRendererObj.getStringWidth(I18n.format(te.getInventoryName())) / 2), 6, 4210752, false);
+ //fontRendererObj.drawString(I18n.format(inventory.getInventoryName()), 8, ySize - 96 + 2, 4210752);
+ fontRendererObj.drawString(I18n.format("CoreTemp:"+te.getCoreTemp()+"K"), 8, ySize - 96 + 2, 4210752);
+ fontRendererObj.drawString(I18n.format("Progress:"+te.getProgress()+"ticks"), 80, ySize - 96 + 2, 4210752);
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_Workbench.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_Workbench.java
index ed092f14d8..86388a2632 100644
--- a/src/Java/gtPlusPlus/core/gui/machine/GUI_Workbench.java
+++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_Workbench.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.gui.machine;
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.container.Container_Workbench;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench;
@@ -12,67 +8,73 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
@SideOnly(Side.CLIENT)
public class GUI_Workbench extends GuiContainer {
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID,
- "textures/gui/BronzeCraftingTable.png");
+ private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/BronzeCraftingTable.png");
+
+ public boolean moveItemsToChest = false;
+ public boolean moveItemsToCrafting = false;
- public boolean moveItemsToChest = false;
- public boolean moveItemsToCrafting = false;
-
- public GUI_Workbench(final InventoryPlayer player_inventory, final TileEntityWorkbench tile) {
+ public GUI_Workbench(InventoryPlayer player_inventory, TileEntityWorkbench tile){
super(new Container_Workbench(player_inventory, tile));
}
+
@Override
- protected void actionPerformed(final GuiButton B) {
- // If the button id is different, or you have mrs buttons, create
- // another if block for that too!
- if (B.id == 1) {
- System.out.println("Trying to empty crafting grid to the storage compartment.");
- // moveItemsToChest = true;
- ((Container_Workbench) this.inventorySlots).moveCraftingToChest();
- }
- else if (B.id == 2) {
- System.out.println("Trying to move items into the crafting grid.");
- // moveItemsToCrafting = true;
- ((Container_Workbench) this.inventorySlots).moveChestToCrafting();
- }
+ protected void drawGuiContainerForegroundLayer(int i, int j){
+ //this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752);
+ //this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
+
@Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(GUI_Workbench.craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ protected void drawGuiContainerBackgroundLayer(float f, int i, int j){
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
}
+
+ //This method is called when the Gui is first called!
@Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j) {
- // this.fontRendererObj.drawString(I18n.format("Workbench", new
- // Object[0]), 28, 6, 4210752);
- // this.fontRendererObj.drawString(I18n.format("container.inventory",
- // new Object[0]), 8, this.ySize - 96 + 2, 4210752);
+ public void initGui()
+ {
+ //You have to add this line for the Gui to function properly!
+ super.initGui();
+
+ //The parameters of GuiButton are(id, x, y, width, height, text);
+ //this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
+ //this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
+ //NOTE: the id always has to be different or else it might get called twice or never!
+ //Add any other buttons here too!
}
- // This method is called when the Gui is first called!
@Override
- public void initGui() {
- // You have to add this line for the Gui to function properly!
- super.initGui();
+ protected void actionPerformed(GuiButton B)
+ {
+ //If the button id is different, or you have mrs buttons, create another if block for that too!
+ if(B.id == 1){
+ System.out.println("Trying to empty crafting grid to the storage compartment.");
+ //moveItemsToChest = true;
+ ((Container_Workbench) this.inventorySlots).moveCraftingToChest();
+ }
+ else if(B.id == 2){
+ System.out.println("Trying to move items into the crafting grid.");
+ //moveItemsToCrafting = true;
+ ((Container_Workbench) this.inventorySlots).moveChestToCrafting();
+ }
- // The parameters of GuiButton are(id, x, y, width, height, text);
- // this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
- // this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
- // NOTE: the id always has to be different or else it might get called
- // twice or never!
- // Add any other buttons here too!
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java
index 3b24ccb02c..5c04acf13b 100644
--- a/src/Java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java
+++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.gui.machine;
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.container.Container_WorkbenchAdvanced;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced;
@@ -11,31 +7,35 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
@SideOnly(Side.CLIENT)
public class GUI_WorkbenchAdvanced extends GuiContainer {
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID,
- "textures/gui/AdvancedCraftingTable.png");
+ private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/AdvancedCraftingTable.png");
- public GUI_WorkbenchAdvanced(final InventoryPlayer player_inventory, final TileEntityWorkbenchAdvanced tile) {
+ public GUI_WorkbenchAdvanced(InventoryPlayer player_inventory, TileEntityWorkbenchAdvanced tile){
super(new Container_WorkbenchAdvanced(player_inventory, tile));
}
+
@Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(GUI_WorkbenchAdvanced.craftingTableGuiTextures);
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ protected void drawGuiContainerForegroundLayer(int i, int j){
+ //this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752);
+ //this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
+
@Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j) {
- // this.fontRendererObj.drawString(I18n.format("Workbench", new
- // Object[0]), 28, 6, 4210752);
- // this.fontRendererObj.drawString(I18n.format("container.inventory",
- // new Object[0]), 8, this.ySize - 96 + 2, 4210752);
+ protected void drawGuiContainerBackgroundLayer(float f, int i, int j){
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index b107dcfa31..63cf7d42c2 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -1,122 +1,155 @@
package gtPlusPlus.core.handler;
-import java.util.LinkedList;
-import java.util.Queue;
-
+import static gtPlusPlus.core.lib.LoadedMods.Gregtech;
import gregtech.api.util.GT_OreDictUnificator;
-import gtPlusPlus.core.common.compat.*;
+import gtPlusPlus.core.common.compat.COMPAT_BigReactors;
+import gtPlusPlus.core.common.compat.COMPAT_CompactWindmills;
+import gtPlusPlus.core.common.compat.COMPAT_EnderIO;
+import gtPlusPlus.core.common.compat.COMPAT_ExtraUtils;
+import gtPlusPlus.core.common.compat.COMPAT_IC2;
+import gtPlusPlus.core.common.compat.COMPAT_MorePlanets;
+import gtPlusPlus.core.common.compat.COMPAT_PneumaticCraft;
+import gtPlusPlus.core.common.compat.COMPAT_RFTools;
+import gtPlusPlus.core.common.compat.COMPAT_SimplyJetpacks;
+import gtPlusPlus.core.common.compat.COMPAT_Thaumcraft;
import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler;
import gtPlusPlus.core.handler.Recipes.RegistrationHandler;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.recipe.*;
+import gtPlusPlus.core.recipe.RECIPES_GREGTECH;
+import gtPlusPlus.core.recipe.RECIPES_LaserEngraver;
+import gtPlusPlus.core.recipe.ShapedRecipeObject;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.recipe.RecipeUtils;
-import gtPlusPlus.xmod.gregtech.registration.gregtech.*;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.Gregtech4Content;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechDehydrator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechEnergyBuffer;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeothermalThermalGenerator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialBlastSmelter;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCentrifuge;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCokeOven;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialElectrolyzer;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMacerator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMassFabricator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMultiTank;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialPlatePress;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialWiremill;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIronBlastFurnace;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechLFTR;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPowerSubStation;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRocketFuelGenerator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSafeBlock;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarGenerators;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSteamCondenser;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSuperConductionPoint;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTieredFluidTanks;
+
+import java.util.LinkedList;
+import java.util.Queue;
+
import net.minecraft.item.ItemStack;
public class COMPAT_HANDLER {
+
+ public static Queue<Object> RemoveRecipeQueue = new LinkedList<Object>();
+ public static Queue<ShapedRecipeObject> AddRecipeQueue = new LinkedList<ShapedRecipeObject>();
+ public static Boolean areInitItemsLoaded = false;
+
+
+ public static void registerMyModsOreDictEntries(){
- public static Queue<Object> RemoveRecipeQueue = new LinkedList<Object>();
- public static Queue<ShapedRecipeObject> AddRecipeQueue = new LinkedList<ShapedRecipeObject>();
- public static Boolean areInitItemsLoaded = false;
+ Utils.LOG_INFO("Registering Materials with OreDict.");
+ //In-house
- public static void InitialiseHandlerThenAddRecipes() {
- RegistrationHandler.run();
- }
+ //tools
+ GT_OreDictUnificator.registerOre("craftingToolSandHammer", new ItemStack(ModItems.itemSandstoneHammer));
- public static void InitialiseLateHandlerThenAddRecipes() {
- LateRegistrationHandler.run();
+ for(int i=1; i<=10; i++){
+ GT_OreDictUnificator.registerOre("bufferCore_"+CORE.VOLTAGES[i-1], new ItemStack(ItemUtils.getItem("miscutils:item.itemBufferCore"+i)));
+ }
}
+
+ public static void registerGregtechMachines() {
+ if (Gregtech) {
+ new RECIPES_LaserEngraver();
+ GregtechEnergyBuffer.run();
+ GregtechLFTR.run();
+ GregtechSteamCondenser.run();
+ GregtechSafeBlock.run();
+ GregtechSuperConductionPoint.run();
+ GregtechIronBlastFurnace.run();
+ GregtechIndustrialCentrifuge.run();
+ GregtechIndustrialCokeOven.run();
+ GregtechIndustrialPlatePress.run();
+ GregtechRocketFuelGenerator.run();
+ GregtechIndustrialElectrolyzer.run();
+ GregtechIndustrialMacerator.run();
+ GregtechIndustrialWiremill.run();
+ GregtechIndustrialMassFabricator.run();
+ GregtechIndustrialBlastSmelter.run();
+ GregtechSolarGenerators.run();
+ GregtechPowerSubStation.run();
+ GregtechDehydrator.run();
+ GregtechTieredFluidTanks.run();
+ GregtechIndustrialMultiTank.run();
+ GregtechGeothermalThermalGenerator.run();
+ Gregtech4Content.run();
+ }
- // InterMod
- public static void intermodOreDictionarySupport() {
-
- if (LoadedMods.Big_Reactors) {
+ }
+
+ //InterMod
+ public static void intermodOreDictionarySupport(){
+
+ if (LoadedMods.Big_Reactors){
COMPAT_BigReactors.OreDict();
}
- if (LoadedMods.EnderIO) {
+ if (LoadedMods.EnderIO){
COMPAT_EnderIO.OreDict();
}
- if (LoadedMods.MorePlanets) {
+ if (LoadedMods.MorePlanets){
COMPAT_MorePlanets.OreDict();
}
- if (LoadedMods.Simply_Jetpacks) {
+ if (LoadedMods.Simply_Jetpacks){
COMPAT_SimplyJetpacks.OreDict();
}
- if (LoadedMods.RFTools) {
+ if (LoadedMods.RFTools){
COMPAT_RFTools.OreDict();
}
- if (LoadedMods.Thaumcraft) {
+ if (LoadedMods.Thaumcraft){
COMPAT_Thaumcraft.OreDict();
}
- if (LoadedMods.Extra_Utils) {
+ if (LoadedMods.Extra_Utils){
COMPAT_ExtraUtils.OreDict();
}
- if (LoadedMods.PneumaticCraft) {
+ if (LoadedMods.PneumaticCraft){
COMPAT_PneumaticCraft.OreDict();
}
- if (LoadedMods.CompactWindmills) {
+ if (LoadedMods.CompactWindmills){
COMPAT_CompactWindmills.OreDict();
}
- if (LoadedMods.IndustrialCraft2) {
+ if (LoadedMods.IndustrialCraft2){
COMPAT_IC2.OreDict();
- }
+ }
}
-
- public static void registerGregtechMachines() {
- if (LoadedMods.Gregtech) {
- new RECIPES_LaserEngraver();
- GregtechEnergyBuffer.run();
- GregtechLFTR.run();
- GregtechSteamCondenser.run();
- GregtechSafeBlock.run();
- GregtechSuperConductionPoint.run();
- GregtechIronBlastFurnace.run();
- GregtechIndustrialCentrifuge.run();
- GregtechIndustrialCokeOven.run();
- GregtechIndustrialPlatePress.run();
- GregtechRocketFuelGenerator.run();
- GregtechIndustrialElectrolyzer.run();
- GregtechIndustrialMacerator.run();
- GregtechIndustrialWiremill.run();
- GregtechIndustrialMassFabricator.run();
- GregtechIndustrialBlastSmelter.run();
- GregtechSolarGenerators.run();
- GregtechPowerSubStation.run();
- GregtechDehydrator.run();
- GregtechTieredFluidTanks.run();
- GregtechIndustrialMultiTank.run();
- GregtechGeothermalThermalGenerator.run();
- Gregtech4Content.run();
- }
-
+
+ public static void RemoveRecipesFromOtherMods(){
+ //Removal of Recipes
+ for(Object item : RemoveRecipeQueue){
+ RecipeUtils.removeCraftingRecipe(item);
+ }
}
-
- public static void registerMyModsOreDictEntries() {
-
- Utils.LOG_INFO("Registering Materials with OreDict.");
- // In-house
-
- // tools
- GT_OreDictUnificator.registerOre("craftingToolSandHammer", new ItemStack(ModItems.itemSandstoneHammer));
-
- for (int i = 1; i <= 10; i++) {
- GT_OreDictUnificator.registerOre("bufferCore_" + CORE.VOLTAGES[i - 1],
- new ItemStack(ItemUtils.getItem("miscutils:item.itemBufferCore" + i)));
- }
+
+ public static void InitialiseHandlerThenAddRecipes(){
+ RegistrationHandler.run();
}
-
- public static void RemoveRecipesFromOtherMods() {
- // Removal of Recipes
- for (final Object item : COMPAT_HANDLER.RemoveRecipeQueue) {
- RecipeUtils.removeCraftingRecipe(item);
- }
+ public static void InitialiseLateHandlerThenAddRecipes(){
+ LateRegistrationHandler.run();
}
-
- public static void startLoadingGregAPIBasedRecipes() {
+
+ public static void startLoadingGregAPIBasedRecipes(){
RECIPES_GREGTECH.run();
}
}
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
index 4dce04f3d5..ccf2b83837 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
@@ -10,7 +10,18 @@ import gtPlusPlus.xmod.thermalfoundation.HANDLER_TF;
public class COMPAT_IntermodStaging {
- public static void init() {
+ public static void preInit(){
+ HANDLER_GT.preInit();
+ HANDLER_GC.preInit();
+ HANDLER_TF.preInit();
+ HANDLER_FR.preInit();
+ HANDLER_Psych.preInit();
+ HANDLER_IC2.preInit();
+ HANDLER_Computronics.preInit();
+
+ }
+
+ public static void init(){
HANDLER_GT.init();
HANDLER_GC.init();
HANDLER_TF.init();
@@ -20,7 +31,7 @@ public class COMPAT_IntermodStaging {
HANDLER_Computronics.init();
}
- public static void postInit() {
+ public static void postInit(){
HANDLER_GT.postInit();
HANDLER_GC.postInit();
HANDLER_TF.postInit();
@@ -30,15 +41,5 @@ public class COMPAT_IntermodStaging {
HANDLER_Computronics.postInit();
}
- public static void preInit() {
- HANDLER_GT.preInit();
- HANDLER_GC.preInit();
- HANDLER_TF.preInit();
- HANDLER_FR.preInit();
- HANDLER_Psych.preInit();
- HANDLER_IC2.preInit();
- HANDLER_Computronics.preInit();
-
- }
}
diff --git a/src/Java/gtPlusPlus/core/handler/CraftingManager.java b/src/Java/gtPlusPlus/core/handler/CraftingManager.java
index 89f7ec1682..bd0f114b1a 100644
--- a/src/Java/gtPlusPlus/core/handler/CraftingManager.java
+++ b/src/Java/gtPlusPlus/core/handler/CraftingManager.java
@@ -2,16 +2,16 @@ package gtPlusPlus.core.handler;
public class CraftingManager {
- public static void addCraftingRecipies() {
-
+ public static void mainRegistry() {
+ addCraftingRecipies();
+ addSmeltingRecipies();
}
- public static void addSmeltingRecipies() {
-
+ public static void addCraftingRecipies() {
+
}
- public static void mainRegistry() {
- CraftingManager.addCraftingRecipies();
- CraftingManager.addSmeltingRecipies();
+ public static void addSmeltingRecipies() {
+
}
}
diff --git a/src/Java/gtPlusPlus/core/handler/GuiHandler.java b/src/Java/gtPlusPlus/core/handler/GuiHandler.java
index e3cf2caf9b..c2b120d428 100644
--- a/src/Java/gtPlusPlus/core/handler/GuiHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java
@@ -1,9 +1,9 @@
package gtPlusPlus.core.handler;
-import cpw.mods.fml.common.network.IGuiHandler;
-import cpw.mods.fml.common.network.NetworkRegistry;
import gtPlusPlus.GTplusplus;
-import gtPlusPlus.core.container.*;
+import gtPlusPlus.core.container.Container_BackpackBase;
+import gtPlusPlus.core.container.Container_Workbench;
+import gtPlusPlus.core.container.Container_WorkbenchAdvanced;
import gtPlusPlus.core.gui.beta.Gui_ID_Registry;
import gtPlusPlus.core.gui.beta.MU_GuiId;
import gtPlusPlus.core.gui.item.GuiBaseBackpack;
@@ -22,129 +22,143 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
+import cpw.mods.fml.common.network.IGuiHandler;
+import cpw.mods.fml.common.network.NetworkRegistry;
public class GuiHandler implements IGuiHandler {
- public static final int GUI1 = 0; // Frame Alveary
- public static final int GUI2 = 1; // RTG
- public static final int GUI3 = 2; // BackpackHandler
- public static final int GUI4 = 3; // Workbench
- public static final int GUI5 = 4; // Workbench Adv
- public static final int GUI6 = 5; //
- public static final int GUI7 = 6; //
- public static final int GUI8 = 7; //
-
- private static short decodeGuiData(final int guiId) {
- return (short) (guiId >> 16);
- }
+ public static final int GUI1 = 0; //Frame Alveary
+ public static final int GUI2 = 1; //RTG
+ public static final int GUI3 = 2; //BackpackHandler
+ public static final int GUI4 = 3; //Workbench
+ public static final int GUI5 = 4; //Workbench Adv
+ public static final int GUI6 = 5; //
+ public static final int GUI7 = 6; //
+ public static final int GUI8 = 7; //
- private static MU_GuiId decodeGuiID(final int guiData) {
- final int guiId = guiData & 0xFF;
- return Gui_ID_Registry.getGuiId(guiId);
- }
- private static int encodeGuiData(final IGuiManager guiHandler, final short data) {
- final MU_GuiId guiId = Gui_ID_Registry.getGuiIdForGuiHandler(guiHandler);
- return data << 16 | guiId.getId();
- }
- public static void init() {
+ public static void init(){
- Utils.LOG_INFO("Registering GUIs.");
- NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new GuiHandler());
- // Register GuiHandler
- // NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new
- // GuiHandler());
+ Utils.LOG_INFO("Registering GUIs.");
+ NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new GuiHandler());
+ //Register GuiHandler
+ //NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new GuiHandler());
}
- // New Methods
- public static void openGui(final EntityPlayer entityplayer, final IGuiManager guiHandler) {
- GuiHandler.openGui(entityplayer, guiHandler, (short) 0);
- }
- public static void openGui(final EntityPlayer entityplayer, final IGuiManager guiHandler, final short data) {
- final int guiData = GuiHandler.encodeGuiData(guiHandler, data);
- final ChunkCoordinates coordinates = guiHandler.getCoordinates();
- entityplayer.openGui(GTplusplus.instance, guiData, entityplayer.worldObj, coordinates.posX, coordinates.posY,
- coordinates.posZ);
- }
+ @Override //ContainerModTileEntity
+ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
+ TileEntity te = world.getTileEntity(x, y, z);
- @Override // GuiModTileEntity
- public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
- final int y, final int z) {
- Utils.LOG_WARNING("getClientGuiElement Called by: " + player + ", in world: " + player.dimension + " at x:" + x
- + ", y:" + y + ", z:" + z + ".");
- final TileEntity te = world.getTileEntity(x, y, z);
- if (te != null) {
- if (ID == GuiHandler.GUI1) {
- if (CORE.configSwitches.enableCustomAlvearyBlocks) {
- Utils.LOG_WARNING("Opening Gui with Id: " + ID + " Alveary Frame Housing");
- return new GUI_FrameHousing((TileAlvearyFrameHousing) te, player);
+ if (te != null){
+ if (ID == GUI1){
+ if (CORE.configSwitches.enableCustomAlvearyBlocks){
+ return new CONTAINER_FrameHousing((TileAlvearyFrameHousing)te, player);
}
}
- else if (ID == GuiHandler.GUI2) {
- Utils.LOG_WARNING("Opening Gui with Id: " + ID + " RTG");
- // return new GUI_RTG((TileEntityRTG) te.);
+ else if (ID == GUI2){
+ //return new CONTAINER_RTG(player, (TileEntityRTG)te);
}
+
+
}
- if (ID == GuiHandler.GUI3) {
- // We have to cast the new container as our custom class
- // and pass in currently held item for the inventory
- return new GuiBaseBackpack(new Container_BackpackBase(player, player.inventory,
- new BaseInventoryBackpack(player.getHeldItem())));
+ if (ID == GUI3)
+ {
+ // Use the player's held item to create the inventory
+ return new Container_BackpackBase(player, player.inventory, new BaseInventoryBackpack(player.getHeldItem()));
}
- if (te != null) {
- if (ID == GuiHandler.GUI4) {
- return new GUI_Workbench(player.inventory, (TileEntityWorkbench) te);
+ if (te != null){
+ if (ID == GUI4){
+
+ return new Container_Workbench(player.inventory, (TileEntityWorkbench)te);
+
}
- if (ID == GuiHandler.GUI5) {
+ if (ID == GUI5){
Utils.LOG_INFO("sad");
- return new GUI_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te);
+ return new Container_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced)te);
+
}
}
+
+
+
+
+
+
return null;
}
- @Override // ContainerModTileEntity
- public Object getServerGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
- final int y, final int z) {
- final TileEntity te = world.getTileEntity(x, y, z);
-
- if (te != null) {
- if (ID == GuiHandler.GUI1) {
- if (CORE.configSwitches.enableCustomAlvearyBlocks) {
- return new CONTAINER_FrameHousing((TileAlvearyFrameHousing) te, player);
+ @Override //GuiModTileEntity
+ public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
+ Utils.LOG_WARNING("getClientGuiElement Called by: "+player+", in world: "+player.dimension+" at x:"+x+", y:"+y+", z:"+z+".");
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te != null){
+ if (ID == GUI1){
+ if (CORE.configSwitches.enableCustomAlvearyBlocks){
+ Utils.LOG_WARNING("Opening Gui with Id: "+ID+" Alveary Frame Housing");
+ return new GUI_FrameHousing((TileAlvearyFrameHousing) te, player);
}
}
- else if (ID == GuiHandler.GUI2) {
- // return new CONTAINER_RTG(player, (TileEntityRTG)te);
+ else if (ID == GUI2){
+ Utils.LOG_WARNING("Opening Gui with Id: "+ID+" RTG");
+ //return new GUI_RTG((TileEntityRTG) te.);
}
-
}
- if (ID == GuiHandler.GUI3) {
- // Use the player's held item to create the inventory
- return new Container_BackpackBase(player, player.inventory,
- new BaseInventoryBackpack(player.getHeldItem()));
+ if (ID == GUI3)
+ {
+ // We have to cast the new container as our custom class
+ // and pass in currently held item for the inventory
+ return new GuiBaseBackpack((Container_BackpackBase) new Container_BackpackBase(player, player.inventory, new BaseInventoryBackpack(player.getHeldItem())));
}
- if (te != null) {
- if (ID == GuiHandler.GUI4) {
-
- return new Container_Workbench(player.inventory, (TileEntityWorkbench) te);
-
+ if (te != null){
+ if (ID == GUI4){
+ return new GUI_Workbench(player.inventory, (TileEntityWorkbench)te);
}
- if (ID == GuiHandler.GUI5) {
+ if (ID == GUI5){
Utils.LOG_INFO("sad");
- return new Container_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te);
-
+ return new GUI_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced)te);
}
}
return null;
}
+
+
+ //New Methods
+ public static void openGui(EntityPlayer entityplayer, IGuiManager guiHandler)
+ {
+ openGui(entityplayer, guiHandler, (short)0);
+ }
+
+ public static void openGui(EntityPlayer entityplayer, IGuiManager guiHandler, short data)
+ {
+ int guiData = encodeGuiData(guiHandler, data);
+ ChunkCoordinates coordinates = guiHandler.getCoordinates();
+ entityplayer.openGui(GTplusplus.instance, guiData, entityplayer.worldObj, coordinates.posX, coordinates.posY, coordinates.posZ);
+ }
+
+ private static int encodeGuiData(IGuiManager guiHandler, short data)
+ {
+ MU_GuiId guiId = Gui_ID_Registry.getGuiIdForGuiHandler(guiHandler);
+ return data << 16 | guiId.getId();
+ }
+
+ private static MU_GuiId decodeGuiID(int guiData)
+ {
+ int guiId = guiData & 0xFF;
+ return Gui_ID_Registry.getGuiId(guiId);
+ }
+
+ private static short decodeGuiData(int guiId)
+ {
+ return (short)(guiId >> 16);
+ }
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java b/src/Java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java
index 71fa76ba38..7d739bdca3 100644
--- a/src/Java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java
@@ -6,25 +6,23 @@ import gtPlusPlus.core.util.Utils;
public class LateRegistrationHandler {
- public static int recipesSuccess = 0;
- public static int recipesFailed = 0;
-
- private final static void init() {
- for (final ShapedRecipeObject item : COMPAT_HANDLER.AddRecipeQueue) {
- item.buildRecipe();
- }
+ public static int recipesSuccess = 0;
+ public static int recipesFailed = 0;
+
+ public static void run(){
+ init();
+ }
+
+ private final static void init(){
+ for(ShapedRecipeObject item : COMPAT_HANDLER.AddRecipeQueue){
+ item.buildRecipe();
+ }
try {
Thread.sleep(10);
- }
- catch (final InterruptedException e) {
+ } catch (InterruptedException e) {
Utils.LOG_INFO(e.toString());
}
- Utils.LOG_INFO("Late Recipes Loaded: " + LateRegistrationHandler.recipesSuccess + " Failed: "
- + LateRegistrationHandler.recipesFailed);
+ Utils.LOG_INFO("Late Recipes Loaded: "+recipesSuccess+" Failed: "+recipesFailed);
}
-
- public static void run() {
- LateRegistrationHandler.init();
- }
-
+
}
diff --git a/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java b/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
index 00e0327134..275a67f571 100644
--- a/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
@@ -1,31 +1,34 @@
package gtPlusPlus.core.handler.Recipes;
import gtPlusPlus.core.handler.COMPAT_HANDLER;
-import gtPlusPlus.core.recipe.*;
+import gtPlusPlus.core.recipe.RECIPES_General;
+import gtPlusPlus.core.recipe.RECIPES_MachineComponents;
+import gtPlusPlus.core.recipe.RECIPES_Machines;
+import gtPlusPlus.core.recipe.RECIPES_Shapeless;
+import gtPlusPlus.core.recipe.RECIPES_Tools;
+import gtPlusPlus.core.recipe.RECIPE_Batteries;
import gtPlusPlus.core.util.Utils;
public class RegistrationHandler {
- public static int recipesSuccess = 0;
- public static int recipesFailed = 0;
-
- private final static void init() {
+ public static int recipesSuccess = 0;
+ public static int recipesFailed = 0;
+
+ public static void run(){
+ init();
+ }
+
+ private final static void init(){
RECIPES_Tools.RECIPES_LOAD();
RECIPES_Machines.RECIPES_LOAD();
RECIPES_Shapeless.RECIPES_LOAD();
RECIPES_MachineComponents.RECIPES_LOAD();
RECIPE_Batteries.RECIPES_LOAD();
RECIPES_General.RECIPES_LOAD();
- // RECIPES_MTWRAPPER.run();
- Utils.LOG_INFO(
- "Loaded: " + RegistrationHandler.recipesSuccess + " Failed: " + RegistrationHandler.recipesFailed);
+ //RECIPES_MTWRAPPER.run();
+ Utils.LOG_INFO("Loaded: "+recipesSuccess+" Failed: "+recipesFailed);
COMPAT_HANDLER.areInitItemsLoaded = true;
- // Utils.LOG_INFO("MT Loaded: "+RECIPES_MTWRAPPER.MT_RECIPES_LOADED+" MT
- // Failed: "+RECIPES_MTWRAPPER.MT_RECIPES_FAILED);
+ //Utils.LOG_INFO("MT Loaded: "+RECIPES_MTWRAPPER.MT_RECIPES_LOADED+" MT Failed: "+RECIPES_MTWRAPPER.MT_RECIPES_FAILED);
}
-
- public static void run() {
- RegistrationHandler.init();
- }
-
+
}
diff --git a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java
index 0e38e91ddb..e529d47699 100644
--- a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java
@@ -1,24 +1,25 @@
package gtPlusPlus.core.handler.events;
-import java.util.UUID;
-
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.gameevent.PlayerEvent;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.player.PlayerCache;
import gtPlusPlus.core.util.player.PlayerUtils;
+
+import java.util.UUID;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.common.gameevent.PlayerEvent;
public class LoginEventHandler {
- public String localPlayersName;
- public UUID localPlayersUUID;
- private EntityPlayer localPlayerRef;
+ public String localPlayersName;
+ public UUID localPlayersUUID;
+ private EntityPlayer localPlayerRef;
@SubscribeEvent
- public void onPlayerLogin(final PlayerEvent.PlayerLoggedInEvent event) {
+ public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) {
this.localPlayerRef = event.player;
this.localPlayersName = event.player.getDisplayName();
@@ -26,71 +27,68 @@ public class LoginEventHandler {
try {
- if (this.localPlayerRef instanceof EntityPlayerMP && this.localPlayerRef != null) {
- // Populates player cache
- if (!this.localPlayerRef.worldObj.isRemote) {
- PlayerCache.appendParamChanges(this.localPlayersName, this.localPlayersUUID.toString());
-
- if (!CORE.isModUpToDate) {
- Utils.LOG_INFO("You're not using the latest recommended version of GT++, consider updating.");
- Utils.LOG_INFO("Latest version is: " + CORE.MASTER_VERSION);
- Utils.LOG_INFO("You currently have: " + CORE.VERSION);
- PlayerUtils.messagePlayer(this.localPlayerRef,
- "You're not using the latest recommended version of GT++, consider updating.");
- }
- else {
- Utils.LOG_INFO("You're using the latest recommended version of GT++.");
- }
+ if (localPlayerRef instanceof EntityPlayerMP && localPlayerRef != null){
+ //Populates player cache
+ if (!localPlayerRef.worldObj.isRemote){
+ PlayerCache.appendParamChanges(localPlayersName, localPlayersUUID.toString());
+
+ if (!CORE.isModUpToDate){
+ Utils.LOG_INFO("You're not using the latest recommended version of GT++, consider updating.");
+ Utils.LOG_INFO("Latest version is: "+CORE.MASTER_VERSION);
+ Utils.LOG_INFO("You currently have: "+CORE.VERSION);
+ PlayerUtils.messagePlayer(localPlayerRef, "You're not using the latest recommended version of GT++, consider updating.");
+ }
+ else {
+ Utils.LOG_INFO("You're using the latest recommended version of GT++.");
+ }
+
}
- /*
- * if (localPlayerRef.getCommandSenderName().toLowerCase().
- * equalsIgnoreCase("ImQ009") ||
- * localPlayerRef.getCommandSenderName().toLowerCase().contains(
- * "player")){ Utils.LOG_INFO("Spawning a new Santa Thread.");
- * Thread t = new Thread() { UUID threadHandlerIDthing =
- * localPlayersUUID;
- *
- * @Override public void run() { while(true &&
- * Minecraft.getMinecraft().getIntegratedServer() != null) { try
- * { if(localPlayerRef == null){ localPlayerRef =
- * Utils.getPlayerOnServerFromUUID(threadHandlerIDthing); }
- *
- *
- * //ImQ009 is a legend. if
- * (localPlayerRef.getCommandSenderName().toLowerCase().
- * equalsIgnoreCase("ImQ009")){
- * Utils.messagePlayer(localPlayerRef,
- * "Enjoy some complimentary Raisin Bread.");
- * localPlayerRef.inventory.addItemStackToInventory(UtilsItems.
- * getSimpleStack(ModItems.itemIngotRaisinBread,
- * MathUtils.randInt(1, 5))); }
- *
- *
- * if
- * (localPlayerRef.getCommandSenderName().toLowerCase().contains
- * ("player")){ Utils.messagePlayer(localPlayerRef,
- * "Enjoy some complimentary Raisin Bread.");
- * localPlayerRef.inventory.addItemStackToInventory(UtilsItems.
- * getSimpleStack(ModItems.itemIngotRaisinBread,
- * MathUtils.randInt(1, 5))); }
- * Thread.sleep(1000*60*MathUtils.randInt(15, 90)); } catch
- * (InterruptedException ie) { Utils.LOG_INFO(
- * "Santa Mode Disabled."); } }
- *
- * Utils.LOG_INFO("Thread Stopped. Handler Closed.");
- *
- * } }; //t.start();
- *
- *
- * }
- */
-
- }
- }
- catch (final Throwable errr) {
+
+ /*if (localPlayerRef.getCommandSenderName().toLowerCase().equalsIgnoreCase("ImQ009") || localPlayerRef.getCommandSenderName().toLowerCase().contains("player")){
+ Utils.LOG_INFO("Spawning a new Santa Thread.");
+ Thread t = new Thread() {
+ UUID threadHandlerIDthing = localPlayersUUID;
+ @Override
+ public void run() {
+ while(true && Minecraft.getMinecraft().getIntegratedServer() != null) {
+ try {
+ if(localPlayerRef == null){
+ localPlayerRef = Utils.getPlayerOnServerFromUUID(threadHandlerIDthing);
+ }
+
+
+ //ImQ009 is a legend.
+ if (localPlayerRef.getCommandSenderName().toLowerCase().equalsIgnoreCase("ImQ009")){
+ Utils.messagePlayer(localPlayerRef, "Enjoy some complimentary Raisin Bread.");
+ localPlayerRef.inventory.addItemStackToInventory(UtilsItems.getSimpleStack(ModItems.itemIngotRaisinBread, MathUtils.randInt(1, 5)));
+ }
+
+
+ if (localPlayerRef.getCommandSenderName().toLowerCase().contains("player")){
+ Utils.messagePlayer(localPlayerRef, "Enjoy some complimentary Raisin Bread.");
+ localPlayerRef.inventory.addItemStackToInventory(UtilsItems.getSimpleStack(ModItems.itemIngotRaisinBread, MathUtils.randInt(1, 5)));
+ }
+ Thread.sleep(1000*60*MathUtils.randInt(15, 90));
+ } catch (InterruptedException ie) {
+ Utils.LOG_INFO("Santa Mode Disabled.");
+ }
+ }
+
+ Utils.LOG_INFO("Thread Stopped. Handler Closed.");
+
+ }
+ };
+ //t.start();
+
+
+ }*/
+
+
+ }
+ } catch (Throwable errr){
Utils.LOG_INFO("Login Handler encountered an error.");
}
diff --git a/src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
index 5c962a5d2f..49b844f057 100644
--- a/src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
@@ -1,53 +1,54 @@
package gtPlusPlus.core.handler.events;
-import java.util.UUID;
-
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.metatileentity.*;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.BaseMetaTileEntity;
+import gregtech.api.metatileentity.BaseTileEntity;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.player.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines.GregtechMetaSafeBlockBase;
+
+import java.util.UUID;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.BlockEvent.BreakEvent;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class PickaxeBlockBreakEventHandler {
@SubscribeEvent
- public void onBreakBlock(final BreakEvent event) {
- try {
- final TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z);
- if (entity != null && !entity.equals(null)) {
- final EntityPlayer playerInternal = event.getPlayer();
+ public void onBreakBlock(BreakEvent event) {
+ try{
+ TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z);
+ if (entity != null && !entity.equals(null)){
+ EntityPlayer playerInternal = event.getPlayer();
Utils.LOG_WARNING(entity.getClass().getSimpleName());
- if (entity.getClass().getSimpleName().equals("")) {
+ if (entity.getClass().getSimpleName().equals("")){
}
- if (entity instanceof BaseTileEntity && !(entity instanceof BaseMetaPipeEntity)) {
- final IMetaTileEntity X = ((BaseMetaTileEntity) entity).getMetaTileEntity();
- final Block ThisBlock = X.getBaseMetaTileEntity().getBlock(event.x, event.y, event.z);
- if (X instanceof GregtechMetaSafeBlockBase) {
-
- final UUID ownerUUID = ((GregtechMetaSafeBlockBase) X).ownerUUID;
- final UUID accessorUUID = playerInternal.getUniqueID();
- Utils.LOG_WARNING("Owner UUID: " + ownerUUID);
- Utils.LOG_WARNING("Accessor UUID: " + accessorUUID);
-
- if (((GregtechMetaSafeBlockBase) X).bUnbreakable) {
+ if (entity instanceof BaseTileEntity && !(entity instanceof BaseMetaPipeEntity)){
+ IMetaTileEntity X = ((BaseMetaTileEntity)entity).getMetaTileEntity();
+ Block ThisBlock = X.getBaseMetaTileEntity().getBlock(event.x, event.y, event.z);
+ if (X instanceof GregtechMetaSafeBlockBase){
- Utils.LOG_INFO("UUID info. Accessor: " + accessorUUID + " | Owner: " + ownerUUID);
+ UUID ownerUUID = ((GregtechMetaSafeBlockBase)X).ownerUUID;
+ UUID accessorUUID = playerInternal.getUniqueID();
+ Utils.LOG_WARNING("Owner UUID: "+ownerUUID);
+ Utils.LOG_WARNING("Accessor UUID: "+accessorUUID);
- if (accessorUUID == ownerUUID) {
- PlayerUtils.messagePlayer(playerInternal,
- "Since you own this block, it has been destroyed.");
+ if (((GregtechMetaSafeBlockBase)X).bUnbreakable){
+
+ Utils.LOG_INFO("UUID info. Accessor: "+accessorUUID + " | Owner: "+ownerUUID);
+
+ if (accessorUUID == ownerUUID){
+ PlayerUtils.messagePlayer(playerInternal, "Since you own this block, it has been destroyed.");
event.setCanceled(false);
}
else {
event.setCanceled(true);
- PlayerUtils.messagePlayer(playerInternal,
- "Since you do not own this block, it has not been destroyed.");
+ PlayerUtils.messagePlayer(playerInternal, "Since you do not own this block, it has not been destroyed.");
}
//
}
@@ -56,17 +57,16 @@ public class PickaxeBlockBreakEventHandler {
}
}
- catch (final NullPointerException e) {
- System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: " + e.getCause());
+ catch (NullPointerException e) {
+ System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: "+e.getCause());
}
}
-
+
+
@SubscribeEvent
- public void onPlayerInteraction(final PlayerInteractEvent aEvent) {
- if (aEvent.entityPlayer != null && aEvent.entityPlayer.worldObj != null && aEvent.action != null
- && aEvent.world.provider != null && !aEvent.entityPlayer.worldObj.isRemote && aEvent.action != null
- && aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR) {
- // Utils.LOG_ERROR("Test");
- }
- }
+ public void onPlayerInteraction(PlayerInteractEvent aEvent) {
+ if (aEvent.entityPlayer != null && aEvent.entityPlayer.worldObj != null && aEvent.action != null && aEvent.world.provider != null && !aEvent.entityPlayer.worldObj.isRemote && aEvent.action != null && aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR) {
+ //Utils.LOG_ERROR("Test");
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java b/src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java
index a7c25266ff..3e126d4463 100644
--- a/src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java
+++ b/src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java
@@ -1,130 +1,137 @@
package gtPlusPlus.core.handler.events;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.metatileentity.*;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.BaseMetaTileEntity;
+import gregtech.api.metatileentity.BaseTileEntity;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaSafeBlock;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-public class UnbreakableBlockManager {
+public class UnbreakableBlockManager{
private static boolean hasRun = false;
- // BaseMetaTileEntity
- // GregtechMetaSafeBlock
+ public final BaseMetaTileEntity getmTileEntity() {
+ return mTileEntity;
+ }
+
+
+ public final void setmTileEntity(BaseMetaTileEntity mTileEntity/*, EntityPlayer aPlayer*/) {
+ UnbreakableBlockManager.mTileEntity = mTileEntity;
+ if (!hasRun){
+ hasRun = true;
+ makeIndestructible(/*aPlayer*/);
+ }
+ else {
+ Utils.LOG_WARNING("Why do you run twice?");
+ }
+ }
+
+
+ //BaseMetaTileEntity
+ //GregtechMetaSafeBlock
private static BaseMetaTileEntity mTileEntity = null;
- private static void innerInvincible(final GregtechMetaSafeBlock MetaSafeBlock, final TileEntity entity,
- final World TE_WORLD, /* EntityPlayer aPlayer, */ final int X, final int Y, final int Z) {
- if (entity != null && !entity.equals(null)) {
- Utils.LOG_WARNING("Checking new State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
- Utils.LOG_WARNING("Grabbed TE: " + entity.toString());
- if (entity instanceof BaseTileEntity && !(entity instanceof BaseMetaPipeEntity)) {
- final IMetaTileEntity I = ((BaseMetaTileEntity) entity).getMetaTileEntity();
- Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
- Utils.LOG_WARNING(
- "I Details: " + I.getMetaName() + " | " + I.getTileEntityBaseType() + " | " + I.toString());
+ private void makeIndestructible(/*EntityPlayer aPlayer*/){
+
+
+ Utils.LOG_WARNING("Initializing the code to set this TE to -1 hardness and make it indestructible.");
+ int X = ((BaseMetaTileEntity)mTileEntity).xCoord; //(GregtechMetaSafeBlock) this.mTileEntity.getXCoord();
+ int Y = ((BaseMetaTileEntity)mTileEntity).yCoord;
+ int Z = ((BaseMetaTileEntity)mTileEntity).zCoord;
+ Utils.LOG_WARNING("Grabbing TileEntity @ [x,y,z] |"+X+"|"+Y+"|"+Z+"|");
+
+
+
+ try{
+ GregtechMetaSafeBlock MetaSafeBlock = ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity());
+ TileEntity BaseMetaTileEntity = ((BaseMetaTileEntity)mTileEntity).getTileEntity(X, Y, Z);
+ //MetaSafeBlockBase.
+ World TE_WORLD = MetaSafeBlock.getBaseMetaTileEntity().getWorld();
+ Utils.LOG_WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ TileEntity entity = BaseMetaTileEntity;
+ innerInvincible(MetaSafeBlock, entity, TE_WORLD, /*aPlayer,*/ X, Y, Z);
+ }
+ catch (NullPointerException e) {
+ System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: ");
+ e.printStackTrace();
+ }
+ }
+
+
+ private static void innerInvincible(GregtechMetaSafeBlock MetaSafeBlock, TileEntity entity, World TE_WORLD, /*EntityPlayer aPlayer,*/ int X, int Y, int Z){
+ if (entity != null && !entity.equals(null)){
+ Utils.LOG_WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ Utils.LOG_WARNING("Grabbed TE: "+entity.toString());
+
+
+
+
+ if (entity instanceof BaseTileEntity && !(entity instanceof BaseMetaPipeEntity)){
+ IMetaTileEntity I = ((BaseMetaTileEntity)entity).getMetaTileEntity();
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ Utils.LOG_WARNING("I Details: "+I.getMetaName()+" | "+I.getTileEntityBaseType()+" | "+I.toString());
+
- if (I instanceof GregtechMetaSafeBlock) {
- Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
- final Block ThisBlock = I.getBaseMetaTileEntity().getBlock(X, Y, Z);
- Utils.LOG_WARNING("Block Details: " + ThisBlock.toString());
- if (((GregtechMetaSafeBlock) I).bUnbreakable) {
+
+ if (I instanceof GregtechMetaSafeBlock){
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+
+ Block ThisBlock = I.getBaseMetaTileEntity().getBlock(X, Y, Z);
+ Utils.LOG_WARNING("Block Details: "+ThisBlock.toString());
+
+
+ if (((GregtechMetaSafeBlock)I).bUnbreakable){
ThisBlock.setHardness(Integer.MAX_VALUE);
- // ThisBlock.setResistance(18000000.0F);
+ //ThisBlock.setResistance(18000000.0F);
ThisBlock.setResistance(-1);
ThisBlock.setBlockUnbreakable();
- Utils.LOG_WARNING("Changing State of Flag. Old Value=" + MetaSafeBlock.bUnbreakable
- + " Expected Value=true");
+ Utils.LOG_WARNING("Changing State of Flag. Old Value="+MetaSafeBlock.bUnbreakable+" Expected Value=true");
MetaSafeBlock.bUnbreakable = true;
- // entity.markDirty();
- Utils.LOG_WARNING(
- "Checking new State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ //entity.markDirty();
+ Utils.LOG_WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
Utils.LOG_ERROR("New Indestructible Flag enabled.");
- // GT_Utility.sendChatToPlayer(aPlayer, "Block is now
- // unbreakable.");
+ //GT_Utility.sendChatToPlayer(aPlayer, "Block is now unbreakable.");
}
+
+
+
else {
ThisBlock.setHardness(1);
ThisBlock.setResistance(1.0F);
- Utils.LOG_WARNING("Changing State of Flag. Old Value=" + MetaSafeBlock.bUnbreakable
- + " Expected Value=false");
+ Utils.LOG_WARNING("Changing State of Flag. Old Value="+MetaSafeBlock.bUnbreakable+" Expected Value=false");
MetaSafeBlock.bUnbreakable = false;
- // entity.markDirty();
- Utils.LOG_WARNING(
- "Checking new State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ //entity.markDirty();
+ Utils.LOG_WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
Utils.LOG_ERROR("New Indestructible Flag disabled.");
- // GT_Utility.sendChatToPlayer(aPlayer, "Block is now
- // breakable.");
+ //GT_Utility.sendChatToPlayer(aPlayer, "Block is now breakable.");
}
- // entity.markDirty();
+ //entity.markDirty();
- Utils.LOG_WARNING("Block Hardness: " + ThisBlock.getBlockHardness(TE_WORLD, X, Y, Z));
- Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
- UnbreakableBlockManager.hasRun = false;
+ Utils.LOG_WARNING("Block Hardness: "+ThisBlock.getBlockHardness(TE_WORLD, X, Y, Z));
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ hasRun = false;
}
else {
Utils.LOG_WARNING("I is not an instanceof MetaSafeBlockBase");
- Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
}
- }
- else {
+ } else {
Utils.LOG_WARNING("TE is not an instanceof BaseTileEntity or may be a pipe.");
- Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
}
- }
- else {
+ }else {
Utils.LOG_WARNING("Did not grab a TE instance to make a block instance from.");
- Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
- }
- }
-
- public final BaseMetaTileEntity getmTileEntity() {
- return UnbreakableBlockManager.mTileEntity;
- }
-
- private void makeIndestructible(/* EntityPlayer aPlayer */) {
-
- Utils.LOG_WARNING("Initializing the code to set this TE to -1 hardness and make it indestructible.");
- final int X = UnbreakableBlockManager.mTileEntity.xCoord; // (GregtechMetaSafeBlock)
- // this.mTileEntity.getXCoord();
- final int Y = UnbreakableBlockManager.mTileEntity.yCoord;
- final int Z = UnbreakableBlockManager.mTileEntity.zCoord;
- Utils.LOG_WARNING("Grabbing TileEntity @ [x,y,z] |" + X + "|" + Y + "|" + Z + "|");
-
- try {
- final GregtechMetaSafeBlock MetaSafeBlock = (GregtechMetaSafeBlock) UnbreakableBlockManager.mTileEntity
- .getMetaTileEntity();
- final TileEntity BaseMetaTileEntity = UnbreakableBlockManager.mTileEntity.getTileEntity(X, Y, Z);
- // MetaSafeBlockBase.
- final World TE_WORLD = MetaSafeBlock.getBaseMetaTileEntity().getWorld();
- Utils.LOG_WARNING("Checking new State of Flag[nUnbreakable]. Value=" + MetaSafeBlock.bUnbreakable);
- final TileEntity entity = BaseMetaTileEntity;
- UnbreakableBlockManager.innerInvincible(MetaSafeBlock, entity, TE_WORLD, /* aPlayer, */ X, Y, Z);
- }
- catch (final NullPointerException e) {
- System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: ");
- e.printStackTrace();
- }
- }
-
- public final void setmTileEntity(
- final BaseMetaTileEntity mTileEntity/* , EntityPlayer aPlayer */) {
- UnbreakableBlockManager.mTileEntity = mTileEntity;
- if (!UnbreakableBlockManager.hasRun) {
- UnbreakableBlockManager.hasRun = true;
- this.makeIndestructible(/* aPlayer */);
- }
- else {
- Utils.LOG_WARNING("Why do you run twice?");
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
}
}
diff --git a/src/Java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java b/src/Java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java
index 39868fd9f9..b5c0c035ec 100644
--- a/src/Java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java
@@ -1,6 +1,8 @@
package gtPlusPlus.core.handler.workbench;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
@@ -8,163 +10,194 @@ import net.minecraft.init.Items;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.*;
+import net.minecraft.item.crafting.IRecipe;
+import net.minecraft.item.crafting.ShapedRecipes;
+import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.world.World;
public class Workbench_CraftingHandler {
- private static final Workbench_CraftingHandler instance = new Workbench_CraftingHandler();
+ private static final Workbench_CraftingHandler instance = new Workbench_CraftingHandler();
+ private List recipes = new ArrayList();
+
public static final Workbench_CraftingHandler getInstance() {
- return Workbench_CraftingHandler.instance;
+ return instance;
}
-
- private final List recipes = new ArrayList();
-
public Workbench_CraftingHandler() {
-
- // just a example recipe so you know how to add them
- this.addRecipe(new ItemStack(Blocks.iron_block), new Object[] {
- "###", "###", "###", Character.valueOf('#'), Items.iron_ingot
- });
-
- // another example Recipe, but shapeless
- this.addShapelessRecipe(new ItemStack(Items.cake), new Object[] {
- Items.stick
- });
-
+
+ //just a example recipe so you know how to add them
+ addRecipe(new ItemStack(Blocks.iron_block), new Object[]
+ {
+ "###",
+ "###",
+ "###",
+ Character.valueOf('#'), Items.iron_ingot
+ });
+
+ //another example Recipe, but shapeless
+ addShapelessRecipe(new ItemStack(Items.cake),new Object[]{Items.stick});
+
+
}
-
- void addRecipe(final ItemStack par1ItemStack, final Object par2ArrayOfObj[]) {
+
+ void addRecipe(ItemStack par1ItemStack, Object par2ArrayOfObj[])
+ {
String s = "";
int i = 0;
int j = 0;
int k = 0;
- if (par2ArrayOfObj[i] instanceof String[]) {
- final String as[] = (String[]) par2ArrayOfObj[i++];
+ if (par2ArrayOfObj[i] instanceof String[])
+ {
+ String as[] = (String[])par2ArrayOfObj[i++];
- for (int l = 0; l < as.length; l++) {
- final String s2 = as[l];
+ for (int l = 0; l < as.length; l++)
+ {
+ String s2 = as[l];
k++;
j = s2.length();
- s = new StringBuilder().append(s).append(s2).toString();
+ s = (new StringBuilder()).append(s).append(s2).toString();
}
}
- else {
- while (par2ArrayOfObj[i] instanceof String) {
- final String s1 = (String) par2ArrayOfObj[i++];
+ else
+ {
+ while (par2ArrayOfObj[i] instanceof String)
+ {
+ String s1 = (String)par2ArrayOfObj[i++];
k++;
j = s1.length();
- s = new StringBuilder().append(s).append(s1).toString();
+ s = (new StringBuilder()).append(s).append(s1).toString();
}
}
- final HashMap hashmap = new HashMap();
+ HashMap hashmap = new HashMap();
- for (; i < par2ArrayOfObj.length; i += 2) {
- final Character character = (Character) par2ArrayOfObj[i];
+ for (; i < par2ArrayOfObj.length; i += 2)
+ {
+ Character character = (Character)par2ArrayOfObj[i];
ItemStack itemstack = null;
- if (par2ArrayOfObj[i + 1] instanceof Item) {
- itemstack = new ItemStack((Item) par2ArrayOfObj[i + 1]);
+ if (par2ArrayOfObj[i + 1] instanceof Item)
+ {
+ itemstack = new ItemStack((Item)par2ArrayOfObj[i + 1]);
}
- else if (par2ArrayOfObj[i + 1] instanceof Block) {
- itemstack = new ItemStack((Block) par2ArrayOfObj[i + 1], 1, -1);
+ else if (par2ArrayOfObj[i + 1] instanceof Block)
+ {
+ itemstack = new ItemStack((Block)par2ArrayOfObj[i + 1], 1, -1);
}
- else if (par2ArrayOfObj[i + 1] instanceof ItemStack) {
- itemstack = (ItemStack) par2ArrayOfObj[i + 1];
+ else if (par2ArrayOfObj[i + 1] instanceof ItemStack)
+ {
+ itemstack = (ItemStack)par2ArrayOfObj[i + 1];
}
hashmap.put(character, itemstack);
}
- final ItemStack aitemstack[] = new ItemStack[j * k];
+ ItemStack aitemstack[] = new ItemStack[j * k];
- for (int i1 = 0; i1 < j * k; i1++) {
- final char c = s.charAt(i1);
+ for (int i1 = 0; i1 < j * k; i1++)
+ {
+ char c = s.charAt(i1);
- if (hashmap.containsKey(Character.valueOf(c))) {
- aitemstack[i1] = ((ItemStack) hashmap.get(Character.valueOf(c))).copy();
+ if (hashmap.containsKey(Character.valueOf(c)))
+ {
+ aitemstack[i1] = ((ItemStack)hashmap.get(Character.valueOf(c))).copy();
}
- else {
+ else
+ {
aitemstack[i1] = null;
}
}
- this.recipes.add(new ShapedRecipes(j, k, aitemstack, par1ItemStack));
+ recipes.add(new ShapedRecipes(j, k, aitemstack, par1ItemStack));
}
- public void addShapelessRecipe(final ItemStack par1ItemStack, final Object par2ArrayOfObj[]) {
- final ArrayList arraylist = new ArrayList();
- final Object aobj[] = par2ArrayOfObj;
- final int i = aobj.length;
+ public void addShapelessRecipe(ItemStack par1ItemStack, Object par2ArrayOfObj[])
+ {
+ ArrayList arraylist = new ArrayList();
+ Object aobj[] = par2ArrayOfObj;
+ int i = aobj.length;
- for (int j = 0; j < i; j++) {
- final Object obj = aobj[j];
+ for (int j = 0; j < i; j++)
+ {
+ Object obj = aobj[j];
- if (obj instanceof ItemStack) {
- arraylist.add(((ItemStack) obj).copy());
+ if (obj instanceof ItemStack)
+ {
+ arraylist.add(((ItemStack)obj).copy());
continue;
}
- if (obj instanceof Item) {
- arraylist.add(new ItemStack((Item) obj));
+ if (obj instanceof Item)
+ {
+ arraylist.add(new ItemStack((Item)obj));
continue;
}
- if (obj instanceof Block) {
- arraylist.add(new ItemStack((Block) obj));
+ if (obj instanceof Block)
+ {
+ arraylist.add(new ItemStack((Block)obj));
}
- else {
+ else
+ {
throw new RuntimeException("Invalid shapeless recipe!");
}
}
- this.recipes.add(new ShapelessRecipes(par1ItemStack, arraylist));
+ recipes.add(new ShapelessRecipes(par1ItemStack, arraylist));
}
- public ItemStack findMatchingRecipe(final InventoryCrafting par1InventoryCrafting, final World par2World) {
+ public ItemStack findMatchingRecipe(InventoryCrafting par1InventoryCrafting, World par2World)
+ {
int i = 0;
ItemStack itemstack = null;
ItemStack itemstack1 = null;
- for (int j = 0; j < par1InventoryCrafting.getSizeInventory(); j++) {
- final ItemStack itemstack2 = par1InventoryCrafting.getStackInSlot(j);
+ for (int j = 0; j < par1InventoryCrafting.getSizeInventory(); j++)
+ {
+ ItemStack itemstack2 = par1InventoryCrafting.getStackInSlot(j);
- if (itemstack2 == null) {
+ if (itemstack2 == null)
+ {
continue;
}
- if (i == 0) {
+ if (i == 0)
+ {
itemstack = itemstack2;
}
- if (i == 1) {
+ if (i == 1)
+ {
itemstack1 = itemstack2;
}
i++;
}
- // TODO - Update from itemIDs
- /*
- * if (i == 2 && itemstack.itemID == itemstack1.itemID &&
- * itemstack.stackSize == 1 && itemstack1.stackSize == 1 &&
- * Item.itemsList[itemstack.itemID].isDamageable()) { Item item =
- * Item.itemsList[itemstack.itemID]; int l = item.getMaxDamage() -
- * itemstack.getItemDamageForDisplay(); int i1 = item.getMaxDamage() -
- * itemstack1.getItemDamageForDisplay(); int j1 = l + i1 +
- * (item.getMaxDamage() * 10) / 100; int k1 = item.getMaxDamage() - j1;
- *
- * if (k1 < 0) { k1 = 0; }
- *
- * return new ItemStack(itemstack.itemID, 1, k1); }
- */
-
- for (int k = 0; k < this.recipes.size(); k++) {
- final IRecipe irecipe = (IRecipe) this.recipes.get(k);
-
- if (irecipe.matches(par1InventoryCrafting, par2World)) {
+ //TODO - Update from itemIDs
+ /*if (i == 2 && itemstack.itemID == itemstack1.itemID && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && Item.itemsList[itemstack.itemID].isDamageable())
+ {
+ Item item = Item.itemsList[itemstack.itemID];
+ int l = item.getMaxDamage() - itemstack.getItemDamageForDisplay();
+ int i1 = item.getMaxDamage() - itemstack1.getItemDamageForDisplay();
+ int j1 = l + i1 + (item.getMaxDamage() * 10) / 100;
+ int k1 = item.getMaxDamage() - j1;
+
+ if (k1 < 0)
+ {
+ k1 = 0;
+ }
+
+ return new ItemStack(itemstack.itemID, 1, k1);
+ }*/
+
+ for (int k = 0; k < recipes.size(); k++)
+ {
+ IRecipe irecipe = (IRecipe)recipes.get(k);
+
+ if (irecipe.matches(par1InventoryCrafting, par2World))
+ {
return irecipe.getCraftingResult(par1InventoryCrafting);
}
}
@@ -172,7 +205,9 @@ public class Workbench_CraftingHandler {
return null;
}
- public List getRecipeList() {
- return this.recipes;
+
+ public List getRecipeList()
+ {
+ return recipes;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java b/src/Java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java
index 3c41a1552b..79d80aa677 100644
--- a/src/Java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java
+++ b/src/Java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java
@@ -2,34 +2,42 @@ package gtPlusPlus.core.handler.workbench;
import java.util.Comparator;
-import net.minecraft.item.crafting.*;
+import net.minecraft.item.crafting.IRecipe;
+import net.minecraft.item.crafting.ShapedRecipes;
+import net.minecraft.item.crafting.ShapelessRecipes;
-public class Workbench_RecipeSorter implements Comparator {
+public class Workbench_RecipeSorter implements Comparator
+{
final Workbench_CraftingHandler CraftingManagerCrafter;
- Workbench_RecipeSorter(final Workbench_CraftingHandler par1CraftingManager) {
- this.CraftingManagerCrafter = par1CraftingManager;
+ Workbench_RecipeSorter(Workbench_CraftingHandler par1CraftingManager)
+ {
+ CraftingManagerCrafter = par1CraftingManager;
}
- @Override
- public int compare(final Object par1Obj, final Object par2Obj) {
- return this.compareRecipes((IRecipe) par1Obj, (IRecipe) par2Obj);
+ public int compareRecipes(IRecipe par1IRecipe, IRecipe par2IRecipe)
+ {
+ if ((par1IRecipe instanceof ShapelessRecipes) && (par2IRecipe instanceof ShapedRecipes))
+ {
+ return 1;
}
- public int compareRecipes(final IRecipe par1IRecipe, final IRecipe par2IRecipe) {
- if (par1IRecipe instanceof ShapelessRecipes && par2IRecipe instanceof ShapedRecipes) {
- return 1;
- }
+ if ((par2IRecipe instanceof ShapelessRecipes) && (par1IRecipe instanceof ShapedRecipes))
+ {
+ return -1;
+ }
- if (par2IRecipe instanceof ShapelessRecipes && par1IRecipe instanceof ShapedRecipes) {
- return -1;
- }
+ if (par2IRecipe.getRecipeSize() < par1IRecipe.getRecipeSize())
+ {
+ return -1;
+ }
- if (par2IRecipe.getRecipeSize() < par1IRecipe.getRecipeSize()) {
- return -1;
- }
+ return par2IRecipe.getRecipeSize() <= par1IRecipe.getRecipeSize() ? 0 : 1;
+ }
- return par2IRecipe.getRecipeSize() <= par1IRecipe.getRecipeSize() ? 0 : 1;
+ public int compare(Object par1Obj, Object par2Obj)
+ {
+ return compareRecipes((IRecipe)par1Obj, (IRecipe)par2Obj);
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/interfaces/IGuiManager.java b/src/Java/gtPlusPlus/core/interfaces/IGuiManager.java
index ad2bfcb10a..1d0ad9ed87 100644
--- a/src/Java/gtPlusPlus/core/interfaces/IGuiManager.java
+++ b/src/Java/gtPlusPlus/core/interfaces/IGuiManager.java
@@ -4,13 +4,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
-public abstract interface IGuiManager extends IGuiManagerMiscUtils {
-
- public abstract Object getContainer(EntityPlayer paramEntityPlayer, int paramInt);
+public abstract interface IGuiManager extends IGuiManagerMiscUtils{
public abstract ChunkCoordinates getCoordinates();
+ public abstract World getWorld();
+
public abstract Object getGui(EntityPlayer paramEntityPlayer, int paramInt);
- public abstract World getWorld();
+ public abstract Object getContainer(EntityPlayer paramEntityPlayer, int paramInt);
}
diff --git a/src/Java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java b/src/Java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java
index 9fb2e74cb1..cf46c67a54 100644
--- a/src/Java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java
+++ b/src/Java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java
@@ -1,4 +1,3 @@
package gtPlusPlus.core.interfaces;
-public abstract interface IGuiManagerMiscUtils {
-} \ No newline at end of file
+public abstract interface IGuiManagerMiscUtils {} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java b/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java
index ebdf4c2e57..90126b1e82 100644
--- a/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java
+++ b/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java
@@ -4,55 +4,45 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
public interface IItemBlueprint {
-
+
/**
- * The inventory size for the blueprint~
- */
+ * The inventory size for the blueprint~
+ */
public int INV_SIZE = 9;
-
- /**
- * Gets the recipe held by the item
- *
- * @param stack
- * yourMetaItem
- * @return the blueprints contents
- */
- public ItemStack[] getBlueprint(ItemStack stack);
-
- /**
- * Does this itemstack hold a blueprint?
- *
- * @param stack
- * yourMetaItem
- * @return true if is holding a Blueprint
- */
- public boolean hasBlueprint(ItemStack stack);
-
+
/**
- * Meta Compatible function to allow meta items to be blueprints
- *
- * @param stack
- * yourMetaItem
- * @return true if it is a Blueprint
- */
+ * Meta Compatible function to allow meta items to be blueprints
+ * @param stack yourMetaItem
+ * @return true if it is a Blueprint
+ */
public boolean isBlueprint(ItemStack stack);
-
+
/**
- * Sets the blueprint for this itemstack.
- *
- * @param stack
- * yourMetaItem
- * @return true if blueprint is set successfully
- */
+ * Sets the blueprint for this itemstack.
+ * @param stack yourMetaItem
+ * @return true if blueprint is set successfully
+ */
public boolean setBlueprint(ItemStack stack, IInventory craftingTable, ItemStack output);
-
+
/**
- * Sets the name of the recipe/blueprint
- *
- * @param String
- * Blueprint Name
- * @return N/A
- */
+ * Sets the name of the recipe/blueprint
+ * @param String Blueprint Name
+ * @return N/A
+ */
public void setBlueprintName(ItemStack stack, String name);
+
+ /**
+ * Does this itemstack hold a blueprint?
+ * @param stack yourMetaItem
+ * @return true if is holding a Blueprint
+ */
+ public boolean hasBlueprint(ItemStack stack);
+
+ /**
+ * Gets the recipe held by the item
+ * @param stack yourMetaItem
+ * @return the blueprints contents
+ */
+ public ItemStack[] getBlueprint(ItemStack stack);
}
diff --git a/src/Java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java b/src/Java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java
index 64e7c9cef5..59fe8aa4fa 100644
--- a/src/Java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java
+++ b/src/Java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java
@@ -1,8 +1,9 @@
package gtPlusPlus.core.inventories;
+import gtPlusPlus.core.item.base.BaseItemBackpack;
+
import java.util.UUID;
-import gtPlusPlus.core.item.base.BaseItemBackpack;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -10,44 +11,40 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.util.Constants;
-public class BaseInventoryBackpack implements IInventory {
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 8;
+public class BaseInventoryBackpack implements IInventory{
- private final String name = "Inventory Item";
+ private String name = "Inventory Item";
/** Provides NBT Tag Compound to reference */
- private final ItemStack invItem;
+ private final ItemStack invItem;
- /**
- * Inventory's size must be same as number of slots you add to the Container
- * class
- */
- private final ItemStack[] inventory = new ItemStack[BaseInventoryBackpack.INV_SIZE];
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 8;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
// declaration of variable:
- protected String uniqueID;
+ protected String uniqueID;
/**
- * @param itemstack
- * - the ItemStack to which this inventory belongs
+ * @param itemstack - the ItemStack to which this inventory belongs
*/
- public BaseInventoryBackpack(final ItemStack stack) {
- this.invItem = stack;
+ public BaseInventoryBackpack(ItemStack stack)
+ {
+ invItem = stack;
/** initialize variable within the constructor: */
- this.uniqueID = "";
+ uniqueID = "";
- if (!stack.hasTagCompound()) {
+ if (!stack.hasTagCompound())
+ {
stack.setTagCompound(new NBTTagCompound());
- // no tag compound means the itemstack does not yet have a UUID, so
- // assign one:
- this.uniqueID = UUID.randomUUID().toString();
- }
-
- // Create a new NBT Tag Compound if one doesn't already exist, or you
- // will crash
+ // no tag compound means the itemstack does not yet have a UUID, so assign one:
+ uniqueID = UUID.randomUUID().toString();
+ }
+
+ // Create a new NBT Tag Compound if one doesn't already exist, or you will crash
if (!stack.hasTagCompound()) {
stack.setTagCompound(new NBTTagCompound());
}
@@ -56,175 +53,189 @@ public class BaseInventoryBackpack implements IInventory {
// either reference will change in the other
// Read the inventory contents from NBT
- this.readFromNBT(stack.getTagCompound());
+ readFromNBT(stack.getTagCompound());
+ }
+ @Override
+ public int getSizeInventory()
+ {
+ return inventory.length;
}
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
@Override
- public void closeInventory() {
+ public ItemStack getStackInSlot(int slot)
+ {
+ return inventory[slot];
}
@Override
- public ItemStack decrStackSize(final int slot, final int amount) {
- ItemStack stack = this.getStackInSlot(slot);
- if (stack != null) {
- if (stack.stackSize > amount) {
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ if(stack != null)
+ {
+ if(stack.stackSize > amount)
+ {
stack = stack.splitStack(amount);
// Don't forget this line or your inventory will not be saved!
- this.markDirty();
+ markDirty();
}
- else {
- // this method also calls markDirty, so we don't need to call it
- // again
- this.setInventorySlotContents(slot, null);
+ else
+ {
+ // this method also calls markDirty, so we don't need to call it again
+ setInventorySlotContents(slot, null);
}
}
return stack;
}
- // 1.7.2+ renamed to getInventoryName
@Override
- public String getInventoryName() {
- return this.name;
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
}
@Override
- public int getInventoryStackLimit() {
- return 64;
- }
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ inventory[slot] = stack;
- @Override
- public int getSizeInventory() {
- return this.inventory.length;
- }
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
}
+ // 1.7.2+ renamed to getInventoryName
@Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
+ public String getInventoryName()
+ {
+ return name;
}
// 1.7.2+ renamed to hasCustomInventoryName
@Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
- }
-
- /**
- * This method doesn't seem to do what it claims to do, as items can still
- * be left-clicked and placed in the inventory even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return !(itemstack.getItem() instanceof BaseItemBackpack);
+ public boolean hasCustomInventoryName()
+ {
+ return name.length() > 0;
}
@Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return true;
+ public int getInventoryStackLimit()
+ {
+ return 64;
}
/**
- * This is the method that will handle saving the inventory contents, as it
- * is called (or should be called!) anytime the inventory changes. Perfect.
- * Much better than using onUpdate in an Item, as this will also let you
- * change things in your inventory without ever opening a Gui, if you want.
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
*/
// 1.7.2+ renamed to markDirty
@Override
- public void markDirty() {
- for (int i = 0; i < this.getSizeInventory(); ++i) {
- if (this.getStackInSlot(i) != null && this.getStackInSlot(i).stackSize == 0) {
- this.inventory[i] = null;
+ public void markDirty()
+ {
+ for (int i = 0; i < getSizeInventory(); ++i)
+ {
+ if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) {
+ inventory[i] = null;
}
}
- // This line here does the work:
- this.writeToNBT(this.invItem.getTagCompound());
+ // This line here does the work:
+ writeToNBT(invItem.getTagCompound());
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer entityplayer)
+ {
+ return true;
}
// 1.7.2+ renamed to openInventory(EntityPlayer player)
@Override
- public void openInventory() {
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack)
+ {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return !(itemstack.getItem() instanceof BaseItemBackpack);
}
/**
* A custom method to read our inventory from an ItemStack's NBT compound
*/
- public void readFromNBT(final NBTTagCompound compound) {
+ public void readFromNBT(NBTTagCompound compound)
+ {
// Gets the custom taglist we wrote to this compound, if any
- // 1.7.2+ change to compound.getTagList("ItemInventory",
- // Constants.NBT.TAG_COMPOUND);
- final NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
-
- if ("".equals(this.uniqueID)) {
+ // 1.7.2+ change to compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
+ NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
+
+ if ("".equals(uniqueID))
+ {
// try to read unique ID from NBT
- this.uniqueID = compound.getString("uniqueID");
+ uniqueID = compound.getString("uniqueID");
// if it's still "", assign a new one:
- if ("".equals(this.uniqueID)) {
- this.uniqueID = UUID.randomUUID().toString();
+ if ("".equals(uniqueID))
+ {
+ uniqueID = UUID.randomUUID().toString();
}
}
- for (int i = 0; i < items.tagCount(); ++i) {
+ for (int i = 0; i < items.tagCount(); ++i)
+ {
// 1.7.2+ change to items.getCompoundTagAt(i)
- final NBTTagCompound item = items.getCompoundTagAt(i);
- final int slot = item.getInteger("Slot");
+ NBTTagCompound item = (NBTTagCompound) items.getCompoundTagAt(i);
+ int slot = item.getInteger("Slot");
- // Just double-checking that the saved slot index is within our
- // inventory array bounds
- if (slot >= 0 && slot < this.getSizeInventory()) {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(item);
+ // Just double-checking that the saved slot index is within our inventory array bounds
+ if (slot >= 0 && slot < getSizeInventory()) {
+ inventory[slot] = ItemStack.loadItemStackFromNBT(item);
}
}
}
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.inventory[slot] = stack;
-
- if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
-
/**
* A custom method to write our inventory to an ItemStack's NBT compound
*/
- public void writeToNBT(final NBTTagCompound tagcompound) {
+ public void writeToNBT(NBTTagCompound tagcompound)
+ {
// Create a new NBT Tag List to store itemstacks as NBT Tags
- final NBTTagList items = new NBTTagList();
+ NBTTagList items = new NBTTagList();
- for (int i = 0; i < this.getSizeInventory(); ++i) {
+ for (int i = 0; i < getSizeInventory(); ++i)
+ {
// Only write stacks that contain items
- if (this.getStackInSlot(i) != null) {
- // Make a new NBT Tag Compound to write the itemstack and slot
- // index to
- final NBTTagCompound item = new NBTTagCompound();
+ if (getStackInSlot(i) != null)
+ {
+ // Make a new NBT Tag Compound to write the itemstack and slot index to
+ NBTTagCompound item = new NBTTagCompound();
item.setInteger("Slot", i);
- // Writes the itemstack in slot(i) to the Tag Compound we just
- // made
- this.getStackInSlot(i).writeToNBT(item);
+ // Writes the itemstack in slot(i) to the Tag Compound we just made
+ getStackInSlot(i).writeToNBT(item);
// add the tag compound to our tag list
items.appendTag(item);
}
}
tagcompound.setString("uniqueID", this.uniqueID);
- // Add the TagList to the ItemStack's Tag Compound with the name
- // "ItemInventory"
+ // Add the TagList to the ItemStack's Tag Compound with the name "ItemInventory"
tagcompound.setTag("ItemInventory", items);
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java
index 7a3507ec55..8d147ad21c 100644
--- a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java
+++ b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchChest.java
@@ -6,168 +6,183 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryWorkbenchChest implements IInventory {
+public class InventoryWorkbenchChest implements IInventory{
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 16;
+ private String name = "Inventory Chest";
- private final String name = "Inventory Chest";
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 16;
- /**
- * Inventory's size must be same as number of slots you add to the Container
- * class
- */
- private ItemStack[] inventory = new ItemStack[InventoryWorkbenchChest.INV_SIZE];
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
/**
- * @param itemstack
- * - the ItemStack to which this inventory belongs
+ * @param itemstack - the ItemStack to which this inventory belongs
*/
- public InventoryWorkbenchChest() {
-
+ public InventoryWorkbenchChest()
+ {
+
+ }
+
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = nbt.getTagList("Items", 10);
+ inventory = new ItemStack[INV_SIZE];
+ for(int i = 0;i<list.tagCount();i++)
+ {
+ NBTTagCompound data = list.getCompoundTagAt(i);
+ int slot = data.getInteger("Slot");
+ if(slot >= 0 && slot < INV_SIZE)
+ {
+ inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = new NBTTagList();
+ for(int i = 0;i<INV_SIZE;i++)
+ {
+ ItemStack stack = inventory[i];
+ if(stack != null)
+ {
+ NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory()
+ {
+ return inventory.length;
+ }
+
+ public ItemStack[] getInventory(){
+ return inventory;
}
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
@Override
- public void closeInventory() {
+ public ItemStack getStackInSlot(int slot)
+ {
+ return inventory[slot];
}
@Override
- public ItemStack decrStackSize(final int slot, final int amount) {
- ItemStack stack = this.getStackInSlot(slot);
- if (stack != null) {
- if (stack.stackSize > amount) {
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ if(stack != null)
+ {
+ if(stack.stackSize > amount)
+ {
stack = stack.splitStack(amount);
// Don't forget this line or your inventory will not be saved!
- this.markDirty();
+ markDirty();
}
- else {
- // this method also calls markDirty, so we don't need to call it
- // again
- this.setInventorySlotContents(slot, null);
+ else
+ {
+ // this method also calls markDirty, so we don't need to call it again
+ setInventorySlotContents(slot, null);
}
}
return stack;
}
- public ItemStack[] getInventory() {
- return this.inventory;
- }
-
- // 1.7.2+ renamed to getInventoryName
@Override
- public String getInventoryName() {
- return this.name;
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
}
@Override
- public int getInventoryStackLimit() {
- return 64;
- }
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ inventory[slot] = stack;
- @Override
- public int getSizeInventory() {
- return this.inventory.length;
- }
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
}
+ // 1.7.2+ renamed to getInventoryName
@Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
+ public String getInventoryName()
+ {
+ return name;
}
// 1.7.2+ renamed to hasCustomInventoryName
@Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ public boolean hasCustomInventoryName()
+ {
+ return name.length() > 0;
}
- /**
- * This method doesn't seem to do what it claims to do, as items can still
- * be left-clicked and placed in the inventory even when this returns false
- */
@Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return true;
+ public int getInventoryStackLimit()
+ {
+ return 64;
}
/**
- * This is the method that will handle saving the inventory contents, as it
- * is called (or should be called!) anytime the inventory changes. Perfect.
- * Much better than using onUpdate in an Item, as this will also let you
- * change things in your inventory without ever opening a Gui, if you want.
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
*/
// 1.7.2+ renamed to markDirty
@Override
- public void markDirty() {
- for (int i = 0; i < this.getSizeInventory(); ++i) {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null) {
- // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+"
- // x"+temp.stackSize);
+ public void markDirty()
+ {
+ for (int i = 0; i < getSizeInventory(); ++i)
+ {
+ ItemStack temp = getStackInSlot(i);
+ if (temp != null){
+ //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
}
-
+
if (temp != null && temp.stackSize == 0) {
- this.inventory[i] = null;
+ inventory[i] = null;
}
}
}
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
@Override
- public void openInventory() {
- }
-
- public void readFromNBT(final NBTTagCompound nbt) {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[InventoryWorkbenchChest.INV_SIZE];
- for (int i = 0; i < list.tagCount(); i++) {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if (slot >= 0 && slot < InventoryWorkbenchChest.INV_SIZE) {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
+ public boolean isUseableByPlayer(EntityPlayer entityplayer)
+ {
+ return true;
}
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
@Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.inventory[slot] = stack;
-
- if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
- stack.stackSize = this.getInventoryStackLimit();
- }
+ public void openInventory() {}
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
- public void writeToNBT(final NBTTagCompound nbt) {
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < InventoryWorkbenchChest.INV_SIZE; i++) {
- final ItemStack stack = this.inventory[i];
- if (stack != null) {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack)
+ {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java
index ff39d3a241..333bb5c847 100644
--- a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java
+++ b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchCrafting.java
@@ -1,183 +1,201 @@
package gtPlusPlus.core.inventories;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.*;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryWorkbenchCrafting implements IInventory {
+public class InventoryWorkbenchCrafting implements IInventory{
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 9;
+ private String name = "Inventory Crafting";
- private final String name = "Inventory Crafting";
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 9;
- /**
- * Inventory's size must be same as number of slots you add to the Container
- * class
- */
- private ItemStack[] inventory = new ItemStack[InventoryWorkbenchCrafting.INV_SIZE];
- public final InventoryCrafting craftMatrix;
- public final Container parentContainer;
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+ public final InventoryCrafting craftMatrix;
+ public final Container parentContainer;
+
+ public InventoryCrafting getCrafting(){
+ return craftMatrix;
+ }
/**
- * @param itemstack
- * - the ItemStack to which this inventory belongs
+ * @param itemstack - the ItemStack to which this inventory belongs
*/
- public InventoryWorkbenchCrafting(final Container containerR) {
+ public InventoryWorkbenchCrafting(Container containerR)
+ {
this.parentContainer = containerR;
- this.craftMatrix = new InventoryCrafting(this.parentContainer, 3, 3);
+ this.craftMatrix = new InventoryCrafting(parentContainer, 3, 3);
+ }
+
+ private ItemStack[] getArrayOfCraftingItems(){
+ ItemStack[] array = new ItemStack[9];
+ for (int i=0; i<craftMatrix.getSizeInventory();i++){
+ if(craftMatrix.getStackInSlot(i) != null){
+ array[i] = craftMatrix.getStackInSlot(i);
+ }
+ }
+ return array;
+ }
+
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = nbt.getTagList("Items", 10);
+ inventory = new ItemStack[INV_SIZE];
+ for(int i = 0;i<list.tagCount();i++)
+ {
+ NBTTagCompound data = list.getCompoundTagAt(i);
+ int slot = data.getInteger("Slot");
+ if(slot >= 0 && slot < INV_SIZE)
+ {
+ getInventory()[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = new NBTTagList();
+ for(int i = 0;i<INV_SIZE;i++)
+ {
+ ItemStack stack = getInventory()[i];
+ if(stack != null)
+ {
+ NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory()
+ {
+ return getInventory().length;
+ }
+
+ public ItemStack[] getInventory(){
+ return getArrayOfCraftingItems();
}
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
@Override
- public void closeInventory() {
+ public ItemStack getStackInSlot(int slot)
+ {
+ return getInventory()[slot];
}
@Override
- public ItemStack decrStackSize(final int slot, final int amount) {
- ItemStack stack = this.getStackInSlot(slot);
- if (stack != null) {
- if (stack.stackSize > amount) {
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ if(stack != null)
+ {
+ if(stack.stackSize > amount)
+ {
stack = stack.splitStack(amount);
// Don't forget this line or your inventory will not be saved!
- this.markDirty();
+ markDirty();
}
- else {
- // this method also calls markDirty, so we don't need to call it
- // again
- this.setInventorySlotContents(slot, null);
+ else
+ {
+ // this method also calls markDirty, so we don't need to call it again
+ setInventorySlotContents(slot, null);
}
}
return stack;
}
- private ItemStack[] getArrayOfCraftingItems() {
- final ItemStack[] array = new ItemStack[9];
- for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) {
- if (this.craftMatrix.getStackInSlot(i) != null) {
- array[i] = this.craftMatrix.getStackInSlot(i);
- }
- }
- return array;
- }
-
- public InventoryCrafting getCrafting() {
- return this.craftMatrix;
- }
-
- public ItemStack[] getInventory() {
- return this.getArrayOfCraftingItems();
- }
-
- // 1.7.2+ renamed to getInventoryName
@Override
- public String getInventoryName() {
- return this.name;
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
}
@Override
- public int getInventoryStackLimit() {
- return 64;
- }
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ getInventory()[slot] = stack;
- @Override
- public int getSizeInventory() {
- return this.getInventory().length;
- }
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.getInventory()[slot];
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
}
+ // 1.7.2+ renamed to getInventoryName
@Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
+ public String getInventoryName()
+ {
+ return name;
}
// 1.7.2+ renamed to hasCustomInventoryName
@Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ public boolean hasCustomInventoryName()
+ {
+ return name.length() > 0;
}
- /**
- * This method doesn't seem to do what it claims to do, as items can still
- * be left-clicked and placed in the inventory even when this returns false
- */
@Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- return true;
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return true;
+ public int getInventoryStackLimit()
+ {
+ return 64;
}
/**
- * This is the method that will handle saving the inventory contents, as it
- * is called (or should be called!) anytime the inventory changes. Perfect.
- * Much better than using onUpdate in an Item, as this will also let you
- * change things in your inventory without ever opening a Gui, if you want.
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
*/
// 1.7.2+ renamed to markDirty
@Override
- public void markDirty() {
- for (int i = 0; i < this.getSizeInventory(); ++i) {
- if (this.getStackInSlot(i) != null && this.getStackInSlot(i).stackSize == 0) {
- this.getInventory()[i] = null;
+ public void markDirty()
+ {
+ for (int i = 0; i < getSizeInventory(); ++i)
+ {
+ if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) {
+ getInventory()[i] = null;
}
}
}
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
@Override
- public void openInventory() {
- }
-
- public void readFromNBT(final NBTTagCompound nbt) {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[InventoryWorkbenchCrafting.INV_SIZE];
- for (int i = 0; i < list.tagCount(); i++) {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if (slot >= 0 && slot < InventoryWorkbenchCrafting.INV_SIZE) {
- this.getInventory()[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
+ public boolean isUseableByPlayer(EntityPlayer entityplayer)
+ {
+ return true;
}
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
@Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.getInventory()[slot] = stack;
+ public void openInventory() {}
- if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
- public void writeToNBT(final NBTTagCompound nbt) {
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < InventoryWorkbenchCrafting.INV_SIZE; i++) {
- final ItemStack stack = this.getInventory()[i];
- if (stack != null) {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack)
+ {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return true;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloCrafting.java b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloCrafting.java
index 9cfa57ec08..f4fe78d458 100644
--- a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloCrafting.java
+++ b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloCrafting.java
@@ -4,133 +4,161 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
-public class InventoryWorkbenchHoloCrafting implements IInventory {
+public class InventoryWorkbenchHoloCrafting implements IInventory{
+
+ private String name = "Inventory Crafting";
/** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 9;
+ public static final int INV_SIZE = 9;
- private final String name = "Inventory Crafting";
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
/**
- * Inventory's size must be same as number of slots you add to the Container
- * class
+ * @param itemstack - the ItemStack to which this inventory belongs
*/
- private final ItemStack[] inventory = new ItemStack[InventoryWorkbenchHoloCrafting.INV_SIZE];
-
- /**
- * @param itemstack
- * - the ItemStack to which this inventory belongs
- */
- public InventoryWorkbenchHoloCrafting() {
+ public InventoryWorkbenchHoloCrafting()
+ {
}
- /*
- * public void readFromNBT(NBTTagCompound nbt) { NBTTagList list =
- * nbt.getTagList("Items", 10); inventory = new ItemStack[INV_SIZE]; for(int
- * i = 0;i<list.tagCount();i++) { NBTTagCompound data =
- * list.getCompoundTagAt(i); int slot = data.getInteger("Slot"); if(slot >=
- * 0 && slot < INV_SIZE) { inventory[slot] =
- * ItemStack.loadItemStackFromNBT(data); } } }
- *
- * public void writeToNBT(NBTTagCompound nbt) { NBTTagList list = new
- * NBTTagList(); for(int i = 0;i<INV_SIZE;i++) { ItemStack stack =
- * inventory[i]; if(stack != null) { NBTTagCompound data = new
- * NBTTagCompound(); stack.writeToNBT(data); data.setInteger("Slot", i);
- * list.appendTag(data); } } nbt.setTag("Items", list); }
- */
-
- @Override
- public void closeInventory() {
+ /*public void readFromNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = nbt.getTagList("Items", 10);
+ inventory = new ItemStack[INV_SIZE];
+ for(int i = 0;i<list.tagCount();i++)
+ {
+ NBTTagCompound data = list.getCompoundTagAt(i);
+ int slot = data.getInteger("Slot");
+ if(slot >= 0 && slot < INV_SIZE)
+ {
+ inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
}
- @Override
- public ItemStack decrStackSize(final int slot, final int amount) {
- ItemStack stack = this.getStackInSlot(slot);
- if (stack != null) {
- if (stack.stackSize > amount) {
- stack = stack.splitStack(amount);
- this.markDirty();
- }
- else {
- this.setInventorySlotContents(slot, null);
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = new NBTTagList();
+ for(int i = 0;i<INV_SIZE;i++)
+ {
+ ItemStack stack = inventory[i];
+ if(stack != null)
+ {
+ NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
}
}
- return stack;
- }
+ nbt.setTag("Items", list);
+ }*/
- public ItemStack[] getInventory() {
- return this.inventory;
+ @Override
+ public int getSizeInventory()
+ {
+ return inventory.length;
}
- @Override
- public String getInventoryName() {
- return this.name;
+ public ItemStack[] getInventory(){
+ return inventory;
}
@Override
- public int getInventoryStackLimit() {
- return 64;
+ public ItemStack getStackInSlot(int slot)
+ {
+ return inventory[slot];
}
@Override
- public int getSizeInventory() {
- return this.inventory.length;
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ if(stack != null)
+ {
+ if(stack.stackSize > amount)
+ {
+ stack = stack.splitStack(amount);
+ markDirty();
+ }
+ else
+ {
+ setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
}
@Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
}
@Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ inventory[slot] = stack;
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
+ markDirty();
}
@Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ public String getInventoryName()
+ {
+ return name;
}
@Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return true;
+ public boolean hasCustomInventoryName()
+ {
+ return name.length() > 0;
}
@Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return true;
+ public int getInventoryStackLimit()
+ {
+ return 64;
}
@Override
- public void markDirty() {
- for (int i = 0; i < this.getSizeInventory(); ++i) {
- final ItemStack temp = this.getStackInSlot(i);
- if (temp != null) {
- // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+"
- // x"+temp.stackSize);
+ public void markDirty()
+ {
+ for (int i = 0; i < getSizeInventory(); ++i)
+ {
+ ItemStack temp = getStackInSlot(i);
+ if (temp != null){
+ //Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize);
}
if (temp != null && temp.stackSize == 0) {
- this.inventory[i] = null;
+ inventory[i] = null;
}
}
}
@Override
- public void openInventory() {
+ public boolean isUseableByPlayer(EntityPlayer entityplayer)
+ {
+ return true;
}
@Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.inventory[slot] = stack;
- if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
- stack.stackSize = this.getInventoryStackLimit();
- }
- this.markDirty();
+ public void openInventory() {}
+
+ @Override
+ public void closeInventory() {}
+
+
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack)
+ {
+ return true;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloSlots.java b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloSlots.java
index 7c4482be7c..c5da273a11 100644
--- a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloSlots.java
+++ b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchHoloSlots.java
@@ -8,215 +8,261 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryWorkbenchHoloSlots implements IInventory {
+public class InventoryWorkbenchHoloSlots implements IInventory{
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 6;
-
- private final String name = "Inventory Holo";
+ private String name = "Inventory Holo";
- // Output Slot
- public IInventory craftResult = new InventoryCraftResult();
-
- /**
- * Inventory's size must be same as number of slots you add to the Container
- * class
- */
- private ItemStack[] inventory = new ItemStack[InventoryWorkbenchHoloSlots.INV_SIZE];
+ //Output Slot
+ public IInventory craftResult = new InventoryCraftResult();
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 6;
- /** A list of one item containing the result of the crafting formula */
- private final ItemStack[] stackResult = new ItemStack[1];
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
/**
- * @param itemstack
- * - the ItemStack to which this inventory belongs
+ * @param itemstack - the ItemStack to which this inventory belongs
*/
- public InventoryWorkbenchHoloSlots() {
+ public InventoryWorkbenchHoloSlots()
+ {
}
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
- @Override
- public void closeInventory() {
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = nbt.getTagList("Items", 10);
+ inventory = new ItemStack[INV_SIZE];
+ for(int i = 0;i<list.tagCount();i++)
+ {
+ NBTTagCompound data = list.getCompoundTagAt(i);
+ int slot = data.getInteger("Slot");
+ if(slot >= 1 && slot < INV_SIZE)
+ {
+ inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
}
- /**
- * Removes from an inventory slot (first arg) up to a specified number
- * (second arg) of items and returns them in a new stack.
- */
- /*
- * @Override public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_)
- * { ItemStack stack = getStackInSlot(0); if (this.stackResult[0] != null) {
- * ItemStack itemstack = this.stackResult[0]; this.stackResult[0] = null;
- * return itemstack; } if(stack != null) { if(stack.stackSize > p_70298_2_)
- * { stack = stack.splitStack(p_70298_2_); // Don't forget this line or your
- * inventory will not be saved! markDirty(); } else { // this method also
- * calls markDirty, so we don't need to call it again
- * setInventorySlotContents(p_70298_1_, null); } } return stack; }
- */
- @Override
- public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) {
- if (this.getStackInSlot(0) != null) {
- Utils.LOG_INFO("getStackInSlot(0) contains " + this.getStackInSlot(0).getDisplayName());
- if (this.stackResult[0] == null) {
- Utils.LOG_INFO("this.stackResult[0] == null");
- this.stackResult[0] = this.getStackInSlot(0);
- }
- else if (this.stackResult[0] != null) {
- Utils.LOG_INFO("this.stackResult[0] != null");
- if (this.stackResult[0].getDisplayName().toLowerCase()
- .equals(this.getStackInSlot(0).getDisplayName().toLowerCase())) {
- Utils.LOG_INFO("Items are the same?");
- }
- else {
- Utils.LOG_INFO("Items are not the same.");
- }
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = new NBTTagList();
+ for(int i = 0;i<INV_SIZE;i++)
+ {
+ ItemStack stack = inventory[i];
+ if(stack != null && i != 0)
+ {
+ NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
}
}
+ nbt.setTag("Items", list);
+ }
- if (this.stackResult[0] != null) {
- Utils.LOG_INFO("this.stackResult[0] != null - Really never should be though. - Returning "
- + this.stackResult[0].getDisplayName());
- final ItemStack itemstack = this.stackResult[0];
- this.stackResult[0] = null;
- return itemstack;
- }
- return null;
+ @Override
+ public int getSizeInventory()
+ {
+ return inventory.length;
}
- public ItemStack[] getInventory() {
- return this.inventory;
+ public ItemStack[] getInventory(){
+ return inventory;
}
- // 1.7.2+ renamed to getInventoryName
@Override
- public String getInventoryName() {
- return this.name;
+ public ItemStack getStackInSlot(int slot)
+ {
+ return inventory[slot];
}
@Override
- public int getInventoryStackLimit() {
- return 1;
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ inventory[slot] = stack;
+
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName()
+ {
+ return name;
}
+ // 1.7.2+ renamed to hasCustomInventoryName
@Override
- public int getSizeInventory() {
- return this.inventory.length;
+ public boolean hasCustomInventoryName()
+ {
+ return name.length() > 0;
}
@Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
+ public int getInventoryStackLimit()
+ {
+ return 1;
}
/**
- * When some containers are closed they call this on each slot, then drop
- * whatever it returns as an EntityItem - like when you close a workbench
- * GUI.
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
*/
+ // 1.7.2+ renamed to markDirty
@Override
- public ItemStack getStackInSlotOnClosing(final int p_70304_1_) {
- if (this.stackResult[0] != null) {
- final ItemStack itemstack = this.stackResult[0];
- this.stackResult[0] = null;
- return itemstack;
+ public void markDirty()
+ {
+ for (int i = 0; i < getSizeInventory(); ++i)
+ {
+ if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) {
+ inventory[i] = null;
+ }
}
- return null;
}
- // 1.7.2+ renamed to hasCustomInventoryName
@Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
+ public boolean isUseableByPlayer(EntityPlayer entityplayer)
+ {
+ return true;
}
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
/**
- * This method doesn't seem to do what it claims to do, as items can still
- * be left-clicked and placed in the inventory even when this returns false
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
*/
@Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack)
+ {
return false;
}
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return true;
- }
+ /** A list of one item containing the result of the crafting formula */
+ private ItemStack[] stackResult = new ItemStack[1];
/**
- * This is the method that will handle saving the inventory contents, as it
- * is called (or should be called!) anytime the inventory changes. Perfect.
- * Much better than using onUpdate in an Item, as this will also let you
- * change things in your inventory without ever opening a Gui, if you want.
+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a
+ * new stack.
*/
- // 1.7.2+ renamed to markDirty
+ /*@Override
+ public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_)
+ {
+ ItemStack stack = getStackInSlot(0);
+ if (this.stackResult[0] != null)
+ {
+ ItemStack itemstack = this.stackResult[0];
+ this.stackResult[0] = null;
+ return itemstack;
+ }
+ if(stack != null)
+ {
+ if(stack.stackSize > p_70298_2_)
+ {
+ stack = stack.splitStack(p_70298_2_);
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
+ }
+ else
+ {
+ // this method also calls markDirty, so we don't need to call it again
+ setInventorySlotContents(p_70298_1_, null);
+ }
+ }
+ return stack;
+ }*/
@Override
- public void markDirty() {
- for (int i = 0; i < this.getSizeInventory(); ++i) {
- if (this.getStackInSlot(i) != null && this.getStackInSlot(i).stackSize == 0) {
- this.inventory[i] = null;
+ public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_)
+ {
+ if (getStackInSlot(0) != null){
+ Utils.LOG_INFO("getStackInSlot(0) contains "+getStackInSlot(0).getDisplayName());
+ if (this.stackResult[0] == null){
+ Utils.LOG_INFO("this.stackResult[0] == null");
+ this.stackResult[0] = getStackInSlot(0);
+ }
+ else if (this.stackResult[0] != null){
+ Utils.LOG_INFO("this.stackResult[0] != null");
+ if (this.stackResult[0].getDisplayName().toLowerCase().equals(getStackInSlot(0).getDisplayName().toLowerCase())){
+ Utils.LOG_INFO("Items are the same?");
+ }
+ else {
+ Utils.LOG_INFO("Items are not the same.");
+ }
}
}
- }
+
+ if (this.stackResult[0] != null)
+ {
+ Utils.LOG_INFO("this.stackResult[0] != null - Really never should be though. - Returning "+this.stackResult[0].getDisplayName());
+ ItemStack itemstack = this.stackResult[0];
+ this.stackResult[0] = null;
+ return itemstack;
+ }
+ return null;
+ }
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ /**
+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -
+ * like when you close a workbench GUI.
+ */
@Override
- public void openInventory() {
- }
-
- public void readFromNBT(final NBTTagCompound nbt) {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[InventoryWorkbenchHoloSlots.INV_SIZE];
- for (int i = 0; i < list.tagCount(); i++) {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if (slot >= 1 && slot < InventoryWorkbenchHoloSlots.INV_SIZE) {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
+ public ItemStack getStackInSlotOnClosing(int p_70304_1_)
+ {
+ if (this.stackResult[0] != null)
+ {
+ ItemStack itemstack = this.stackResult[0];
+ this.stackResult[0] = null;
+ return itemstack;
}
+ return null;
}
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.inventory[slot] = stack;
+}
- if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
- stack.stackSize = this.getInventoryStackLimit();
- }
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
- public void writeToNBT(final NBTTagCompound nbt) {
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < InventoryWorkbenchHoloSlots.INV_SIZE; i++) {
- final ItemStack stack = this.inventory[i];
- if (stack != null && i != 0) {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
+//Default Behaviour
+/*@Override
+public ItemStack decrStackSize(int slot, int amount)
+{
+ if(stack != null)
+ {
+ if(stack.stackSize > amount)
+ {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
+ }
+ else
+ {
+ // this method also calls markDirty, so we don't need to call it again
+ setInventorySlotContents(slot, null);
}
- nbt.setTag("Items", list);
}
+ return stack;
+}*/
-}
+//Default Behaviour
+/*@Override
+public ItemStack getStackInSlotOnClosing(int slot)
+{
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
+}*/
-// Default Behaviour
-/*
- * @Override public ItemStack decrStackSize(int slot, int amount) { if(stack !=
- * null) { if(stack.stackSize > amount) { stack = stack.splitStack(amount); //
- * Don't forget this line or your inventory will not be saved! markDirty(); }
- * else { // this method also calls markDirty, so we don't need to call it again
- * setInventorySlotContents(slot, null); } } return stack; }
- */
-
-// Default Behaviour
-/*
- * @Override public ItemStack getStackInSlotOnClosing(int slot) { ItemStack
- * stack = getStackInSlot(slot); setInventorySlotContents(slot, null); return
- * stack; }
- */
diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java
index 114776dc49..7e3e7c3aef 100644
--- a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java
+++ b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchTools.java
@@ -7,165 +7,181 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryWorkbenchTools implements IInventory {
+public class InventoryWorkbenchTools implements IInventory{
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 5;
+ private String name = "Inventory Tools";
- private final String name = "Inventory Tools";
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 5;
- /**
- * Inventory's size must be same as number of slots you add to the Container
- * class
- */
- private ItemStack[] inventory = new ItemStack[InventoryWorkbenchTools.INV_SIZE];
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
/**
- * @param itemstack
- * - the ItemStack to which this inventory belongs
+ * @param itemstack - the ItemStack to which this inventory belongs
*/
- public InventoryWorkbenchTools() {
-
+ public InventoryWorkbenchTools()
+ {
+
+ }
+
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = nbt.getTagList("Items", 10);
+ inventory = new ItemStack[INV_SIZE];
+ for(int i = 0;i<list.tagCount();i++)
+ {
+ NBTTagCompound data = list.getCompoundTagAt(i);
+ int slot = data.getInteger("Slot");
+ if(slot >= 0 && slot < INV_SIZE)
+ {
+ inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = new NBTTagList();
+ for(int i = 0;i<INV_SIZE;i++)
+ {
+ ItemStack stack = inventory[i];
+ if(stack != null)
+ {
+ NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory()
+ {
+ return inventory.length;
+ }
+
+ public ItemStack[] getInventory(){
+ return inventory;
}
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
@Override
- public void closeInventory() {
+ public ItemStack getStackInSlot(int slot)
+ {
+ return inventory[slot];
}
@Override
- public ItemStack decrStackSize(final int slot, final int amount) {
- ItemStack stack = this.getStackInSlot(slot);
- if (stack != null) {
- if (stack.stackSize > amount) {
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ if(stack != null)
+ {
+ if(stack.stackSize > amount)
+ {
stack = stack.splitStack(amount);
// Don't forget this line or your inventory will not be saved!
- this.markDirty();
+ markDirty();
}
- else {
- // this method also calls markDirty, so we don't need to call it
- // again
- this.setInventorySlotContents(slot, null);
+ else
+ {
+ // this method also calls markDirty, so we don't need to call it again
+ setInventorySlotContents(slot, null);
}
}
return stack;
}
- public ItemStack[] getInventory() {
- return this.inventory;
- }
-
- // 1.7.2+ renamed to getInventoryName
@Override
- public String getInventoryName() {
- return this.name;
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
}
@Override
- public int getInventoryStackLimit() {
- return 1;
- }
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ inventory[slot] = stack;
- @Override
- public int getSizeInventory() {
- return this.inventory.length;
- }
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
}
+ // 1.7.2+ renamed to getInventoryName
@Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
+ public String getInventoryName()
+ {
+ return name;
}
// 1.7.2+ renamed to hasCustomInventoryName
@Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
- }
-
- /**
- * This method doesn't seem to do what it claims to do, as items can still
- * be left-clicked and placed in the inventory even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) {
- return true;
- }
- return false;
+ public boolean hasCustomInventoryName()
+ {
+ return name.length() > 0;
}
@Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return true;
+ public int getInventoryStackLimit()
+ {
+ return 1;
}
/**
- * This is the method that will handle saving the inventory contents, as it
- * is called (or should be called!) anytime the inventory changes. Perfect.
- * Much better than using onUpdate in an Item, as this will also let you
- * change things in your inventory without ever opening a Gui, if you want.
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
*/
// 1.7.2+ renamed to markDirty
@Override
- public void markDirty() {
- for (int i = 0; i < this.getSizeInventory(); ++i) {
- if (this.getStackInSlot(i) != null && this.getStackInSlot(i).stackSize == 0) {
- this.inventory[i] = null;
+ public void markDirty()
+ {
+ for (int i = 0; i < getSizeInventory(); ++i)
+ {
+ if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) {
+ inventory[i] = null;
}
}
}
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
@Override
- public void openInventory() {
- }
-
- public void readFromNBT(final NBTTagCompound nbt) {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[InventoryWorkbenchTools.INV_SIZE];
- for (int i = 0; i < list.tagCount(); i++) {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if (slot >= 0 && slot < InventoryWorkbenchTools.INV_SIZE) {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
+ public boolean isUseableByPlayer(EntityPlayer entityplayer)
+ {
+ return true;
}
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
@Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.inventory[slot] = stack;
+ public void openInventory() {}
- if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
- public void writeToNBT(final NBTTagCompound nbt) {
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < InventoryWorkbenchTools.INV_SIZE; i++) {
- final ItemStack stack = this.inventory[i];
- if (stack != null) {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack)
+ {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ if (itemstack.getItem() instanceof GT_MetaGenerated_Tool){
+ return true;
+ }
+ return false;
}
-
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java
index fbfb45a518..77f3351e59 100644
--- a/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java
+++ b/src/Java/gtPlusPlus/core/inventories/InventoryWorkbenchToolsElectric.java
@@ -10,166 +10,182 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-public class InventoryWorkbenchToolsElectric implements IInventory {
+public class InventoryWorkbenchToolsElectric implements IInventory{
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 5;
+ private String name = "Inventory Tools";
- private final String name = "Inventory Tools";
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 5;
- /**
- * Inventory's size must be same as number of slots you add to the Container
- * class
- */
- private ItemStack[] inventory = new ItemStack[InventoryWorkbenchToolsElectric.INV_SIZE];
- private final Slot[] toolSlots = new SlotGtToolElectric[InventoryWorkbenchToolsElectric.INV_SIZE]; // TODO
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+ private Slot[] toolSlots = new SlotGtToolElectric[INV_SIZE]; //TODO
/**
- * @param itemstack
- * - the ItemStack to which this inventory belongs
+ * @param itemstack - the ItemStack to which this inventory belongs
*/
- public InventoryWorkbenchToolsElectric() {
-
+ public InventoryWorkbenchToolsElectric()
+ {
+
+ }
+
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = nbt.getTagList("Items", 10);
+ inventory = new ItemStack[INV_SIZE];
+ for(int i = 0;i<list.tagCount();i++)
+ {
+ NBTTagCompound data = list.getCompoundTagAt(i);
+ int slot = data.getInteger("Slot");
+ if(slot >= 0 && slot < INV_SIZE)
+ {
+ inventory[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
+ }
+ }
+
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ NBTTagList list = new NBTTagList();
+ for(int i = 0;i<INV_SIZE;i++)
+ {
+ ItemStack stack = inventory[i];
+ if(stack != null)
+ {
+ NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getSizeInventory()
+ {
+ return inventory.length;
+ }
+
+ public ItemStack[] getInventory(){
+ return inventory;
}
- // 1.7.2+ renamed to closeInventory(EntityPlayer player)
@Override
- public void closeInventory() {
+ public ItemStack getStackInSlot(int slot)
+ {
+ return inventory[slot];
}
@Override
- public ItemStack decrStackSize(final int slot, final int amount) {
- ItemStack stack = this.getStackInSlot(slot);
- if (stack != null) {
- if (stack.stackSize > amount) {
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ if(stack != null)
+ {
+ if(stack.stackSize > amount)
+ {
stack = stack.splitStack(amount);
// Don't forget this line or your inventory will not be saved!
- this.markDirty();
+ markDirty();
}
- else {
- // this method also calls markDirty, so we don't need to call it
- // again
- this.setInventorySlotContents(slot, null);
+ else
+ {
+ // this method also calls markDirty, so we don't need to call it again
+ setInventorySlotContents(slot, null);
}
}
return stack;
}
- public ItemStack[] getInventory() {
- return this.inventory;
- }
-
- // 1.7.2+ renamed to getInventoryName
@Override
- public String getInventoryName() {
- return this.name;
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
}
@Override
- public int getInventoryStackLimit() {
- return 1;
- }
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ inventory[slot] = stack;
- @Override
- public int getSizeInventory() {
- return this.inventory.length;
- }
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
}
+ // 1.7.2+ renamed to getInventoryName
@Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
+ public String getInventoryName()
+ {
+ return name;
}
// 1.7.2+ renamed to hasCustomInventoryName
@Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
- }
-
- /**
- * This method doesn't seem to do what it claims to do, as items can still
- * be left-clicked and placed in the inventory even when this returns false
- */
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- // Don't want to be able to store the inventory item within itself
- // Bad things will happen, like losing your inventory
- // Actually, this needs a custom Slot to work
- if (itemstack.getItem() instanceof GT_MetaGenerated_Tool || itemstack.getItem() instanceof IElectricItem) {
- return true;
- }
- return false;
+ public boolean hasCustomInventoryName()
+ {
+ return name.length() > 0;
}
@Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return true;
+ public int getInventoryStackLimit()
+ {
+ return 1;
}
/**
- * This is the method that will handle saving the inventory contents, as it
- * is called (or should be called!) anytime the inventory changes. Perfect.
- * Much better than using onUpdate in an Item, as this will also let you
- * change things in your inventory without ever opening a Gui, if you want.
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
*/
// 1.7.2+ renamed to markDirty
@Override
- public void markDirty() {
- for (int i = 0; i < this.getSizeInventory(); ++i) {
- if (this.getStackInSlot(i) != null && this.getStackInSlot(i).stackSize == 0) {
- this.inventory[i] = null;
+ public void markDirty()
+ {
+ for (int i = 0; i < getSizeInventory(); ++i)
+ {
+ if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) {
+ inventory[i] = null;
}
}
}
- // 1.7.2+ renamed to openInventory(EntityPlayer player)
@Override
- public void openInventory() {
- }
-
- public void readFromNBT(final NBTTagCompound nbt) {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[InventoryWorkbenchToolsElectric.INV_SIZE];
- for (int i = 0; i < list.tagCount(); i++) {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if (slot >= 0 && slot < InventoryWorkbenchToolsElectric.INV_SIZE) {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
+ public boolean isUseableByPlayer(EntityPlayer entityplayer)
+ {
+ return true;
}
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
@Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.inventory[slot] = stack;
+ public void openInventory() {}
- if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
- stack.stackSize = this.getInventoryStackLimit();
- }
-
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- }
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
- public void writeToNBT(final NBTTagCompound nbt) {
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < InventoryWorkbenchToolsElectric.INV_SIZE; i++) {
- final ItemStack stack = this.inventory[i];
- if (stack != null) {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack)
+ {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ if (itemstack.getItem() instanceof GT_MetaGenerated_Tool || itemstack.getItem() instanceof IElectricItem){
+ return true;
+ }
+ return false;
}
-
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index 79b813c745..2fa0d2c698 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -1,11 +1,14 @@
package gtPlusPlus.core.item;
-
-import cpw.mods.fml.common.registry.GameRegistry;
+import static gtPlusPlus.core.creative.AddToCreativeTab.tabMachines;
+import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc;
+import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT;
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.common.compat.COMPAT_Baubles;
import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.*;
+import gtPlusPlus.core.item.base.BaseEuItem;
+import gtPlusPlus.core.item.base.BaseItemBackpack;
+import gtPlusPlus.core.item.base.CoreItem;
import gtPlusPlus.core.item.base.dusts.decimal.BaseItemCentidust;
import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust;
import gtPlusPlus.core.item.base.foods.BaseItemFood;
@@ -13,390 +16,350 @@ import gtPlusPlus.core.item.base.foods.BaseItemHotFood;
import gtPlusPlus.core.item.base.ingots.BaseItemIngot;
import gtPlusPlus.core.item.base.plates.BaseItemPlate;
import gtPlusPlus.core.item.effects.RarityUncommon;
-import gtPlusPlus.core.item.general.*;
+import gtPlusPlus.core.item.general.BufferCore;
+import gtPlusPlus.core.item.general.ItemBlueprint;
+import gtPlusPlus.core.item.general.RF2EU_Battery;
import gtPlusPlus.core.item.general.fuelrods.FuelRod_Base;
import gtPlusPlus.core.item.init.ItemsFoods;
import gtPlusPlus.core.item.tool.misc.SandstoneHammer;
-import gtPlusPlus.core.item.tool.staballoy.*;
+import gtPlusPlus.core.item.tool.staballoy.MultiPickaxeBase;
+import gtPlusPlus.core.item.tool.staballoy.MultiSpadeBase;
+import gtPlusPlus.core.item.tool.staballoy.StaballoyAxe;
+import gtPlusPlus.core.item.tool.staballoy.StaballoyPickaxe;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.CORE.configSwitches;
import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.material.*;
+import gtPlusPlus.core.material.ALLOY;
+import gtPlusPlus.core.material.ELEMENT;
+import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.debug.DEBUG_INIT;
import gtPlusPlus.core.util.item.ItemUtils;
-import net.minecraft.item.*;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
+import net.minecraft.item.ItemFood;
+import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.EnumHelper;
-
+import cpw.mods.fml.common.registry.GameRegistry;
public final class ModItems {
- public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18);
-
- public static Item AAA_Broken;
-
- public static Item itemDebugShapeSpawner;
-
- public static Item itemBaseSpawnEgg;
-
- // EnderIO
- public static Item itemPlateSoularium;
- public static Item itemPlateRedstoneAlloy;
- public static Item itemPlateElectricalSteel;
- public static Item itemPlatePulsatingIron;
- public static Item itemPlateEnergeticAlloy;
- public static Item itemPlateVibrantAlloy;
- public static Item itemPlateConductiveIron;
- public static Item itemPlateDarkSteel;
- // Big Reactors
- public static Item itemPlateBlutonium;
- public static Item itemPlateCyanite;
- public static Item itemPlateLudicrite;
- // Thaumcraft
- public static Item itemPlateVoidMetal;
- // Pneumaticraft
- public static Item itemPlateCompressedIron;
- // SimplyJetpacks
- public static Item itemPlateEnrichedSoularium;
- // rfTools
- public static Item itemPlateDimensionShard;
- // Staballoy
- public static Item itemStaballoyPickaxe;
- public static Item itemStaballoyAxe;
- // Tools
- public static Item itemSandstoneHammer;
- // Machine Related
- public static Item itemBufferCore0;
- // Material related
- public static Item itemStickyRubber;
- public static Item itemIngotBatteryAlloy;
- public static Item itemPlateBatteryAlloy;
- public static Item itemHeliumBlob;
- public static Item itemPLACEHOLDER_Circuit;
-
- public static Item FuelRod_Empty;
- public static Item FuelRod_Thorium;
- public static Item FuelRod_Uranium;
- public static Item FuelRod_Plutonium;
-
- public static Item itemBedLocator_Base;
- public static Item itemBaseItemWithCharge;
-
- public static Item itemIngotRaisinBread;
- public static Item itemHotIngotRaisinBread;
-
- public static ItemFood itemFoodRaisinToast;
- public static BaseItemHotFood itemHotFoodRaisinToast;
- public static BaseItemFood itemFoodCurriedSausages;
- public static BaseItemHotFood itemHotFoodCurriedSausages;
-
- public static Item RfEuBattery;
- public static Item itemPersonalCloakingDevice;
- public static Item itemPersonalCloakingDeviceCharged;
- public static Item itemPersonalHealingDevice;
-
- public static MultiPickaxeBase MP_GTMATERIAL;
- public static MultiSpadeBase MS_GTMATERIAL;
-
- public static BaseItemDecidust itemBaseDecidust;
- public static BaseItemCentidust itemBaseCentidust;
-
- public static ItemStack FluidCell;
-
- public static BaseItemBackpack backpack_Red;
- public static BaseItemBackpack backpack_Green;
- public static BaseItemBackpack backpack_Blue;
- public static BaseItemBackpack backpack_Yellow;
- public static BaseItemBackpack backpack_Purple;
- public static BaseItemBackpack backpack_Cyan;
- public static BaseItemBackpack backpack_Maroon;
- public static BaseItemBackpack backpack_Olive;
- public static BaseItemBackpack backpack_DarkGreen;
- public static BaseItemBackpack backpack_DarkPurple;
- public static BaseItemBackpack backpack_Teal;
- public static BaseItemBackpack backpack_Navy;
- public static BaseItemBackpack backpack_Silver;
- public static BaseItemBackpack backpack_Gray;
- public static BaseItemBackpack backpack_Black;
- public static BaseItemBackpack backpack_White;
-
- public static ItemBlueprint itemBlueprintBase;
-
- public static Item dustLithiumCarbonate;
- public static Item dustLithiumHydroxide;
- public static Item dustLithiumPeroxide;
- public static Item dustLithiumFluoride;
-
- public static Item dustUraniumTetraFluoride;
- public static Item dustUraniumHexaFluoride;
-
- public static Item dustBerylliumFluoride;
-
- public static Item dustQuicklime;
- public static Item dustCalciumHydroxide;
- public static Item dustCalciumCarbonate;
- public static Item dust2LiOH_CaCO3;
- public static Item dustLi2BeF4;
-
- public static BaseEuItem metaItem2;
-
- // @SuppressWarnings("unused")
+ public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18);
+
+ public static Item AAA_Broken;
+
+ public static Item itemDebugShapeSpawner;
+
+ public static Item itemBaseSpawnEgg;
+
+ //EnderIO
+ public static Item itemPlateSoularium;
+ public static Item itemPlateRedstoneAlloy;
+ public static Item itemPlateElectricalSteel;
+ public static Item itemPlatePulsatingIron;
+ public static Item itemPlateEnergeticAlloy;
+ public static Item itemPlateVibrantAlloy;
+ public static Item itemPlateConductiveIron;
+ public static Item itemPlateDarkSteel;
+ //Big Reactors
+ public static Item itemPlateBlutonium;
+ public static Item itemPlateCyanite;
+ public static Item itemPlateLudicrite;
+ //Thaumcraft
+ public static Item itemPlateVoidMetal;
+ //Pneumaticraft
+ public static Item itemPlateCompressedIron;
+ //SimplyJetpacks
+ public static Item itemPlateEnrichedSoularium;
+ //rfTools
+ public static Item itemPlateDimensionShard;
+ //Staballoy
+ public static Item itemStaballoyPickaxe;
+ public static Item itemStaballoyAxe;
+ //Tools
+ public static Item itemSandstoneHammer;
+ //Machine Related
+ public static Item itemBufferCore0;
+ //Material related
+ public static Item itemStickyRubber;
+ public static Item itemIngotBatteryAlloy;
+ public static Item itemPlateBatteryAlloy;
+ public static Item itemHeliumBlob;
+ public static Item itemPLACEHOLDER_Circuit;
+
+ public static Item FuelRod_Empty;
+ public static Item FuelRod_Thorium;
+ public static Item FuelRod_Uranium;
+ public static Item FuelRod_Plutonium;
+
+ public static Item itemBedLocator_Base;
+ public static Item itemBaseItemWithCharge;
+
+ public static Item itemIngotRaisinBread;
+ public static Item itemHotIngotRaisinBread;
+
+ public static ItemFood itemFoodRaisinToast;
+ public static BaseItemHotFood itemHotFoodRaisinToast;
+ public static BaseItemFood itemFoodCurriedSausages;
+ public static BaseItemHotFood itemHotFoodCurriedSausages;
+
+ public static Item RfEuBattery;
+ public static Item itemPersonalCloakingDevice;
+ public static Item itemPersonalCloakingDeviceCharged;
+ public static Item itemPersonalHealingDevice;
+
+ public static MultiPickaxeBase MP_GTMATERIAL;
+ public static MultiSpadeBase MS_GTMATERIAL;
+
+ public static BaseItemDecidust itemBaseDecidust;
+ public static BaseItemCentidust itemBaseCentidust;
+
+ public static ItemStack FluidCell;
+
+ public static BaseItemBackpack backpack_Red;
+ public static BaseItemBackpack backpack_Green;
+ public static BaseItemBackpack backpack_Blue;
+ public static BaseItemBackpack backpack_Yellow;
+ public static BaseItemBackpack backpack_Purple;
+ public static BaseItemBackpack backpack_Cyan;
+ public static BaseItemBackpack backpack_Maroon;
+ public static BaseItemBackpack backpack_Olive;
+ public static BaseItemBackpack backpack_DarkGreen;
+ public static BaseItemBackpack backpack_DarkPurple;
+ public static BaseItemBackpack backpack_Teal;
+ public static BaseItemBackpack backpack_Navy;
+ public static BaseItemBackpack backpack_Silver;
+ public static BaseItemBackpack backpack_Gray;
+ public static BaseItemBackpack backpack_Black;
+ public static BaseItemBackpack backpack_White;
+
+ public static ItemBlueprint itemBlueprintBase;
+
+ public static Item dustLithiumCarbonate;
+ public static Item dustLithiumHydroxide;
+ public static Item dustLithiumPeroxide;
+ public static Item dustLithiumFluoride;
+
+ public static Item dustUraniumTetraFluoride;
+ public static Item dustUraniumHexaFluoride;
+
+ public static Item dustBerylliumFluoride;
+
+ public static Item dustQuicklime;
+ public static Item dustCalciumHydroxide;
+ public static Item dustCalciumCarbonate;
+ public static Item dust2LiOH_CaCO3;
+ public static Item dustLi2BeF4;
+
+ public static BaseEuItem metaItem2;
+
+
+ //@SuppressWarnings("unused")
@SuppressWarnings("unused")
- public static final void init() {
+ public static final void init(){
- ModItems.AAA_Broken = new BaseItemIngot("AAA_Broken", "Errors - Tell Alkalus",
- Utils.rgbtoHexValue(128, 128, 128), 0);
+ AAA_Broken = new BaseItemIngot("AAA_Broken", "Errors - Tell Alkalus", Utils.rgbtoHexValue(128, 128, 128), 0);
- // Debug Loading
- if (CORE.DEBUG) {
+ //Debug Loading
+ if (CORE.DEBUG){
DEBUG_INIT.registerItems();
- }
-
- // Some Simple forms of materials
- ModItems.itemStickyRubber = new Item().setUnlocalizedName("itemStickyRubber")
- .setCreativeTab(AddToCreativeTab.tabMachines).setTextureName(CORE.MODID + ":itemStickyRubber");
- GameRegistry.registerItem(ModItems.itemStickyRubber, "itemStickyRubber");
- GT_OreDictUnificator.registerOre("ingotRubber", ItemUtils.getItemStack(CORE.MODID + ":itemStickyRubber", 1));
-
- ModItems.itemHeliumBlob = new CoreItem("itemHeliumBlob", AddToCreativeTab.tabMisc)
- .setTextureName(CORE.MODID + ":itemHeliumBlob");
+ }
+
+
+ //Some Simple forms of materials
+ itemStickyRubber = new Item().setUnlocalizedName("itemStickyRubber").setCreativeTab(tabMachines).setTextureName(CORE.MODID + ":itemStickyRubber");
+ GameRegistry.registerItem(itemStickyRubber, "itemStickyRubber");
+ GT_OreDictUnificator.registerOre("ingotRubber", ItemUtils.getItemStack(CORE.MODID+":itemStickyRubber", 1));
+
+ itemHeliumBlob = new CoreItem("itemHeliumBlob", tabMisc).setTextureName(CORE.MODID + ":itemHeliumBlob");
GT_OreDictUnificator.registerOre("dustHydrogen", new ItemStack(ModItems.itemHeliumBlob));
- // GameRegistry.registerItem(itemHeliumBlob, "itemHeliumBlob");
-
- // Make some backpacks
- // Primary colours
- ModItems.backpack_Red = new BaseItemBackpack("backpackRed", Utils.rgbtoHexValue(200, 0, 0));
- ModItems.backpack_Green = new BaseItemBackpack("backpackGreen", Utils.rgbtoHexValue(0, 200, 0));
- ModItems.backpack_Blue = new BaseItemBackpack("backpackBlue", Utils.rgbtoHexValue(0, 0, 200));
- // Secondary Colours
- ModItems.backpack_Yellow = new BaseItemBackpack("backpackYellow", Utils.rgbtoHexValue(200, 200, 0));
- ModItems.backpack_Purple = new BaseItemBackpack("backpackPurple", Utils.rgbtoHexValue(200, 0, 200));
- ModItems.backpack_Cyan = new BaseItemBackpack("backpackCyan", Utils.rgbtoHexValue(0, 200, 200));
- // Tertiary Colours
- ModItems.backpack_Maroon = new BaseItemBackpack("backpackMaroon", Utils.rgbtoHexValue(128, 0, 0));
- ModItems.backpack_Olive = new BaseItemBackpack("backpackOlive", Utils.rgbtoHexValue(128, 128, 0));
- ModItems.backpack_DarkGreen = new BaseItemBackpack("backpackDarkGreen", Utils.rgbtoHexValue(0, 128, 0));
- ModItems.backpack_DarkPurple = new BaseItemBackpack("backpackDarkPurple", Utils.rgbtoHexValue(128, 0, 128));
- ModItems.backpack_Teal = new BaseItemBackpack("backpackTeal", Utils.rgbtoHexValue(0, 128, 128));
- ModItems.backpack_Navy = new BaseItemBackpack("backpackNavy", Utils.rgbtoHexValue(0, 0, 128));
- // Shades
- ModItems.backpack_Silver = new BaseItemBackpack("backpackSilver", Utils.rgbtoHexValue(192, 192, 192));
- ModItems.backpack_Gray = new BaseItemBackpack("backpackGray", Utils.rgbtoHexValue(128, 128, 128));
- ModItems.backpack_Black = new BaseItemBackpack("backpackBlack", Utils.rgbtoHexValue(20, 20, 20));
- ModItems.backpack_White = new BaseItemBackpack("backpackWhite", Utils.rgbtoHexValue(240, 240, 240));
-
- ModItems.itemBlueprintBase = new ItemBlueprint("itemBlueprint");
-
- // Start meta Item Generation
+ //GameRegistry.registerItem(itemHeliumBlob, "itemHeliumBlob");
+
+ //Make some backpacks
+ //Primary colours
+ backpack_Red = new BaseItemBackpack("backpackRed", Utils.rgbtoHexValue(200, 0, 0));
+ backpack_Green = new BaseItemBackpack("backpackGreen", Utils.rgbtoHexValue(0, 200, 0));
+ backpack_Blue = new BaseItemBackpack("backpackBlue", Utils.rgbtoHexValue(0, 0, 200));
+ //Secondary Colours
+ backpack_Yellow = new BaseItemBackpack("backpackYellow", Utils.rgbtoHexValue(200, 200, 0));
+ backpack_Purple = new BaseItemBackpack("backpackPurple", Utils.rgbtoHexValue(200, 0, 200));
+ backpack_Cyan = new BaseItemBackpack("backpackCyan", Utils.rgbtoHexValue(0, 200, 200));
+ //Tertiary Colours
+ backpack_Maroon = new BaseItemBackpack("backpackMaroon", Utils.rgbtoHexValue(128, 0, 0));
+ backpack_Olive = new BaseItemBackpack("backpackOlive", Utils.rgbtoHexValue(128, 128, 0));
+ backpack_DarkGreen = new BaseItemBackpack("backpackDarkGreen", Utils.rgbtoHexValue(0, 128, 0));
+ backpack_DarkPurple = new BaseItemBackpack("backpackDarkPurple", Utils.rgbtoHexValue(128, 0, 128));
+ backpack_Teal = new BaseItemBackpack("backpackTeal", Utils.rgbtoHexValue(0, 128, 128));
+ backpack_Navy = new BaseItemBackpack("backpackNavy", Utils.rgbtoHexValue(0, 0, 128));
+ //Shades
+ backpack_Silver = new BaseItemBackpack("backpackSilver", Utils.rgbtoHexValue(192, 192, 192));
+ backpack_Gray = new BaseItemBackpack("backpackGray", Utils.rgbtoHexValue(128, 128, 128));
+ backpack_Black = new BaseItemBackpack("backpackBlack", Utils.rgbtoHexValue(20, 20, 20));
+ backpack_White = new BaseItemBackpack("backpackWhite", Utils.rgbtoHexValue(240, 240, 240));
+
+ itemBlueprintBase = new ItemBlueprint("itemBlueprint");
+
+ //Start meta Item Generation
ItemsFoods.load();
- try {
- // Elements generate first so they can be used in compounds.
-
- // Uranium-233 is a fissile isotope of uranium that is bred from
- // thorium-232 as part of the thorium fuel cycle.
- MaterialGenerator.generate(ELEMENT.getInstance().URANIUM233);
- MaterialGenerator.generate(ELEMENT.getInstance().ZIRCONIUM);
-
- // Carbides - Tungsten Carbide exists in .09 so don't generate it. -
- // Should still come before alloys though
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ try{
+ //Elements generate first so they can be used in compounds.
+
+ //Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel cycle.
+ MaterialGenerator.generate(ELEMENT.getInstance().URANIUM233);
+ MaterialGenerator.generate(ELEMENT.getInstance().ZIRCONIUM);
+
+ //Carbides - Tungsten Carbide exists in .09 so don't generate it. - Should still come before alloys though
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
MaterialGenerator.generate(ALLOY.TUNGSTEN_CARBIDE);
}
MaterialGenerator.generate(ALLOY.SILICON_CARBIDE);
MaterialGenerator.generate(ALLOY.ZIRCONIUM_CARBIDE);
MaterialGenerator.generate(ALLOY.TANTALUM_CARBIDE);
- MaterialGenerator.generate(ALLOY.NIOBIUM_CARBIDE);
-
- // Generate some Alloys
-
- // Misc Alloys
+ MaterialGenerator.generate(ALLOY.NIOBIUM_CARBIDE);
+
+ //Generate some Alloys
+
+ //Misc Alloys
MaterialGenerator.generate(ALLOY.ENERGYCRYSTAL);
MaterialGenerator.generate(ALLOY.BLOODSTEEL);
MaterialGenerator.generate(ALLOY.BEDROCKIUM);
MaterialGenerator.generate(ALLOY.ZERON_100);
- // Tumbaga was the name given by Spaniards to a non-specific alloy
- // of gold and copper
+ //Tumbaga was the name given by Spaniards to a non-specific alloy of gold and copper
MaterialGenerator.generate(ALLOY.TUMBAGA);
- // Potin is traditionally an alloy of bronze, tin and lead, with
- // varying quantities of each possible
+ //Potin is traditionally an alloy of bronze, tin and lead, with varying quantities of each possible
MaterialGenerator.generate(ALLOY.POTIN);
-
- // Staballoy & Tantalloy
+
+ //Staballoy & Tantalloy
MaterialGenerator.generate(ALLOY.STABALLOY);
MaterialGenerator.generate(ALLOY.TANTALLOY_60);
MaterialGenerator.generate(ALLOY.TANTALLOY_61);
- // Inconel
+ //Inconel
MaterialGenerator.generate(ALLOY.INCONEL_625);
MaterialGenerator.generate(ALLOY.INCONEL_690);
MaterialGenerator.generate(ALLOY.INCONEL_792);
- // Maraging Steel
+
+ //Maraging Steel
MaterialGenerator.generate(ALLOY.MARAGING250);
MaterialGenerator.generate(ALLOY.MARAGING300);
MaterialGenerator.generate(ALLOY.MARAGING350);
-
- // Composite Alloys
+
+ //Composite Alloys
MaterialGenerator.generate(ALLOY.STELLITE);
- MaterialGenerator.generate(ALLOY.TALONITE);
+ MaterialGenerator.generate(ALLOY.TALONITE);
- // Hastelloy
+ //Hastelloy
MaterialGenerator.generate(ALLOY.HASTELLOY_W);
MaterialGenerator.generate(ALLOY.HASTELLOY_X);
MaterialGenerator.generate(ALLOY.HASTELLOY_C276);
MaterialGenerator.generate(ALLOY.HASTELLOY_N);
- // Incoloy
+ //Incoloy
MaterialGenerator.generate(ALLOY.INCOLOY_020);
MaterialGenerator.generate(ALLOY.INCOLOY_DS);
MaterialGenerator.generate(ALLOY.INCOLOY_MA956);
-
- // Leagrisium
- MaterialGenerator.generate(ALLOY.LEAGRISIUM);
- // Must be the final Alloy to Generate
- MaterialGenerator.generate(ALLOY.QUANTUM);
-
- }
- catch (final Throwable r) {
- Utils.LOG_INFO("Failed to Generated a Material. " + r.getMessage());
- // Utils.LOG_INFO("Failed to Generated a Material.
- // "+r.getCause().getMessage());
- Utils.LOG_INFO("Failed to Generated a Material. " + r.getStackTrace()[0].getMethodName());
- Utils.LOG_INFO("Failed to Generated a Material. " + r.getStackTrace()[1].getMethodName());
+
+ //Leagrisium
+ MaterialGenerator.generate(ALLOY.LEAGRISIUM);
+ //Must be the final Alloy to Generate
+ MaterialGenerator.generate(ALLOY.QUANTUM);
+
+
+ } catch (Throwable r){
+ Utils.LOG_INFO("Failed to Generated a Material. "+r.getMessage());
+ //Utils.LOG_INFO("Failed to Generated a Material. "+r.getCause().getMessage());
+ Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[0].getMethodName());
+ Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[1].getMethodName());
r.printStackTrace();
System.exit(1);
}
- // Nuclear Fuel Dusts
- ModItems.dustUraniumTetraFluoride = ItemUtils.generateSpecialUseDusts("UraniumTetrafluoride",
- "Uranium Tetrafluoride", Utils.rgbtoHexValue(17, 179, 42))[0];
- ModItems.dustUraniumHexaFluoride = ItemUtils.generateSpecialUseDusts("UraniumHexafluoride",
- "Uranium Hexafluoride", Utils.rgbtoHexValue(9, 199, 32))[0];
-
- ModItems.dustBerylliumFluoride = ItemUtils.generateSpecialUseDusts("BerylliumFluoride", "Beryllium Fluoride",
- Utils.rgbtoHexValue(175, 175, 175))[0]; // https://en.wikipedia.org/wiki/Beryllium_fluoride
-
- ModItems.dustLithiumCarbonate = ItemUtils.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate",
- Utils.rgbtoHexValue(240, 240, 240))[0]; // https://en.wikipedia.org/wiki/Lithium_carbonate
- ModItems.dustLithiumFluoride = ItemUtils.generateSpecialUseDusts("LithiumFluoride", "Lithium Fluoride",
- Utils.rgbtoHexValue(245, 245, 245))[0]; // https://en.wikipedia.org/wiki/Lithium_fluoride
- ModItems.dustLithiumPeroxide = ItemUtils.generateSpecialUseDusts("LithiumPeroxide", "Lithium Peroxide",
- Utils.rgbtoHexValue(250, 250, 250))[0]; // https://en.wikipedia.org/wiki/Lithium_peroxide
- ModItems.dustLithiumHydroxide = ItemUtils.generateSpecialUseDusts("LithiumHydroxide", "Lithium Hydroxide",
- Utils.rgbtoHexValue(250, 250, 250))[0]; // https://en.wikipedia.org/wiki/Lithium_hydroxide
-
- if (ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() == ModItems.AAA_Broken
- || !LoadedMods.IHL) {
- ModItems.dustQuicklime = ItemUtils.generateSpecialUseDusts("Quicklime", "Quicklime",
- Utils.rgbtoHexValue(255, 255, 255))[0]; // https://en.wikipedia.org/wiki/Calcium_oxide
- }
- ModItems.dustCalciumHydroxide = ItemUtils.generateSpecialUseDusts("CalciumHydroxide", "Hydrated Lime",
- Utils.rgbtoHexValue(255, 255, 255))[0]; // https://en.wikipedia.org/wiki/Calcium_hydroxide
- ModItems.dustCalciumCarbonate = ItemUtils.generateSpecialUseDusts("CalciumCarbonate", "Calcium Carbonate",
- Utils.rgbtoHexValue(255, 255, 255))[0]; // https://en.wikipedia.org/wiki/Calcium_carbonate
- ModItems.dust2LiOH_CaCO3 = ItemUtils.generateSpecialUseDusts("2LiOHCaCO3", "2LiOH & CaCO3 Compound",
- Utils.rgbtoHexValue(255, 255, 255))[0]; // https://en.wikipedia.org/wiki/Calcium_carbonate
-
- // FLiBe Fuel Compounds
- ModItems.dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound",
- Utils.rgbtoHexValue(255, 255, 255))[0]; // https://en.wikipedia.org/wiki/FLiBe
-
- ModItems.metaItem2 = new BaseEuItem();
- ModItems.metaItem2.registerItem(0, EnumChatFormatting.BLACK + "Test Item 0", 0, 0, "I am 0.");
- ModItems.metaItem2.registerItem(1, EnumChatFormatting.GREEN + "Test Item 1", 1006346000, 1, "I Hold EU 1.",
- 500);
- ModItems.metaItem2.registerItem(2, EnumChatFormatting.GOLD + "Test Item 2", 1004630000, 2, "I Hold EU 2.",
- 8000);
- ModItems.metaItem2.registerItem(3, "Test Item 3", 1000765000, 4, "I Hold EU 3.", 32000);
- ModItems.metaItem2.registerItem(4, "Whirlygig", 1043644000, (short) 5, "Spin me right round.", EnumRarity.rare,
- EnumChatFormatting.DARK_GREEN, true);
- ModItems.metaItem2.registerItem(5, "Whirlygig 2", 2124867000, (short) 7, "Spin me right round.",
- EnumRarity.uncommon, EnumChatFormatting.RED, true);
- // ItemList.Battery_RE_HV_Cadmium.set(BaseEuItem.
- // GameRegistry.registerItem(this, unlocalName);
+ //Nuclear Fuel Dusts
+ dustUraniumTetraFluoride = ItemUtils.generateSpecialUseDusts("UraniumTetrafluoride", "Uranium Tetrafluoride", Utils.rgbtoHexValue(17, 179, 42))[0];
+ dustUraniumHexaFluoride = ItemUtils.generateSpecialUseDusts("UraniumHexafluoride", "Uranium Hexafluoride", Utils.rgbtoHexValue(9, 199, 32))[0];
+
+ dustBerylliumFluoride = ItemUtils.generateSpecialUseDusts("BerylliumFluoride", "Beryllium Fluoride", Utils.rgbtoHexValue(175, 175, 175))[0]; //https://en.wikipedia.org/wiki/Beryllium_fluoride
- final boolean gtStyleTools = LoadedMods.Gregtech;
+ dustLithiumCarbonate = ItemUtils.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", Utils.rgbtoHexValue(240, 240, 240))[0]; //https://en.wikipedia.org/wiki/Lithium_carbonate
+ dustLithiumFluoride = ItemUtils.generateSpecialUseDusts("LithiumFluoride", "Lithium Fluoride", Utils.rgbtoHexValue(245, 245, 245))[0]; //https://en.wikipedia.org/wiki/Lithium_fluoride
+ dustLithiumPeroxide = ItemUtils.generateSpecialUseDusts("LithiumPeroxide", "Lithium Peroxide", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_peroxide
+ dustLithiumHydroxide = ItemUtils.generateSpecialUseDusts("LithiumHydroxide", "Lithium Hydroxide", Utils.rgbtoHexValue(250, 250, 250))[0]; //https://en.wikipedia.org/wiki/Lithium_hydroxide
- final Materials[] rm = Materials.values();
- for (final Materials m : rm) {
- ModItems.MP_GTMATERIAL = ItemUtils.generateMultiPick(gtStyleTools, m);
- ModItems.MS_GTMATERIAL = ItemUtils.generateMultiShovel(gtStyleTools, m);
- /*
- * itemBaseDecidust = UtilsItems.generateDecidust(m);
- * itemBaseCentidust = UtilsItems.generateCentidust(m);
- */
+ if (ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() == ModItems.AAA_Broken || !LoadedMods.IHL){
+ dustQuicklime = ItemUtils.generateSpecialUseDusts("Quicklime", "Quicklime", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_oxide
}
+ dustCalciumHydroxide = ItemUtils.generateSpecialUseDusts("CalciumHydroxide", "Hydrated Lime", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_hydroxide
+ dustCalciumCarbonate = ItemUtils.generateSpecialUseDusts("CalciumCarbonate", "Calcium Carbonate", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate
+ dust2LiOH_CaCO3 = ItemUtils.generateSpecialUseDusts("2LiOHCaCO3", "2LiOH & CaCO3 Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate
+
+ //FLiBe Fuel Compounds
+ dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe
+
+ metaItem2 = new BaseEuItem();
+ metaItem2.registerItem(0, EnumChatFormatting.BLACK+"Test Item 0", 0, 0, "I am 0.");
+ metaItem2.registerItem(1, EnumChatFormatting.GREEN+"Test Item 1", 1006346000, 1, "I Hold EU 1.", 500);
+ metaItem2.registerItem(2, EnumChatFormatting.GOLD+"Test Item 2", 1004630000, 2, "I Hold EU 2.", 8000);
+ metaItem2.registerItem(3, "Test Item 3", 1000765000, 4, "I Hold EU 3.", 32000);
+ metaItem2.registerItem(4, "Whirlygig", 1043644000, (short) 5, "Spin me right round.", EnumRarity.rare, EnumChatFormatting.DARK_GREEN, true);
+ metaItem2.registerItem(5, "Whirlygig 2", 2124867000, (short) 7, "Spin me right round.", EnumRarity.uncommon, EnumChatFormatting.RED, true);
+
+ // ItemList.Battery_RE_HV_Cadmium.set(BaseEuItem.
- // EnderIO Resources
- if (LoadedMods.EnderIO || CORE.LOAD_ALL_CONTENT) {
+ //GameRegistry.registerItem(this, unlocalName);
+
+ boolean gtStyleTools = LoadedMods.Gregtech;
+
+ Materials[] rm = Materials.values();
+ for (Materials m : rm){
+ MP_GTMATERIAL = ItemUtils.generateMultiPick(gtStyleTools, m);
+ MS_GTMATERIAL = ItemUtils.generateMultiShovel(gtStyleTools, m);
+ /*itemBaseDecidust = UtilsItems.generateDecidust(m);
+ itemBaseCentidust = UtilsItems.generateCentidust(m);*/
+ }
+
+ //EnderIO Resources
+ if (LoadedMods.EnderIO || LOAD_ALL_CONTENT){
Utils.LOG_INFO("EnderIO Found - Loading Resources.");
- // Item Init
- ModItems.itemPlateSoularium = new BaseItemPlate("itemPlate" + "Soularium", "Soularium", new short[] {
- 95, 90, 54
- }, 2, 0);
- ModItems.itemPlateRedstoneAlloy = new BaseItemPlate("itemPlate" + "RedstoneAlloy", "Redstone Alloy",
- new short[] {
- 178, 34, 34
- }, 2, 0);
- ModItems.itemPlateElectricalSteel = new BaseItemPlate("itemPlate" + "ElectricalSteel", "Electrical Steel",
- new short[] {
- 194, 194, 194
- }, 2, 0);
- ModItems.itemPlatePulsatingIron = new BaseItemPlate("itemPlate" + "PhasedIron", "Phased Iron", new short[] {
- 50, 91, 21
- }, 2, 0);
- ModItems.itemPlateEnergeticAlloy = new BaseItemPlate("itemPlate" + "EnergeticAlloy", "Energetic Alloy",
- new short[] {
- 252, 152, 45
- }, 2, 0);
- ModItems.itemPlateVibrantAlloy = new BaseItemPlate("itemPlate" + "VibrantAlloy", "Vibrant Alloy",
- new short[] {
- 204, 242, 142
- }, 2, 0);
- ModItems.itemPlateConductiveIron = new BaseItemPlate("itemPlate" + "ConductiveIron", "Conductive Iron",
- new short[] {
- 164, 109, 100
- }, 2, 0);
+ //Item Init
+ itemPlateSoularium = new BaseItemPlate("itemPlate"+"Soularium", "Soularium", new short[]{95, 90, 54}, 2, 0);
+ itemPlateRedstoneAlloy = new BaseItemPlate("itemPlate"+"RedstoneAlloy", "Redstone Alloy", new short[]{178,34,34}, 2, 0);
+ itemPlateElectricalSteel =new BaseItemPlate("itemPlate"+"ElectricalSteel", "Electrical Steel", new short[]{194, 194, 194}, 2, 0);
+ itemPlatePulsatingIron = new BaseItemPlate("itemPlate"+"PhasedIron", "Phased Iron", new short[]{50, 91, 21}, 2, 0);
+ itemPlateEnergeticAlloy = new BaseItemPlate("itemPlate"+"EnergeticAlloy", "Energetic Alloy", new short[]{252, 152, 45}, 2, 0);
+ itemPlateVibrantAlloy = new BaseItemPlate("itemPlate"+"VibrantAlloy", "Vibrant Alloy", new short[]{204, 242, 142}, 2, 0);
+ itemPlateConductiveIron = new BaseItemPlate("itemPlate"+"ConductiveIron", "Conductive Iron", new short[]{164, 109, 100}, 2, 0);
}
else {
Utils.LOG_WARNING("EnderIO not Found - Skipping Resources.");
}
- // Big Reactors
- if (LoadedMods.Big_Reactors || CORE.LOAD_ALL_CONTENT) {
+ //Big Reactors
+ if (LoadedMods.Big_Reactors|| LOAD_ALL_CONTENT){
Utils.LOG_INFO("BigReactors Found - Loading Resources.");
- // Item Init
- ModItems.itemPlateBlutonium = new BaseItemPlate("itemPlate" + "Blutonium", "Blutonium", new short[] {
- 0, 0, 255
- }, 2, 0);
- ModItems.itemPlateCyanite = new BaseItemPlate("itemPlate" + "Cyanite", "Cyanite", new short[] {
- 0, 191, 255
- }, 2, 0);
- ModItems.itemPlateLudicrite = new BaseItemPlate("itemPlate" + "Ludicrite", "Ludicrite", new short[] {
- 167, 5, 179
- }, 2, 0);
+ //Item Init
+ itemPlateBlutonium = new BaseItemPlate("itemPlate"+"Blutonium", "Blutonium", new short[]{0, 0, 255}, 2, 0);
+ itemPlateCyanite = new BaseItemPlate("itemPlate"+"Cyanite", "Cyanite", new short[]{0, 191, 255}, 2, 0);
+ itemPlateLudicrite = new BaseItemPlate("itemPlate"+"Ludicrite", "Ludicrite", new short[]{167, 5, 179}, 2, 0);
}
else {
Utils.LOG_WARNING("BigReactors not Found - Skipping Resources.");
}
- // Thaumcraft
- if (LoadedMods.Thaumcraft || CORE.LOAD_ALL_CONTENT) {
+ //Thaumcraft
+ if (LoadedMods.Thaumcraft|| LOAD_ALL_CONTENT){
Utils.LOG_INFO("Thaumcraft Found - Loading Resources.");
- // Item Init
+ //Item Init
try {
- ItemUtils.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16);
- ModItems.itemPlateVoidMetal = new BaseItemPlate("itemPlate" + "Void", "Void", new short[] {
- 82, 17, 82
- }, 2, 0);
+ ItemUtils.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16);
+ itemPlateVoidMetal = new BaseItemPlate("itemPlate"+"Void", "Void", new short[]{82, 17, 82}, 2, 0);
GT_OreDictUnificator.registerOre("plateVoidMetal", new ItemStack(ModItems.itemPlateVoidMetal));
- }
- catch (final NullPointerException e) {
+ } catch (NullPointerException e){
e.getClass();
}
@@ -404,146 +367,123 @@ public final class ModItems {
else {
Utils.LOG_WARNING("Thaumcraft not Found - Skipping Resources.");
}
- // ExtraUtils
- if (LoadedMods.Extra_Utils || CORE.LOAD_ALL_CONTENT) {
+ //ExtraUtils
+ if (LoadedMods.Extra_Utils|| LOAD_ALL_CONTENT){
Utils.LOG_INFO("ExtraUtilities Found - Loading Resources.");
- // Item Init
+ //Item Init
try {
- // itemPlateBedrockium = new
- // Item().setUnlocalizedName("itemPlateBedrockium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID
- // + ":itemPlateBedrockium");
- }
- catch (final NullPointerException e) {
+ //itemPlateBedrockium = new Item().setUnlocalizedName("itemPlateBedrockium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateBedrockium");
+ } catch (NullPointerException e){
e.getClass();
}
- // Registry
- // GameRegistry.registerItem(itemPlateBedrockium,
- // "itemPlateBedrockium");
+ //Registry
+ //GameRegistry.registerItem(itemPlateBedrockium, "itemPlateBedrockium");
}
else {
Utils.LOG_WARNING("ExtraUtilities not Found - Skipping Resources.");
}
- // Pneumaticraft
- if (LoadedMods.PneumaticCraft || CORE.LOAD_ALL_CONTENT) {
+ //Pneumaticraft
+ if (LoadedMods.PneumaticCraft|| LOAD_ALL_CONTENT){
Utils.LOG_INFO("PneumaticCraft Found - Loading Resources.");
- // Item Init
- ModItems.itemPlateCompressedIron = new BaseItemPlate("itemPlate" + "CompressedIron", "Compressed Iron",
- new short[] {
- 128, 128, 128
- }, 2, 0);
+ //Item Init
+ itemPlateCompressedIron = new BaseItemPlate("itemPlate"+"CompressedIron", "Compressed Iron", new short[]{128, 128, 128}, 2, 0);
}
else {
Utils.LOG_WARNING("PneumaticCraft not Found - Skipping Resources.");
}
- // Simply Jetpacks
- if (LoadedMods.Simply_Jetpacks || CORE.LOAD_ALL_CONTENT) {
+ //Simply Jetpacks
+ if (LoadedMods.Simply_Jetpacks|| LOAD_ALL_CONTENT){
Utils.LOG_INFO("SimplyJetpacks Found - Loading Resources.");
- // Item Init
- ModItems.itemPlateEnrichedSoularium = new RarityUncommon().setUnlocalizedName("itemPlateEnrichedSoularium")
- .setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateSoularium");
- // Registry
- GameRegistry.registerItem(ModItems.itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium");
+ //Item Init
+ itemPlateEnrichedSoularium = new RarityUncommon().setUnlocalizedName("itemPlateEnrichedSoularium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateSoularium");
+ //Registry
+ GameRegistry.registerItem(itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium");
}
else {
Utils.LOG_WARNING("SimplyJetpacks not Found - Skipping Resources.");
}
- // rfTools
- if (LoadedMods.RFTools || CORE.LOAD_ALL_CONTENT) {
+ //rfTools
+ if (LoadedMods.RFTools|| LOAD_ALL_CONTENT){
Utils.LOG_INFO("rfTools Found - Loading Resources.");
- // Item Init
- ModItems.itemPlateDimensionShard = new BaseItemPlate("itemPlate" + "DimensionShard", "Dimensional Shard",
- new short[] {
- 170, 230, 230
- }, 2, 0);
+ //Item Init
+ itemPlateDimensionShard = new BaseItemPlate("itemPlate"+"DimensionShard", "Dimensional Shard", new short[]{170, 230, 230}, 2, 0);
}
else {
Utils.LOG_WARNING("rfTools not Found - Skipping Resources.");
}
- // IC2 Exp
- if (LoadedMods.IndustrialCraft2 || CORE.LOAD_ALL_CONTENT) {
+ //IC2 Exp
+ if (LoadedMods.IndustrialCraft2|| LOAD_ALL_CONTENT){
Utils.LOG_INFO("IndustrialCraft2 Found - Loading Resources.");
- // Item Init
- ModItems.FuelRod_Empty = new FuelRod_Base("itemFuelRod_Empty", "Empty", 0, 1000);
- ModItems.FuelRod_Thorium = new FuelRod_Base("itemFuelRod_Thorium", "Thorium", 1000, 1000);
- ModItems.FuelRod_Uranium = new FuelRod_Base("itemFuelRod_Uranium", "Uranium", 2500, 2500);
- ModItems.FuelRod_Plutonium = new FuelRod_Base("itemFuelRod_Plutonium", "Plutonium", 5000, 5000);
- ModItems.RfEuBattery = new RF2EU_Battery();
-
- try {
- final Class baublesTest = Class.forName("baubles.api.IBauble");
- if (baublesTest != null) {
- COMPAT_Baubles.run();
- }
- else {
- Utils.LOG_INFO("Baubles Not Found - Skipping Resources.");
- }
+ //Item Init
+ FuelRod_Empty = new FuelRod_Base("itemFuelRod_Empty", "Empty", 0, 1000);
+ FuelRod_Thorium = new FuelRod_Base("itemFuelRod_Thorium", "Thorium", 1000, 1000);
+ FuelRod_Uranium = new FuelRod_Base("itemFuelRod_Uranium", "Uranium", 2500, 2500);
+ FuelRod_Plutonium = new FuelRod_Base("itemFuelRod_Plutonium", "Plutonium", 5000, 5000);
+ RfEuBattery = new RF2EU_Battery();
+
+ try {Class baublesTest = Class.forName("baubles.api.IBauble");
+ if (baublesTest != null){
+ COMPAT_Baubles.run();
+ }
+ else {
+ Utils.LOG_INFO("Baubles Not Found - Skipping Resources.");
}
- catch (final Throwable T) {
- Utils.LOG_INFO("Baubles Not Found - Skipping Resources.");
+ } catch(Throwable T){
+ Utils.LOG_INFO("Baubles Not Found - Skipping Resources.");
}
- // Registry
- // GameRegistry.registerItem(FuelRod_Empty, "itemFuelRod_Empty");
- // GameRegistry.registerItem(FuelRod_Thorium,
- // "itemFuelRod_Thorium");
- // GameRegistry.registerItem(FuelRod_Uranium,
- // "itemFuelRod_Uranium");
- // GameRegistry.registerItem(FuelRod_Plutonium,
- // "itemFuelRod_Plutonium");
-
- // FluidCell = new ItemStack(new
- // IC2_ItemFluidCell("itemGT++FluidCell"));
+ //Registry
+ //GameRegistry.registerItem(FuelRod_Empty, "itemFuelRod_Empty");
+ //GameRegistry.registerItem(FuelRod_Thorium, "itemFuelRod_Thorium");
+ //GameRegistry.registerItem(FuelRod_Uranium, "itemFuelRod_Uranium");
+ //GameRegistry.registerItem(FuelRod_Plutonium, "itemFuelRod_Plutonium");
+
+ //FluidCell = new ItemStack(new IC2_ItemFluidCell("itemGT++FluidCell"));
+
}
else {
Utils.LOG_WARNING("IndustrialCraft2 not Found - Skipping Resources.");
}
- // Special Item Handling Case
+
+ //Special Item Handling Case
if (configSwitches.enableAlternativeBatteryAlloy) {
- // ModItems.itemIngotBatteryAlloy = new
- // BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", new
- // short[]{35, 228, 141}, 0); TODO
- ModItems.itemPlateBatteryAlloy = new BaseItemPlate("itemPlateBatteryAlloy", "Battery Alloy", new short[] {
- 35, 228, 141
- }, 2, 0);
+ //ModItems.itemIngotBatteryAlloy = new BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", new short[]{35, 228, 141}, 0); TODO
+ ModItems.itemPlateBatteryAlloy = new BaseItemPlate("itemPlateBatteryAlloy", "Battery Alloy", new short[]{35, 228, 141}, 2, 0);
}
- // UtilsItems.generateSpawnEgg("ic2", "boatcarbon",
- // Utils.generateSingularRandomHexValue(),
- // Utils.generateSingularRandomHexValue());
+
+ //UtilsItems.generateSpawnEgg("ic2", "boatcarbon", Utils.generateSingularRandomHexValue(), Utils.generateSingularRandomHexValue());
+
+
/*
* Misc Items
*/
- // Staballoy Equipment
- ModItems.itemStaballoyPickaxe = new StaballoyPickaxe("itemStaballoyPickaxe", ModItems.STABALLOY)
- .setCreativeTab(AddToCreativeTab.tabTools);
- GameRegistry.registerItem(ModItems.itemStaballoyPickaxe, ModItems.itemStaballoyPickaxe.getUnlocalizedName());
- ModItems.itemStaballoyAxe = new StaballoyAxe("itemStaballoyAxe", ModItems.STABALLOY)
- .setCreativeTab(AddToCreativeTab.tabTools);
- GameRegistry.registerItem(ModItems.itemStaballoyAxe, ModItems.itemStaballoyAxe.getUnlocalizedName());
+ //Staballoy Equipment
+ itemStaballoyPickaxe = new StaballoyPickaxe("itemStaballoyPickaxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools);
+ GameRegistry.registerItem(itemStaballoyPickaxe, itemStaballoyPickaxe.getUnlocalizedName());
+ itemStaballoyAxe = new StaballoyAxe("itemStaballoyAxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools);
+ GameRegistry.registerItem(itemStaballoyAxe, itemStaballoyAxe.getUnlocalizedName());
- // Sandstone Hammer
- ModItems.itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer")
- .setCreativeTab(AddToCreativeTab.tabTools);
- GameRegistry.registerItem(ModItems.itemSandstoneHammer, ModItems.itemSandstoneHammer.getUnlocalizedName());
+ //Sandstone Hammer
+ itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer").setCreativeTab(AddToCreativeTab.tabTools);
+ GameRegistry.registerItem(itemSandstoneHammer, itemSandstoneHammer.getUnlocalizedName());
- // Buffer Cores!
+ //Buffer Cores!
Item itemBufferCore;
- for (int i = 1; i <= 10; i++) {
- // Utils.LOG_INFO(""+i);
+ for(int i=1; i<=10; i++){
+ //Utils.LOG_INFO(""+i);
itemBufferCore = new BufferCore("itemBufferCore", i).setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerItem(itemBufferCore, itemBufferCore.getUnlocalizedName() + i);
- // System.out.println("Buffer Core registration count is: "+i);
+ GameRegistry.registerItem(itemBufferCore, itemBufferCore.getUnlocalizedName()+i);
+ //System.out.println("Buffer Core registration count is: "+i);
}
- ModItems.itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit")
- .setTextureName(CORE.MODID + ":itemPLACEHOLDER_Circuit");
- GameRegistry.registerItem(ModItems.itemPLACEHOLDER_Circuit, "itemPLACEHOLDER_Circuit");
+ itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit").setTextureName(CORE.MODID + ":itemPLACEHOLDER_Circuit");
+ GameRegistry.registerItem(itemPLACEHOLDER_Circuit, "itemPLACEHOLDER_Circuit");
- // ItemBlockGtFrameBox = new
- // ItemBlockGtFrameBox(ModBlocks.blockGtFrameSet1);
- // GameRegistry.registerItem(ItemBlockGtFrameBox, "itemGtFrameBoxSet1");
+ //ItemBlockGtFrameBox = new ItemBlockGtFrameBox(ModBlocks.blockGtFrameSet1);
+ //GameRegistry.registerItem(ItemBlockGtFrameBox, "itemGtFrameBoxSet1");
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseEuItem.java b/src/Java/gtPlusPlus/core/item/base/BaseEuItem.java
index e92e69f0e0..80412fdd3c 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseEuItem.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseEuItem.java
@@ -1,10 +1,7 @@
package gtPlusPlus.core.item.base;
-import java.util.*;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
+import static gregtech.api.enums.GT_Values.D1;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.SubTag;
@@ -12,620 +9,509 @@ import gregtech.api.enums.TC_Aspects.TC_AspectStack;
import gregtech.api.interfaces.IItemBehaviour;
import gregtech.api.interfaces.IItemContainer;
import gregtech.api.objects.ItemData;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.array.Pair;
-import ic2.api.item.*;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import ic2.api.item.IElectricItemManager;
+import ic2.api.item.ISpecialElectricItem;
+
+import java.util.ArrayList;
+import java.util.BitSet;
+import java.util.HashMap;
+import java.util.List;
+
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
-import net.minecraft.item.*;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BaseEuItem extends Item implements ISpecialElectricItem, IElectricItemManager {
/* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
- private final HashMap<Short, ArrayList<IItemBehaviour<BaseEuItem>>> mItemBehaviors = new HashMap<Short, ArrayList<IItemBehaviour<BaseEuItem>>>();
- public final short mOffset, mItemAmount;
- public final BitSet mEnabledItems;
- public final BitSet mVisibleItems;
- public final IIcon[][] mIconList;
- /** The unlocalized name of this item. */
- private String unlocalizedName;
-
- private final ArrayList<Pair<Integer, EnumRarity>> rarity = new ArrayList<Pair<Integer, EnumRarity>>();
- private final ArrayList<Pair<Integer, EnumChatFormatting>> descColour = new ArrayList<Pair<Integer, EnumChatFormatting>>();
- private final ArrayList<Pair<Integer, String>> itemName = new ArrayList<Pair<Integer, String>>();
- private final ArrayList<Pair<Integer, String>> itemDescription = new ArrayList<Pair<Integer, String>>();
- private final ArrayList<Pair<Integer, Boolean>> hasEffect = new ArrayList<Pair<Integer, Boolean>>();
-
- public final HashMap<Short, Long[]> mElectricStats = new HashMap<Short, Long[]>();
- public final HashMap<Short, Short> mBurnValues = new HashMap<Short, Short>();
+ private final HashMap<Short, ArrayList<IItemBehaviour<BaseEuItem>>> mItemBehaviors = new HashMap<Short, ArrayList<IItemBehaviour<BaseEuItem>>>();
+ public final short mOffset, mItemAmount;
+ public final BitSet mEnabledItems;
+ public final BitSet mVisibleItems;
+ public final IIcon[][] mIconList;
+ /** The unlocalized name of this item. */
+ private String unlocalizedName;
+
+ private ArrayList<Pair<Integer, EnumRarity>> rarity = new ArrayList<Pair<Integer, EnumRarity>>();
+ private ArrayList<Pair<Integer, EnumChatFormatting>> descColour = new ArrayList<Pair<Integer, EnumChatFormatting>>();
+ private ArrayList<Pair<Integer, String>> itemName = new ArrayList<Pair<Integer, String>>();
+ private ArrayList<Pair<Integer, String>> itemDescription = new ArrayList<Pair<Integer, String>>();
+ private ArrayList<Pair<Integer, Boolean>> hasEffect = new ArrayList<Pair<Integer, Boolean>>();
+
+ public final HashMap<Short, Long[]> mElectricStats = new HashMap<Short, Long[]>();
+ public final HashMap<Short, Short> mBurnValues = new HashMap<Short, Short>();
public BaseEuItem() {
- this("MU-metaitem.02", AddToCreativeTab.tabOther, (short) 1000, (short) 31766);
- }
-
- public BaseEuItem(final String unlocalizedName, final CreativeTabs creativeTab, final short aOffset,
- final short aItemAmount) {
- this.mEnabledItems = new BitSet(aItemAmount);
- this.mVisibleItems = new BitSet(aItemAmount);
- this.mOffset = (short) Math.min(32766, aOffset);
- this.mItemAmount = (short) Math.min(aItemAmount, 32766 - this.mOffset);
- this.mIconList = new IIcon[aItemAmount][1];
- this.setHasSubtypes(true);
- this.setMaxDamage(0);
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(creativeTab);
- this.setMaxStackSize(1);
+ this("MU-metaitem.02", AddToCreativeTab.tabOther, (short) 1000, (short) 31766);
+ }
+
+ public BaseEuItem(String unlocalizedName, CreativeTabs creativeTab, short aOffset, short aItemAmount) {
+ mEnabledItems = new BitSet(aItemAmount);
+ mVisibleItems = new BitSet(aItemAmount);
+ mOffset = (short) Math.min(32766, aOffset);
+ mItemAmount = (short) Math.min(aItemAmount, 32766 - mOffset);
+ mIconList = new IIcon[aItemAmount][1];
+ setHasSubtypes(true);
+ setMaxDamage(0);
+ setUnlocalizedName(unlocalizedName);
+ setCreativeTab(creativeTab);
+ setMaxStackSize(1);
GameRegistry.registerItem(this, unlocalizedName);
- }
+ }
+
+
+ public void registerItem(int id, String localizedName, long euStorage, int tier, String description) {
+ registerItem(id, localizedName, euStorage, (short) tier, description, EnumRarity.common, EnumChatFormatting.GRAY, false);
+ }
+
+ public void registerItem(int id, String localizedName, long euStorage, int tier, String description, int burnTime) {
+ registerItem(id, localizedName, euStorage, (short) tier, description, EnumRarity.common, EnumChatFormatting.GRAY, false);
+ setBurnValue(id, burnTime);
+ }
+
+
+ public void registerItem(int id, String localizedName, long euStorage, short tier, String description, EnumRarity regRarity, EnumChatFormatting colour, boolean Effect) {
+ addItem(id, localizedName, EnumChatFormatting.YELLOW+"Electric", new Object[]{});
+ setElectricStats(mOffset + id, euStorage, GT_Values.V[tier], tier, -3L, true);
+ this.rarity.add(new Pair<Integer, EnumRarity>(id, regRarity));
+ this.itemName.add(new Pair<Integer, String>(id, localizedName));
+ this.itemDescription.add(new Pair<Integer, String>(id, description));
+ this.descColour.add(new Pair<Integer, EnumChatFormatting>(id, colour));
+ this.hasEffect.add(new Pair<Integer, Boolean>(id, Effect));
+ }
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
@Override
- public final void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, List aList,
- final boolean aF3_H) {
- // aList.add("Meta: "+(aStack.getItemDamage()-mOffset));
- if (this.descColour.get(aStack.getItemDamage() - this.mOffset) != null
- && this.itemDescription.get(aStack.getItemDamage() - this.mOffset) != null) {
- aList.add(this.descColour.get(aStack.getItemDamage() - this.mOffset).getValue()
- + this.itemDescription.get(aStack.getItemDamage() - this.mOffset).getValue());
- }
- final String tKey = this.getUnlocalizedName(aStack) + ".tooltip",
- tString = GT_LanguageManager.getTranslation(tKey);
- if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) {
- aList.add(tString);
- }
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats != null) {
- if (tStats[3] > 0) {
- aList.add(EnumChatFormatting.AQUA + "Contains " + GT_Utility.formatNumbers(tStats[3]) + " EU Tier: "
- + (tStats[2] >= 0 ? tStats[2] : 0) + EnumChatFormatting.GRAY);
- }
- else {
- final long tCharge = this.getRealCharge(aStack);
- if (tStats[3] == -2 && tCharge <= 0) {
- aList.add(EnumChatFormatting.AQUA + "Empty. You should recycle it properly."
- + EnumChatFormatting.GRAY);
- }
- else {
- aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharge) + " / "
- + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: "
- + GT_Values.V[(int) (tStats[2] >= 0
- ? tStats[2] < GT_Values.V.length ? tStats[2] : GT_Values.V.length - 1 : 1)]
- + EnumChatFormatting.GRAY);
- }
- }
- }
- final ArrayList<IItemBehaviour<BaseEuItem>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final IItemBehaviour<BaseEuItem> tBehavior : tList) {
- aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
- }
- }
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ if (rarity.get(par1ItemStack.getItemDamage()-mOffset) != null)
+ return rarity.get(par1ItemStack.getItemDamage()-mOffset).getValue();
+ return EnumRarity.common;
}
- /**
- * This adds a Custom Item to the ending Range.
- *
- * @param aID
- * The Id of the assigned Item [0 - mItemAmount] (The MetaData
- * gets auto-shifted by +mOffset)
- * @param aEnglish
- * The Default Localized Name of the created Item
- * @param aToolTip
- * The Default ToolTip of the created Item, you can also insert
- * null for having no ToolTip
- * @param aFoodBehavior
- * The Food Value of this Item. Can be null aswell. Just a
- * convenience thing.
- * @param aRandomData
- * The OreDict Names you want to give the Item. Also used for TC
- * Aspects and some other things.
- * @return An ItemStack containing the newly created Item.
- */
- @SuppressWarnings("unchecked")
- public final ItemStack addItem(final int aID, final String aEnglish, String aToolTip, final Object... aRandomData) {
- if (aToolTip == null) {
- aToolTip = "";
- }
- if (aID >= 0 && aID < this.mItemAmount) {
- final ItemStack rStack = new ItemStack(this, 1, this.mOffset + aID);
- this.mEnabledItems.set(aID);
- this.mVisibleItems.set(aID);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish);
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip);
- final List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
- // Important Stuff to do first
- for (final Object tRandomData : aRandomData) {
- if (tRandomData instanceof SubTag) {
- if (tRandomData == SubTag.INVISIBLE) {
- this.mVisibleItems.set(aID, false);
- continue;
- }
- if (tRandomData == SubTag.NO_UNIFICATION) {
- GT_OreDictUnificator.addToBlacklist(rStack);
- continue;
- }
- }
- }
- // now check for the rest
- for (final Object tRandomData : aRandomData) {
- if (tRandomData != null) {
- boolean tUseOreDict = true;
- if (tRandomData instanceof IItemBehaviour) {
- this.addItemBehavior(this.mOffset + aID, (IItemBehaviour<BaseEuItem>) tRandomData);
- tUseOreDict = false;
- }
- if (tRandomData instanceof IItemContainer) {
- ((IItemContainer) tRandomData).set(rStack);
- tUseOreDict = false;
- }
- if (tRandomData instanceof SubTag) {
- continue;
- }
- if (tRandomData instanceof TC_AspectStack) {
- ((TC_AspectStack) tRandomData).addToAspectList(tAspects);
- continue;
- }
- if (tRandomData instanceof ItemData) {
- if (GT_Utility.isStringValid(tRandomData)) {
- GT_OreDictUnificator.registerOre(tRandomData, rStack);
- }
- else {
- GT_OreDictUnificator.addItemData(rStack, (ItemData) tRandomData);
- }
- continue;
- }
- if (tUseOreDict) {
- GT_OreDictUnificator.registerOre(tRandomData, rStack);
- continue;
- }
- }
- }
- if (GregTech_API.sThaumcraftCompat != null) {
- GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
- }
- return rStack;
- }
- return null;
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ if (hasEffect.get(par1ItemStack.getItemDamage()-mOffset) != null)
+ return hasEffect.get(par1ItemStack.getItemDamage()-mOffset).getValue();
+ return false;
}
- /**
- * Adds a special Item Behaviour to the Item.
- * <p/>
- * Note: the boolean Behaviours sometimes won't be executed if another
- * boolean Behaviour returned true before.
- *
- * @param aMetaValue
- * the Meta Value of the Item you want to add it to. [0 - 32765]
- * @param aBehavior
- * the Click Behavior you want to add.
- * @return the Item itself for convenience in constructing.
- */
- public final BaseEuItem addItemBehavior(final int aMetaValue, final IItemBehaviour<BaseEuItem> aBehavior) {
- if (aMetaValue < 0 || aMetaValue >= 32766 || aBehavior == null) {
- return this;
- }
- ArrayList<IItemBehaviour<BaseEuItem>> tList = this.mItemBehaviors.get((short) aMetaValue);
- if (tList == null) {
- tList = new ArrayList<IItemBehaviour<BaseEuItem>>(1);
- this.mItemBehaviors.put((short) aMetaValue, tList);
- }
- tList.add(aBehavior);
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ //aList.add("Meta: "+(aStack.getItemDamage()-mOffset));
+ if (descColour.get(aStack.getItemDamage()-mOffset) != null && itemDescription.get(aStack.getItemDamage()-mOffset) != null)
+ aList.add(descColour.get(aStack.getItemDamage()-mOffset).getValue()+itemDescription.get(aStack.getItemDamage()-mOffset).getValue());
+ String tKey = getUnlocalizedName(aStack) + ".tooltip", tString = GT_LanguageManager.getTranslation(tKey);
+ if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString);
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats != null) {
+ if (tStats[3] > 0) {
+ aList.add(EnumChatFormatting.AQUA + "Contains " + GT_Utility.formatNumbers(tStats[3]) + " EU Tier: " + (tStats[2] >= 0 ? tStats[2] : 0) + EnumChatFormatting.GRAY);
+ } else {
+ long tCharge = getRealCharge(aStack);
+ if (tStats[3] == -2 && tCharge <= 0) {
+ aList.add(EnumChatFormatting.AQUA + "Empty. You should recycle it properly." + EnumChatFormatting.GRAY);
+ } else {
+ aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharge) + " / " + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)] + EnumChatFormatting.GRAY);
+ }
+ }
+ }
+ ArrayList<IItemBehaviour<BaseEuItem>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (IItemBehaviour<BaseEuItem> tBehavior : tList)
+ aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
+ }
+
+
+ @Override
+ public final Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
- public final boolean canProvideEnergy(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return false;
- }
- return tStats[3] > 0 || aStack.stackSize == 1 && (tStats[3] == -2 || tStats[3] == -3);
+ public final Item getEmptyItem(ItemStack itemStack) {
+ return this;
}
@Override
- public final boolean canUse(final ItemStack aStack, final double aAmount) {
- return this.getRealCharge(aStack) >= aAmount;
+ public final double getMaxCharge(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ return Math.abs(tStats[0]);
}
@Override
- public final double charge(final ItemStack aStack, final double aCharge, final int aTier,
- final boolean aIgnoreTransferLimit, final boolean aSimulate) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null || tStats[2] > aTier
- || !(tStats[3] == -1 || tStats[3] == -3 || tStats[3] < 0 && aCharge == Integer.MAX_VALUE)
- || aStack.stackSize != 1) {
- return 0;
- }
- final long tChargeBefore = this.getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE
- ? Long.MAX_VALUE
- : Math.min(Math.abs(tStats[0]),
- tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
- if (!aSimulate) {
- this.setCharge(aStack, tNewCharge);
- }
- return tNewCharge - tChargeBefore;
+ public final double getTransferLimit(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ return Math.max(tStats[1], tStats[3]);
}
@Override
- public final void chargeFromArmor(final ItemStack aStack, final EntityLivingBase aPlayer) {
- if (aPlayer == null || aPlayer.worldObj.isRemote) {
- return;
- }
- for (int i = 1; i < 5; i++) {
- final ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
- if (GT_ModHandler.isElectricItem(tArmor)) {
- final IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
- if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= this.getTier(aStack)) {
- final double tCharge = ElectricItem.manager.discharge(tArmor,
- this.charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true),
- Integer.MAX_VALUE, true, true, false);
- if (tCharge > 0) {
- this.charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
- if (aPlayer instanceof EntityPlayer) {
- final Container tContainer = ((EntityPlayer) aPlayer).openContainer;
- if (tContainer != null) {
- tContainer.detectAndSendChanges();
- }
- }
- }
- }
- }
- }
+ public final int getTier(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
}
@Override
- public final double discharge(final ItemStack aStack, final double aCharge, final int aTier,
- final boolean aIgnoreTransferLimit, final boolean aBatteryAlike, final boolean aSimulate) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null || tStats[2] > aTier) {
+ public final double charge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1)
return 0;
- }
- if (aBatteryAlike && !this.canProvideEnergy(aStack)) {
- return 0;
- }
+ long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE ? Long.MAX_VALUE : Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
+ if (!aSimulate) setCharge(aStack, tNewCharge);
+ return tNewCharge - tChargeBefore;
+ }
+
+ @Override
+ public final double discharge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aBatteryAlike, boolean aSimulate) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[2] > aTier) return 0;
+ if (aBatteryAlike && !canProvideEnergy(aStack)) return 0;
if (tStats[3] > 0) {
- if (aCharge < tStats[3] || aStack.stackSize < 1) {
- return 0;
- }
- if (!aSimulate) {
- aStack.stackSize--;
- }
+ if (aCharge < tStats[3] || aStack.stackSize < 1) return 0;
+ if (!aSimulate) aStack.stackSize--;
return tStats[3];
}
- final long tChargeBefore = this.getRealCharge(aStack), tNewCharge = Math.max(0,
- tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
- if (!aSimulate) {
- this.setCharge(aStack, tNewCharge);
- }
+ long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.max(0, tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
+ if (!aSimulate) setCharge(aStack, tNewCharge);
return tChargeBefore - tNewCharge;
}
@Override
- public final double getCharge(final ItemStack aStack) {
- return this.getRealCharge(aStack);
+ public final double getCharge(ItemStack aStack) {
+ return getRealCharge(aStack);
}
@Override
- public final Item getChargedItem(final ItemStack itemStack) {
- return this;
+ public final boolean canUse(ItemStack aStack, double aAmount) {
+ return getRealCharge(aStack) >= aAmount;
}
- @SuppressWarnings("static-method")
- public short getChargedMetaData(final ItemStack aStack) {
- return (short) aStack.getItemDamage();
+ @Override
+ public final boolean use(ItemStack aStack, double aAmount, EntityLivingBase aPlayer) {
+ chargeFromArmor(aStack, aPlayer);
+ if (aPlayer instanceof EntityPlayer && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) return true;
+ double tTransfer = discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
+ if (tTransfer == aAmount) {
+ discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ chargeFromArmor(aStack, aPlayer);
+ return true;
+ }
+ discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ chargeFromArmor(aStack, aPlayer);
+ return false;
}
- public final Long[] getElectricStats(final ItemStack aStack) {
- return this.mElectricStats.get((short) aStack.getItemDamage());
+ @Override
+ public final boolean canProvideEnergy(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return false;
+ return tStats[3] > 0 || (aStack.stackSize == 1 && (tStats[3] == -2 || tStats[3] == -3));
}
@Override
- public final Item getEmptyItem(final ItemStack itemStack) {
- return this;
+ public final void chargeFromArmor(ItemStack aStack, EntityLivingBase aPlayer) {
+ if (aPlayer == null || aPlayer.worldObj.isRemote) return;
+ for (int i = 1; i < 5; i++) {
+ ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
+ if (GT_ModHandler.isElectricItem(tArmor)) {
+ IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
+ if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= getTier(aStack)) {
+ double tCharge = ElectricItem.manager.discharge(tArmor, charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, true, false);
+ if (tCharge > 0) {
+ charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
+ if (aPlayer instanceof EntityPlayer) {
+ Container tContainer = ((EntityPlayer) aPlayer).openContainer;
+ if (tContainer != null) tContainer.detectAndSendChanges();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public final long getRealCharge(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ if (tStats[3] > 0) return (int) (long) tStats[3];
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
+ }
+
+ public final boolean setCharge(ItemStack aStack, long aCharge) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[3] > 0) return false;
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) tNBT = new NBTTagCompound();
+ tNBT.removeTag("GT.ItemCharge");
+ aCharge = Math.min(tStats[0] < 0 ? Math.abs(tStats[0] / 2) : aCharge, Math.abs(tStats[0]));
+ if (aCharge > 0) {
+ aStack.setItemDamage(getChargedMetaData(aStack));
+ tNBT.setLong("GT.ItemCharge", aCharge);
+ } else {
+ aStack.setItemDamage(getEmptyMetaData(aStack));
+ }
+ if (tNBT.hasNoTags()) aStack.setTagCompound(null);
+ else aStack.setTagCompound(tNBT);
+ isItemStackUsable(aStack);
+ return true;
}
@SuppressWarnings("static-method")
- public short getEmptyMetaData(final ItemStack aStack) {
+ public short getChargedMetaData(ItemStack aStack) {
return (short) aStack.getItemDamage();
}
- @Override
- public final IIcon getIconFromDamage(final int aMetaData) {
- if (aMetaData < 0) {
- return null;
- }
- return aMetaData - this.mOffset < this.mIconList.length ? this.mIconList[aMetaData - this.mOffset][0] : null;
+ @SuppressWarnings("static-method")
+ public short getEmptyMetaData(ItemStack aStack) {
+ return (short) aStack.getItemDamage();
}
- @Override
- public boolean getIsRepairable(final ItemStack aStack, final ItemStack aMaterial) {
- return false;
- }
- @Override
- public int getItemEnchantability() {
- return 0;
+ public boolean isItemStackUsable(ItemStack aStack) {
+ ArrayList<IItemBehaviour<BaseEuItem>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (IItemBehaviour<BaseEuItem> tBehavior : tList)
+ if (!tBehavior.isItemStackUsable(this, aStack)) return false;
+ return true;
}
@Override
- public String getItemStackDisplayName(final ItemStack par1ItemStack) {
- return this.itemName.get(par1ItemStack.getItemDamage() - this.mOffset).getValue();
- }
+ public final String getToolTip(ItemStack aStack) {
+ return null;
+ } // This has its own ToolTip Handler, no need to let the IC2 Handler screw us up at this Point
@Override
- public final IElectricItemManager getManager(final ItemStack aStack) {
+ public final IElectricItemManager getManager(ItemStack aStack) {
return this;
} // We are our own Manager
- @Override
- public final double getMaxCharge(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return Math.abs(tStats[0]);
+ /**
+ * Sets the Furnace Burn Value for the Item.
+ *
+ * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765]
+ * @param aValue 200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU)
+ * @return the Item itself for convenience in constructing.
+ */
+ public final BaseEuItem setBurnValue(int aMetaValue, int aValue) {
+ if (aMetaValue < 0 || aValue < 0) return this;
+ if (aValue == 0) mBurnValues.remove((short) aMetaValue);
+ else mBurnValues.put((short) aMetaValue, aValue > Short.MAX_VALUE ? Short.MAX_VALUE : (short) aValue);
+ return this;
}
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
- if (this.rarity.get(par1ItemStack.getItemDamage() - this.mOffset) != null) {
- return this.rarity.get(par1ItemStack.getItemDamage() - this.mOffset).getValue();
+ /**
+ * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765]
+ * @param aMaxCharge Maximum Charge. (if this is == 0 it will remove the Electric Behavior)
+ * @param aTransferLimit Transfer Limit.
+ * @param aTier The electric Tier.
+ * @param aSpecialData If this Item has a Fixed Charge, like a SingleUse Battery (if > 0).
+ * Use -1 if you want to make this Battery chargeable (the use and canUse Functions will still discharge if you just use this)
+ * Use -2 if you want to make this Battery dischargeable.
+ * Use -3 if you want to make this Battery charge/discharge-able.
+ * @return the Item itself for convenience in constructing.
+ */
+ public final BaseEuItem setElectricStats(int aMetaValue, long aMaxCharge, long aTransferLimit, long aTier, long aSpecialData, boolean aUseAnimations) {
+ if (aMetaValue < 0) return this;
+ if (aMaxCharge == 0) mElectricStats.remove((short) aMetaValue);
+ else {
+ mElectricStats.put((short) aMetaValue, new Long[]{aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData});
}
- return EnumRarity.common;
+ return this;
}
- public final long getRealCharge(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- if (tStats[3] > 0) {
- return (int) (long) tStats[3];
- }
- final NBTTagCompound tNBT = aStack.getTagCompound();
- return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
- }
- @SuppressWarnings({
- "rawtypes", "unchecked"
- })
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
- public void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) {
- for (int i = 0, j = this.mEnabledItems.length(); i < j; i++) {
- if (this.mVisibleItems.get(i) || GT_Values.D1 && this.mEnabledItems.get(i)) {
- final Long[] tStats = this.mElectricStats.get((short) (this.mOffset + i));
+ public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ for (int i = 0, j = mEnabledItems.length(); i < j; i++)
+ if (mVisibleItems.get(i) || (D1 && mEnabledItems.get(i))) {
+ Long[] tStats = mElectricStats.get((short) (mOffset + i));
if (tStats != null && tStats[3] < 0) {
- final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
- this.setCharge(tStack, Math.abs(tStats[0]));
- this.isItemStackUsable(tStack);
+ ItemStack tStack = new ItemStack(this, 1, mOffset + i);
+ setCharge(tStack, Math.abs(tStats[0]));
+ isItemStackUsable(tStack);
aList.add(tStack);
}
if (tStats == null || tStats[3] != -2) {
- final ItemStack tStack = new ItemStack(this, 1, this.mOffset + i);
- this.isItemStackUsable(tStack);
+ ItemStack tStack = new ItemStack(this, 1, mOffset + i);
+ isItemStackUsable(tStack);
aList.add(tStack);
}
}
- }
- }
-
- @Override
- public final int getTier(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
- }
-
- @Override
- public final String getToolTip(final ItemStack aStack) {
- return null;
- } // This has its own ToolTip Handler, no need to let the IC2 Handler screw
- // us up at this Point
-
- @Override
- public final double getTransferLimit(final ItemStack aStack) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null) {
- return 0;
- }
- return Math.max(tStats[1], tStats[3]);
- }
-
- /**
- * Returns the unlocalized name of this item.
- */
- @Override
- public String getUnlocalizedName() {
- return this.unlocalizedName;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
- if (this.hasEffect.get(par1ItemStack.getItemDamage() - this.mOffset) != null) {
- return this.hasEffect.get(par1ItemStack.getItemDamage() - this.mOffset).getValue();
- }
- return false;
- }
-
- @Override
- public boolean isBookEnchantable(final ItemStack aStack, final ItemStack aBook) {
- return false;
- }
-
- public boolean isItemStackUsable(final ItemStack aStack) {
- final ArrayList<IItemBehaviour<BaseEuItem>> tList = this.mItemBehaviors.get((short) this.getDamage(aStack));
- if (tList != null) {
- for (final IItemBehaviour<BaseEuItem> tBehavior : tList) {
- if (!tBehavior.isItemStackUsable(this, aStack)) {
- return false;
- }
- }
- }
- return true;
}
@Override
@SideOnly(Side.CLIENT)
- public final void registerIcons(final IIconRegister aIconRegister) {
- for (short i = 0, j = (short) this.mEnabledItems.length(); i < j; i++) {
- if (this.mEnabledItems.get(i)) {
- for (byte k = 1; k < this.mIconList[i].length; k++) {
- this.mIconList[i][k] = aIconRegister
- .registerIcon(CORE.MODID + ":" + this.getUnlocalizedName() + "/" + i + "/" + k);
+ public final void registerIcons(IIconRegister aIconRegister) {
+ for (short i = 0, j = (short) mEnabledItems.length(); i < j; i++)
+ if (mEnabledItems.get(i)) {
+ for (byte k = 1; k < mIconList[i].length; k++) {
+ mIconList[i][k] = aIconRegister.registerIcon(CORE.MODID+":" + (getUnlocalizedName() + "/" + i + "/" + k));
}
- this.mIconList[i][0] = aIconRegister
- .registerIcon(CORE.MODID + ":" + this.getUnlocalizedName() + "/" + i);
+ mIconList[i][0] = aIconRegister.registerIcon(CORE.MODID+":" + (getUnlocalizedName() + "/" + i));
}
- }
- }
-
- public void registerItem(final int id, final String localizedName, final long euStorage, final int tier,
- final String description) {
- this.registerItem(id, localizedName, euStorage, (short) tier, description, EnumRarity.common,
- EnumChatFormatting.GRAY, false);
- }
-
- public void registerItem(final int id, final String localizedName, final long euStorage, final int tier,
- final String description, final int burnTime) {
- this.registerItem(id, localizedName, euStorage, (short) tier, description, EnumRarity.common,
- EnumChatFormatting.GRAY, false);
- this.setBurnValue(id, burnTime);
- }
-
- public void registerItem(final int id, final String localizedName, final long euStorage, final short tier,
- final String description, final EnumRarity regRarity, final EnumChatFormatting colour,
- final boolean Effect) {
- this.addItem(id, localizedName, EnumChatFormatting.YELLOW + "Electric", new Object[] {});
- this.setElectricStats(this.mOffset + id, euStorage, GT_Values.V[tier], tier, -3L, true);
- this.rarity.add(new Pair<Integer, EnumRarity>(id, regRarity));
- this.itemName.add(new Pair<Integer, String>(id, localizedName));
- this.itemDescription.add(new Pair<Integer, String>(id, description));
- this.descColour.add(new Pair<Integer, EnumChatFormatting>(id, colour));
- this.hasEffect.add(new Pair<Integer, Boolean>(id, Effect));
}
-
+
+
+ @Override
+ public final IIcon getIconFromDamage(int aMetaData) {
+ if (aMetaData < 0) return null;
+ return aMetaData - mOffset < mIconList.length ? mIconList[aMetaData - mOffset][0] : null;
+ }
+
/**
- * Sets the Furnace Burn Value for the Item.
- *
- * @param aMetaValue
- * the Meta Value of the Item you want to set it to. [0 - 32765]
- * @param aValue
- * 200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5
- * EU)
- * @return the Item itself for convenience in constructing.
- */
- public final BaseEuItem setBurnValue(final int aMetaValue, final int aValue) {
- if (aMetaValue < 0 || aValue < 0) {
- return this;
- }
- if (aValue == 0) {
- this.mBurnValues.remove((short) aMetaValue);
- }
- else {
- this.mBurnValues.put((short) aMetaValue, aValue > Short.MAX_VALUE ? Short.MAX_VALUE : (short) aValue);
- }
- return this;
- }
-
- public final boolean setCharge(final ItemStack aStack, long aCharge) {
- final Long[] tStats = this.getElectricStats(aStack);
- if (tStats == null || tStats[3] > 0) {
- return false;
- }
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- }
- tNBT.removeTag("GT.ItemCharge");
- aCharge = Math.min(tStats[0] < 0 ? Math.abs(tStats[0] / 2) : aCharge, Math.abs(tStats[0]));
- if (aCharge > 0) {
- aStack.setItemDamage(this.getChargedMetaData(aStack));
- tNBT.setLong("GT.ItemCharge", aCharge);
- }
- else {
- aStack.setItemDamage(this.getEmptyMetaData(aStack));
- }
- if (tNBT.hasNoTags()) {
- aStack.setTagCompound(null);
- }
- else {
- aStack.setTagCompound(tNBT);
- }
- this.isItemStackUsable(aStack);
- return true;
- }
-
- /**
- * @param aMetaValue
- * the Meta Value of the Item you want to set it to. [0 - 32765]
- * @param aMaxCharge
- * Maximum Charge. (if this is == 0 it will remove the Electric
- * Behavior)
- * @param aTransferLimit
- * Transfer Limit.
- * @param aTier
- * The electric Tier.
- * @param aSpecialData
- * If this Item has a Fixed Charge, like a SingleUse Battery (if
- * > 0). Use -1 if you want to make this Battery chargeable (the
- * use and canUse Functions will still discharge if you just use
- * this) Use -2 if you want to make this Battery dischargeable.
- * Use -3 if you want to make this Battery charge/discharge-able.
- * @return the Item itself for convenience in constructing.
- */
- public final BaseEuItem setElectricStats(final int aMetaValue, final long aMaxCharge, final long aTransferLimit,
- final long aTier, final long aSpecialData, final boolean aUseAnimations) {
- if (aMetaValue < 0) {
- return this;
- }
- if (aMaxCharge == 0) {
- this.mElectricStats.remove((short) aMetaValue);
- }
- else {
- this.mElectricStats.put((short) aMetaValue, new Long[] {
- aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData
- });
- }
- return this;
- }
-
+ * Sets the unlocalized name of this item to the string passed as the parameter"
+ */
+ @Override
+ public Item setUnlocalizedName(String p_77655_1_){
+ this.unlocalizedName = p_77655_1_;
+ super.setUnlocalizedName(p_77655_1_);
+ return this;
+ }
+
/**
- * Sets the unlocalized name of this item to the string passed as the
- * parameter"
- */
+ * Returns the unlocalized name of this item.
+ */
+ @Override
+ public String getUnlocalizedName()
+ {
+ return this.unlocalizedName;
+ }
+
+ public final Long[] getElectricStats(ItemStack aStack) {
+ return mElectricStats.get((short) aStack.getItemDamage());
+ }
+
@Override
- public Item setUnlocalizedName(final String p_77655_1_) {
- this.unlocalizedName = p_77655_1_;
- super.setUnlocalizedName(p_77655_1_);
- return this;
- }
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
+ return false;
+ }
+
+
+ /**
+ * Adds a special Item Behaviour to the Item.
+ * <p/>
+ * Note: the boolean Behaviours sometimes won't be executed if another boolean Behaviour returned true before.
+ *
+ * @param aMetaValue the Meta Value of the Item you want to add it to. [0 - 32765]
+ * @param aBehavior the Click Behavior you want to add.
+ * @return the Item itself for convenience in constructing.
+ */
+ public final BaseEuItem addItemBehavior(int aMetaValue, IItemBehaviour<BaseEuItem> aBehavior) {
+ if (aMetaValue < 0 || aMetaValue >= 32766 || aBehavior == null) return this;
+ ArrayList<IItemBehaviour<BaseEuItem>> tList = mItemBehaviors.get((short) aMetaValue);
+ if (tList == null) {
+ tList = new ArrayList<IItemBehaviour<BaseEuItem>>(1);
+ mItemBehaviors.put((short) aMetaValue, tList);
+ }
+ tList.add(aBehavior);
+ return this;
+ }
+
+ /**
+ * This adds a Custom Item to the ending Range.
+ *
+ * @param aID The Id of the assigned Item [0 - mItemAmount] (The MetaData gets auto-shifted by +mOffset)
+ * @param aEnglish The Default Localized Name of the created Item
+ * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip
+ * @param aFoodBehavior The Food Value of this Item. Can be null aswell. Just a convenience thing.
+ * @param aRandomData The OreDict Names you want to give the Item. Also used for TC Aspects and some other things.
+ * @return An ItemStack containing the newly created Item.
+ */
+ @SuppressWarnings("unchecked")
+ public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) {
+ if (aToolTip == null) aToolTip = "";
+ if (aID >= 0 && aID < mItemAmount) {
+ ItemStack rStack = new ItemStack(this, 1, mOffset + aID);
+ mEnabledItems.set(aID);
+ mVisibleItems.set(aID);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".name", aEnglish);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".tooltip", aToolTip);
+ List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
+ // Important Stuff to do first
+ for (Object tRandomData : aRandomData)
+ if (tRandomData instanceof SubTag) {
+ if (tRandomData == SubTag.INVISIBLE) {
+ mVisibleItems.set(aID, false);
+ continue;
+ }
+ if (tRandomData == SubTag.NO_UNIFICATION) {
+ GT_OreDictUnificator.addToBlacklist(rStack);
+ continue;
+ }
+ }
+ // now check for the rest
+ for (Object tRandomData : aRandomData)
+ if (tRandomData != null) {
+ boolean tUseOreDict = true;
+ if (tRandomData instanceof IItemBehaviour) {
+ addItemBehavior(mOffset + aID, (IItemBehaviour<BaseEuItem>) tRandomData);
+ tUseOreDict = false;
+ }
+ if (tRandomData instanceof IItemContainer) {
+ ((IItemContainer) tRandomData).set(rStack);
+ tUseOreDict = false;
+ }
+ if (tRandomData instanceof SubTag) {
+ continue;
+ }
+ if (tRandomData instanceof TC_AspectStack) {
+ ((TC_AspectStack) tRandomData).addToAspectList(tAspects);
+ continue;
+ }
+ if (tRandomData instanceof ItemData) {
+ if (GT_Utility.isStringValid(tRandomData))
+ GT_OreDictUnificator.registerOre(tRandomData, rStack);
+ else GT_OreDictUnificator.addItemData(rStack, (ItemData) tRandomData);
+ continue;
+ }
+ if (tUseOreDict) {
+ GT_OreDictUnificator.registerOre(tRandomData, rStack);
+ continue;
+ }
+ }
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
+ return rStack;
+ }
+ return null;
+ }
@Override
- public final boolean use(final ItemStack aStack, final double aAmount, final EntityLivingBase aPlayer) {
- this.chargeFromArmor(aStack, aPlayer);
- if (aPlayer instanceof EntityPlayer && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) {
- return true;
- }
- final double tTransfer = this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
- if (tTransfer == aAmount) {
- this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- this.chargeFromArmor(aStack, aPlayer);
- return true;
- }
- this.discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
- this.chargeFromArmor(aStack, aPlayer);
- return false;
+ public String getItemStackDisplayName(ItemStack par1ItemStack) {
+ return itemName.get(par1ItemStack.getItemDamage()-mOffset).getValue();
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java b/src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java
index eb61454f15..391f7bb986 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.item.base;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.core.creative.AddToCreativeTab;
@@ -15,75 +12,78 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class BaseItemBackpack extends Item {
-
- protected final int colourValue;
- protected final String unlocalName;
-
- public BaseItemBackpack(final String unlocalizedName, final int colour) {
- this.unlocalName = unlocalizedName;
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + "itemBackpack");
- this.colourValue = colour;
- GameRegistry.registerItem(this, unlocalizedName);
- GT_OreDictUnificator.registerOre("storageBackpack", ItemUtils.getSimpleStack(this));
- this.setMaxStackSize(1);
- this.setCreativeTab(AddToCreativeTab.tabOther);
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colourValue == 0) {
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colourValue;
-
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- // Name Formatting.
- String temp = this.unlocalName.replace("backpack", "");
- // Lets find the colour.
- if (temp.toLowerCase().contains("dark")) {
- temp = this.unlocalName.substring(12, this.unlocalName.length());
- temp = "Dark " + temp;
- }
- return temp + " Backpack";
+public class BaseItemBackpack extends Item{
+
+ protected final int colourValue;
+ protected final String unlocalName;
+
+
+ public BaseItemBackpack(String unlocalizedName, int colour){
+ this.unlocalName = unlocalizedName;
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + "itemBackpack");
+ this.colourValue = colour;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre("storageBackpack", ItemUtils.getSimpleStack(this));
+ setMaxStackSize(1);
+ setCreativeTab(AddToCreativeTab.tabOther);
}
// Without this method, your inventory will NOT work!!!
@Override
- public int getMaxItemUseDuration(final ItemStack stack) {
+ public int getMaxItemUseDuration(ItemStack stack) {
return 1; // return any value greater than zero
}
-
- @Override
- public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) {
- if (!world.isRemote) {
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
+ {
+ if (!world.isRemote)
+ {
// If player not sneaking, open the inventory gui
if (!player.isSneaking()) {
player.openGui(GTplusplus.instance, GuiHandler.GUI3, world, 0, 0, 0);
}
-
- // Otherwise, stealthily place some diamonds in there for a nice
- // surprise next time you open it up :)
+
+ // Otherwise, stealthily place some diamonds in there for a nice surprise next time you open it up :)
else {
- // Utils.LOG_INFO("Player is Sneaking, giving them sneaky
- // diamonds.");
- // new
- // BaseInventoryBackpack(player.getHeldItem()).setInventorySlotContents(0,
- // new ItemStack(Items.diamond,4));
+ // Utils.LOG_INFO("Player is Sneaking, giving them sneaky diamonds.");
+ // new BaseInventoryBackpack(player.getHeldItem()).setInventorySlotContents(0, new ItemStack(Items.diamond,4));
}
}
-
+
return itemstack;
}
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colourValue == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colourValue;
+
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+ //Name Formatting.
+ String temp = unlocalName.replace("backpack", "");
+ //Lets find the colour.
+ if (temp.toLowerCase().contains("dark")){
+ temp = unlocalName.substring(12, unlocalName.length());
+ temp = "Dark "+ temp;
+ }
+ return (temp+" Backpack");
+ }
@Override
@SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister iconRegister) {
+ public void registerIcons(IIconRegister iconRegister)
+ {
this.itemIcon = iconRegister.registerIcon(CORE.MODID + ":" + "itemBackpack");
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java b/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java
index 1a1c6fd3c9..86cd1c8046 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java
@@ -2,18 +2,18 @@ package gtPlusPlus.core.item.base;
import java.util.List;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
/*
- *
- *
+ *
+ *
Key Point: You can access the NBT compound data from the Item class (in those methods that pass an ItemStack), but the NBT compound can only be set on an ItemStack.
The steps to add NBT data to an ItemStack:
@@ -21,80 +21,88 @@ import net.minecraft.util.StatCollector;
Create an NBTTagCompound and fill it with the appropriate data
Call ItemStack#setTagCompound() method to set it.
- *
+ *
*/
-public class BaseItemBrain extends Item {
+public class BaseItemBrain extends Item{
// This is an array of all the types I am going to be adding.
- String[] brainTypes = {
- "dead", "preserved", "fresh", "tasty"
- };
+ String[] brainTypes = { "dead", "preserved", "fresh", "tasty" };
- // This code will allow us to tell the items apart in game. You can change
- @SuppressWarnings("unchecked")
- // texture based on nbt data, but I won't be covering that.
+ // This method allows us to have different language translation keys for
+ // each item we add.
@Override
- @SideOnly(Side.CLIENT)
- public void addInformation(final ItemStack stack, final EntityPlayer player, final List tooltip,
- final boolean isAdvanced) {
- if (stack.hasTagCompound() && stack.getTagCompound().hasKey("brainType")) {
- // StatCollector is a class which allows us to handle string
- // language translation. This requires that you fill out the
- // translation in you language class.
- tooltip.add(StatCollector
- .translateToLocal("tooltip.yourmod." + stack.getTagCompound().getString("brainType") + ".desc"));
- }
- else // If the brain does not have valid tag data, a default message
+ public String getUnlocalizedName(ItemStack stack)
+ {
+ // This makes sure that the stack has a tag compound. This is how data
+ // is stored on items.
+ if (stack.hasTagCompound())
{
- tooltip.add(StatCollector.translateToLocal("tooltip.yourmod.nullbrain.desc"));
+ // This is the object holding all of the item data.
+ NBTTagCompound itemData = stack.getTagCompound();
+ // This checks to see if the item has data stored under the
+ // brainType key.
+ if (itemData.hasKey("brainType"))
+ {
+ // This retrieves data from the brainType key and uses it in
+ // the return value
+ return "item." + itemData.getString("brainType");
+ }
}
+ // This will be used if the item is obtained without nbt data on it.
+ return "item.nullBrain";
}
+
// This is a fun method which allows us to run some code when our item is
- // shown in a creative tab. I am going to use it to add all the brain
+ // shown in a creative tab. I am going to use it to add all the brain
// types.
@SuppressWarnings("unchecked")
@Override
@SideOnly(Side.CLIENT)
- public void getSubItems(final Item item, final CreativeTabs tab, final List itemList) {
+ public void getSubItems(Item item, CreativeTabs tab, List itemList)
+ {
// This creates a loop with a counter. It will go through once for
- // every listing in brainTypes, and gives us a number associated
+ // every listing in brainTypes, and gives us a number associated
// with each listing.
- for (int pos = 0; pos < this.brainTypes.length; pos++) {
- // This creates a new ItemStack instance. The item parameter
+ for (int pos = 0; pos < brainTypes.length; pos++)
+ {
+ // This creates a new ItemStack instance. The item parameter
// supplied is this item.
- final ItemStack brainStack = new ItemStack(item);
- // By default, a new ItemStack does not have any nbt compound data.
+ ItemStack brainStack = new ItemStack(item);
+ // By default, a new ItemStack does not have any nbt compound data.
// We need to give it some.
brainStack.setTagCompound(new NBTTagCompound());
- // Now we set the type of the item, brainType is the key, and
+ // Now we set the type of the item, brainType is the key, and
// brainTypes[pos] is grabbing a
// entry from the brainTypes array.
- brainStack.getTagCompound().setString("brainType", this.brainTypes[pos]);
+ brainStack.getTagCompound().setString("brainType",
+ brainTypes[pos]);
// And this adds it to the itemList, which is a list of all items
// in the creative tab.
itemList.add(brainStack);
}
}
- // This method allows us to have different language translation keys for
- // each item we add.
+ // This code will allow us to tell the items apart in game. You can change
+ @SuppressWarnings("unchecked")
+ // texture based on nbt data, but I won't be covering that.
@Override
- public String getUnlocalizedName(final ItemStack stack) {
- // This makes sure that the stack has a tag compound. This is how data
- // is stored on items.
- if (stack.hasTagCompound()) {
- // This is the object holding all of the item data.
- final NBTTagCompound itemData = stack.getTagCompound();
- // This checks to see if the item has data stored under the
- // brainType key.
- if (itemData.hasKey("brainType")) {
- // This retrieves data from the brainType key and uses it in
- // the return value
- return "item." + itemData.getString("brainType");
- }
+ @SideOnly(Side.CLIENT)
+ public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean isAdvanced){
+ if ( stack.hasTagCompound()
+ && stack.getTagCompound().hasKey("brainType"))
+ {
+ // StatCollector is a class which allows us to handle string
+ // language translation. This requires that you fill out the
+ // translation in you language class.
+ tooltip.add(StatCollector.translateToLocal("tooltip.yourmod."
+ + stack.getTagCompound().getString("brainType") + ".desc"));
+ }
+ else // If the brain does not have valid tag data, a default message
+ {
+ tooltip.add(StatCollector.translateToLocal(
+ "tooltip.yourmod.nullbrain.desc"));
}
- // This will be used if the item is obtained without nbt data on it.
- return "item.nullBrain";
}
}
+
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
index f03b5ac83f..ee9d451948 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -1,121 +1,96 @@
package gtPlusPlus.core.item.base;
-import java.util.List;
-
-import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.entity.EntityUtils;
import gtPlusPlus.core.util.item.ItemUtils;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class BaseItemComponent extends Item {
-
- public static enum ComponentTypes {
- DUST("Dust", " Dust", "dust"), INGOT("Ingot", " Ingot", "ingot"), PLATE("Plate", " Plate",
- "plate"), PLATEDOUBLE("PlateDouble", " Double Plate", "plateDouble"), ROD("Rod", " Rod",
- "stick"), RODLONG("RodLong", " Long Rod", "stickLong"), GEAR("Gear", " Gear", "gear"), SCREW(
- "Screw", " Screw", "screw"), BOLT("Bolt", " Bolt", "bolt"), ROTOR("Rotor", " Rotor",
- "rotor"), RING("Ring", " Ring", "ring"), CELL("Cell", " Cell",
- "cell"), NUGGET("Nugget", " Nugget", "nugget");
-
- private String COMPONENT_NAME;
- private String DISPLAY_NAME;
- private String OREDICT_NAME;
-
- private ComponentTypes(final String LocalName, final String DisplayName, final String OreDictName) {
- this.COMPONENT_NAME = LocalName;
- this.DISPLAY_NAME = DisplayName;
- this.OREDICT_NAME = OreDictName;
- }
-
- public String getComponent() {
- return this.COMPONENT_NAME;
- }
-
- public String getName() {
- return this.DISPLAY_NAME;
- }
-
- public String getOreDictName() {
- return this.OREDICT_NAME;
- }
+public class BaseItemComponent extends Item{
- }
- public final Material componentMaterial;
- public final String materialName;
- public final String unlocalName;
+ public final Material componentMaterial;
+ public final String materialName;
+ public final String unlocalName;
+ public final ComponentTypes componentType;
- public final ComponentTypes componentType;
-
- public BaseItemComponent(final Material material, final ComponentTypes componentType) {
+ public BaseItemComponent(Material material, ComponentTypes componentType) {
this.componentMaterial = material;
- this.unlocalName = "item" + componentType.COMPONENT_NAME + material.getUnlocalizedName();
+ this.unlocalName = "item"+componentType.COMPONENT_NAME+material.getUnlocalizedName();
this.materialName = material.getLocalizedName();
this.componentType = componentType;
this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(this.unlocalName);
+ this.setUnlocalizedName(unlocalName);
this.setMaxStackSize(64);
- this.setTextureName(CORE.MODID + ":" + "item" + componentType.COMPONENT_NAME);
- GameRegistry.registerItem(this, this.unlocalName);
- GT_OreDictUnificator.registerOre(componentType.getOreDictName() + material.getUnlocalizedName(),
- ItemUtils.getSimpleStack(this));
+ this.setTextureName(CORE.MODID + ":" + "item"+componentType.COMPONENT_NAME);
+ GameRegistry.registerItem(this, unlocalName);
+ GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this));
}
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (componentMaterial.getLocalizedName()+componentType.DISPLAY_NAME);
+ }
- if (this.materialName != null && this.materialName != "" && !this.materialName.equals("")) {
+ public final String getMaterialName() {
+ return materialName;
+ }
- if (this.componentType == ComponentTypes.DUST) {
- list.add(EnumChatFormatting.GRAY + "A pile of " + this.materialName + " dust.");
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+
+
+ if (componentType == ComponentTypes.DUST){
+ list.add(EnumChatFormatting.GRAY+"A pile of " + materialName + " dust.");
}
- if (this.componentType == ComponentTypes.INGOT) {
- list.add(EnumChatFormatting.GRAY + "A solid ingot of " + this.materialName + ".");
- if (this.materialName != null && this.materialName != "" && !this.materialName.equals("")
- && this.unlocalName.toLowerCase().contains("ingothot")) {
- list.add(EnumChatFormatting.GRAY + "Warning: " + EnumChatFormatting.RED + "Very hot! "
- + EnumChatFormatting.GRAY + " Avoid direct handling..");
+ if (componentType == ComponentTypes.INGOT){
+ list.add(EnumChatFormatting.GRAY+"A solid ingot of " + materialName + ".");
+ if (materialName != null && materialName != "" && !materialName.equals("") && unlocalName.toLowerCase().contains("ingothot")){
+ list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot! "+EnumChatFormatting.GRAY+" Avoid direct handling..");
}
}
- if (this.componentType == ComponentTypes.PLATE) {
- list.add(EnumChatFormatting.GRAY + "A flat plate of " + this.materialName + ".");
+ if (componentType == ComponentTypes.PLATE){
+ list.add(EnumChatFormatting.GRAY+"A flat plate of " + materialName + ".");
}
- if (this.componentType == ComponentTypes.PLATEDOUBLE) {
- list.add(EnumChatFormatting.GRAY + "A double plate of " + this.materialName + ".");
+ if (componentType == ComponentTypes.PLATEDOUBLE){
+ list.add(EnumChatFormatting.GRAY+"A double plate of " + materialName + ".");
}
- if (this.componentType == ComponentTypes.ROD) {
- list.add(EnumChatFormatting.GRAY + "A 40cm Rod of " + this.materialName + ".");
+ if (componentType == ComponentTypes.ROD){
+ list.add(EnumChatFormatting.GRAY+"A 40cm Rod of " + materialName + ".");
}
- if (this.componentType == ComponentTypes.RODLONG) {
- list.add(EnumChatFormatting.GRAY + "A 80cm Rod of " + this.materialName + ".");
+ if (componentType == ComponentTypes.RODLONG){
+ list.add(EnumChatFormatting.GRAY+"A 80cm Rod of " + materialName + ".");
}
- if (this.componentType == ComponentTypes.ROTOR) {
- list.add(EnumChatFormatting.GRAY + "A Rotor made out of " + this.materialName + ". ");
+ if (componentType == ComponentTypes.ROTOR){
+ list.add(EnumChatFormatting.GRAY+"A Rotor made out of " + materialName + ". ");
}
- if (this.componentType == ComponentTypes.BOLT) {
- list.add(EnumChatFormatting.GRAY + "A small Bolt, constructed from " + this.materialName + ".");
+ if (componentType == ComponentTypes.BOLT){
+ list.add(EnumChatFormatting.GRAY+"A small Bolt, constructed from " + materialName + ".");
}
- if (this.componentType == ComponentTypes.SCREW) {
- list.add(EnumChatFormatting.GRAY + "A 8mm Screw, fabricated out of some " + this.materialName + ".");
+ if (componentType == ComponentTypes.SCREW){
+ list.add(EnumChatFormatting.GRAY+"A 8mm Screw, fabricated out of some " + materialName + ".");
}
- if (this.componentType == ComponentTypes.GEAR) {
- list.add(EnumChatFormatting.GRAY + "A large Gear, constructed from " + this.materialName + ".");
+ if (componentType == ComponentTypes.GEAR){
+ list.add(EnumChatFormatting.GRAY+"A large Gear, constructed from " + materialName + ".");
}
- if (this.componentType == ComponentTypes.RING) {
- list.add(EnumChatFormatting.GRAY + "A " + this.materialName + " Ring.");
+ if (componentType == ComponentTypes.RING){
+ list.add(EnumChatFormatting.GRAY+"A " + materialName + " Ring.");
}
- if (this.componentMaterial.isRadioactive) {
+ if (componentMaterial.isRadioactive){
list.add(CORE.GT_Tooltip_Radioactive);
}
@@ -124,25 +99,62 @@ public class BaseItemComponent extends Item {
super.addInformation(stack, aPlayer, list, bool);
}
+
@Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return this.componentMaterial.getRgbAsHex();
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ return componentMaterial.getRgbAsHex();
}
@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return this.componentMaterial.getLocalizedName() + this.componentType.DISPLAY_NAME;
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ EntityUtils.applyRadiationDamageToEntity(componentMaterial.vRadioationLevel, world, entityHolding);
}
- public final String getMaterialName() {
- return this.materialName;
- }
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
- final boolean p_77663_5_) {
- EntityUtils.applyRadiationDamageToEntity(this.componentMaterial.vRadioationLevel, world, entityHolding);
+
+
+
+
+
+
+ public static enum ComponentTypes {
+ DUST("Dust", " Dust", "dust"),
+ INGOT("Ingot", " Ingot", "ingot"),
+ PLATE("Plate", " Plate", "plate"),
+ PLATEDOUBLE("PlateDouble", " Double Plate", "plateDouble"),
+ ROD("Rod", " Rod", "stick"),
+ RODLONG("RodLong", " Long Rod", "stickLong"),
+ GEAR("Gear", " Gear", "gear"),
+ SCREW("Screw", " Screw", "screw"),
+ BOLT("Bolt", " Bolt", "bolt"),
+ ROTOR("Rotor", " Rotor", "rotor"),
+ RING("Ring", " Ring", "ring"),
+ CELL("Cell", " Cell", "cell"),
+ NUGGET("Nugget", " Nugget", "nugget");
+
+ private String COMPONENT_NAME;
+ private String DISPLAY_NAME;
+ private String OREDICT_NAME;
+ private ComponentTypes (final String LocalName, String DisplayName, String OreDictName){
+ this.COMPONENT_NAME = LocalName;
+ this.DISPLAY_NAME = DisplayName;
+ this.OREDICT_NAME = OreDictName;
+ }
+
+ public String getComponent(){
+ return COMPONENT_NAME;
+ }
+
+ public String getName(){
+ return DISPLAY_NAME;
+ }
+
+ public String getOreDictName(){
+ return OREDICT_NAME;
+ }
+
}
}
+
+
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemGeneric.java b/src/Java/gtPlusPlus/core/item/base/BaseItemGeneric.java
index 769baa6d3c..431f93b3e6 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemGeneric.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemGeneric.java
@@ -1,27 +1,28 @@
package gtPlusPlus.core.item.base;
+import gtPlusPlus.core.lib.CORE;
+
import java.util.List;
-import gtPlusPlus.core.lib.CORE;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-public class BaseItemGeneric extends Item {
- public BaseItemGeneric(final String unlocalizedName, final CreativeTabs c, final int stackSize, final int maxDmg) {
- this.setUnlocalizedName(CORE.MODID + "_" + unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(c);
- this.setMaxStackSize(stackSize);
- this.setMaxDamage(maxDmg);
+public class BaseItemGeneric extends Item
+{
+ public BaseItemGeneric(String unlocalizedName, CreativeTabs c, int stackSize, int maxDmg)
+ {
+ setUnlocalizedName(CORE.MODID + "_" + unlocalizedName);
+ setTextureName(CORE.MODID + ":" + unlocalizedName);
+ setCreativeTab(c);
+ setMaxStackSize(stackSize);
+ setMaxDamage(maxDmg);
}
-
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
super.addInformation(stack, aPlayer, list, bool);
- }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemLoot.java b/src/Java/gtPlusPlus/core/item/base/BaseItemLoot.java
index b8d89e461b..ed87677970 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemLoot.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemLoot.java
@@ -1,103 +1,108 @@
package gtPlusPlus.core.item.base;
-import java.util.List;
-
import gregtech.api.enums.Materials;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Quality;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-public class BaseItemLoot extends Item {
-
- public static enum LootTypes {
- Sword("Sword", " Longsword", "sword"), Shortsword("Sword", " Short Blade", "blade"), Helmet("Helmet",
- " Medium Helm", "helmet"), Chestplate("Platebody", " Chestplate", "platebody"), Leggings("Platelegs",
- " Platelegs", "platelegs"), Boots("Boots", " Boots", "boots");
- private String LOOT_TYPE;
- private String DISPLAY_SUFFIX;
- private String OREDICT_NAME;
-
- private LootTypes(final String LocalName, final String DisplayName, final String OreDictName) {
- this.LOOT_TYPE = LocalName;
- this.DISPLAY_SUFFIX = DisplayName;
- this.OREDICT_NAME = OreDictName;
- }
+public class BaseItemLoot extends Item{
- public String getLootType() {
- return this.LOOT_TYPE;
- }
+ private final String materialName;
+ private final String unlocalName;
+ private final LootTypes lootTypes;
+ private Quality lootQuality;
+ private final Materials lootMaterial;
- public String getName() {
- return this.DISPLAY_SUFFIX;
- }
-
- public String getOreDictName() {
- return this.OREDICT_NAME;
- }
- }
- private final String materialName;
- private final String unlocalName;
- private final LootTypes lootTypes;
- private Quality lootQuality;
-
- private final Materials lootMaterial;
-
- public BaseItemLoot(final LootTypes lootType, final Materials material) {
+ public BaseItemLoot(LootTypes lootType, Materials material) {
this.lootTypes = lootType;
this.lootMaterial = material;
- this.materialName = material.mDefaultLocalName;
- this.unlocalName = "item" + lootType.LOOT_TYPE + this.materialName;
- this.setUnlocalizedName(this.unlocalName);
+ this.materialName = material.mDefaultLocalName;
+ this.unlocalName = "item"+lootType.LOOT_TYPE+this.materialName;
+ this.setUnlocalizedName(unlocalName);
this.setMaxStackSize(1);
- this.setTextureName(CORE.MODID + ":" + "item" + lootType.LOOT_TYPE);
+ this.setTextureName(CORE.MODID + ":" + "item"+lootType.LOOT_TYPE);
+ }
+
+ public ItemStack generateLootStack(){
+ lootQuality = Quality.getRandomQuality();
+ return ItemUtils.getSimpleStack(this, 1);
}
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(this.lootQuality.getQuality());
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+ return (materialName+lootTypes.DISPLAY_SUFFIX);
+ }
- /*
- * if (componentMaterial.isRadioactive){
- * list.add(CORE.GT_Tooltip_Radioactive); }
- */
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(lootQuality.getQuality());
+
+ /*if (componentMaterial.isRadioactive){
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }*/
super.addInformation(stack, aPlayer, list, bool);
}
- public ItemStack generateLootStack() {
- this.lootQuality = Quality.getRandomQuality();
- return ItemUtils.getSimpleStack(this, 1);
- }
@Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- final short[] temp = this.lootMaterial.mRGBa;
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ short[] temp = lootMaterial.mRGBa;
return Utils.rgbtoHexValue(temp[0], temp[1], temp[2]);
}
@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return this.materialName + this.lootTypes.DISPLAY_SUFFIX;
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ //EntityUtils.applyRadiationDamageToEntity(lootQuality.vRadioationLevel, world, entityHolding);
}
- public final String getMaterialName() {
- return this.materialName;
- }
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
- final boolean p_77663_5_) {
- // EntityUtils.applyRadiationDamageToEntity(lootQuality.vRadioationLevel,
- // world, entityHolding);
+
+
+
+
+
+
+ public static enum LootTypes {
+ Sword("Sword", " Longsword", "sword"),
+ Shortsword("Sword", " Short Blade", "blade"),
+ Helmet("Helmet", " Medium Helm", "helmet"),
+ Chestplate("Platebody", " Chestplate", "platebody"),
+ Leggings("Platelegs", " Platelegs", "platelegs"),
+ Boots("Boots", " Boots", "boots");
+ private String LOOT_TYPE;
+ private String DISPLAY_SUFFIX;
+ private String OREDICT_NAME;
+ private LootTypes (final String LocalName, final String DisplayName, final String OreDictName){
+ this.LOOT_TYPE = LocalName;
+ this.DISPLAY_SUFFIX = DisplayName;
+ this.OREDICT_NAME = OreDictName;
+ }
+ public String getLootType(){
+ return LOOT_TYPE;
+ }
+ public String getName(){
+ return DISPLAY_SUFFIX;
+ }
+ public String getOreDictName(){
+ return OREDICT_NAME;
+ }
}
}
+
+
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java b/src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java
index cd0053cb2f..c793776e37 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java
@@ -1,9 +1,10 @@
package gtPlusPlus.core.item.base;
-import java.util.List;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -12,61 +13,63 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-public class BaseItemWithCharge extends Item {
-
- public int int_Charge = 0;
- public int int_Max_Charge = 0;
+public class BaseItemWithCharge extends Item{
- public BaseItemWithCharge(final String unlocalizedName, final int constructor_Charge,
- final int constructor_Max_Charge) {
+ public int int_Charge = 0;
+ public int int_Max_Charge = 0;
+
+ public BaseItemWithCharge(String unlocalizedName, int constructor_Charge, int constructor_Max_Charge) {
this.setUnlocalizedName(unlocalizedName);
this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
+ this.setMaxStackSize(1);
this.setCreativeTab(AddToCreativeTab.tabMachines);
this.int_Charge = constructor_Charge;
this.int_Max_Charge = constructor_Max_Charge;
}
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- int NBT_Charge = this.int_Charge;
- int NBT_Max_Charge = this.int_Max_Charge;
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ int NBT_Charge = int_Charge;
+ int NBT_Max_Charge = int_Max_Charge;
if (stack.stackTagCompound != null) {
NBT_Charge = stack.stackTagCompound.getInteger("charge_Current");
NBT_Max_Charge = stack.stackTagCompound.getInteger("charge_Max");
- final String tempX = String.valueOf(NBT_Charge);
- final String tempY = String.valueOf(NBT_Max_Charge);
- final String formattedX = EnumChatFormatting.RED + tempX + EnumChatFormatting.GRAY;
- final String formattedY = EnumChatFormatting.DARK_RED + tempY + EnumChatFormatting.GRAY;
- list.add(EnumChatFormatting.GRAY + "Charge:" + formattedX + "/" + formattedY + ".");
- super.addInformation(stack, aPlayer, list, bool);
- }
+ String tempX = String.valueOf(NBT_Charge);
+ String tempY = String.valueOf(NBT_Max_Charge);
+ String formattedX = EnumChatFormatting.RED+tempX+EnumChatFormatting.GRAY;
+ String formattedY = EnumChatFormatting.DARK_RED+tempY+EnumChatFormatting.GRAY;
+ list.add(EnumChatFormatting.GRAY+"Charge:"+formattedX+"/"+formattedY+".");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
}
- // Ticking and NBT Handling
- /*
- * Called each tick as long the item is on a player inventory. Uses by maps
- * to check if is on a player hand and update it's contents.
- *
- * public int fuelRemaining = 0; public int maximumFuel = 0; public String
- * fuelType = ""; public float heat = 0; public float maxHeat = 5000;
+ //Ticking and NBT Handling
+ /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
+ * update it's contents.
*
+ * public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = 5000;
+ *
*/
@Override
- public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {
+ public void onCreated(ItemStack itemStack, World world, EntityPlayer player) {
+
+ }
+ @Override
+ public void onUpdate(ItemStack itemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
+
}
@Override
- public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer par3Entity) {
+ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer par3Entity) {
itemStack.stackTagCompound = new NBTTagCompound();
return super.onItemRightClick(itemStack, world, par3Entity);
}
- @Override
- public void onUpdate(final ItemStack itemStack, final World par2World, final Entity par3Entity, final int par4,
- final boolean par5) {
- }
}
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java b/src/Java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java
index 8533ad20e9..ec052ef1f9 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java
@@ -1,32 +1,29 @@
package gtPlusPlus.core.item.base;
+import gtPlusPlus.core.lib.CORE;
+
import java.util.List;
-import gtPlusPlus.core.lib.CORE;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-public class BaseItemWithDamageValue extends Item {
- public BaseItemWithDamageValue(final String unlocalizedName) {
+public class BaseItemWithDamageValue extends Item{
+ public BaseItemWithDamageValue(String unlocalizedName) {
this.setUnlocalizedName(unlocalizedName);
this.setTextureName(CORE.MODID + ":" + unlocalizedName);
this.setMaxStackSize(1);
this.setMaxDamage(100);
}
-
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GOLD + "");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public void setDamage(final ItemStack stack, final int damage) {
+ public void setDamage(ItemStack stack, int damage) {
super.setDamage(stack, damage);
- }
+ }
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.GOLD+"");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java b/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java
index cfa871fd2b..9407689cfc 100644
--- a/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java
+++ b/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java
@@ -1,236 +1,259 @@
package gtPlusPlus.core.item.base;
-import java.util.List;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.util.Utils;
+
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.*;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityList;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.*;
-import net.minecraft.util.*;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemMonsterPlacer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.Facing;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class BasicSpawnEgg extends ItemMonsterPlacer {
- @SideOnly(Side.CLIENT)
- private IIcon theIcon;
- protected int colorBase = 0x000000;
- protected int colorSpots = 0xFFFFFF;
- protected String entityMODID = "";
- protected String entityToSpawnName = "";
- protected String entityToSpawnNameFull = "";
- protected EntityLiving entityToSpawn = null;
-
- public BasicSpawnEgg() {
- super();
- }
-
- public BasicSpawnEgg(final String MODID, final String parEntityToSpawnName, final int parPrimaryColor,
- final int parSecondaryColor) {
- this.setHasSubtypes(false);
- this.maxStackSize = 64;
- this.setCreativeTab(AddToCreativeTab.tabOther);
- this.setEntityToSpawnName(parEntityToSpawnName);
- this.colorBase = parPrimaryColor;
- this.colorSpots = parSecondaryColor;
- this.entityMODID = MODID;
-
- // DEBUG
- Utils.LOG_WARNING("Spawn egg constructor for " + this.entityToSpawnName);
- }
-
- public int getColorBase() {
- return this.colorBase;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(final ItemStack par1ItemStack, final int parColorType) {
- return parColorType == 0 ? this.colorBase : this.colorSpots;
- }
-
- public int getColorSpots() {
- return this.colorSpots;
- }
-
- /**
- * Gets an icon index based on an item's damage value and the given render
- * pass
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIconFromDamageForRenderPass(final int parDamageVal, final int parRenderPass) {
- return parRenderPass > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(parDamageVal, parRenderPass);
- }
-
- @Override
- // Doing this override means that there is no localization for language
- // unless you specifically check for localization here and convert
- public String getItemStackDisplayName(final ItemStack par1ItemStack) {
- return "Spawn " + this.entityToSpawnName;
- }
-
- /**
- * returns a list of items with the same ID, but different meta (eg: dye
- * returns 16 items)
- */
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(final Item parItem, final CreativeTabs parTab, final List parList) {
- parList.add(new ItemStack(parItem, 1, 0));
- }
-
- /**
- * Called whenever this item is equipped and the right mouse button is
- * pressed.
- *
- * Args: itemStack, world, entityPlayer
- */
- @Override
- public ItemStack onItemRightClick(final ItemStack par1ItemStack, final World par2World,
- final EntityPlayer par3EntityPlayer) {
- if (par2World.isRemote) {
- return par1ItemStack;
- }
- final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World,
- par3EntityPlayer, true);
-
- if (movingobjectposition == null) {
- return par1ItemStack;
- }
- if (movingobjectposition.typeOfHit == MovingObjectPosition
-
- .MovingObjectType.BLOCK)
- {
- final int i = movingobjectposition.blockX;
- final int j = movingobjectposition.blockY;
- final int k = movingobjectposition.blockZ;
-
- if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) {
- return par1ItemStack;
- }
-
- if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) {
- return par1ItemStack;
- }
-
- if (par2World.getBlock(i, j, k) instanceof BlockLiquid) {
- final Entity entity = this.spawnEntity(par2World, i, j, k);
-
- if (entity != null) {
- if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) {
- ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
- }
-
- if (!par3EntityPlayer.capabilities.isCreativeMode) {
- --par1ItemStack.stackSize;
- }
- }
- }
- }
- return par1ItemStack;
- }
-
- /**
- * Callback for item usage. If the item does something special on right
- * clicking,
- *
- * he will have one of those. Return True if something happen and false if
- * it don't. This is for ITEMS, not BLOCKS
- */
- @Override
- public boolean onItemUse(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final World par3World,
- int par4, int par5, int par6, final int par7, final float par8, final float par9, final float par10) {
- if (par3World.isRemote) {
- return true;
- }
- final Block block = par3World.getBlock(par4, par5, par6);
+public class BasicSpawnEgg extends ItemMonsterPlacer
+{
+ @SideOnly(Side.CLIENT)
+ private IIcon theIcon;
+ protected int colorBase = 0x000000;
+ protected int colorSpots = 0xFFFFFF;
+ protected String entityMODID = "";
+ protected String entityToSpawnName = "";
+ protected String entityToSpawnNameFull = "";
+ protected EntityLiving entityToSpawn = null;
+
+ public BasicSpawnEgg(){
+ super();
+ }
+
+ public BasicSpawnEgg(String MODID, String parEntityToSpawnName, int parPrimaryColor, int parSecondaryColor){
+ setHasSubtypes(false);
+ maxStackSize = 64;
+ setCreativeTab(AddToCreativeTab.tabOther);
+ setEntityToSpawnName(parEntityToSpawnName);
+ colorBase = parPrimaryColor;
+ colorSpots = parSecondaryColor;
+ entityMODID = MODID;
+
+ // DEBUG
+ Utils.LOG_WARNING("Spawn egg constructor for "+entityToSpawnName);
+ }
+
+ /**
+ * Callback for item usage. If the item does something special on right clicking,
+
+ * he will have one of those. Return
+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
+ */
+ @Override
+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10){
+ if (par3World.isRemote)
+ {
+ return true;
+ }
+ Block block = par3World.getBlock(par4, par5, par6);
par4 += Facing.offsetsXForSide[par7];
par5 += Facing.offsetsYForSide[par7];
par6 += Facing.offsetsZForSide[par7];
double d0 = 0.0D;
- if (par7 == 1 && block.getRenderType() == 11) {
- d0 = 0.5D;
+ if (par7 == 1 && block.getRenderType() == 11)
+ {
+ d0 = 0.5D;
}
- final Entity entity = this.spawnEntity(par3World, par4 + 0.5D, par5 + d0, par6 + 0.5D);
+ Entity entity = spawnEntity(par3World, par4 + 0.5D, par5 + d0, par6 + 0.5D);
- if (entity != null) {
- if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) {
- ((EntityLiving) entity).setCustomNameTag(par1ItemStack.getDisplayName());
- }
-
- if (!par2EntityPlayer.capabilities.isCreativeMode) {
- --par1ItemStack.stackSize;
- }
+ if (entity != null)
+ {
+ if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName())
+ {
+ ((EntityLiving)entity).setCustomNameTag(par1ItemStack.getDisplayName());
+ }
+
+ if (!par2EntityPlayer.capabilities.isCreativeMode)
+ {
+ --par1ItemStack.stackSize;
+ }
}
return true;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister par1IconRegister) {
- super.registerIcons(par1IconRegister);
- this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_overlay");
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
-
- public void setColors(final int parColorBase, final int parColorSpots) {
- this.colorBase = parColorBase;
- this.colorSpots = parColorSpots;
- }
-
- public void setEntityToSpawnName(final String parEntityToSpawnName) {
- this.entityToSpawnName = parEntityToSpawnName;
- this.entityToSpawnNameFull = this.entityMODID + "." + this.entityToSpawnName;
- }
-
- /**
- * Spawns the creature specified by the egg's type in the location specified
- * by
- *
- * the last three parameters. Parameters: world, entityID, x, y, z.
- */
- public Entity spawnEntity(final World parWorld, final double parX, final double parY, final double parZ) {
-
- if (!parWorld.isRemote) // never spawn entity on client side
+ }
+
+ /**
+ * Called whenever this item is equipped and the right mouse button is pressed.
+
+ *Args: itemStack, world, entityPlayer
+ */
+ @Override
+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){
+ if (par2World.isRemote)
+ {
+ return par1ItemStack;
+ }
+ MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
+
+ if (movingobjectposition == null)
{
- this.entityToSpawnNameFull = this.entityMODID + "." + this.entityToSpawnName;
- if (EntityList.stringToClassMapping.containsKey(this.entityToSpawnNameFull)) {
- this.entityToSpawn = (EntityLiving) EntityList
-
- .createEntityByName(this.entityToSpawnNameFull, parWorld);
- this.entityToSpawn.setLocationAndAngles(parX, parY, parZ,
-
- MathHelper.wrapAngleTo180_float(parWorld.rand.nextFloat()
-
- * 360.0F),
- 0.0F);
- parWorld.spawnEntityInWorld(this.entityToSpawn);
- this.entityToSpawn.onSpawnWithEgg((IEntityLivingData) null);
- this.entityToSpawn.playLivingSound();
- }
- else {
- // DEBUG
- Utils.LOG_WARNING("Entity not found " + this.entityToSpawnName);
- }
+ return par1ItemStack;
}
+ if (movingobjectposition.typeOfHit == MovingObjectPosition
+
+ .MovingObjectType.BLOCK)
- return this.entityToSpawn;
- }
+ {
+ int i = movingobjectposition.blockX;
+ int j = movingobjectposition.blockY;
+ int k = movingobjectposition.blockZ;
+
+ if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
+ {
+ return par1ItemStack;
+ }
+
+ if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
+ {
+ return par1ItemStack;
+ }
+
+ if (par2World.getBlock(i, j, k) instanceof BlockLiquid)
+ {
+ Entity entity = spawnEntity(par2World, i, j, k);
+
+ if (entity != null)
+ {
+ if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName())
+ {
+ ((EntityLiving)entity).setCustomNameTag(par1ItemStack.getDisplayName());
+ }
+
+ if (!par3EntityPlayer.capabilities.isCreativeMode)
+ {
+ --par1ItemStack.stackSize;
+ }
+ }
+ }
+ }
+
+ return par1ItemStack;
+ }
+
+ /**
+ * Spawns the creature specified by the egg's type in the location specified by
+
+ * the last three parameters.
+ * Parameters: world, entityID, x, y, z.
+ */
+ public Entity spawnEntity(World parWorld, double parX, double parY, double parZ){
+
+ if (!parWorld.isRemote) // never spawn entity on client side
+ {
+ entityToSpawnNameFull = entityMODID+"."+entityToSpawnName;
+ if (EntityList.stringToClassMapping.containsKey(entityToSpawnNameFull))
+ {
+ entityToSpawn = (EntityLiving) EntityList
+
+ .createEntityByName(entityToSpawnNameFull, parWorld);
+ entityToSpawn.setLocationAndAngles(parX, parY, parZ,
+
+ MathHelper.wrapAngleTo180_float(parWorld.rand.nextFloat()
+
+ * 360.0F), 0.0F);
+ parWorld.spawnEntityInWorld(entityToSpawn);
+ entityToSpawn.onSpawnWithEgg((IEntityLivingData)null);
+ entityToSpawn.playLivingSound();
+ }
+ else
+ {
+ //DEBUG
+ Utils.LOG_WARNING("Entity not found "+entityToSpawnName);
+ }
+ }
+
+ return entityToSpawn;
+ }
+
+
+ /**
+ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item parItem, CreativeTabs parTab, List parList){
+ parList.add(new ItemStack(parItem, 1, 0));
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(ItemStack par1ItemStack, int parColorType){
+ return (parColorType == 0) ? colorBase : colorSpots;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses(){
+ return true;
+ }
+
+ @Override
+ // Doing this override means that there is no localization for language
+ // unless you specifically check for localization here and convert
+ public String getItemStackDisplayName(ItemStack par1ItemStack){
+ return "Spawn "+entityToSpawnName;
+ }
+
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister){
+ super.registerIcons(par1IconRegister);
+ theIcon = par1IconRegister.registerIcon(getIconString() + "_overlay");
+ }
+
+ /**
+ * Gets an icon index based on an item's damage value and the given render pass
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamageForRenderPass(int parDamageVal, int parRenderPass){
+ return parRenderPass > 0 ? theIcon : super.getIconFromDamageForRenderPass(parDamageVal, parRenderPass);
+ }
+
+ public void setColors(int parColorBase, int parColorSpots){
+ colorBase = parColorBase;
+ colorSpots = parColorSpots;
+ }
+
+ public int getColorBase(){
+ return colorBase;
+ }
+
+ public int getColorSpots(){
+ return colorSpots;
+ }
+
+ public void setEntityToSpawnName(String parEntityToSpawnName){
+ entityToSpawnName = parEntityToSpawnName;
+ entityToSpawnNameFull = entityMODID+"."+entityToSpawnName;
+ }
}
+
diff --git a/src/Java/gtPlusPlus/core/item/base/CoreItem.java b/src/Java/gtPlusPlus/core/item/base/CoreItem.java
index aa83b6857d..0653cddbb8 100644
--- a/src/Java/gtPlusPlus/core/item/base/CoreItem.java
+++ b/src/Java/gtPlusPlus/core/item/base/CoreItem.java
@@ -1,90 +1,96 @@
package gtPlusPlus.core.item.base;
+import gtPlusPlus.core.lib.CORE;
+
import java.util.List;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.lib.CORE;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.*;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class CoreItem extends Item {
+public class CoreItem extends Item
+{
- private final EnumRarity rarity;
- private final EnumChatFormatting descColour;
- private final String itemDescription;
- private final boolean hasEffect;
+ private final EnumRarity rarity;
+ private final EnumChatFormatting descColour;
+ private final String itemDescription;
+ private final boolean hasEffect;
- // 0
+ //0
/*
* Name, Tab - 64 Stack, 0 Dmg
*/
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab) {
- this(unlocalizedName, creativeTab, 64, 0); // Calls 3
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab)
+ {
+ this(unlocalizedName, creativeTab, 64, 0); //Calls 3
}
-
- // 1
+ //1
/*
* Name, Tab, Stack - 0 Dmg
*/
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize) {
- this(unlocalizedName, creativeTab, stackSize, 0); // Calls 3
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize)
+ {
+ this(unlocalizedName, creativeTab, stackSize, 0); //Calls 3
}
-
- // 3
+ //2
+ /*
+ * Name, Tab, Stack, Description - 0 Dmg
+ */
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, String description)
+ {
+ this(unlocalizedName, creativeTab, stackSize, 0, description); //Calls 4
+ }
+ //3
/*
* Name, Tab, Stack, Dmg - Description
*/
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize,
- final int maxDmg) {
- this(unlocalizedName, creativeTab, stackSize, maxDmg, ""); // Calls 4
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg)
+ {
+ this(unlocalizedName, creativeTab, stackSize, maxDmg, ""); //Calls 4
}
-
- // 4 //Not Rare + basic tooltip
+ //4 //Not Rare + basic tooltip
/*
* Name, Tab, Stack, Dmg, Description
*/
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg,
- final String description) {
- this(unlocalizedName, creativeTab, stackSize, maxDmg, description, EnumRarity.common, EnumChatFormatting.GRAY,
- false); // Calls 4.5
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, String description)
+ {
+ this(unlocalizedName, creativeTab, stackSize, maxDmg, description, EnumRarity.common, EnumChatFormatting.GRAY, false); //Calls 4.5
}
-
- // 4.5
+ //4.5
/*
* Name, Tab, Stack, Dmg, Description, Text Colour - Common
*/
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg,
- final String description, final EnumChatFormatting colour) {
- this(unlocalizedName, creativeTab, stackSize, maxDmg, description, EnumRarity.common, colour, false); // Calls
- // 5
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, String description, EnumChatFormatting colour)
+ {
+ this(unlocalizedName, creativeTab, stackSize, maxDmg, description, EnumRarity.common, colour, false); //Calls 5
}
- // 4.75
+ //4.75
/*
* Name, Tab, Stack, Dmg, Description, Rarity - Gray text
*/
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg,
- final String description, final EnumRarity rarity) {
- this(unlocalizedName, creativeTab, stackSize, maxDmg, description, rarity, EnumChatFormatting.GRAY, false); // Calls
- // 5
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, String description, EnumRarity rarity)
+ {
+ this(unlocalizedName, creativeTab, stackSize, maxDmg, description, rarity, EnumChatFormatting.GRAY, false); //Calls 5
}
- // 5
+ //5
/*
* Name, Tab, Stack, Dmg, Description, Rarity, Text Colour, Effect
*/
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize, final int maxDmg,
- final String description, final EnumRarity regRarity, final EnumChatFormatting colour,
- final boolean Effect) {
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(creativeTab);
- this.setMaxStackSize(stackSize);
- this.setMaxDamage(maxDmg);
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, String description, EnumRarity regRarity, EnumChatFormatting colour, boolean Effect)
+ {
+ setUnlocalizedName(unlocalizedName);
+ setTextureName(CORE.MODID + ":" + unlocalizedName);
+ setCreativeTab(creativeTab);
+ setMaxStackSize(stackSize);
+ setMaxDamage(maxDmg);
this.rarity = regRarity;
this.itemDescription = description;
this.descColour = colour;
@@ -92,33 +98,21 @@ public class CoreItem extends Item {
GameRegistry.registerItem(this, unlocalizedName);
}
- // 2
- /*
- * Name, Tab, Stack, Description - 0 Dmg
- */
- public CoreItem(final String unlocalizedName, final CreativeTabs creativeTab, final int stackSize,
- final String description) {
- this(unlocalizedName, creativeTab, stackSize, 0, description); // Calls
- // 4
- }
-
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(this.descColour + this.itemDescription);
- // super.addInformation(stack, aPlayer, list, bool);
- }
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(descColour+itemDescription);
+ //super.addInformation(stack, aPlayer, list, bool);
+ }
@Override
@SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
- return this.rarity;
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return rarity;
}
@Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
- return this.hasEffect;
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return hasEffect;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java
index 8d4d70ea9a..6292c5cde6 100644
--- a/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java
+++ b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java
@@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.bolts;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemBolt extends BaseItemComponent {
+public class BaseItemBolt extends BaseItemComponent{
- public BaseItemBolt(final Material material) {
+ public BaseItemBolt(Material material) {
super(material, BaseItemComponent.ComponentTypes.BOLT);
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
index 9736d3281d..f2c2187558 100644
--- a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
+++ b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
@@ -1,41 +1,42 @@
package gtPlusPlus.core.item.base.cell;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class BaseItemCell extends BaseItemComponent {
-
- private IIcon base;
- private IIcon overlay;
- ComponentTypes Cell = ComponentTypes.CELL;
+public class BaseItemCell extends BaseItemComponent{
- public BaseItemCell(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.CELL);
+ private IIcon base;
+ private IIcon overlay;
+ ComponentTypes Cell = ComponentTypes.CELL;
+
+ public BaseItemCell(Material material) {
+ super(material, BaseItemComponent.ComponentTypes.CELL);
}
@Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- if (pass == 0) {
- return this.base;
- }
- return this.overlay;
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses(){
+ return true;
}
- @Override
- public void registerIcons(final IIconRegister i) {
- this.base = i.registerIcon(CORE.MODID + ":" + "item" + this.Cell.getComponent());
- this.overlay = i.registerIcon(CORE.MODID + ":" + "item" + this.Cell.getComponent() + "_Overlay");
+ @Override
+ public void registerIcons(IIconRegister i) {
+ this.base = i.registerIcon(CORE.MODID + ":" + "item"+Cell.getComponent());
+ this.overlay = i.registerIcon(CORE.MODID + ":" + "item"+Cell.getComponent()+"_Overlay");
}
+
@Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses() {
- return true;
+ public IIcon getIconFromDamageForRenderPass(int damage, int pass) {
+ if(pass == 0) {
+ return this.base;
+ }
+ return this.overlay;
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
index 58f1076dbb..69d5363240 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
@@ -1,49 +1,45 @@
package gtPlusPlus.core.item.base.dusts;
-import java.util.List;
-
-import cpw.mods.fml.common.registry.GameRegistry;
+import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc;
import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
-import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.entity.EntityUtils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class BaseItemDust extends Item {
+public class BaseItemDust extends Item{
- protected int colour;
- protected String materialName;
- protected String pileType;
- String name = "";
- private final int mTier;
- private final Material dustInfo;
- private String oredictName;
+ protected int colour;
+ protected String materialName;
+ protected String pileType;
+ String name = "";
+ private int mTier;
+ private Material dustInfo;
+ private String oredictName;
- protected final int sRadiation;
-
- public BaseItemDust(final String unlocalizedName, final String materialName, final Material matInfo,
- final int colour, final String pileSize, final int tier, final int sRadioactivity) {
- this.setUnlocalizedName(unlocalizedName);
+ public BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, int tier, int sRadioactivity) {
+ setUnlocalizedName(unlocalizedName);
this.setUnlocalizedName(unlocalizedName);
- this.setMaxStackSize(64);
- if (pileSize == "dust" || pileSize == "Dust") {
- this.setTextureName(CORE.MODID + ":" + "dust");
- }
- else {
- this.setTextureName(CORE.MODID + ":" + "dust" + pileSize);
- }
- this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setMaxStackSize(64);
+ if (pileSize == "dust" || pileSize == "Dust"){
+ this.setTextureName(CORE.MODID + ":" + "dust");}
+ else{
+ this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);}
+ this.setCreativeTab(tabMisc);
this.colour = colour;
this.mTier = tier;
this.materialName = materialName;
@@ -52,215 +48,215 @@ public class BaseItemDust extends Item {
GameRegistry.registerItem(this, unlocalizedName);
String temp = "";
- Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: " + this.getUnlocalizedName());
- if (this.getUnlocalizedName().contains("item.")) {
- temp = this.getUnlocalizedName().replace("item.", "");
- Utils.LOG_WARNING("Generating OreDict Name: " + temp);
+ Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ temp = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
else {
- temp = this.getUnlocalizedName();
+ temp = getUnlocalizedName();
}
- if (temp.contains("DustTiny")) {
+ if (temp.contains("DustTiny")){
temp = temp.replace("itemD", "d");
- Utils.LOG_WARNING("Generating OreDict Name: " + temp);
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
- else if (temp.contains("DustSmall")) {
+ else if (temp.contains("DustSmall")){
temp = temp.replace("itemD", "d");
- Utils.LOG_WARNING("Generating OreDict Name: " + temp);
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
else {
temp = temp.replace("itemD", "d");
- Utils.LOG_WARNING("Generating OreDict Name: " + temp);
- }
- if (temp != null && temp != "") {
- this.oredictName = temp;
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ if (temp != null && temp != ""){
+ oredictName = temp;
GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
}
- this.addFurnaceRecipe();
- this.addMacerationRecipe();
+ addFurnaceRecipe();
+ addMacerationRecipe();
}
- private void addBlastFurnaceRecipe(final ItemStack input1, final ItemStack input2, final ItemStack output1,
- final ItemStack output2, final int tempRequired) {
- // Special Cases
- /*
- * if
- * (input1.getUnlocalizedName().toLowerCase().contains("tantalloy61")){
- * Utils.LOG_INFO(
- * "Adding Special handler for Staballoy-61 in the Blast Furnace");
- * input2 =
- * UtilsItems.getItemStackOfAmountFromOreDict("dustTantalloy60", 2); if
- * (input2 == null){ Utils.LOG_INFO("invalid itemstack."); } else {
- * Utils.LOG_INFO("Found "+input2.getDisplayName()); } }
- */
- GT_Values.RA.addBlastRecipe(input1, input2, GT_Values.NF, GT_Values.NF, output1, output2, 250 * this.mTier * 20,
- this.mTier * 64, tempRequired);
-
- }
-
- private void addFurnaceRecipe() {
+ @Override
+ public String getItemStackDisplayName(ItemStack iStack) {
- String temp = "";
- if (this.getUnlocalizedName().contains("item.")) {
- temp = this.getUnlocalizedName().replace("item.", "");
+ if (getUnlocalizedName().contains("DustTiny")){
+ name = "Tiny Pile of "+materialName + " Dust";
}
- else {
- temp = this.getUnlocalizedName();
+ else if (getUnlocalizedName().contains("DustSmall")){
+ name = "Small Pile of "+materialName + " Dust";
}
- if (temp.contains("DustTiny") || temp.contains("DustSmall")) {
- return;
+ else {
+ name = materialName + " Dust";
}
- temp = temp.replace("itemDust", "ingot");
- if (temp != null && temp != "") {
-
- if (this.dustInfo.requiresBlastFurnace()) {
- Utils.LOG_WARNING("Adding recipe for Hot " + this.materialName + " Ingots in a Blast furnace.");
- final String tempIngot = temp.replace("ingot", "ingotHot");
- final ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1);
- Utils.LOG_WARNING("This will produce " + tempOutputStack.getDisplayName() + " Debug: " + tempIngot);
- if (null != tempOutputStack) {
- this.addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null,
- 350 * this.mTier);
- }
- return;
- }
- Utils.LOG_WARNING("Adding recipe for " + this.materialName + " Ingots in a furnace.");
- final ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1);
- Utils.LOG_WARNING("This will produce an ingot of " + tempOutputStack.getDisplayName() + " Debug: " + temp);
- if (null != tempOutputStack) {
- if (this.mTier < 5 || !this.dustInfo.requiresBlastFurnace()) {
- if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(ItemUtils.getSimpleStack(this),
- tempOutputStack)) {
- Utils.LOG_WARNING("Successfully added a furnace recipe for " + this.materialName);
- }
- else {
- Utils.LOG_WARNING("Failed to add a furnace recipe for " + this.materialName);
- }
- }
- else if (this.mTier >= 5 || this.dustInfo.requiresBlastFurnace()) {
- Utils.LOG_WARNING("Adding recipe for " + this.materialName + " Ingots in a Blast furnace.");
- Utils.LOG_WARNING("This will produce " + tempOutputStack.getDisplayName());
- if (null != tempOutputStack) {
- this.addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null,
- 350 * this.mTier);
- }
- return;
- }
- }
+ return name;
+ }
- }
+ protected final int sRadiation;
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ EntityUtils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
}
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- // if (pileType != null && materialName != null && pileType != "" &&
- // materialName != "" && !pileType.equals("") &&
- // !materialName.equals("")){
- if (this.getUnlocalizedName().contains("DustTiny")) {
- list.add(EnumChatFormatting.GRAY + "A tiny pile of " + this.materialName + " dust.");
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ //if (pileType != null && materialName != null && pileType != "" && materialName != "" && !pileType.equals("") && !materialName.equals("")){
+ if (getUnlocalizedName().contains("DustTiny")){
+ list.add(EnumChatFormatting.GRAY+"A tiny pile of " + materialName + " dust.");
}
- else if (this.getUnlocalizedName().contains("DustSmall")) {
- list.add(EnumChatFormatting.GRAY + "A small pile of " + this.materialName + " dust.");
+ else if (getUnlocalizedName().contains("DustSmall")){
+ list.add(EnumChatFormatting.GRAY+"A small pile of " + materialName + " dust.");
}
else {
- list.add(EnumChatFormatting.GRAY + "A pile of " + this.materialName + " dust.");
+ list.add(EnumChatFormatting.GRAY+"A pile of " + materialName + " dust.");
}
- if (this.sRadiation > 0) {
+ if (sRadiation > 0){
list.add(CORE.GT_Tooltip_Radioactive);
}
- if (this.dustInfo != null) {
- list.add(this.dustInfo.vChemicalFormula);
+ if (dustInfo != null){
+ list.add(dustInfo.vChemicalFormula);
}
- // }
+ //}
super.addInformation(stack, aPlayer, list, bool);
}
- private void addMacerationRecipe() {
- Utils.LOG_WARNING("Adding recipe for " + this.materialName + " Dusts");
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
- String tempIngot = this.getUnlocalizedName().replace("item.itemDust", "ingot");
- final String tempDust = this.getUnlocalizedName().replace("item.itemDust", "dust");
+ }
+
+ private void addMacerationRecipe(){
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Dusts");
+
+ String tempIngot = getUnlocalizedName().replace("item.itemDust", "ingot");
+ String tempDust = getUnlocalizedName().replace("item.itemDust", "dust");
ItemStack tempInputStack;
ItemStack tempOutputStack;
- if (this.getUnlocalizedName().contains("DustSmall") || this.getUnlocalizedName().contains("DustTiny")) {
+ if (getUnlocalizedName().contains("DustSmall") || getUnlocalizedName().contains("DustTiny")){
return;
}
- Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: " + this.getUnlocalizedName());
- if (this.getUnlocalizedName().contains("item.")) {
- tempIngot = this.getUnlocalizedName().replace("item.", "");
- Utils.LOG_WARNING("Generating OreDict Name: " + tempIngot);
+ Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ tempIngot = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot);
}
else {
- tempIngot = this.getUnlocalizedName();
+ tempIngot = getUnlocalizedName();
}
tempIngot = tempIngot.replace("itemDust", "ingot");
- Utils.LOG_WARNING("Generating OreDict Name: " + tempIngot);
- final ItemStack[] outputStacks = {
- this.dustInfo.getDust(1)
- };
- if (tempIngot != null && tempIngot != "") {
+ Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot);
+ ItemStack[] outputStacks = {dustInfo.getDust(1)};
+ if (tempIngot != null && tempIngot != ""){
tempInputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1);
tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempDust, 1);
ItemStack tempStackOutput2 = null;
- final int chance = this.mTier * 10 / MathUtils.randInt(10, 20);
- if (outputStacks.length != 0) {
- if (outputStacks.length == 1) {
+ int chance = mTier*10/MathUtils.randInt(10, 20);
+ if (outputStacks.length != 0){
+ if (outputStacks.length == 1){
tempStackOutput2 = null;
}
else {
- if (!outputStacks[1].getUnlocalizedName().toLowerCase().contains("aaa_broken")) {
+ if (!outputStacks[1].getUnlocalizedName().toLowerCase().contains("aaa_broken")){
tempStackOutput2 = outputStacks[1];
tempOutputStack = outputStacks[0];
}
else {
tempStackOutput2 = null;
}
- }
+ }
}
else {
tempStackOutput2 = null;
}
- if (null != tempOutputStack && null != tempInputStack) {
- GT_ModHandler.addPulverisationRecipe(tempInputStack, tempOutputStack.splitStack(1), tempStackOutput2,
- chance);
+ if (null != tempOutputStack && null != tempInputStack){
+ GT_ModHandler.addPulverisationRecipe(tempInputStack, tempOutputStack.splitStack(1), tempStackOutput2, chance);
}
}
}
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0) {
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colour;
+ private void addFurnaceRecipe(){
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack iStack) {
-
- if (this.getUnlocalizedName().contains("DustTiny")) {
- this.name = "Tiny Pile of " + this.materialName + " Dust";
- }
- else if (this.getUnlocalizedName().contains("DustSmall")) {
- this.name = "Small Pile of " + this.materialName + " Dust";
+ String temp = "";
+ if (getUnlocalizedName().contains("item.")){
+ temp = getUnlocalizedName().replace("item.", "");
}
else {
- this.name = this.materialName + " Dust";
+ temp = getUnlocalizedName();
}
- return this.name;
- }
+ if (temp.contains("DustTiny") || temp.contains("DustSmall")){
+ return;
+ }
+ temp = temp.replace("itemDust", "ingot");
+ if (temp != null && temp != ""){
- public final String getMaterialName() {
- return this.materialName;
+ if (dustInfo.requiresBlastFurnace()){
+ Utils.LOG_WARNING("Adding recipe for Hot "+materialName+" Ingots in a Blast furnace.");
+ String tempIngot = temp.replace("ingot", "ingotHot");
+ ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot);
+ if (null != tempOutputStack){
+ addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*mTier);
+ }
+ return;
+ }
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Ingots in a furnace.");
+ ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1);
+ Utils.LOG_WARNING("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp);
+ if (null != tempOutputStack){
+ if (mTier < 5 || !dustInfo.requiresBlastFurnace()){
+ if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(ItemUtils.getSimpleStack(this), tempOutputStack)){
+ Utils.LOG_WARNING("Successfully added a furnace recipe for "+materialName);
+ }
+ else {
+ Utils.LOG_WARNING("Failed to add a furnace recipe for "+materialName);
+ }
+ }
+ else if (mTier >= 5 || dustInfo.requiresBlastFurnace()){
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Ingots in a Blast furnace.");
+ Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName());
+ if (null != tempOutputStack){
+ addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*mTier);
+ }
+ return;
+ }
+ }
+
+ }
}
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
- final boolean p_77663_5_) {
- EntityUtils.applyRadiationDamageToEntity(this.sRadiation, world, entityHolding);
+ private void addBlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tempRequired){
+ //Special Cases
+ /*if (input1.getUnlocalizedName().toLowerCase().contains("tantalloy61")){
+ Utils.LOG_INFO("Adding Special handler for Staballoy-61 in the Blast Furnace");
+ input2 = UtilsItems.getItemStackOfAmountFromOreDict("dustTantalloy60", 2);
+ if (input2 == null){
+ Utils.LOG_INFO("invalid itemstack.");
+ }
+ else {
+ Utils.LOG_INFO("Found "+input2.getDisplayName());
+ }
+ }*/
+ GT_Values.RA.addBlastRecipe(
+ input1,
+ input2,
+ GT_Values.NF, GT_Values.NF,
+ output1,
+ output2,
+ 250*mTier*20,
+ mTier*64,
+ tempRequired);
+
+
+
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
index 7ab194ba49..a49dc58188 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
@@ -1,42 +1,42 @@
package gtPlusPlus.core.item.base.dusts;
+import gtPlusPlus.core.lib.CORE;
+
import java.util.List;
-import cpw.mods.fml.common.registry.GameRegistry;
-import gtPlusPlus.core.lib.CORE;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import cpw.mods.fml.common.registry.GameRegistry;
-public abstract class BaseItemDustAbstract extends Item {
-
- protected int colour = 0;
- protected String materialName;
- protected String pileType;
-
- public BaseItemDustAbstract(final String unlocalizedName, final String materialName, final int colour,
- final String pileSize) {
+public abstract class BaseItemDustAbstract extends Item{
+
+ protected int colour = 0;
+ protected String materialName;
+ protected String pileType;
+
+ public BaseItemDustAbstract(String unlocalizedName, String materialName, int colour, String pileSize) {
this.setUnlocalizedName(unlocalizedName);
- this.setMaxStackSize(64);
- if (pileSize == "dust" || pileSize == "Dust") {
- this.setTextureName(CORE.MODID + ":" + "dust");
+ this.setMaxStackSize(64);
+ if (pileSize == "dust" || pileSize == "Dust"){
+ this.setTextureName(CORE.MODID + ":" + "dust");
}
- else {
- this.setTextureName(CORE.MODID + ":" + "dust" + pileSize);
+ else{
+ this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);
}
this.setMaxStackSize(64);
this.colour = colour;
- this.materialName = materialName;
- this.setUnlocalizedName(unlocalizedName);
+ this.materialName = materialName;
+ setUnlocalizedName(unlocalizedName);
GameRegistry.registerItem(this, unlocalizedName);
}
@Override
public abstract void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool);
- @Override
- public abstract int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF);
-
public abstract String getMaterialName();
+ @Override
+ public abstract int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF);
+
}
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
index 24b721ff0e..d5dd78a49b 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
@@ -1,127 +1,121 @@
package gtPlusPlus.core.item.base.dusts;
-import java.util.List;
-
-import cpw.mods.fml.common.registry.GameRegistry;
+import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc;
import gregtech.api.util.GT_OreDictUnificator;
-import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.entity.EntityUtils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class BaseItemDustUnique extends Item {
+public class BaseItemDustUnique extends Item{
- protected int colour;
- protected String materialName;
- protected String pileType;
- String name = "";
+ protected int colour;
+ protected String materialName;
+ protected String pileType;
+ String name = "";
- protected final int sRadiation;
-
- public BaseItemDustUnique(final String unlocalizedName, final String materialName, final int colour,
- final String pileSize) {
- this.setUnlocalizedName(unlocalizedName);
+ public BaseItemDustUnique(String unlocalizedName, String materialName, int colour, String pileSize) {
+ setUnlocalizedName(unlocalizedName);
this.setUnlocalizedName(unlocalizedName);
- this.setMaxStackSize(64);
- if (pileSize == "dust" || pileSize == "Dust") {
- this.setTextureName(CORE.MODID + ":" + "dust");
- }
- else {
- this.setTextureName(CORE.MODID + ":" + "dust" + pileSize);
- }
- this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setMaxStackSize(64);
+ if (pileSize == "dust" || pileSize == "Dust"){
+ this.setTextureName(CORE.MODID + ":" + "dust");}
+ else{
+ this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);}
+ this.setCreativeTab(tabMisc);
this.colour = colour;
this.materialName = materialName;
this.sRadiation = ItemUtils.getRadioactivityLevel(materialName);
GameRegistry.registerItem(this, unlocalizedName);
String temp = "";
- Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: " + this.getUnlocalizedName());
- if (this.getUnlocalizedName().contains("item.")) {
- temp = this.getUnlocalizedName().replace("item.", "");
- Utils.LOG_WARNING("Generating OreDict Name: " + temp);
+ Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ temp = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
else {
- temp = this.getUnlocalizedName();
+ temp = getUnlocalizedName();
}
- if (temp.contains("DustTiny")) {
+ if (temp.contains("DustTiny")){
temp = temp.replace("itemD", "d");
- Utils.LOG_WARNING("Generating OreDict Name: " + temp);
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
- else if (temp.contains("DustSmall")) {
+ else if (temp.contains("DustSmall")){
temp = temp.replace("itemD", "d");
- Utils.LOG_WARNING("Generating OreDict Name: " + temp);
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
else {
temp = temp.replace("itemD", "d");
- Utils.LOG_WARNING("Generating OreDict Name: " + temp);
- }
- if (temp != null && temp != "") {
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ if (temp != null && temp != ""){
GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
}
}
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- // if (pileType != null && materialName != null && pileType != "" &&
- // materialName != "" && !pileType.equals("") &&
- // !materialName.equals("")){
- if (this.getUnlocalizedName().contains("DustTiny")) {
- list.add(EnumChatFormatting.GRAY + "A tiny pile of " + this.materialName + " dust.");
+ public String getItemStackDisplayName(ItemStack iStack) {
+
+ if (getUnlocalizedName().contains("DustTiny")){
+ name = "Tiny Pile of "+materialName + " Dust";
}
- else if (this.getUnlocalizedName().contains("DustSmall")) {
- list.add(EnumChatFormatting.GRAY + "A small pile of " + this.materialName + " dust.");
+ else if (getUnlocalizedName().contains("DustSmall")){
+ name = "Small Pile of "+materialName + " Dust";
}
else {
- list.add(EnumChatFormatting.GRAY + "A pile of " + this.materialName + " dust.");
+ name = materialName + " Dust";
}
- if (this.sRadiation > 0) {
- list.add(CORE.GT_Tooltip_Radioactive);
- }
- // }
- super.addInformation(stack, aPlayer, list, bool);
+ return name;
}
+ protected final int sRadiation;
@Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0) {
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colour;
-
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ EntityUtils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
}
@Override
- public String getItemStackDisplayName(final ItemStack iStack) {
-
- if (this.getUnlocalizedName().contains("DustTiny")) {
- this.name = "Tiny Pile of " + this.materialName + " Dust";
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ //if (pileType != null && materialName != null && pileType != "" && materialName != "" && !pileType.equals("") && !materialName.equals("")){
+ if (getUnlocalizedName().contains("DustTiny")){
+ list.add(EnumChatFormatting.GRAY+"A tiny pile of " + materialName + " dust.");
}
- else if (this.getUnlocalizedName().contains("DustSmall")) {
- this.name = "Small Pile of " + this.materialName + " Dust";
+ else if (getUnlocalizedName().contains("DustSmall")){
+ list.add(EnumChatFormatting.GRAY+"A small pile of " + materialName + " dust.");
}
else {
- this.name = this.materialName + " Dust";
+ list.add(EnumChatFormatting.GRAY+"A pile of " + materialName + " dust.");
+ }
+ if (sRadiation > 0){
+ list.add(CORE.GT_Tooltip_Radioactive);
}
- return this.name;
+ //}
+ super.addInformation(stack, aPlayer, list, bool);
}
public final String getMaterialName() {
- return this.materialName;
+ return materialName;
}
@Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
- final boolean p_77663_5_) {
- EntityUtils.applyRadiationDamageToEntity(this.sRadiation, world, entityHolding);
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java
index d60aff043f..0faa781fd9 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java
@@ -1,56 +1,56 @@
package gtPlusPlus.core.item.base.dusts.decimal;
-import java.util.List;
-
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
+
+import java.util.List;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class BaseItemCentidust extends Item {
+public class BaseItemCentidust extends Item{
- final Material dustMaterial;
- final String materialName;
- final String unlocalName;
+ final Material dustMaterial;
+ final String materialName;
+ final String unlocalName;
- public BaseItemCentidust(final Material material) {
+ public BaseItemCentidust(Material material) {
this.dustMaterial = material;
- this.unlocalName = "itemCentidust" + material.getUnlocalizedName();
+ this.unlocalName = "itemCentidust"+material.getUnlocalizedName();
this.materialName = material.getLocalizedName();
this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(this.unlocalName);
+ this.setUnlocalizedName(unlocalName);
this.setMaxStackSize(10);
- this.setTextureName(CORE.MODID + ":" + "itemCentidust"); // TODO
- GameRegistry.registerItem(this, this.unlocalName);
- // GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"),
- // UtilsItems.getSimpleStack(this)); //TODO
+ this.setTextureName(CORE.MODID + ":" + "itemCentidust"); //TODO
+ GameRegistry.registerItem(this, unlocalName);
+ //GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); //TODO
}
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.materialName != null && this.materialName != "" && !this.materialName.equals("")) {
- list.add(EnumChatFormatting.GRAY + "1% of a " + this.materialName + " dust pile.");
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return this.dustMaterial.getRgbAsHex();
+ return (materialName+ " Centidust");
}
@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return this.materialName + " Centidust";
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"1% of a " + materialName + " dust pile.");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
}
public final String getMaterialName() {
- return this.materialName;
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ return dustMaterial.getRgbAsHex();
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java
index 3b81d46de2..afb9eef473 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java
@@ -1,56 +1,56 @@
package gtPlusPlus.core.item.base.dusts.decimal;
-import java.util.List;
-
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
+
+import java.util.List;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class BaseItemDecidust extends Item {
+public class BaseItemDecidust extends Item{
- final Material dustMaterial;
- final String materialName;
- final String unlocalName;
+ final Material dustMaterial;
+ final String materialName;
+ final String unlocalName;
- public BaseItemDecidust(final Material material) {
+ public BaseItemDecidust(Material material) {
this.dustMaterial = material;
- this.unlocalName = "itemDecidust" + material.getUnlocalizedName();
+ this.unlocalName = "itemDecidust"+material.getUnlocalizedName();
this.materialName = material.getLocalizedName();
this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setUnlocalizedName(this.unlocalName);
+ this.setUnlocalizedName(unlocalName);
this.setMaxStackSize(10);
- this.setTextureName(CORE.MODID + ":" + "itemDecidust"); // TODO
- GameRegistry.registerItem(this, this.unlocalName);
- // GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"),
- // UtilsItems.getSimpleStack(this)); //TODO
+ this.setTextureName(CORE.MODID + ":" + "itemDecidust"); //TODO
+ GameRegistry.registerItem(this, unlocalName);
+ //GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this)); //TODO
}
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.materialName != null && this.materialName != "" && !this.materialName.equals("")) {
- list.add(EnumChatFormatting.GRAY + "10% of a " + this.materialName + " dust pile.");
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return this.dustMaterial.getRgbAsHex();
+ return (materialName+ " Decidust");
}
@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return this.materialName + " Decidust";
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"10% of a " + materialName + " dust pile.");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
}
public final String getMaterialName() {
- return this.materialName;
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ return dustMaterial.getRgbAsHex();
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemFood.java b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemFood.java
index ba97e34c08..7b0663d9cf 100644
--- a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemFood.java
+++ b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemFood.java
@@ -1,6 +1,5 @@
package gtPlusPlus.core.item.base.foods;
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import net.minecraft.entity.player.EntityPlayer;
@@ -8,14 +7,14 @@ import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
public class BaseItemFood extends ItemFood {
- private final PotionEffect[] effects;
- protected String localName;
+ private PotionEffect[] effects;
+ protected String localName;
- public BaseItemFood(final String unlocalizedName, final String localizedName, final int healAmount,
- final float saturationModifier, final boolean wolvesFavorite, final PotionEffect... effects) {
+ public BaseItemFood(String unlocalizedName, String localizedName, int healAmount, float saturationModifier, boolean wolvesFavorite, PotionEffect... effects) {
super(healAmount, saturationModifier, wolvesFavorite);
this.setUnlocalizedName(unlocalizedName);
this.setTextureName(CORE.MODID + ":" + unlocalizedName.replace("Hot", ""));
@@ -26,21 +25,23 @@ public class BaseItemFood extends ItemFood {
}
@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) {
+ super.onFoodEaten(stack, world, player);
- return "A Serving of " + this.localName;
+ for (int i = 0; i < effects.length; i ++) {
+ if (!world.isRemote && effects[i] != null && effects[i].getPotionID() > 0)
+ player.addPotionEffect(new PotionEffect(this.effects[i].getPotionID(),
+ this.effects[i].getDuration(), this.effects[i].getAmplifier(),
+ this.effects[i].getIsAmbient()
+ )
+ );
+ }
}
-
+
@Override
- protected void onFoodEaten(final ItemStack stack, final World world, final EntityPlayer player) {
- super.onFoodEaten(stack, world, player);
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
- for (int i = 0; i < this.effects.length; i++) {
- if (!world.isRemote && this.effects[i] != null && this.effects[i].getPotionID() > 0) {
- player.addPotionEffect(new PotionEffect(this.effects[i].getPotionID(), this.effects[i].getDuration(),
- this.effects[i].getAmplifier(), this.effects[i].getIsAmbient()));
- }
- }
+ return ("A Serving of "+localName);
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java
index d20cad018e..92b8c8c224 100644
--- a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java
+++ b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java
@@ -1,10 +1,11 @@
package gtPlusPlus.core.item.base.foods;
-import java.util.List;
-
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -13,16 +14,15 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-public class BaseItemHotFood extends BaseItemFood {
+public class BaseItemHotFood extends BaseItemFood{
- protected String materialName;
- protected String unlocalName;
- protected int cooldownTime;
- protected Item output;
+ protected String materialName;
+ protected String unlocalName;
+ protected int cooldownTime;
+ protected Item output;
- public BaseItemHotFood(final String unlocalizedName, final int healAmount, final float healSaturation,
- final String foodName, final int timeToCoolInSeconds, final Item cooledFood) {
- super(unlocalizedName, "Hot " + foodName, healAmount, healSaturation, false);
+ public BaseItemHotFood(String unlocalizedName, int healAmount, float healSaturation, String foodName, int timeToCoolInSeconds, Item cooledFood) {
+ super(unlocalizedName, "Hot "+foodName, healAmount, healSaturation, false);
this.unlocalName = unlocalizedName;
this.cooldownTime = timeToCoolInSeconds * 20;
this.materialName = foodName;
@@ -31,53 +31,48 @@ public class BaseItemHotFood extends BaseItemFood {
}
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.materialName != null && this.materialName != "" && !this.materialName.equals("")) {
- list.add(EnumChatFormatting.GRAY + "Warning: " + EnumChatFormatting.RED + "Very hot!"
- + EnumChatFormatting.GRAY + " Avoid direct handling..");
- list.add(EnumChatFormatting.GRAY + "This food has " + (this.cooldownTime - stack.getItemDamage()) / 20
- + " seconds left, until it is cool.");
- }
- super.addInformation(stack, aPlayer, list, bool);
+ public ItemStack onEaten(ItemStack iStack, World world, EntityPlayer player) {
+ return super.onEaten(iStack, world, player);
}
@Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- return Utils.rgbtoHexValue(230, 96, 96);
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ //Utils.LOG_INFO("Item Damage: "+iStack.getItemDamage()+" Max Damage: "+iStack.getMaxDamage());
+ if (!world.isRemote){
+ if(iStack.getItemDamage() == cooldownTime) {
+ if (entityHolding instanceof EntityPlayer){
+ Utils.LOG_INFO("Foods Done.");
+ ((EntityPlayer) entityHolding).inventory.addItemStackToInventory(ItemUtils.getSimpleStack(output));
+ ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
+ }
+ }else if(iStack.getItemDamage() < cooldownTime){
+ iStack.setItemDamage(iStack.getItemDamage() + 1);
+ }
+ if(MathUtils.divideXintoY(iStack.getItemDamage(), 150)){
+ entityHolding.attackEntityFrom(DamageSource.onFire, 1);
+ }
+
+ }
+ super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
}
- public final String getMaterialName() {
- return this.materialName;
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot!"+EnumChatFormatting.GRAY+" Avoid direct handling..");
+ list.add(EnumChatFormatting.GRAY+"This food has "+((cooldownTime-(int) stack.getItemDamage())/20)+" seconds left, until it is cool.");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
}
- @Override
- public ItemStack onEaten(final ItemStack iStack, final World world, final EntityPlayer player) {
- return super.onEaten(iStack, world, player);
+ public final String getMaterialName() {
+ return materialName;
}
@Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
- final boolean p_77663_5_) {
- // Utils.LOG_INFO("Item Damage: "+iStack.getItemDamage()+" Max Damage:
- // "+iStack.getMaxDamage());
- if (!world.isRemote) {
- if (iStack.getItemDamage() == this.cooldownTime) {
- if (entityHolding instanceof EntityPlayer) {
- Utils.LOG_INFO("Foods Done.");
- ((EntityPlayer) entityHolding).inventory
- .addItemStackToInventory(ItemUtils.getSimpleStack(this.output));
- ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
- }
- }
- else if (iStack.getItemDamage() < this.cooldownTime) {
- iStack.setItemDamage(iStack.getItemDamage() + 1);
- }
- if (MathUtils.divideXintoY(iStack.getItemDamage(), 150)) {
- entityHolding.attackEntityFrom(DamageSource.onFire, 1);
- }
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ return Utils.rgbtoHexValue(230, 96, 96);
- }
- super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java
index c74e90401f..7c4fe89568 100644
--- a/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java
+++ b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java
@@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.gears;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemGear extends BaseItemComponent {
+public class BaseItemGear extends BaseItemComponent{
- public BaseItemGear(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.GEAR);
+ public BaseItemGear(Material material) {
+ super(material, BaseItemComponent.ComponentTypes.GEAR);
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java
index a41fe9a0e9..9a0ef0d097 100644
--- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java
+++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.item.base.ingots;
-import java.util.List;
-
-import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.creative.AddToCreativeTab;
@@ -11,24 +8,25 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.entity.EntityUtils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class BaseItemIngot extends Item {
-
- protected int colour;
- protected String materialName;
- protected String unlocalName;
+public class BaseItemIngot extends Item{
- protected final int sRadiation;
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
- public BaseItemIngot(final String unlocalizedName, final String materialName, final int colour,
- final int sRadioactivity) {
- this.setUnlocalizedName(unlocalizedName);
+ public BaseItemIngot(String unlocalizedName, String materialName, int colour, int sRadioactivity) {
+ setUnlocalizedName(unlocalizedName);
this.setCreativeTab(AddToCreativeTab.tabMisc);
this.setUnlocalizedName(unlocalizedName);
this.unlocalName = unlocalizedName;
@@ -40,83 +38,82 @@ public class BaseItemIngot extends Item {
this.sRadiation = sRadioactivity;
GameRegistry.registerItem(this, unlocalizedName);
String temp = "";
- if (this.unlocalName.contains("itemIngot")) {
- temp = this.unlocalName.replace("itemI", "i");
+ if (unlocalName.contains("itemIngot")){
+ temp = unlocalName.replace("itemI", "i");
}
- else if (this.unlocalName.contains("itemHotIngot")) {
- temp = this.unlocalName.replace("itemHotIngot", "ingotHot");
+ else if (unlocalName.contains("itemHotIngot")){
+ temp = unlocalName.replace("itemHotIngot", "ingotHot");
}
- if (temp != null && temp != "") {
+ if (temp != null && temp != ""){
GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
- }
- this.generateCompressorRecipe();
+ }
+ generateCompressorRecipe();
}
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.materialName != null && this.materialName != "" && !this.materialName.equals("")
- && !this.unlocalName.contains("HotIngot")) {
- list.add(EnumChatFormatting.GRAY + "A solid ingot of " + this.materialName + ".");
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (materialName+ " Ingot");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("") && !unlocalName.contains("HotIngot")){
+ list.add(EnumChatFormatting.GRAY+"A solid ingot of " + materialName + ".");
}
- else if (this.materialName != null && this.materialName != "" && !this.materialName.equals("")
- && this.unlocalName.toLowerCase().contains("ingothot")) {
- list.add(EnumChatFormatting.GRAY + "Warning: " + EnumChatFormatting.RED + "Very hot! "
- + EnumChatFormatting.GRAY + " Avoid direct handling..");
+ else if (materialName != null && materialName != "" && !materialName.equals("") && unlocalName.toLowerCase().contains("ingothot")){
+ list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot! "+EnumChatFormatting.GRAY+" Avoid direct handling..");
}
- if (this.sRadiation > 0) {
+ if (sRadiation > 0){
list.add(CORE.GT_Tooltip_Radioactive);
- }
+ }
super.addInformation(stack, aPlayer, list, bool);
}
- private void generateCompressorRecipe() {
- if (this.unlocalName.contains("itemIngot")) {
- final ItemStack tempStack = ItemUtils.getSimpleStack(this, 9);
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ private void generateCompressorRecipe(){
+ if (unlocalName.contains("itemIngot")){
+ ItemStack tempStack = ItemUtils.getSimpleStack(this, 9);
ItemStack tempOutput = null;
- String temp = this.getUnlocalizedName().replace("item.itemIngot", "block");
- Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: " + this.getUnlocalizedName());
- if (this.getUnlocalizedName().contains("item.")) {
- temp = this.getUnlocalizedName().replace("item.", "");
- Utils.LOG_WARNING("Generating OreDict Name: " + temp);
+ String temp = getUnlocalizedName().replace("item.itemIngot", "block");
+ Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ temp = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
temp = temp.replace("itemIngot", "block");
- Utils.LOG_WARNING("Generating OreDict Name: " + temp);
- if (temp != null && temp != "") {
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ if (temp != null && temp != ""){
tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1);
- if (tempOutput != null) {
+ if (tempOutput != null){
GT_ModHandler.addCompressionRecipe(tempStack, tempOutput);
}
-
+
}
}
- else if (this.unlocalName.contains("itemHotIngot")) {
+ else if (unlocalName.contains("itemHotIngot")){
return;
}
+
}
+
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0) {
- return MathUtils.generateSingularRandomHexValue();
+ protected final int sRadiation;
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ EntityUtils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
}
- return this.colour;
-
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return this.materialName + " Ingot";
- }
-
- public final String getMaterialName() {
- return this.materialName;
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
- final boolean p_77663_5_) {
- EntityUtils.applyRadiationDamageToEntity(this.sRadiation, world, entityHolding);
- }
}
diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
index 5f43c513af..6b60e7f8d3 100644
--- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
+++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
@@ -1,11 +1,12 @@
package gtPlusPlus.core.item.base.ingots;
-import java.util.List;
-
import gregtech.api.enums.GT_Values;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -13,61 +14,60 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-public class BaseItemIngotHot extends BaseItemIngot {
+public class BaseItemIngotHot extends BaseItemIngot{
- private final ItemStack outputIngot;
- private int tickCounter = 0;
- private final int tickCounterMax = 200;
- private final int mTier;
+ private ItemStack outputIngot;
+ private int tickCounter = 0;
+ private int tickCounterMax = 200;
+ private int mTier;
- public BaseItemIngotHot(final String unlocalizedName, final String materialName, final ItemStack coldIngot,
- final int tier) {
+ public BaseItemIngotHot(String unlocalizedName, String materialName, ItemStack coldIngot, int tier) {
super(unlocalizedName, materialName, Utils.rgbtoHexValue(225, 225, 225), 0);
this.setTextureName(CORE.MODID + ":" + "itemIngotHot");
this.outputIngot = coldIngot;
this.mTier = tier;
- this.generateRecipe();
+ generateRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return ("Hot "+materialName+ " Ingot");
}
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.materialName != null && this.materialName != "" && !this.materialName.equals("")) {
- list.add(EnumChatFormatting.GRAY + "A " + EnumChatFormatting.RED + "burning hot" + EnumChatFormatting.GRAY
- + " ingot of " + this.materialName + ".");
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"A "+EnumChatFormatting.RED+"burning hot"+EnumChatFormatting.GRAY+" ingot of " + materialName + ".");
}
super.addInformation(stack, aPlayer, list, bool);
}
- private void generateRecipe() {
- Utils.LOG_WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of " + this.materialName + ".");
- GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getSimpleStack(this), this.outputIngot.copy(), 60 * this.mTier);
-
- }
-
@Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
return Utils.rgbtoHexValue(225, 225, 225);
}
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ private void generateRecipe(){
+ Utils.LOG_WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+materialName+".");
+ GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getSimpleStack(this), outputIngot.copy(), 60*mTier);
- return "Hot " + this.materialName + " Ingot";
- }
+
+ }
@Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
- final boolean p_77663_5_) {
- if (!world.isRemote) {
- if (this.tickCounter < this.tickCounterMax) {
- this.tickCounter++;
- }
- else if (this.tickCounter == this.tickCounterMax) {
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ if (!world.isRemote){
+ if(tickCounter < tickCounterMax){
+ tickCounter++;
+ }
+ else if(tickCounter == tickCounterMax){
entityHolding.attackEntityFrom(DamageSource.onFire, 1);
- this.tickCounter = 0;
+ tickCounter = 0;
}
super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
}
}
+
}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBase.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBase.java
index 1ad2ab0f24..488f9a6f60 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBase.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBase.java
@@ -7,15 +7,16 @@ import net.minecraft.item.ItemStack;
public class ItemBlockBase extends ItemBlock {
- public ItemBlockBase(final Block block) {
- super(block);
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack p_82790_1_, final int p_82790_2_) {
-
- return super.getColorFromItemStack(p_82790_1_, p_82790_2_);
- }
+ public ItemBlockBase(Block block) {
+ super(block);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ }
+ @Override
+ public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) {
+
+ return super.getColorFromItemStack(p_82790_1_, p_82790_2_);
+ }
+
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java
index 373305dc25..2e39a47f81 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java
@@ -1,82 +1,78 @@
package gtPlusPlus.core.item.base.itemblock;
-import java.util.List;
-
import gtPlusPlus.core.fluids.BlockFluidBase;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
-public class ItemBlockFluid extends ItemBlock {
+public class ItemBlockFluid extends ItemBlock{
- protected final int blockColour;
- protected final int sRadiation;
- protected Material thisFluid;
- final BlockFluidBase baseBlock;
- String name;
+ protected final int blockColour;
+ protected final int sRadiation;
+ protected Material thisFluid;
+ final BlockFluidBase baseBlock;
+ String name;
- public ItemBlockFluid(final Block block) {
+ public ItemBlockFluid(Block block) {
super(block);
this.baseBlock = (BlockFluidBase) block;
- this.blockColour = this.baseBlock.getRenderColor(1);
- this.thisFluid = this.baseBlock.getFluidMaterial();
- this.sRadiation = ItemUtils.getRadioactivityLevel(this.baseBlock.getUnlocalizedName());
- this.name = this.baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "")
- .replace("block", "").replace(".", "");
- // GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.",
- // "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_",
- // "").replace(" ", "").replace("FrameBox", ""),
- // UtilsItems.getSimpleStack(this));
+ this.blockColour = baseBlock.getRenderColor(1);
+ this.thisFluid = baseBlock.getFluidMaterial();
+ this.sRadiation=ItemUtils.getRadioactivityLevel(baseBlock.getUnlocalizedName());
+ this.name = baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", "");
+ //GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), UtilsItems.getSimpleStack(this));
+ }
+
+ public final Material setFluidMaterial(Material M){
+ return thisFluid=M;
}
+ public int getRenderColor(int aMeta) {
+ return blockColour;
+ }
+
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("Temperature: " + MathUtils.celsiusToKelvin(this.thisFluid.getMeltingPointC()) + "K");
- if (this.sRadiation > 0) {
- list.add(CORE.GT_Tooltip_Radioactive);
+ public String getItemStackDisplayName(ItemStack iStack) {
+ if (thisFluid != null){
+ this.name = "Molten "+thisFluid.getLocalizedName();
+ return name;
}
- super.addInformation(stack, aPlayer, list, bool);
+ this.name = "Molten "+baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", "");
+ return name;
}
-
+
@Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.blockColour == 0) {
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (blockColour == 0){
return MathUtils.generateSingularRandomHexValue();
}
- return this.blockColour;
+ return blockColour;
}
@Override
- public String getItemStackDisplayName(final ItemStack iStack) {
- if (this.thisFluid != null) {
- this.name = "Molten " + this.thisFluid.getLocalizedName();
- return this.name;
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add("Temperature: "+MathUtils.celsiusToKelvin(thisFluid.getMeltingPointC())+"K");
+ if (sRadiation > 0){
+ list.add(CORE.GT_Tooltip_Radioactive);
}
- this.name = "Molten " + this.baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "")
- .replace("name", "").replace("block", "").replace(".", "");
- return this.name;
+ super.addInformation(stack, aPlayer, list, bool);
}
public String GetProperName() {
- String tempIngot;
+ String tempIngot;
- tempIngot = "Molten " + this.baseBlock.getLocalizedName();
+ tempIngot = "Molten "+baseBlock.getLocalizedName();
return tempIngot;
}
- public int getRenderColor(final int aMeta) {
- return this.blockColour;
- }
-
- public final Material setFluidMaterial(final Material M) {
- return this.thisFluid = M;
- }
-
}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
index 2fe88ff3c2..8bf5346084 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
@@ -1,12 +1,13 @@
package gtPlusPlus.core.item.base.itemblock;
-import java.util.List;
-
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.block.base.BlockBaseModular;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.entity.EntityUtils;
import gtPlusPlus.core.util.item.ItemUtils;
+
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -14,45 +15,39 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-public class ItemBlockGtBlock extends ItemBlock {
-
- protected final int blockColour;
- protected final int sRadiation;
+public class ItemBlockGtBlock extends ItemBlock{
- public ItemBlockGtBlock(final Block block) {
+ protected final int blockColour;
+ protected final int sRadiation;
+
+ public ItemBlockGtBlock(Block block) {
super(block);
- final BlockBaseModular baseBlock = (BlockBaseModular) block;
+ BlockBaseModular baseBlock = (BlockBaseModular) block;
this.blockColour = baseBlock.getRenderColor(0);
- if (block.getLocalizedName().toLowerCase().contains("uranium")
- || block.getLocalizedName().toLowerCase().contains("plutonium")
- || block.getLocalizedName().toLowerCase().contains("thorium")) {
- this.sRadiation = 2;
+ if (block.getLocalizedName().toLowerCase().contains("uranium") || block.getLocalizedName().toLowerCase().contains("plutonium") || block.getLocalizedName().toLowerCase().contains("thorium")){
+ sRadiation = 2;
}
else {
- this.sRadiation = 0;
+ sRadiation = 0;
}
- GT_OreDictUnificator.registerOre(
- "block" + block.getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "")
- .replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""),
- ItemUtils.getSimpleStack(this));
+ GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "").replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""), ItemUtils.getSimpleStack(this));
}
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- if (this.sRadiation > 0) {
- list.add(CORE.GT_Tooltip_Radioactive);
- }
+ public int getRenderColor(int aMeta) {
+ return blockColour;
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (sRadiation > 0){
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
super.addInformation(stack, aPlayer, list, bool);
}
-
- public int getRenderColor(final int aMeta) {
- return this.blockColour;
- }
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
- final boolean p_77663_5_) {
- EntityUtils.applyRadiationDamageToEntity(this.sRadiation, world, entityHolding);
- }
+
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ EntityUtils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
+ }
}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java
index 6151e4818d..9d442e3102 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java
@@ -6,22 +6,19 @@ import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
-public class ItemBlockGtFrameBox extends ItemBlock {
+public class ItemBlockGtFrameBox extends ItemBlock{
protected int blockColour;
-
- public ItemBlockGtFrameBox(final Block block) {
+
+ public ItemBlockGtFrameBox(Block block) {
super(block);
- final BlockBaseModular baseBlock = (BlockBaseModular) block;
+ BlockBaseModular baseBlock = (BlockBaseModular) block;
this.blockColour = baseBlock.getRenderColor(1);
- GT_OreDictUnificator.registerOre(
- "frameGt" + block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "")
- .replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""),
- ItemUtils.getSimpleStack(this));
+ GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), ItemUtils.getSimpleStack(this));
}
- public int getRenderColor(final int aMeta) {
- return this.blockColour;
- }
+ public int getRenderColor(int aMeta) {
+ return blockColour;
+ }
}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockTileEntity.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockTileEntity.java
index 6436012e4d..73fcbc2ab6 100644
--- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockTileEntity.java
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockTileEntity.java
@@ -9,35 +9,35 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-public class ItemBlockTileEntity extends ItemBlock {
+public class ItemBlockTileEntity extends ItemBlock{
String[] description;
-
- public ItemBlockTileEntity(final Block block) {
+
+ public ItemBlockTileEntity(Block block) {
super(block);
}
-
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- for (int i = 0; i < this.description.length; i++) {
- if (!this.description[i].equals("")) {
- list.add(this.description[i]);
- }
- }
-
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ for (int i =0; i< this.description.length; i++){
+ if (!this.description[i].equals("")){
+ list.add(this.description[i]);
+ }
+ }
+
+
super.addInformation(stack, aPlayer, list, bool);
}
-
- @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_,
- final boolean p_77663_5_) {
-
- }
-
- public void setDecription(final String[] description) {
- for (int i = 0; i < description.length; i++) {
- this.description[i] = description[i];
+
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+
}
- }
+
+ public void setDecription(String[] description){
+ for (int i =0; i< description.length; i++){
+ this.description[i] = description[i];
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java b/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java
index 5e20f3c714..d4f7ac02a6 100644
--- a/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java
+++ b/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java
@@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.nugget;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemNugget extends BaseItemComponent {
+public class BaseItemNugget extends BaseItemComponent{
- public BaseItemNugget(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.NUGGET);
+ public BaseItemNugget(Material material) {
+ super(material, BaseItemComponent.ComponentTypes.NUGGET);
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java
index a2b4ce4d28..3d1153eb6a 100644
--- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java
+++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java
@@ -4,17 +4,16 @@ import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.materials.MaterialUtils;
-public class BaseItemPlate extends BaseItemComponent {
+public class BaseItemPlate extends BaseItemComponent{
- public BaseItemPlate(final Material material) {
+ public BaseItemPlate(Material material) {
super(material, BaseItemComponent.ComponentTypes.PLATE);
}
-
- public BaseItemPlate(final String unlocalizedName, final String materialName, final short[] colour, final int tier,
- final int sRadioactivity) {
- this(MaterialUtils.generateQuickMaterial(materialName, new short[] {
- colour[0], colour[1], colour[2], 0
- }, sRadioactivity));
+
+ public BaseItemPlate(String unlocalizedName, String materialName, short[] colour, int tier, int sRadioactivity) {
+ this(MaterialUtils.generateQuickMaterial(materialName, new short[]{colour[0], colour[1], colour[2], 0}, sRadioactivity));
}
+
+
}
diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java
index 41b067d3fd..ce8bbe8191 100644
--- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java
+++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java
@@ -4,15 +4,15 @@ import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
import net.minecraft.item.ItemStack;
-public class BaseItemPlateDouble extends BaseItemComponent {
+public class BaseItemPlateDouble extends BaseItemComponent{
- public BaseItemPlateDouble(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.PLATEDOUBLE);
+ public BaseItemPlateDouble(Material material) {
+ super(material, BaseItemComponent.ComponentTypes.PLATEDOUBLE);
this.setMaxStackSize(32);
}
@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return "Double " + this.materialName + " Plate";
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+ return ("Double "+materialName+ " Plate");
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java
index 436b1809fc..6ad3509876 100644
--- a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java
+++ b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java
@@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.rings;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemRing extends BaseItemComponent {
+public class BaseItemRing extends BaseItemComponent{
- public BaseItemRing(final Material material) {
+ public BaseItemRing(Material material) {
super(material, BaseItemComponent.ComponentTypes.RING);
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java
index b1eb28f4d5..2e4acd6ccb 100644
--- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java
+++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java
@@ -6,21 +6,26 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import net.minecraft.item.ItemStack;
-public class BaseItemRod extends BaseItemComponent {
+public class BaseItemRod extends BaseItemComponent{
- public BaseItemRod(final Material material) {
- super(material, BaseItemComponent.ComponentTypes.ROD);
- this.addExtruderRecipe();
+ public BaseItemRod(Material material) {
+ super(material, BaseItemComponent.ComponentTypes.ROD);
+ addExtruderRecipe();
}
- private void addExtruderRecipe() {
- Utils.LOG_WARNING("Adding cutter recipe for " + this.materialName + " Rods");
- final ItemStack stackStick = this.componentMaterial.getRod(1);
- final ItemStack stackBolt = this.componentMaterial.getBolt(4);
+ private void addExtruderRecipe(){
+ Utils.LOG_WARNING("Adding cutter recipe for "+materialName+" Rods");
- GT_Values.RA.addCutterRecipe(stackStick, stackBolt, null,
- (int) Math.max(this.componentMaterial.getMass() * 2L, 1L), 4);
+ ItemStack stackStick = componentMaterial.getRod(1);
+ ItemStack stackBolt = componentMaterial.getBolt(4);
+
+ GT_Values.RA.addCutterRecipe(
+ stackStick,
+ stackBolt,
+ null,
+ (int) Math.max(componentMaterial.getMass() * 2L, 1L),
+ 4);
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java
index df69bf5a8d..882dc8b2bf 100644
--- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java
+++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java
@@ -7,32 +7,41 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.item.ItemStack;
-public class BaseItemRodLong extends BaseItemComponent {
+public class BaseItemRodLong extends BaseItemComponent{
- public BaseItemRodLong(final Material material) {
+ public BaseItemRodLong(Material material) {
super(material, BaseItemComponent.ComponentTypes.RODLONG);
- this.addExtruderRecipe();
+ addExtruderRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+ return ("Long "+materialName+ " Rod");
}
- private void addExtruderRecipe() {
- Utils.LOG_WARNING("Adding recipe for Long " + this.materialName + " Rods");
+ private void addExtruderRecipe(){
+ Utils.LOG_WARNING("Adding recipe for Long "+materialName+" Rods");
- final String tempStick = this.unlocalName.replace("itemRodLong", "stick");
- final String tempStickLong = this.unlocalName.replace("itemRodLong", "stickLong");
- final ItemStack stackStick = ItemUtils.getItemStackOfAmountFromOreDict(tempStick, 1);
- final ItemStack stackLong = ItemUtils.getItemStackOfAmountFromOreDict(tempStickLong, 1);
+ String tempStick = unlocalName.replace("itemRodLong", "stick");
+ String tempStickLong = unlocalName.replace("itemRodLong", "stickLong");
+ ItemStack stackStick = ItemUtils.getItemStackOfAmountFromOreDict(tempStick, 1);
+ ItemStack stackLong = ItemUtils.getItemStackOfAmountFromOreDict(tempStickLong, 1);
- final ItemStack temp = stackStick;
+ ItemStack temp = stackStick;
temp.stackSize = 2;
- GT_Values.RA.addForgeHammerRecipe(temp, stackLong, (int) Math.max(this.componentMaterial.getMass(), 1L), 16);
-
- GT_Values.RA.addCutterRecipe(stackLong, temp, null, (int) Math.max(this.componentMaterial.getMass(), 1L), 4);
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return "Long " + this.materialName + " Rod";
+ GT_Values.RA.addForgeHammerRecipe(
+ temp,
+ stackLong,
+ (int) Math.max(componentMaterial.getMass(), 1L),
+ 16);
+
+ GT_Values.RA.addCutterRecipe(
+ stackLong,
+ temp,
+ null,
+ (int) Math.max(componentMaterial.getMass(), 1L),
+ 4);
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java b/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java
index 46270623c9..f993cc64b2 100644
--- a/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java
+++ b/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java
@@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.rotors;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.material.Material;
-public class BaseItemRotor extends BaseItemComponent {
+public class BaseItemRotor extends BaseItemComponent{
- public BaseItemRotor(final Material material) {
+ public BaseItemRotor(Material material) {
super(material, BaseItemComponent.ComponentTypes.ROTOR);
}
}
diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java
index 11b365d1e3..93aa5b7526 100644
--- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java
+++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java
@@ -7,21 +7,24 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.item.ItemStack;
-public class BaseItemScrew extends BaseItemComponent {
+public class BaseItemScrew extends BaseItemComponent{
- public BaseItemScrew(final Material material) {
+ public BaseItemScrew(Material material) {
super(material, BaseItemComponent.ComponentTypes.SCREW);
- this.addLatheRecipe();
+ addLatheRecipe();
}
- private void addLatheRecipe() {
- Utils.LOG_WARNING("Adding recipe for " + this.materialName + " Screws");
- final ItemStack boltStack = ItemUtils
- .getItemStackOfAmountFromOreDict(this.unlocalName.replace("itemScrew", "bolt"), 1);
- if (null != boltStack) {
- GT_Values.RA.addLatheRecipe(boltStack, ItemUtils.getSimpleStack(this), null,
- (int) Math.max(this.componentMaterial.getMass() / 8L, 1L), 4);
- }
+ private void addLatheRecipe(){
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Screws");
+ ItemStack boltStack = ItemUtils.getItemStackOfAmountFromOreDict(unlocalName.replace("itemScrew", "bolt"), 1);
+ if (null != boltStack){
+ GT_Values.RA.addLatheRecipe(
+ boltStack,
+ ItemUtils.getSimpleStack(this),
+ null,
+ (int) Math.max(componentMaterial.getMass() / 8L, 1L),
+ 4);
+ }
}
}
diff --git a/src/Java/gtPlusPlus/core/item/effects/RarityEffect.java b/src/Java/gtPlusPlus/core/item/effects/RarityEffect.java
index 16fe9bf2bf..cd5149b622 100644
--- a/src/Java/gtPlusPlus/core/item/effects/RarityEffect.java
+++ b/src/Java/gtPlusPlus/core/item/effects/RarityEffect.java
@@ -1,12 +1,14 @@
package gtPlusPlus.core.item.effects;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.*;
/*
- *
+ *
This determines the name colour. EnumRarity can be:
EnumRarity.common - the standard white colour.
EnumRarity.uncommon - a yellow colour.
@@ -15,25 +17,25 @@ EnumRarity.epic - the purple colour used on the Golden Apple.
@SideOnly is an FML annotation. It marks the method below it for existing only on one side. Possible values are:
Side.CLIENT is probably the most common one. This marks the method as existing only on the client side.
Side.SERVER marks the method as existing only on the server side.
- *
+ *
*/
public class RarityEffect extends Item {
- public RarityEffect(final int par1) {
+ public RarityEffect(int par1){
super();
this.setCreativeTab(CreativeTabs.tabMaterials);
}
-
+
@Override
@SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ public EnumRarity getRarity(ItemStack par1ItemStack){
return EnumRarity.common;
}
-
+
@Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
+ public boolean hasEffect(ItemStack par1ItemStack){
return true;
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/item/effects/RarityEpic.java b/src/Java/gtPlusPlus/core/item/effects/RarityEpic.java
index 6e313e21e4..35c5527d16 100644
--- a/src/Java/gtPlusPlus/core/item/effects/RarityEpic.java
+++ b/src/Java/gtPlusPlus/core/item/effects/RarityEpic.java
@@ -1,26 +1,28 @@
package gtPlusPlus.core.item.effects;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.*;
public class RarityEpic extends Item {
- public RarityEpic(final int par1) {
+ public RarityEpic(int par1){
super();
this.setCreativeTab(CreativeTabs.tabMaterials);
}
-
+
@Override
@SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ public EnumRarity getRarity(ItemStack par1ItemStack){
return EnumRarity.epic;
}
-
+
@Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
+ public boolean hasEffect(ItemStack par1ItemStack){
return true;
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/item/effects/RarityRare.java b/src/Java/gtPlusPlus/core/item/effects/RarityRare.java
index acff879d90..c64accb7aa 100644
--- a/src/Java/gtPlusPlus/core/item/effects/RarityRare.java
+++ b/src/Java/gtPlusPlus/core/item/effects/RarityRare.java
@@ -1,26 +1,28 @@
package gtPlusPlus.core.item.effects;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.*;
public class RarityRare extends Item {
- public RarityRare(final int par1) {
+ public RarityRare(int par1){
super();
this.setCreativeTab(CreativeTabs.tabMaterials);
}
-
+
@Override
@SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ public EnumRarity getRarity(ItemStack par1ItemStack){
return EnumRarity.rare;
}
-
+
@Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
+ public boolean hasEffect(ItemStack par1ItemStack){
return true;
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/item/effects/RarityUncommon.java b/src/Java/gtPlusPlus/core/item/effects/RarityUncommon.java
index c2d78767c3..398217a24a 100644
--- a/src/Java/gtPlusPlus/core/item/effects/RarityUncommon.java
+++ b/src/Java/gtPlusPlus/core/item/effects/RarityUncommon.java
@@ -1,20 +1,22 @@
package gtPlusPlus.core.item.effects;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.item.*;
public class RarityUncommon extends Item {
-
+
@Override
@SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ public EnumRarity getRarity(ItemStack par1ItemStack){
return EnumRarity.uncommon;
}
-
+
@Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
+ public boolean hasEffect(ItemStack par1ItemStack){
return true;
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/item/general/BedLocator_Base.java b/src/Java/gtPlusPlus/core/item/general/BedLocator_Base.java
index fe93fdf70e..5a05ac7655 100644
--- a/src/Java/gtPlusPlus/core/item/general/BedLocator_Base.java
+++ b/src/Java/gtPlusPlus/core/item/general/BedLocator_Base.java
@@ -1,9 +1,10 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -12,91 +13,95 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-public class BedLocator_Base extends Item {
-
- public int bed_X = 0;
- public int bed_Y = 0;
- public int bed_Z = 0;
+public class BedLocator_Base extends Item{
- public BedLocator_Base(final String unlocalizedName) {
+ public int bed_X = 0;
+ public int bed_Y = 0;
+ public int bed_Z = 0;
+
+ public BedLocator_Base(String unlocalizedName) {
this.setUnlocalizedName(unlocalizedName);
this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
+ this.setMaxStackSize(1);
this.setCreativeTab(AddToCreativeTab.tabMachines);
}
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
- int NBT_X = this.bed_X;
- int NBT_Y = this.bed_Y;
- int NBT_Z = this.bed_Z;
+
+ int NBT_X = bed_X;
+ int NBT_Y = bed_Y;
+ int NBT_Z = bed_Z;
+
if (stack.stackTagCompound != null) {
NBT_X = stack.stackTagCompound.getInteger("pos_x");
NBT_Y = stack.stackTagCompound.getInteger("pos_y");
NBT_Z = stack.stackTagCompound.getInteger("pos_z");
- final String tempX = String.valueOf(NBT_X);
- final String tempY = String.valueOf(NBT_Y);
- final String tempZ = String.valueOf(NBT_Z);
- final String formattedX = EnumChatFormatting.DARK_RED + tempX + EnumChatFormatting.GRAY;
- final String formattedY = EnumChatFormatting.RED + tempY + EnumChatFormatting.GRAY;
- final String formattedZ = EnumChatFormatting.RED + tempZ + EnumChatFormatting.GRAY;
-
- list.add(EnumChatFormatting.GRAY + "X: " + formattedX + ".");
- list.add(EnumChatFormatting.GRAY + "Y: " + formattedY + ".");
- list.add(EnumChatFormatting.GRAY + "Z: " + formattedZ + ".");
- super.addInformation(stack, aPlayer, list, bool);
- }
+ String tempX = String.valueOf(NBT_X);
+ String tempY = String.valueOf(NBT_Y);
+ String tempZ = String.valueOf(NBT_Z);
+ String formattedX = EnumChatFormatting.DARK_RED+tempX+EnumChatFormatting.GRAY;
+ String formattedY = EnumChatFormatting.RED+tempY+EnumChatFormatting.GRAY;
+ String formattedZ = EnumChatFormatting.RED+tempZ+EnumChatFormatting.GRAY;
+
+ list.add(EnumChatFormatting.GRAY+"X: "+formattedX+".");
+ list.add(EnumChatFormatting.GRAY+"Y: "+formattedY+".");
+ list.add(EnumChatFormatting.GRAY+"Z: "+formattedZ+".");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
}
- // Ticking and NBT Handling
- /*
- * Called each tick as long the item is on a player inventory. Uses by maps
- * to check if is on a player hand and update it's contents.
- *
- * public int fuelRemaining = 0; public int maximumFuel = 0; public String
- * fuelType = ""; public float heat = 0; public float maxHeat = 5000;
+ //Ticking and NBT Handling
+ /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
+ * update it's contents.
*
+ * public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = 5000;
+ *
*/
@Override
- public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {
+ public void onCreated(ItemStack itemStack, World world, EntityPlayer player) {
itemStack.stackTagCompound = new NBTTagCompound();
this.bed_X = 0;
this.bed_Y = 0;
this.bed_Z = 0;
- itemStack.stackTagCompound.setInteger("pos_x", this.bed_X);
- itemStack.stackTagCompound.setInteger("pos_y", this.bed_Y);
- itemStack.stackTagCompound.setInteger("pos_z", this.bed_Z);
+ itemStack.stackTagCompound.setInteger("pos_x", bed_X);
+ itemStack.stackTagCompound.setInteger("pos_y", bed_Y);
+ itemStack.stackTagCompound.setInteger("pos_z", bed_Z);
}
@Override
- public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer par3Entity) {
+ public void onUpdate(ItemStack itemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
+
+
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer par3Entity) {
itemStack.stackTagCompound = new NBTTagCompound();
- if (par3Entity.getBedLocation() != null) {
- this.bed_X = par3Entity.getBedLocation().posX;
- this.bed_Y = par3Entity.getBedLocation().posY;
- this.bed_Z = par3Entity.getBedLocation().posZ;
+ if (par3Entity.getBedLocation() != null){
+ this.bed_X = par3Entity.getBedLocation().posX;
+ this.bed_Y = par3Entity.getBedLocation().posY;
+ this.bed_Z = par3Entity.getBedLocation().posZ;
}
else {
this.bed_X = 0;
this.bed_Y = 0;
this.bed_Z = 0;
}
- itemStack.stackTagCompound.setInteger("pos_x", this.bed_X);
- itemStack.stackTagCompound.setInteger("pos_y", this.bed_Y);
- itemStack.stackTagCompound.setInteger("pos_z", this.bed_Z);
+ itemStack.stackTagCompound.setInteger("pos_x", bed_X);
+ itemStack.stackTagCompound.setInteger("pos_y", bed_Y);
+ itemStack.stackTagCompound.setInteger("pos_z", bed_Z);
return super.onItemRightClick(itemStack, world, par3Entity);
}
- @Override
- public void onUpdate(final ItemStack itemStack, final World par2World, final Entity par3Entity, final int par4,
- final boolean par5) {
- }
}
diff --git a/src/Java/gtPlusPlus/core/item/general/BufferCore.java b/src/Java/gtPlusPlus/core/item/general/BufferCore.java
index 12d78b6f83..42f8c99c70 100644
--- a/src/Java/gtPlusPlus/core/item/general/BufferCore.java
+++ b/src/Java/gtPlusPlus/core/item/general/BufferCore.java
@@ -1,98 +1,98 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.base.BaseItemWithDamageValue;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class BufferCore extends BaseItemWithDamageValue {
-
+public class BufferCore extends BaseItemWithDamageValue{
+
public int coreTier = 0;
-
- public BufferCore(final String unlocalizedName, final int i) {
+
+ public BufferCore(String unlocalizedName, int i) {
super(unlocalizedName);
this.setTextureName(CORE.MODID + ":" + unlocalizedName);
this.setMaxStackSize(2);
this.coreTier = i;
}
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GRAY + "A key crafting component for making energy buffers.");
+ public String getItemStackDisplayName(ItemStack stack) {
+ return super.getItemStackDisplayName(stack)+" ["+CORE.VOLTAGES[this.coreTier-1]+"].";
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses()
+ {
+ return true;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.GRAY+"A key crafting component for making energy buffers.");
super.addInformation(stack, aPlayer, list, bool);
}
+ public final int getCoreTier() {
+ return coreTier;
+ }
+
@Override
- public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- // Figure Out Damage
- final String s = String.format("%X", HEX_OxFFFFFF);
- // Utils.LOG_INFO(s);
- // String rgb = Utils.hex2Rgb(s);
- // Utils.LOG_INFO(rgb);
- if (this.coreTier == 1) {
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ //Figure Out Damage
+ String s = String.format("%X", HEX_OxFFFFFF);
+ //Utils.LOG_INFO(s);
+ //String rgb = Utils.hex2Rgb(s);
+ //Utils.LOG_INFO(rgb);
+ if (coreTier == 1){
HEX_OxFFFFFF = 0x4d4d4d;
}
- else if (this.coreTier == 2) {
+ else if (coreTier == 2){
HEX_OxFFFFFF = 0x666666;
}
- else if (this.coreTier == 3) {
+ else if (coreTier == 3){
HEX_OxFFFFFF = 0x8c8c8c;
}
- else if (this.coreTier == 4) {
+ else if (coreTier == 4){
HEX_OxFFFFFF = 0xa6a6a6;
}
- else if (this.coreTier == 5) {
+ else if (coreTier == 5){
HEX_OxFFFFFF = 0xcccccc;
}
- else if (this.coreTier == 6) {
+ else if (coreTier == 6){
HEX_OxFFFFFF = 0xe6e6e6;
}
- else if (this.coreTier == 7) {
+ else if (coreTier == 7){
HEX_OxFFFFFF = 0xffffcc;
}
- else if (this.coreTier == 8) {
+ else if (coreTier == 8){
HEX_OxFFFFFF = 0xace600;
}
- else if (this.coreTier == 9) {
+ else if (coreTier == 9){
HEX_OxFFFFFF = 0xffff00;
}
- /*
- * else if (coreTier == 10){ HEX_OxFFFFFF = 0xff0000; }
- */
- else if (this.coreTier == 10) {
- HEX_OxFFFFFF = Utils.rgbtoHexValue(MathUtils.randInt(220, 250), MathUtils.randInt(221, 251),
- MathUtils.randInt(220, 250));
+ /*else if (coreTier == 10){
+ HEX_OxFFFFFF = 0xff0000;
+ }*/
+ else if (coreTier == 10){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(MathUtils.randInt(220, 250), MathUtils.randInt(221, 251), MathUtils.randInt(220, 250));
}
else {
HEX_OxFFFFFF = 0xffffff;
}
+
return HEX_OxFFFFFF;
}
-
- public final int getCoreTier() {
- return this.coreTier;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack stack) {
- return super.getItemStackDisplayName(stack) + " [" + CORE.VOLTAGES[this.coreTier - 1] + "].";
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
-
+
}
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
index 22bb194fde..3c8e09e9e5 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.interfaces.IItemBlueprint;
import gtPlusPlus.core.lib.CORE;
@@ -10,6 +7,9 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.player.PlayerUtils;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@@ -19,208 +19,97 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
-public class ItemBlueprint extends Item implements IItemBlueprint {
+public class ItemBlueprint extends Item implements IItemBlueprint{
- public ItemBlueprint(final String unlocalizedName) {
+ public ItemBlueprint(String unlocalizedName) {
this.setUnlocalizedName(unlocalizedName);
this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
+ this.setMaxStackSize(1);
this.setCreativeTab(AddToCreativeTab.tabMachines);
- // this.bpID = MathUtils.randInt(0, 1000);
+ //this.bpID = MathUtils.randInt(0, 1000);
GameRegistry.registerItem(this, unlocalizedName);
}
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
- public void addInformation(final ItemStack itemStack, final EntityPlayer aPlayer, final List list,
- final boolean bool) {
- // Create some NBT if it's not there, otherwise this does nothing.
- if (!itemStack.hasTagCompound()) {
- this.createNBT(itemStack);
+ public void addInformation(ItemStack itemStack, EntityPlayer aPlayer, List list, boolean bool) {
+ //Create some NBT if it's not there, otherwise this does nothing.
+ if (!itemStack.hasTagCompound()){
+ createNBT(itemStack);
}
- // Set up some default variables.
+ //Set up some default variables.
int id = -1;
String name = "";
boolean blueprint = false;
- // Get proper display vars from NBT if it's there
- if (itemStack.hasTagCompound()) {
- // Utils.LOG_WARNING("Found TagCompound");
- id = (int) this.getNBT(itemStack, "mID");
- name = (String) this.getNBT(itemStack, "mName");
- blueprint = (boolean) this.getNBT(itemStack, "mBlueprint");
+ //Get proper display vars from NBT if it's there
+ if (itemStack.hasTagCompound()){
+ //Utils.LOG_WARNING("Found TagCompound");
+ id = (int) getNBT(itemStack, "mID");
+ name = (String) getNBT(itemStack, "mName");
+ blueprint = (boolean) getNBT(itemStack, "mBlueprint");
}
- // Write to tooltip list for each viable setting.
+ //Write to tooltip list for each viable setting.
if (itemStack.hasTagCompound()) {
- if (id != -1) {
- list.add(EnumChatFormatting.GRAY + "Technical Document No. " + id);
+ if (id != -1){
+ list.add(EnumChatFormatting.GRAY+"Technical Document No. "+id);
}
- if (blueprint) {
- list.add(EnumChatFormatting.BLUE + "Currently holding a blueprint for " + name);
+ if(blueprint){
+ list.add(EnumChatFormatting.BLUE+"Currently holding a blueprint for "+name);
}
else {
- list.add(EnumChatFormatting.RED + "Currently not holding a blueprint for anything.");
+ list.add(EnumChatFormatting.RED+"Currently not holding a blueprint for anything.");
}
- }
+ }
else {
- list.add(EnumChatFormatting.RED + "Currently not holding a blueprint for anything.");
+ list.add(EnumChatFormatting.RED+"Currently not holding a blueprint for anything.");
}
super.addInformation(itemStack, aPlayer, list, bool);
}
- public boolean createNBT(final ItemStack itemStack) {
- if (itemStack.hasTagCompound()) {
- if (!itemStack.stackTagCompound.getBoolean("mBlueprint")
- && !itemStack.stackTagCompound.getString("mName").equals("")) {
- // No Blueprint and no name Set
- Utils.LOG_WARNING("No Blueprint and no name Set");
- return false;
- }
- else if (itemStack.stackTagCompound.getBoolean("mBlueprint")
- && !itemStack.stackTagCompound.getString("mName").equals("")) {
- // Has Blueprint but invalid name set
- Utils.LOG_WARNING("Has Blueprint but invalid name set");
- // itemStack.stackTagCompound = null;
- // createNBT(itemStack);
- return false;
- }
- else if (!itemStack.stackTagCompound.getBoolean("mBlueprint")
- && itemStack.stackTagCompound.getString("mName").equals("")) {
- // Has no Blueprint, but strangely has a name
- Utils.LOG_WARNING("Has no Blueprint, but strangely has a name");
- // itemStack.stackTagCompound = null;
- // createNBT(itemStack);
- return false;
- }
- return false;
- }
- else if (!itemStack.hasTagCompound()) {
- final int bpID = MathUtils.randInt(0, 1000);
- final boolean hasRecipe = false;
- final String recipeName = "";
- Utils.LOG_WARNING("Creating Blueprint, setting up it's NBT data. " + bpID);
- itemStack.stackTagCompound = new NBTTagCompound();
- itemStack.stackTagCompound.setInteger("mID", bpID);
- itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
- itemStack.stackTagCompound.setString("mName", recipeName);
- return true;
- }
- else {
- final int bpID = MathUtils.randInt(0, 1000);
- final boolean hasRecipe = false;
- final String recipeName = "";
- Utils.LOG_WARNING("Creating a Blueprint, setting up it's NBT data. " + bpID);
- itemStack.stackTagCompound = new NBTTagCompound();
- itemStack.stackTagCompound.setInteger("mID", bpID);
- itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
- itemStack.stackTagCompound.setString("mName", recipeName);
- return true;
- }
- }
-
- @Override
- public ItemStack[] getBlueprint(final ItemStack stack) {
- ItemStack[] blueprint = new ItemStack[9];
- if (stack.hasTagCompound()) {
- blueprint = this.readItemsFromNBT(stack);
- }
- try {
- final ItemStack[] returnStack = new ItemStack[9];
- for (int o = 0; o < blueprint.length; o++) {
- returnStack[o] = blueprint[o];
- if (returnStack[0] != null) {
- returnStack[0].stackSize = 1;
- }
- }
- return returnStack;
- }
- catch (final Throwable t) {
- return null;
- }
- }
-
@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
return "Blueprint [I am useless]";
}
- public Object getNBT(final ItemStack itemStack, final String tagNBT) {
- if (!itemStack.hasTagCompound()) {
- return null;
- }
- Object o = null;
- if (tagNBT.equals("mID")) {
- o = itemStack.stackTagCompound.getInteger(tagNBT);
- }
- else if (tagNBT.equals("mBlueprint")) {
- o = itemStack.stackTagCompound.getBoolean(tagNBT);
- }
- else if (tagNBT.equals("mName")) {
- o = itemStack.stackTagCompound.getString(tagNBT);
- }
- else if (tagNBT.equals("")) {
- // For More Tag Support
- // o = itemStack.stackTagCompound.getInteger(tagNBT);
- }
- if (o != null) {
- return o;
- }
- return null;
- }
-
@Override
- public boolean hasBlueprint(final ItemStack stack) {
- if (stack.hasTagCompound()) {
- return (boolean) this.getNBT(stack, "mBlueprint");
- }
- return false;
+ public void onCreated(ItemStack itemStack, World world, EntityPlayer player) {
+ createNBT(itemStack);
}
@Override
- public boolean isBlueprint(final ItemStack stack) {
- return true;
- }
+ public void onUpdate(ItemStack itemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
- @Override
- public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {
- this.createNBT(itemStack);
}
@Override
- public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer par3Entity) {
- // Let the player know what blueprint is held
+ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer par3Entity) {
+ //Let the player know what blueprint is held
if (itemStack.hasTagCompound()) {
- PlayerUtils.messagePlayer(par3Entity,
- "This Blueprint holds NBT data. " + "|" + this.getNBT(itemStack, "mID") + "|"
- + this.getNBT(itemStack, "mBlueprint") + "|" + this.getNBT(itemStack, "mName") + "|"
- + ItemUtils.getArrayStackNames(this.readItemsFromNBT(itemStack)));
+ PlayerUtils.messagePlayer(par3Entity, "This Blueprint holds NBT data. "+"|"+getNBT(itemStack, "mID")+"|"+getNBT(itemStack, "mBlueprint")+"|"+getNBT(itemStack, "mName")+"|"+ItemUtils.getArrayStackNames(readItemsFromNBT(itemStack)));
}
else {
- this.createNBT(itemStack);
- PlayerUtils.messagePlayer(par3Entity, "This is a placeholder. " + this.getNBT(itemStack, "mID"));
+ createNBT(itemStack);
+ PlayerUtils.messagePlayer(par3Entity, "This is a placeholder. "+getNBT(itemStack, "mID"));
}
- return super.onItemRightClick(itemStack, world, par3Entity);
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World par2World, final Entity par3Entity, final int par4,
- final boolean par5) {
+ return super.onItemRightClick(itemStack, world, par3Entity);
}
- public ItemStack[] readItemsFromNBT(final ItemStack itemStack) {
+ public ItemStack[] readItemsFromNBT(ItemStack itemStack){
ItemStack[] blueprint = new ItemStack[9];
- if (itemStack.hasTagCompound()) {
- final NBTTagCompound nbt = itemStack.getTagCompound();
- final NBTTagList list = nbt.getTagList("Items", 10);
- blueprint = new ItemStack[IItemBlueprint.INV_SIZE];
- for (int i = 0; i < list.tagCount(); i++) {
- final NBTTagCompound data = list.getCompoundTagAt(i);
- final int slot = data.getInteger("Slot");
- if (slot >= 0 && slot < IItemBlueprint.INV_SIZE) {
+ if (itemStack.hasTagCompound()){
+ NBTTagCompound nbt = itemStack.getTagCompound();
+ NBTTagList list = nbt.getTagList("Items", 10);
+ blueprint = new ItemStack[INV_SIZE];
+ for(int i = 0;i<list.tagCount();i++)
+ {
+ NBTTagCompound data = list.getCompoundTagAt(i);
+ int slot = data.getInteger("Slot");
+ if(slot >= 0 && slot < INV_SIZE)
+ {
blueprint[slot] = ItemStack.loadItemStackFromNBT(data);
}
}
@@ -229,72 +118,175 @@ public class ItemBlueprint extends Item implements IItemBlueprint {
return null;
}
+ public ItemStack writeItemsToNBT(ItemStack itemStack, ItemStack[] craftingGrid){
+ ItemStack[] blueprint = craftingGrid;
+ if (itemStack.hasTagCompound()){
+ NBTTagCompound nbt = itemStack.getTagCompound();
+ NBTTagList list = new NBTTagList();
+ for(int i = 0;i<INV_SIZE;i++)
+ {
+ ItemStack stack = blueprint[i];
+ if(stack != null)
+ {
+ NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
+ }
+ nbt.setTag("Items", list);
+ itemStack.setTagCompound(nbt);
+ return itemStack;
+ }
+ return null;
+ }
+
@Override
- public boolean setBlueprint(final ItemStack stack, final IInventory craftingTable, final ItemStack output) {
+ public boolean isBlueprint(ItemStack stack) {
+ return true;
+ }
+
+ @Override
+ public boolean setBlueprint(ItemStack stack, IInventory craftingTable, ItemStack output) {
boolean hasBP = false;
ItemStack[] blueprint = new ItemStack[9];
- if (stack.hasTagCompound()) {
- hasBP = (boolean) this.getNBT(stack, "mBlueprint");
- blueprint = this.readItemsFromNBT(stack);
+ if (stack.hasTagCompound()){
+ hasBP = (boolean) getNBT(stack, "mBlueprint");
+ blueprint = readItemsFromNBT(stack);
}
- if (!hasBP) {
+ if (!hasBP){
try {
- for (int o = 0; o < craftingTable.getSizeInventory(); o++) {
+ for (int o=0; o<craftingTable.getSizeInventory(); o++){
blueprint[o] = craftingTable.getStackInSlot(o);
- if (blueprint[0] != null) {
+ if (blueprint[0] != null){
blueprint[0].stackSize = 0;
}
}
- this.writeItemsToNBT(stack, blueprint);
- if (stack.hasTagCompound()) {
- if (stack.getTagCompound().getCompoundTag("Items") != null) {
+ writeItemsToNBT(stack, blueprint);
+ if (stack.hasTagCompound()){
+ if(stack.getTagCompound().getCompoundTag("Items") != null){
stack.stackTagCompound.setBoolean("mBlueprint", true);
}
else {
- // Invalid BP saved?
+ //Invalid BP saved?
}
- hasBP = (boolean) this.getNBT(stack, "mBlueprint");
+ hasBP = (boolean) getNBT(stack, "mBlueprint");
}
-
- if (output != null) {
- this.setBlueprintName(stack, output.getDisplayName());
- return hasBP = true;
+
+ if (output != null){
+ setBlueprintName(stack, output.getDisplayName());
+ return (hasBP = true);
}
return false;
- }
- catch (final Throwable t) {
- return false;
+ } catch (Throwable t){
+ return false;
}
}
return false;
}
@Override
- public void setBlueprintName(final ItemStack stack, final String name) {
+ public void setBlueprintName(ItemStack stack, String name) {
stack.stackTagCompound.setString("mName", name);
}
- public ItemStack writeItemsToNBT(final ItemStack itemStack, final ItemStack[] craftingGrid) {
- final ItemStack[] blueprint = craftingGrid;
- if (itemStack.hasTagCompound()) {
- final NBTTagCompound nbt = itemStack.getTagCompound();
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < IItemBlueprint.INV_SIZE; i++) {
- final ItemStack stack = blueprint[i];
- if (stack != null) {
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
+ @Override
+ public boolean hasBlueprint(ItemStack stack) {
+ if (stack.hasTagCompound()){
+ return (boolean) getNBT(stack, "mBlueprint");
+ }
+ return false;
+ }
+
+ @Override
+ public ItemStack[] getBlueprint(ItemStack stack) {
+ ItemStack[] blueprint = new ItemStack[9];
+ if (stack.hasTagCompound()){
+ blueprint = readItemsFromNBT(stack);
+ }
+ try {
+ ItemStack[] returnStack = new ItemStack[9];
+ for (int o=0; o<blueprint.length; o++){
+ returnStack[o] = blueprint[o];
+ if (returnStack[0] != null){
+ returnStack[0].stackSize = 1;
}
}
- nbt.setTag("Items", list);
- itemStack.setTagCompound(nbt);
- return itemStack;
+ return returnStack;
+ } catch (Throwable t){
+ return null;
}
- return null;
}
+ public boolean createNBT(ItemStack itemStack){
+ if (itemStack.hasTagCompound()){
+ if (!itemStack.stackTagCompound.getBoolean("mBlueprint") && !itemStack.stackTagCompound.getString("mName").equals("")){
+ //No Blueprint and no name Set
+ Utils.LOG_WARNING("No Blueprint and no name Set");
+ return false;
+ }
+ else if (itemStack.stackTagCompound.getBoolean("mBlueprint") && !itemStack.stackTagCompound.getString("mName").equals("")){
+ //Has Blueprint but invalid name set
+ Utils.LOG_WARNING("Has Blueprint but invalid name set");
+ //itemStack.stackTagCompound = null;
+ //createNBT(itemStack);
+ return false;
+ }
+ else if (!itemStack.stackTagCompound.getBoolean("mBlueprint") && itemStack.stackTagCompound.getString("mName").equals("")){
+ //Has no Blueprint, but strangely has a name
+ Utils.LOG_WARNING("Has no Blueprint, but strangely has a name");
+ //itemStack.stackTagCompound = null;
+ //createNBT(itemStack);
+ return false;
+ }
+ return false;
+ }
+ else if(!itemStack.hasTagCompound()){
+ int bpID = MathUtils.randInt(0, 1000);
+ boolean hasRecipe = false;
+ String recipeName = "";
+ Utils.LOG_WARNING("Creating Blueprint, setting up it's NBT data. "+bpID);
+ itemStack.stackTagCompound = new NBTTagCompound();
+ itemStack.stackTagCompound.setInteger("mID", bpID);
+ itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
+ itemStack.stackTagCompound.setString("mName", recipeName);
+ return true;
+ }
+ else {
+ int bpID = MathUtils.randInt(0, 1000);
+ boolean hasRecipe = false;
+ String recipeName = "";
+ Utils.LOG_WARNING("Creating a Blueprint, setting up it's NBT data. "+bpID);
+ itemStack.stackTagCompound = new NBTTagCompound();
+ itemStack.stackTagCompound.setInteger("mID", bpID);
+ itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
+ itemStack.stackTagCompound.setString("mName", recipeName);
+ return true;
+ }
+ }
+
+ public Object getNBT(ItemStack itemStack, String tagNBT){
+ if (!itemStack.hasTagCompound()){
+ return null;
+ }
+ Object o = null;
+ if (tagNBT.equals("mID")){
+ o = itemStack.stackTagCompound.getInteger(tagNBT);
+ }
+ else if (tagNBT.equals("mBlueprint")){
+ o = itemStack.stackTagCompound.getBoolean(tagNBT);
+ }
+ else if (tagNBT.equals("mName")){
+ o = itemStack.stackTagCompound.getString(tagNBT);
+ }
+ else if (tagNBT.equals("")){
+ //For More Tag Support
+ //o = itemStack.stackTagCompound.getInteger(tagNBT);
+ }
+ if (o != null)
+ return o;
+ return null; }
+
}
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java
index d0316730bf..c5f383955c 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java
@@ -1,16 +1,15 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
-import baubles.api.BaubleType;
-import baubles.api.IBauble;
-import cpw.mods.fml.common.Optional;
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
-import ic2.api.item.*;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import ic2.api.item.IElectricItemManager;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -20,235 +19,240 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
+import baubles.api.BaubleType;
+import baubles.api.IBauble;
+import cpw.mods.fml.common.Optional;
+import cpw.mods.fml.common.registry.GameRegistry;
-@Optional.InterfaceList(value = {
- @Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"),
- @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")
-})
-public class ItemCloakingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble {
+@Optional.InterfaceList(value = {@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"), @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")})
+public class ItemCloakingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble{
- private final static int maxValueEU = 10000 * 20 * 500;
- private final String unlocalizedName = "personalCloakingDevice";
- private final ItemStack thisStack;
- protected double chargeEU = 0;
+ private final String unlocalizedName = "personalCloakingDevice";
+ private final ItemStack thisStack;
+ private final static int maxValueEU = 10000*20*500;
+ protected double chargeEU = 0;
- public ItemCloakingDevice(final double charge) {
+ public ItemCloakingDevice(double charge){
this.chargeEU = charge;
this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setUnlocalizedName(this.unlocalizedName);
+ this.setUnlocalizedName(unlocalizedName);
this.setMaxStackSize(1);
this.setTextureName(CORE.MODID + ":" + "personalCloakingDevice");
this.thisStack = ItemUtils.getSimpleStack(this);
- this.charge(this.thisStack, charge, 3, true, false);
- if (charge == 10000 * 20 * 500) {
- this.setDamage(this.thisStack, 13);
+ this.charge(thisStack, charge, 3, true, false);
+ if (charge == 10000*20*500){
+ this.setDamage(thisStack, 13);
}
- GameRegistry.registerItem(this, this.unlocalizedName + "-" + charge);
- }
-
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("");
- list.add(EnumChatFormatting.GREEN + "Worn as a Belt within Baubles." + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GREEN + "Drains 10,000EU/t to provide invisibility." + EnumChatFormatting.GRAY);
- list.add("");
- list.add(EnumChatFormatting.GOLD + "IC2/EU Information" + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GRAY + "Tier: [" + EnumChatFormatting.YELLOW + this.getTier(this.thisStack)
- + EnumChatFormatting.GRAY + "] Input Limit: [" + EnumChatFormatting.YELLOW
- + this.getTransferLimit(this.thisStack) + EnumChatFormatting.GRAY + "EU/t]");
- list.add(EnumChatFormatting.GRAY + "Current Power: [" + EnumChatFormatting.YELLOW + (long) this.getCharge(stack)
- + EnumChatFormatting.GRAY + "EU] [" + EnumChatFormatting.YELLOW
- + MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack)) + EnumChatFormatting.GRAY
- + "%]");
- list.add(EnumChatFormatting.GRAY + "Time Remaining: [" + EnumChatFormatting.YELLOW + this.secondsLeft(stack)
- + EnumChatFormatting.GRAY + " seconds]");
- super.addInformation(stack, aPlayer, list, bool);
+ GameRegistry.registerItem(this, unlocalizedName+"-"+charge);
}
@Override
- public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
+ public void onUpdate(ItemStack itemStack, World worldObj, Entity player, int p_77663_4_, boolean p_77663_5_) {
+ if (worldObj.isRemote) {
+ return;
+ }
+
+ if (player instanceof EntityPlayer){
+ for (ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
+ if (is == itemStack) {
+ continue;
+ }
+ if (is != null) {
+ if (is.getItem() instanceof IElectricItem) {
+ IElectricItem electricItem = (IElectricItem) is.getItem();
+ chargeEU = ElectricItem.manager.getCharge(is);
+ }
+
+ }
+ }
+ }
+
+
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
}
@Override
- public boolean canProvideEnergy(final ItemStack itemStack) {
+ public boolean canProvideEnergy(ItemStack itemStack) {
return true;
}
@Override
- public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
+ public Item getChargedItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(maxValueEU);
+ return x.getItem();
}
@Override
- public boolean canUse(final ItemStack stack, final double amount) {
- return ElectricItem.manager.canUse(stack, amount);
+ public Item getEmptyItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(0);
+ return x.getItem();
}
@Override
- public double charge(final ItemStack stack, final double amount, final int tier, final boolean ignoreTransferLimit,
- final boolean simulate) {
-
- if (!simulate) {
- ElectricItem.manager.charge(stack, amount, tier, true, simulate);
-
- }
- return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+ public double getMaxCharge(ItemStack itemStack) {
+ return maxValueEU;
}
@Override
- public void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
- ElectricItem.manager.chargeFromArmor(stack, entity);
+ public int getTier(ItemStack itemStack) {
+ return 5;
}
@Override
- public double discharge(final ItemStack stack, final double amount, final int tier,
- final boolean ignoreTransferLimit, final boolean externally, final boolean simulate) {
- if (!simulate) {
- ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
- }
-
- return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ public double getTransferLimit(ItemStack itemStack) {
+ return 8196;
}
@Override
- public BaubleType getBaubleType(final ItemStack arg0) {
- return BaubleType.BELT;
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (EnumChatFormatting.BLUE+"Personal Cloaking Device"+EnumChatFormatting.GRAY);
}
@Override
- public double getCharge(final ItemStack stack) {
- return ElectricItem.manager.getCharge(stack);
+ public double getDurabilityForDisplay(ItemStack stack)
+ {
+ //return 1.0D - getEnergyStored(stack) / this.capacity;
+ return 1.0D - (double)getCharge(stack) / (double)getMaxCharge(stack);
}
@Override
- public Item getChargedItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(ItemCloakingDevice.maxValueEU);
- return x.getItem();
+ public boolean showDurabilityBar(ItemStack stack)
+ {
+ return true;
+ }
+
+ public int secondsLeft(ItemStack stack){
+ double r = 0;
+ r = getCharge(stack)/(10000*20);
+ return (int) MathUtils.decimalRounding(r);
}
@Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- // return 1.0D - getEnergyStored(stack) / this.capacity;
- return 1.0D - this.getCharge(stack) / this.getMaxCharge(stack);
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add("");
+ list.add(EnumChatFormatting.GREEN+"Worn as a Belt within Baubles."+EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GREEN+"Drains 10,000EU/t to provide invisibility."+EnumChatFormatting.GRAY);
+ list.add("");
+ list.add(EnumChatFormatting.GOLD+"IC2/EU Information"+EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GRAY+"Tier: ["+EnumChatFormatting.YELLOW+getTier(thisStack)+EnumChatFormatting.GRAY+"] Input Limit: ["+EnumChatFormatting.YELLOW+getTransferLimit(thisStack)+EnumChatFormatting.GRAY +"EU/t]");
+ list.add(EnumChatFormatting.GRAY+"Current Power: ["+EnumChatFormatting.YELLOW+(long) getCharge(stack)+EnumChatFormatting.GRAY+"EU] ["+EnumChatFormatting.YELLOW+MathUtils.findPercentage(getCharge(stack), getMaxCharge(stack))+EnumChatFormatting.GRAY +"%]");
+ list.add(EnumChatFormatting.GRAY+"Time Remaining: ["+EnumChatFormatting.YELLOW+secondsLeft(stack)+ EnumChatFormatting.GRAY +" seconds]");
+ super.addInformation(stack, aPlayer, list, bool);
}
- /*
- * @Override public ItemStack getContainerItem(ItemStack itemStack) {
- * ItemStack newItem = itemStack.copy(); newItem.stackSize = 1;
- * extractEnergy(newItem, 150000, false); return newItem; }
- */
-
- /*
- * @Override public boolean hasContainerItem(ItemStack stack) { return true;
- * }
- */
+ /*@Override
+ public ItemStack getContainerItem(ItemStack itemStack)
+ {
+ ItemStack newItem = itemStack.copy();
+ newItem.stackSize = 1;
+ extractEnergy(newItem, 150000, false);
+ return newItem;
+ }*/
+
+ /*@Override
+ public boolean hasContainerItem(ItemStack stack)
+ {
+ return true;
+ }*/
- /*
- * @Override public int getBurnTime(ItemStack fuel) { if ((fuel == null) ||
- * (fuel.getItem() != this)) { return 0; } return extractEnergy(fuel,
- * 150000, true) / 50 / 100; }
- */
+ /*@Override
+ public int getBurnTime(ItemStack fuel) {
+ if ((fuel == null) || (fuel.getItem() != this)) {
+ return 0;
+ }
+ return extractEnergy(fuel, 150000, true) / 50 / 100;
+ }*/
@Override
- public Item getEmptyItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(0);
- return x.getItem();
+ public double charge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean simulate) {
+
+ if (!simulate)
+ {
+ ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+
+ }
+ return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
}
@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ public double discharge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean externally, boolean simulate) {
+ if (!simulate)
+ {
+ ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
- return EnumChatFormatting.BLUE + "Personal Cloaking Device" + EnumChatFormatting.GRAY;
+ return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
}
@Override
- public double getMaxCharge(final ItemStack itemStack) {
- return ItemCloakingDevice.maxValueEU;
+ public double getCharge(ItemStack stack) {
+ return ElectricItem.manager.getCharge(stack);
}
@Override
- public int getTier(final ItemStack itemStack) {
- return 5;
+ public boolean canUse(ItemStack stack, double amount) {
+ return ElectricItem.manager.canUse(stack, amount);
}
@Override
- public String getToolTip(final ItemStack stack) {
- return ElectricItem.manager.getToolTip(stack);
+ public boolean use(ItemStack stack, double amount, EntityLivingBase entity) {
+ return ElectricItem.manager.use(stack, amount, entity);
}
@Override
- public double getTransferLimit(final ItemStack itemStack) {
- return 8196;
+ public void chargeFromArmor(ItemStack stack, EntityLivingBase entity) {
+ ElectricItem.manager.chargeFromArmor(stack, entity);
}
- @Override // TODO
- public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {
-
+ @Override
+ public String getToolTip(ItemStack stack) {
+ return ElectricItem.manager.getToolTip(stack);
}
- @Override // TODO
- public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {
+ @Override
+ public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) {
+ return true;
+ }
+ @Override
+ public boolean canUnequip(ItemStack arg0, EntityLivingBase arg1) {
+ return true;
}
@Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_,
- final boolean p_77663_5_) {
- if (worldObj.isRemote) {
- return;
- }
+ public BaubleType getBaubleType(ItemStack arg0) {
+ return BaubleType.BELT;
+ }
- if (player instanceof EntityPlayer) {
- for (final ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
- if (is == itemStack) {
- continue;
- }
- if (is != null) {
- if (is.getItem() instanceof IElectricItem) {
- final IElectricItem electricItem = (IElectricItem) is.getItem();
- this.chargeEU = ElectricItem.manager.getCharge(is);
- }
+ @Override //TODO
+ public void onEquipped(ItemStack arg0, EntityLivingBase arg1) {
- }
- }
- }
+ }
+
+ @Override //TODO
+ public void onUnequipped(ItemStack arg0, EntityLivingBase arg1) {
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
}
- @Override // TODO
- public void onWornTick(final ItemStack arg0, final EntityLivingBase arg1) {
- // Utils.LOG_INFO("Trying to Tick Belt. 1");
- if (!arg1.worldObj.isRemote) {
- if (this.getCharge(arg0) >= 10000) {
+ @Override //TODO
+ public void onWornTick(ItemStack arg0, EntityLivingBase arg1) {
+ //Utils.LOG_INFO("Trying to Tick Belt. 1");
+ if (!arg1.worldObj.isRemote){
+ if (getCharge(arg0) >= 10000){
arg1.addPotionEffect(new PotionEffect(Potion.invisibility.id, 10, 2));
- this.discharge(arg0, 10000, 5, true, true, false);
+ discharge(arg0, 10000, 5, true, true, false);
}
else {
- if (arg1.isPotionActive(Potion.invisibility)) {
+ if (arg1.isPotionActive((Potion.invisibility))){
arg1.removePotionEffect(Potion.invisibility.id);
}
}
}
}
- public int secondsLeft(final ItemStack stack) {
- double r = 0;
- r = this.getCharge(stack) / (10000 * 20);
- return (int) MathUtils.decimalRounding(r);
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return true;
- }
-
- @Override
- public boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
- return ElectricItem.manager.use(stack, amount, entity);
- }
-
}
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
index 6a60809fce..4f1d7f4ecf 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
@@ -1,18 +1,17 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
-import baubles.api.BaubleType;
-import baubles.api.IBauble;
-import cpw.mods.fml.common.Optional;
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.player.PlayerUtils;
-import ic2.api.item.*;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import ic2.api.item.IElectricItemManager;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -20,216 +19,213 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
+import baubles.api.BaubleType;
+import baubles.api.IBauble;
+import cpw.mods.fml.common.Optional;
+import cpw.mods.fml.common.registry.GameRegistry;
-@Optional.InterfaceList(value = {
- @Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"),
- @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")
-})
-public class ItemHealingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble {
+@Optional.InterfaceList(value = {@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"), @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")})
+public class ItemHealingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble{
- private final static int maxValueEU = 1000000000;
- private final String unlocalizedName = "personalHealingDevice";
- private final ItemStack thisStack;
- protected double chargeEU = 0;
+ private final String unlocalizedName = "personalHealingDevice";
+ private final ItemStack thisStack;
+ private final static int maxValueEU = 1000000000;
+ protected double chargeEU = 0;
- public ItemHealingDevice() {
+ public ItemHealingDevice(){
this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setUnlocalizedName(this.unlocalizedName);
+ this.setUnlocalizedName(unlocalizedName);
this.setMaxStackSize(1);
this.setTextureName(CORE.MODID + ":" + "personalCloakingDevice");
this.thisStack = ItemUtils.getSimpleStack(this);
- GameRegistry.registerItem(this, this.unlocalizedName);
- }
-
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("");
- list.add(EnumChatFormatting.GREEN + "Worn as a Necklace within Baubles." + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GREEN + "Drains 1638400eu to restore hunger." + EnumChatFormatting.GRAY);
- list.add("");
- list.add(EnumChatFormatting.GOLD + "IC2/EU Information" + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GRAY + "Tier: [" + EnumChatFormatting.YELLOW + this.getTier(this.thisStack)
- + EnumChatFormatting.GRAY + "] Transfer Limit: [" + EnumChatFormatting.YELLOW
- + this.getTransferLimit(this.thisStack) + EnumChatFormatting.GRAY + "Eu/t]");
- list.add(EnumChatFormatting.GRAY + "Current Power: [" + EnumChatFormatting.YELLOW + (long) this.getCharge(stack)
- + EnumChatFormatting.GRAY + "Eu] [" + EnumChatFormatting.YELLOW
- + MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack)) + EnumChatFormatting.GRAY
- + "%]");
- list.add(EnumChatFormatting.GRAY + "Uses Remaining: [" + EnumChatFormatting.YELLOW + this.secondsLeft(stack)
- + EnumChatFormatting.GRAY + "]");
- super.addInformation(stack, aPlayer, list, bool);
+ GameRegistry.registerItem(this, unlocalizedName);
}
@Override
- public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
+ public void onUpdate(ItemStack itemStack, World worldObj, Entity player, int p_77663_4_, boolean p_77663_5_) {
+ if (worldObj.isRemote) {
+ return;
+ }
+
+ if (player instanceof EntityPlayer){
+ for (ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
+ if (is == itemStack) {
+ continue;
+ }
+ if (is != null) {
+ if (is.getItem() instanceof IElectricItem) {
+ IElectricItem electricItem = (IElectricItem) is.getItem();
+ chargeEU = ElectricItem.manager.getCharge(is);
+ }
+
+ }
+ }
+ }
+
+
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
}
@Override
- public boolean canProvideEnergy(final ItemStack itemStack) {
+ public boolean canProvideEnergy(ItemStack itemStack) {
return true;
}
@Override
- public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
+ public Item getChargedItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(maxValueEU);
+ return x.getItem();
}
@Override
- public boolean canUse(final ItemStack stack, final double amount) {
- return ElectricItem.manager.canUse(stack, amount);
+ public Item getEmptyItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(0);
+ return x.getItem();
}
@Override
- public double charge(final ItemStack stack, final double amount, final int tier, final boolean ignoreTransferLimit,
- final boolean simulate) {
-
- if (!simulate) {
- ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+ public double getMaxCharge(ItemStack itemStack) {
+ return maxValueEU;
+ }
- }
- return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+ @Override
+ public int getTier(ItemStack itemStack) {
+ return 5;
}
@Override
- public void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
- ElectricItem.manager.chargeFromArmor(stack, entity);
+ public double getTransferLimit(ItemStack itemStack) {
+ return 32784;
}
@Override
- public double discharge(final ItemStack stack, final double amount, final int tier,
- final boolean ignoreTransferLimit, final boolean externally, final boolean simulate) {
- if (!simulate) {
- ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
- }
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
- return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ return (EnumChatFormatting.BLUE+"Personal Healing NanoBooster"+EnumChatFormatting.RESET);
}
@Override
- public BaubleType getBaubleType(final ItemStack arg0) {
- return BaubleType.AMULET;
+ public double getDurabilityForDisplay(ItemStack stack)
+ {
+ //return 1.0D - getEnergyStored(stack) / this.capacity;
+ return 1.0D - (double)getCharge(stack) / (double)getMaxCharge(stack);
}
@Override
- public double getCharge(final ItemStack stack) {
- return ElectricItem.manager.getCharge(stack);
+ public boolean showDurabilityBar(ItemStack stack)
+ {
+ return true;
+ }
+
+ public double secondsLeft(ItemStack stack){
+
+ double r = 0;
+ r = getCharge(stack)/(1638400/4);
+ return (int) r;
}
@Override
- public Item getChargedItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(ItemHealingDevice.maxValueEU);
- return x.getItem();
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add("");
+ list.add(EnumChatFormatting.GREEN+"Worn as a Necklace within Baubles."+EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GREEN+"Drains 1638400eu to restore hunger."+EnumChatFormatting.GRAY);
+ list.add("");
+ list.add(EnumChatFormatting.GOLD+"IC2/EU Information"+EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GRAY+"Tier: ["+EnumChatFormatting.YELLOW+getTier(thisStack)+EnumChatFormatting.GRAY+"] Transfer Limit: ["+EnumChatFormatting.YELLOW+getTransferLimit(thisStack)+EnumChatFormatting.GRAY +"Eu/t]");
+ list.add(EnumChatFormatting.GRAY+"Current Power: ["+EnumChatFormatting.YELLOW+(long) getCharge(stack)+EnumChatFormatting.GRAY+"Eu] ["+EnumChatFormatting.YELLOW+MathUtils.findPercentage(getCharge(stack), getMaxCharge(stack))+EnumChatFormatting.GRAY +"%]");
+ list.add(EnumChatFormatting.GRAY+"Uses Remaining: ["+EnumChatFormatting.YELLOW+secondsLeft(stack)+ EnumChatFormatting.GRAY +"]");
+ super.addInformation(stack, aPlayer, list, bool);
}
@Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- // return 1.0D - getEnergyStored(stack) / this.capacity;
- return 1.0D - this.getCharge(stack) / this.getMaxCharge(stack);
+ public double charge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean simulate) {
+
+ if (!simulate)
+ {
+ ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+
+ }
+ return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
}
@Override
- public Item getEmptyItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(0);
- return x.getItem();
+ public double discharge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean externally, boolean simulate) {
+ if (!simulate)
+ {
+ ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
}
@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ public double getCharge(ItemStack stack) {
+ return ElectricItem.manager.getCharge(stack);
+ }
- return EnumChatFormatting.BLUE + "Personal Healing NanoBooster" + EnumChatFormatting.RESET;
+ @Override
+ public boolean canUse(ItemStack stack, double amount) {
+ return ElectricItem.manager.canUse(stack, amount);
}
@Override
- public double getMaxCharge(final ItemStack itemStack) {
- return ItemHealingDevice.maxValueEU;
+ public boolean use(ItemStack stack, double amount, EntityLivingBase entity) {
+ return ElectricItem.manager.use(stack, amount, entity);
}
@Override
- public int getTier(final ItemStack itemStack) {
- return 5;
+ public void chargeFromArmor(ItemStack stack, EntityLivingBase entity) {
+ ElectricItem.manager.chargeFromArmor(stack, entity);
}
@Override
- public String getToolTip(final ItemStack stack) {
+ public String getToolTip(ItemStack stack) {
return ElectricItem.manager.getToolTip(stack);
}
@Override
- public double getTransferLimit(final ItemStack itemStack) {
- return 32784;
+ public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) {
+ return true;
}
- @Override // TODO
- public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {
-
+ @Override
+ public boolean canUnequip(ItemStack arg0, EntityLivingBase arg1) {
+ return true;
}
- @Override // TODO
- public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {
-
+ @Override
+ public BaubleType getBaubleType(ItemStack arg0) {
+ return BaubleType.AMULET;
}
- @Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_,
- final boolean p_77663_5_) {
- if (worldObj.isRemote) {
- return;
- }
+ @Override //TODO
+ public void onEquipped(ItemStack arg0, EntityLivingBase arg1) {
- if (player instanceof EntityPlayer) {
- for (final ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
- if (is == itemStack) {
- continue;
- }
- if (is != null) {
- if (is.getItem() instanceof IElectricItem) {
- final IElectricItem electricItem = (IElectricItem) is.getItem();
- this.chargeEU = ElectricItem.manager.getCharge(is);
- }
+ }
- }
- }
- }
+ @Override //TODO
+ public void onUnequipped(ItemStack arg0, EntityLivingBase arg1) {
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
}
- @Override // TODO
- public void onWornTick(final ItemStack arg0, final EntityLivingBase arg1) {
- if (!arg1.worldObj.isRemote) {
- if (this.getCharge(arg0) >= 1638400 / 4) {
- if (arg1.getHealth() < arg1.getMaxHealth()) {
- final float rx = arg1.getMaxHealth() - arg1.getHealth();
- Utils.LOG_INFO("rx:" + rx);
- arg1.heal(rx * 2);
- this.discharge(arg0, 1638400 / 4 * rx, 6, true, true, false);
- PlayerUtils.messagePlayer((EntityPlayer) arg1,
- "Your NanoBooster Whirs! Leaving you feeling stronger. It Healed " + rx + " hp.");
- PlayerUtils.messagePlayer((EntityPlayer) arg1,
- "You check it's remaining uses, it has " + this.secondsLeft(arg0) + ".");
+ @Override //TODO
+ public void onWornTick(ItemStack arg0, EntityLivingBase arg1) {
+ if (!arg1.worldObj.isRemote){
+ if (getCharge(arg0) >= 1638400/4){
+ if (arg1.getHealth() < arg1.getMaxHealth()){
+ float rx = arg1.getMaxHealth()-arg1.getHealth();
+ Utils.LOG_INFO("rx:"+rx);
+ arg1.heal(rx*2);
+ discharge(arg0, (1638400/4)*rx, 6, true, true, false);
+ PlayerUtils.messagePlayer((EntityPlayer) arg1, "Your NanoBooster Whirs! Leaving you feeling stronger. It Healed "+rx+" hp.");
+ PlayerUtils.messagePlayer((EntityPlayer) arg1, "You check it's remaining uses, it has "+secondsLeft(arg0)+".");
}
}
}
}
- public double secondsLeft(final ItemStack stack) {
-
- double r = 0;
- r = this.getCharge(stack) / (1638400 / 4);
- return (int) r;
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return true;
- }
-
- @Override
- public boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
- return ElectricItem.manager.use(stack, amount, entity);
- }
-
}
diff --git a/src/Java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java b/src/Java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java
index a80a998aed..f452b83a73 100644
--- a/src/Java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java
+++ b/src/Java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java
@@ -1,6 +1,5 @@
package gtPlusPlus.core.item.general;
-import cpw.mods.fml.common.eventhandler.Event;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
@@ -13,169 +12,199 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.FillBucketEvent;
+import cpw.mods.fml.common.eventhandler.Event;
-public class NuclearFuelRodBase extends Item {
- /** field for checking if the bucket has been filled. */
- private final Block isFull;
-
- public NuclearFuelRodBase(final Block p_i45331_1_) {
- this.maxStackSize = 1;
- this.isFull = p_i45331_1_;
- this.setCreativeTab(CreativeTabs.tabMisc);
- }
-
- @SuppressWarnings("static-method")
- private ItemStack func_150910_a(final ItemStack p_150910_1_, final EntityPlayer p_150910_2_,
- final Item p_150910_3_) {
- if (p_150910_2_.capabilities.isCreativeMode) {
- return p_150910_1_;
- }
- else if (--p_150910_1_.stackSize <= 0) {
- return new ItemStack(p_150910_3_);
- }
- else {
- if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_))) {
- p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false);
- }
-
- return p_150910_1_;
- }
- }
-
- /**
- * Called whenever this item is equipped and the right mouse button is
- * pressed. Args: itemStack, world, entityPlayer
- */
- @Override
- public ItemStack onItemRightClick(final ItemStack p_77659_1_, final World p_77659_2_,
- final EntityPlayer p_77659_3_) {
- final boolean flag = this.isFull == Blocks.air;
- final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_,
- flag);
-
- if (movingobjectposition == null) {
- return p_77659_1_;
- }
- final FillBucketEvent event = new FillBucketEvent(p_77659_3_, p_77659_1_, p_77659_2_, movingobjectposition);
- if (MinecraftForge.EVENT_BUS.post(event)) {
- return p_77659_1_;
+public class NuclearFuelRodBase extends Item
+{
+ /** field for checking if the bucket has been filled. */
+ private Block isFull;
+ public NuclearFuelRodBase(Block p_i45331_1_)
+ {
+ this.maxStackSize = 1;
+ this.isFull = p_i45331_1_;
+ this.setCreativeTab(CreativeTabs.tabMisc);
+ }
+
+ /**
+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
+ */
+ @Override
+ public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_)
+ {
+ boolean flag = this.isFull == Blocks.air;
+ MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, flag);
+
+ if (movingobjectposition == null)
+ {
+ return p_77659_1_;
+ }
+ FillBucketEvent event = new FillBucketEvent(p_77659_3_, p_77659_1_, p_77659_2_, movingobjectposition);
+ if (MinecraftForge.EVENT_BUS.post(event))
+ {
+ return p_77659_1_;
}
- if (event.getResult() == Event.Result.ALLOW) {
- if (p_77659_3_.capabilities.isCreativeMode) {
- return p_77659_1_;
- }
+ if (event.getResult() == Event.Result.ALLOW)
+ {
+ if (p_77659_3_.capabilities.isCreativeMode)
+ {
+ return p_77659_1_;
+ }
- if (--p_77659_1_.stackSize <= 0) {
- return event.result;
- }
+ if (--p_77659_1_.stackSize <= 0)
+ {
+ return event.result;
+ }
- if (!p_77659_3_.inventory.addItemStackToInventory(event.result)) {
- p_77659_3_.dropPlayerItemWithRandomChoice(event.result, false);
- }
+ if (!p_77659_3_.inventory.addItemStackToInventory(event.result))
+ {
+ p_77659_3_.dropPlayerItemWithRandomChoice(event.result, false);
+ }
- return p_77659_1_;
+ return p_77659_1_;
}
- if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
- int i = movingobjectposition.blockX;
- int j = movingobjectposition.blockY;
- int k = movingobjectposition.blockZ;
-
- if (!p_77659_2_.canMineBlock(p_77659_3_, i, j, k)) {
- return p_77659_1_;
- }
-
- if (flag) {
- if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_)) {
- return p_77659_1_;
- }
-
- final Material material = p_77659_2_.getBlock(i, j, k).getMaterial();
- final int l = p_77659_2_.getBlockMetadata(i, j, k);
-
- if (material == Material.water && l == 0) {
- p_77659_2_.setBlockToAir(i, j, k);
- return this.func_150910_a(p_77659_1_, p_77659_3_, Items.water_bucket);
- }
-
- if (material == Material.lava && l == 0) {
- p_77659_2_.setBlockToAir(i, j, k);
- return this.func_150910_a(p_77659_1_, p_77659_3_, Items.lava_bucket);
- }
- }
- else {
- if (this.isFull == Blocks.air) {
- return new ItemStack(Items.bucket);
- }
-
- if (movingobjectposition.sideHit == 0) {
- --j;
- }
-
- if (movingobjectposition.sideHit == 1) {
- ++j;
- }
-
- if (movingobjectposition.sideHit == 2) {
- --k;
- }
-
- if (movingobjectposition.sideHit == 3) {
- ++k;
- }
-
- if (movingobjectposition.sideHit == 4) {
- --i;
- }
-
- if (movingobjectposition.sideHit == 5) {
- ++i;
- }
-
- if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_)) {
- return p_77659_1_;
- }
-
- if (this.tryPlaceContainedLiquid(p_77659_2_, i, j, k) && !p_77659_3_.capabilities.isCreativeMode) {
- return new ItemStack(Items.bucket);
- }
- }
+ if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
+ {
+ int i = movingobjectposition.blockX;
+ int j = movingobjectposition.blockY;
+ int k = movingobjectposition.blockZ;
+
+ if (!p_77659_2_.canMineBlock(p_77659_3_, i, j, k))
+ {
+ return p_77659_1_;
+ }
+
+ if (flag)
+ {
+ if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_))
+ {
+ return p_77659_1_;
+ }
+
+ Material material = p_77659_2_.getBlock(i, j, k).getMaterial();
+ int l = p_77659_2_.getBlockMetadata(i, j, k);
+
+ if (material == Material.water && l == 0)
+ {
+ p_77659_2_.setBlockToAir(i, j, k);
+ return this.func_150910_a(p_77659_1_, p_77659_3_, Items.water_bucket);
+ }
+
+ if (material == Material.lava && l == 0)
+ {
+ p_77659_2_.setBlockToAir(i, j, k);
+ return this.func_150910_a(p_77659_1_, p_77659_3_, Items.lava_bucket);
+ }
+ }
+ else
+ {
+ if (this.isFull == Blocks.air)
+ {
+ return new ItemStack(Items.bucket);
+ }
+
+ if (movingobjectposition.sideHit == 0)
+ {
+ --j;
+ }
+
+ if (movingobjectposition.sideHit == 1)
+ {
+ ++j;
+ }
+
+ if (movingobjectposition.sideHit == 2)
+ {
+ --k;
+ }
+
+ if (movingobjectposition.sideHit == 3)
+ {
+ ++k;
+ }
+
+ if (movingobjectposition.sideHit == 4)
+ {
+ --i;
+ }
+
+ if (movingobjectposition.sideHit == 5)
+ {
+ ++i;
+ }
+
+ if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_))
+ {
+ return p_77659_1_;
+ }
+
+ if (this.tryPlaceContainedLiquid(p_77659_2_, i, j, k) && !p_77659_3_.capabilities.isCreativeMode)
+ {
+ return new ItemStack(Items.bucket);
+ }
+ }
}
return p_77659_1_;
- }
-
- /**
- * Attempts to place the liquid contained inside the bucket.
- */
- public boolean tryPlaceContainedLiquid(final World p_77875_1_, final int p_77875_2_, final int p_77875_3_,
- final int p_77875_4_) {
- if (this.isFull == Blocks.air) {
- return false;
+ }
+
+ @SuppressWarnings("static-method")
+ private ItemStack func_150910_a(ItemStack p_150910_1_, EntityPlayer p_150910_2_, Item p_150910_3_)
+ {
+ if (p_150910_2_.capabilities.isCreativeMode)
+ {
+ return p_150910_1_;
+ }
+ else if (--p_150910_1_.stackSize <= 0)
+ {
+ return new ItemStack(p_150910_3_);
+ }
+ else
+ {
+ if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_)))
+ {
+ p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false);
+ }
+
+ return p_150910_1_;
+ }
+ }
+
+ /**
+ * Attempts to place the liquid contained inside the bucket.
+ */
+ public boolean tryPlaceContainedLiquid(World p_77875_1_, int p_77875_2_, int p_77875_3_, int p_77875_4_)
+ {
+ if (this.isFull == Blocks.air)
+ {
+ return false;
+ }
+ Material material = p_77875_1_.getBlock(p_77875_2_, p_77875_3_, p_77875_4_).getMaterial();
+ boolean flag = !material.isSolid();
+
+ if (!p_77875_1_.isAirBlock(p_77875_2_, p_77875_3_, p_77875_4_) && !flag)
+ {
+ return false;
}
- final Material material = p_77875_1_.getBlock(p_77875_2_, p_77875_3_, p_77875_4_).getMaterial();
- final boolean flag = !material.isSolid();
-
- if (!p_77875_1_.isAirBlock(p_77875_2_, p_77875_3_, p_77875_4_) && !flag) {
- return false;
+ if (p_77875_1_.provider.isHellWorld && this.isFull == Blocks.flowing_water)
+ {
+ p_77875_1_.playSoundEffect((double)((float)p_77875_2_ + 0.5F), (double)((float)p_77875_3_ + 0.5F), (double)((float)p_77875_4_ + 0.5F), "random.fizz", 0.5F, 2.6F + (p_77875_1_.rand.nextFloat() - p_77875_1_.rand.nextFloat()) * 0.8F);
+
+ for (int l = 0; l < 8; ++l)
+ {
+ p_77875_1_.spawnParticle("largesmoke", (double)p_77875_2_ + Math.random(), (double)p_77875_3_ + Math.random(), (double)p_77875_4_ + Math.random(), 0.0D, 0.0D, 0.0D);
+ }
}
- if (p_77875_1_.provider.isHellWorld && this.isFull == Blocks.flowing_water) {
- p_77875_1_.playSoundEffect(p_77875_2_ + 0.5F, p_77875_3_ + 0.5F, p_77875_4_ + 0.5F, "random.fizz", 0.5F,
- 2.6F + (p_77875_1_.rand.nextFloat() - p_77875_1_.rand.nextFloat()) * 0.8F);
-
- for (int l = 0; l < 8; ++l) {
- p_77875_1_.spawnParticle("largesmoke", p_77875_2_ + Math.random(), p_77875_3_ + Math.random(),
- p_77875_4_ + Math.random(), 0.0D, 0.0D, 0.0D);
- }
- }
- else {
- if (!p_77875_1_.isRemote && flag && !material.isLiquid()) {
- p_77875_1_.func_147480_a(p_77875_2_, p_77875_3_, p_77875_4_, true);
- }
-
- p_77875_1_.setBlock(p_77875_2_, p_77875_3_, p_77875_4_, this.isFull, 0, 3);
+ else
+ {
+ if (!p_77875_1_.isRemote && flag && !material.isLiquid())
+ {
+ p_77875_1_.func_147480_a(p_77875_2_, p_77875_3_, p_77875_4_, true);
+ }
+
+ p_77875_1_.setBlock(p_77875_2_, p_77875_3_, p_77875_4_, this.isFull, 0, 3);
}
return true;
- }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java
index db278134de..7844d96f3f 100644
--- a/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java
+++ b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java
@@ -1,17 +1,15 @@
package gtPlusPlus.core.item.general;
-import java.util.List;
-
-import cofh.api.energy.ItemEnergyContainer;
-import cpw.mods.fml.common.IFuelHandler;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
-import ic2.api.item.*;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import ic2.api.item.IElectricItemManager;
+
+import java.util.List;
+
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -22,287 +20,295 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
+import cofh.api.energy.ItemEnergyContainer;
+import cpw.mods.fml.common.IFuelHandler;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, IElectricItemManager, IFuelHandler {
+public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, IElectricItemManager, IFuelHandler{
- public static int rfPerEU = 4;
- private final static int maxValueEU = 100000000;
- private final static int maxValueRF = RF2EU_Battery.maxValueEU * RF2EU_Battery.rfPerEU;
- private final String unlocalizedName = "rfEUBattery";
- private final ItemStack thisStack;
- protected double chargeEU = 0;
+ public static int rfPerEU = 4;
+ private final String unlocalizedName = "rfEUBattery";
+ private final ItemStack thisStack;
+ private final static int maxValueEU = 100000000;
+ private final static int maxValueRF = maxValueEU * rfPerEU;
+ protected double chargeEU = 0;
- public RF2EU_Battery() {
- super(RF2EU_Battery.maxValueRF, RF2EU_Battery.maxValueRF, RF2EU_Battery.maxValueRF);
+ public RF2EU_Battery(){
+ super(maxValueRF, maxValueRF, maxValueRF);
GameRegistry.registerFuelHandler(this);
- // this.setMaxDamage(Integer.MAX_VALUE);
- // this.setDamage(UtilsItems.getSimpleStack(this), 0);
+ //this.setMaxDamage(Integer.MAX_VALUE);
+ //this.setDamage(UtilsItems.getSimpleStack(this), 0);
this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setUnlocalizedName(this.unlocalizedName);
+ this.setUnlocalizedName(unlocalizedName);
this.setMaxStackSize(1);
this.setTextureName(CORE.MODID + ":" + "itemIngot");
this.thisStack = ItemUtils.getSimpleStack(this);
- GameRegistry.registerItem(this, this.unlocalizedName);
+ GameRegistry.registerItem(this, unlocalizedName);
}
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.YELLOW + "IC2/EU Information" + EnumChatFormatting.GRAY);
- list.add(EnumChatFormatting.GRAY + "Tier: [" + EnumChatFormatting.YELLOW + this.getTier(this.thisStack)
- + EnumChatFormatting.GRAY + "] Current Power: [" + EnumChatFormatting.YELLOW
- + (long) this.getCharge(stack) + EnumChatFormatting.GRAY + "/EU]");
- list.add(EnumChatFormatting.GRAY + "Transfer Limit: [" + EnumChatFormatting.YELLOW
- + this.getTransferLimit(this.thisStack) + EnumChatFormatting.GRAY + "Eu/t]" + "Burn Time: ["
- + EnumChatFormatting.YELLOW + this.getBurnTime(stack) / 20 + EnumChatFormatting.GRAY + "s]");
- list.add("");
- list.add(EnumChatFormatting.RED + "RF Information");
- list.add(EnumChatFormatting.GRAY + "Extraction Rate: [" + EnumChatFormatting.RED + this.maxExtract
- + EnumChatFormatting.GRAY + "Rf/t]" + " Insert Rate: [" + EnumChatFormatting.RED + this.maxReceive
- + EnumChatFormatting.GRAY + "Rf/t]");
- list.add(EnumChatFormatting.GRAY + "Current Charge: [" + EnumChatFormatting.RED + this.getEnergyStored(stack)
- + EnumChatFormatting.GRAY + "Rf / " + this.getMaxEnergyStored(stack) + "Rf] " + EnumChatFormatting.RED
- + MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack))
- + EnumChatFormatting.GRAY + "%");
- super.addInformation(stack, aPlayer, list, bool);
+ public void onUpdate(ItemStack itemStack, World worldObj, Entity player, int p_77663_4_, boolean p_77663_5_) {
+ getEnergyStored(itemStack);
+ if (worldObj.isRemote) {
+ return;
+ }
+
+ if (player instanceof EntityPlayer){
+ for (ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
+ if (is == itemStack) {
+ continue;
+ }
+ if (is != null) {
+ if (is.getItem() instanceof IElectricItem) {
+ IElectricItem electricItem = (IElectricItem) is.getItem();
+ chargeEU = ElectricItem.manager.getCharge(is);
+ }
+
+ }
+ }
+ }
+
+
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
}
@Override
- public boolean canProvideEnergy(final ItemStack itemStack) {
+ public boolean canProvideEnergy(ItemStack itemStack) {
return true;
}
@Override
- public boolean canUse(final ItemStack stack, final double amount) {
- return ElectricItem.manager.canUse(stack, amount);
+ public Item getChargedItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(maxValueEU);
+ return x.getItem();
}
@Override
- public double charge(final ItemStack stack, final double amount, final int tier, final boolean ignoreTransferLimit,
- final boolean simulate) {
- if (stack.stackTagCompound == null) {
- stack.stackTagCompound = new NBTTagCompound();
- }
- int energy = stack.stackTagCompound.getInteger("Energy");
- final int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, this.maxReceive));
- if (!simulate) {
- energy += energyReceived;
- stack.stackTagCompound.setInteger("Energy", energy);
- ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false);
- ElectricItem.manager.charge(stack, energy / RF2EU_Battery.rfPerEU, 3, true, false);
-
- }
- return ElectricItem.manager.charge(stack, amount, tier, ignoreTransferLimit, simulate);
+ public Item getEmptyItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(0);
+ return x.getItem();
}
@Override
- public void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
- ElectricItem.manager.chargeFromArmor(stack, entity);
+ public double getMaxCharge(ItemStack itemStack) {
+ return maxValueEU;
}
@Override
- public double discharge(final ItemStack stack, final double amount, final int tier,
- final boolean ignoreTransferLimit, final boolean externally, final boolean simulate) {
- if (stack.stackTagCompound == null || !stack.stackTagCompound.hasKey("Energy")) {
- final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
- if (euCharge != 0 && euCharge >= 1) {
- return (int) MathUtils.decimalRoundingToWholes(euCharge * RF2EU_Battery.rfPerEU);
- }
- return 0;
- }
- int energy = stack.stackTagCompound.getInteger("Energy");
- final int energyExtracted = Math.min(energy, Math.min(this.maxExtract, this.maxExtract));
- if (!simulate) {
- energy -= energyExtracted;
- stack.stackTagCompound.setInteger("Energy", energy);
- ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false);
- ElectricItem.manager.charge(stack, energy / RF2EU_Battery.rfPerEU, 3, true, false);
- }
-
- return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ public int getTier(ItemStack itemStack) {
+ return 3;
}
@Override
- public int extractEnergy(final ItemStack container, final int maxExtract, final boolean simulate) {
- if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
- final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
- if (euCharge != 0 && euCharge >= 1) {
- return (int) MathUtils.decimalRoundingToWholes(euCharge * RF2EU_Battery.rfPerEU);
- }
- return 0;
- }
- int energy = container.stackTagCompound.getInteger("Energy");
- final int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
- if (!simulate) {
- energy -= energyExtracted;
- container.stackTagCompound.setInteger("Energy", energy);
- ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
- ElectricItem.manager.charge(container, energy / RF2EU_Battery.rfPerEU, 3, true, false);
- }
- return energyExtracted;
+ public double getTransferLimit(ItemStack itemStack) {
+ return 8196;
}
@Override
- public int getBurnTime(final ItemStack fuel) {
- if (fuel == null || fuel.getItem() != this) {
- return 0;
- }
- return this.extractEnergy(fuel, 150000, true) / 50 / 100;
- }
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
- @Override
- public double getCharge(final ItemStack stack) {
- return ElectricItem.manager.getCharge(stack);
+ return ("Universally Chargeable Battery");
}
@Override
- public Item getChargedItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(RF2EU_Battery.maxValueEU);
- return x.getItem();
+ public double getDurabilityForDisplay(ItemStack stack)
+ {
+ //return 1.0D - getEnergyStored(stack) / this.capacity;
+ return MathUtils.findPercentage(getEnergyStored(stack), getMaxEnergyStored(stack));
}
@Override
@SideOnly(Side.CLIENT)
- public int getColorFromItemStack(final ItemStack par1ItemStack, final int par2) {
- final int i = 30;
+ public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
+ {
+ int i = 30;
- final float f13 = Minecraft.getSystemTime() % 6000L / 3000.0F * 3.141592F * 2.0F;
+ float f13 = (float)(Minecraft.getSystemTime() % 6000L) / 3000.0F * 3.141592F * 2.0F;
- final float t = 0.9F + 0.1F * MathHelper.cos(f13);
+ float t = 0.9F + 0.1F * MathHelper.cos(f13);
- final double v = 1.0D - this.getDurabilityForDisplay(par1ItemStack);
+ double v = 1.0D - getDurabilityForDisplay(par1ItemStack);
- int r = i + (int) (v * (255 - i) * t);
+ int r = i + (int)(v * (255 - i) * t);
if (r > 255) {
r = 255;
}
- final int g = i + (int) (v * (64 - i) * t);
+ int g = i + (int)(v * (64 - i) * t);
return r << 16 | g << 8 | i;
}
@Override
- public ItemStack getContainerItem(final ItemStack itemStack) {
- final ItemStack newItem = itemStack.copy();
- newItem.stackSize = 1;
- this.extractEnergy(newItem, 150000, false);
- return newItem;
+ public boolean showDurabilityBar(ItemStack stack)
+ {
+ return false;
}
@Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- // return 1.0D - getEnergyStored(stack) / this.capacity;
- return MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack));
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.YELLOW+"IC2/EU Information"+EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GRAY+"Tier: ["+EnumChatFormatting.YELLOW+getTier(thisStack)+EnumChatFormatting.GRAY+"] Current Power: ["+EnumChatFormatting.YELLOW+(long) getCharge(stack)+EnumChatFormatting.GRAY+"/EU]");
+ list.add(EnumChatFormatting.GRAY+"Transfer Limit: ["+EnumChatFormatting.YELLOW+getTransferLimit(thisStack)+ EnumChatFormatting.GRAY +"Eu/t]" +"Burn Time: ["+EnumChatFormatting.YELLOW+getBurnTime(stack)/20+EnumChatFormatting.GRAY+"s]");
+ list.add("");
+ list.add(EnumChatFormatting.RED+"RF Information");
+ list.add(EnumChatFormatting.GRAY+"Extraction Rate: [" +EnumChatFormatting.RED+ this.maxExtract + EnumChatFormatting.GRAY + "Rf/t]" + " Insert Rate: [" +EnumChatFormatting.RED+ this.maxReceive+EnumChatFormatting.GRAY+"Rf/t]");
+ list.add(EnumChatFormatting.GRAY+"Current Charge: ["+EnumChatFormatting.RED+getEnergyStored(stack) + EnumChatFormatting.GRAY + "Rf / " + getMaxEnergyStored(stack)+"Rf] "+EnumChatFormatting.RED+MathUtils.findPercentage(getEnergyStored(stack), getMaxEnergyStored(stack))+EnumChatFormatting.GRAY+"%");
+ super.addInformation(stack, aPlayer, list, bool);
}
@Override
- public Item getEmptyItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(0);
- return x.getItem();
+ public ItemStack getContainerItem(ItemStack itemStack)
+ {
+ ItemStack newItem = itemStack.copy();
+ newItem.stackSize = 1;
+ extractEnergy(newItem, 150000, false);
+ return newItem;
}
@Override
- public int getEnergyStored(final ItemStack container) {
- if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
- final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
- if (euCharge != 0 && euCharge >= 1) {
- return (int) MathUtils.decimalRoundingToWholes(euCharge * RF2EU_Battery.rfPerEU);
- }
+ public boolean hasContainerItem(ItemStack stack)
+ {
+ return true;
+ }
+
+ @Override
+ public int getBurnTime(ItemStack fuel) {
+ if ((fuel == null) || (fuel.getItem() != this)) {
return 0;
}
- final int energy = container.stackTagCompound.getInteger("Energy");
- ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
- ElectricItem.manager.charge(container, energy / RF2EU_Battery.rfPerEU, 3, true, false);
- return energy;
+ return extractEnergy(fuel, 150000, true) / 50 / 100;
}
@Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
-
- return "Universally Chargeable Battery";
+ public double charge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean simulate) {
+ if (stack.stackTagCompound == null) {
+ stack.stackTagCompound = new NBTTagCompound();
+ }
+ int energy = stack.stackTagCompound.getInteger("Energy");
+ int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, maxReceive));
+ if (!simulate)
+ {
+ energy += energyReceived;
+ stack.stackTagCompound.setInteger("Energy", energy);
+ ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false);
+ ElectricItem.manager.charge(stack, energy/rfPerEU, 3, true, false);
+
+ }
+ return ElectricItem.manager.charge(stack, amount, tier, ignoreTransferLimit, simulate);
}
@Override
- public double getMaxCharge(final ItemStack itemStack) {
- return RF2EU_Battery.maxValueEU;
+ public double discharge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean externally, boolean simulate) {
+ if ((stack.stackTagCompound == null) || (!stack.stackTagCompound.hasKey("Energy"))) {
+ double euCharge = getCharge(ItemUtils.getSimpleStack(this));
+ if (euCharge != 0 && euCharge >= 1){
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
+ }
+ return 0;
+ }
+ int energy = stack.stackTagCompound.getInteger("Energy");
+ int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
+ if (!simulate)
+ {
+ energy -= energyExtracted;
+ stack.stackTagCompound.setInteger("Energy", energy);
+ ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false);
+ ElectricItem.manager.charge(stack, energy/rfPerEU, 3, true, false);
+ }
+
+ return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
}
@Override
- public int getTier(final ItemStack itemStack) {
- return 3;
+ public double getCharge(ItemStack stack) {
+ return ElectricItem.manager.getCharge(stack);
}
@Override
- public String getToolTip(final ItemStack stack) {
- return ElectricItem.manager.getToolTip(stack);
+ public boolean canUse(ItemStack stack, double amount) {
+ return ElectricItem.manager.canUse(stack, amount);
}
@Override
- public double getTransferLimit(final ItemStack itemStack) {
- return 8196;
+ public boolean use(ItemStack stack, double amount, EntityLivingBase entity) {
+ return ElectricItem.manager.use(stack, amount, entity);
}
@Override
- public boolean hasContainerItem(final ItemStack stack) {
- return true;
+ public void chargeFromArmor(ItemStack stack, EntityLivingBase entity) {
+ ElectricItem.manager.chargeFromArmor(stack, entity);
}
@Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_,
- final boolean p_77663_5_) {
- this.getEnergyStored(itemStack);
- if (worldObj.isRemote) {
- return;
- }
-
- if (player instanceof EntityPlayer) {
- for (final ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
- if (is == itemStack) {
- continue;
- }
- if (is != null) {
- if (is.getItem() instanceof IElectricItem) {
- final IElectricItem electricItem = (IElectricItem) is.getItem();
- this.chargeEU = ElectricItem.manager.getCharge(is);
- }
-
- }
- }
- }
-
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ public String getToolTip(ItemStack stack) {
+ return ElectricItem.manager.getToolTip(stack);
}
@Override
- public int receiveEnergy(final ItemStack container, final int maxReceive, final boolean simulate) {
- if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) {
- final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this));
- if (euCharge != 0 && euCharge >= 1) {
- return (int) MathUtils.decimalRoundingToWholes(euCharge * RF2EU_Battery.rfPerEU);
+ public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate)
+ {
+ if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
+ double euCharge = getCharge(ItemUtils.getSimpleStack(this));
+ if (euCharge != 0 && euCharge >= 1){
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
}
return 0;
}
int energy = container.stackTagCompound.getInteger("Energy");
- final int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, maxReceive));
- if (!simulate) {
+ int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, maxReceive));
+ if (!simulate)
+ {
energy += energyReceived;
container.stackTagCompound.setInteger("Energy", energy);
ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
- ElectricItem.manager.charge(container, energy / RF2EU_Battery.rfPerEU, 3, true, false);
-
+ ElectricItem.manager.charge(container, energy/rfPerEU, 3, true, false);
+
}
return energyReceived;
}
@Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return false;
+ public int extractEnergy(ItemStack container, int maxExtract, boolean simulate)
+ {
+ if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
+ double euCharge = getCharge(ItemUtils.getSimpleStack(this));
+ if (euCharge != 0 && euCharge >= 1){
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
+ }
+ return 0;
+ }
+ int energy = container.stackTagCompound.getInteger("Energy");
+ int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
+ if (!simulate)
+ {
+ energy -= energyExtracted;
+ container.stackTagCompound.setInteger("Energy", energy);
+ ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
+ ElectricItem.manager.charge(container, energy/rfPerEU, 3, true, false);
+ }
+ return energyExtracted;
}
@Override
- public boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
- return ElectricItem.manager.use(stack, amount, entity);
+ public int getEnergyStored(ItemStack container)
+ {
+ if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
+ double euCharge = getCharge(ItemUtils.getSimpleStack(this));
+ if (euCharge != 0 && euCharge >= 1){
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
+ }
+ return 0;
+ }
+ int energy = container.stackTagCompound.getInteger("Energy");
+ ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
+ ElectricItem.manager.charge(container, energy/rfPerEU, 3, true, false);
+ return energy;
}
}
diff --git a/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
index 63638d9055..36e6c66df8 100644
--- a/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
+++ b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
@@ -1,9 +1,10 @@
package gtPlusPlus.core.item.general.fuelrods;
-import java.util.List;
-
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -12,15 +13,14 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
-public class FuelRod_Base extends Item {
+public class FuelRod_Base extends Item{
- public int fuelRemaining = 0;
- public int maximumFuel = 0;
- public String fuelType = "";
- public float heat = 0;
- public float maxHeat = this.getMaxHeat();
-
- public FuelRod_Base(final String unlocalizedName, final String type, final int fuelLeft, final int maxFuel) {
+ public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = getMaxHeat();
+ public FuelRod_Base(String unlocalizedName, String type, int fuelLeft, int maxFuel) {
this.setUnlocalizedName(unlocalizedName);
this.setTextureName(CORE.MODID + ":" + unlocalizedName);
this.setMaxStackSize(1);
@@ -30,192 +30,194 @@ public class FuelRod_Base extends Item {
this.fuelType = type;
this.setCreativeTab(AddToCreativeTab.tabMachines);
}
-
- public boolean addFuel(final int i) {
- final int tempFuel = this.fuelRemaining;
- this.fuelRemaining = tempFuel + i;
- if (this.fuelRemaining != tempFuel) {
- return true;
+
+ private float getMaxHeat(){
+ float tempvar;
+ if (fuelType == "Thorium"){
+ tempvar = 2500;
}
- return false;
- }
-
- public boolean addHeat(final float i) {
- final float tempFuel = this.heat;
- this.heat = tempFuel + i;
- if (this.heat != tempFuel) {
- return true;
+
+ else if (fuelType == "Uranium"){
+ tempvar = 5000;
}
- return false;
+
+ else if (fuelType == "Plutonium"){
+ tempvar = 10000;
+ }
+
+ else {
+ tempvar = 5000;
+ }
+ return tempvar;
+
}
-
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
+
+ private void updateVars(ItemStack stack){
+ if (stack.stackTagCompound != null) {
+ heat = stack.stackTagCompound.getFloat("heat");
+ fuelRemaining = stack.stackTagCompound.getInteger("fuelRemaining");
+ }
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
- Float NBT_Heat = this.heat;
- Float NBT_MaxHeat = this.maxHeat;
- int NBT_Fuel = this.fuelRemaining;
- String NBT_Type = this.fuelType;
+ Float NBT_Heat = heat;
+ Float NBT_MaxHeat = maxHeat;
+ int NBT_Fuel = fuelRemaining;
+ String NBT_Type= fuelType;
if (stack.stackTagCompound != null) {
NBT_Heat = stack.stackTagCompound.getFloat("heat");
NBT_MaxHeat = stack.stackTagCompound.getFloat("maxHeat");
NBT_Fuel = stack.stackTagCompound.getInteger("fuelRemaining");
NBT_Type = stack.stackTagCompound.getString("fuelType");
- }
-
- final String tempHeat = String.valueOf(NBT_Heat);
- final String tempMaxHeat = String.valueOf(NBT_MaxHeat);
- final String tempFuel = String.valueOf(NBT_Fuel);
- final String formattedType = EnumChatFormatting.DARK_RED + NBT_Type + EnumChatFormatting.GRAY;
- String formattedHeat = EnumChatFormatting.RED + tempHeat + EnumChatFormatting.GRAY;
- final String formattedMaxHeat = EnumChatFormatting.RED + tempMaxHeat + EnumChatFormatting.GRAY;
- String formattedFuelLeft = tempFuel + EnumChatFormatting.GRAY;
-
- final int tempMax = this.maximumFuel;
- final float tempCurrentHeat = this.heat;
- final int tempFuelLeft = this.fuelRemaining;
-
- // Fuel Usage Formatting
- if (tempFuelLeft <= this.maximumFuel / 3) {
- formattedFuelLeft = EnumChatFormatting.RED + tempFuel + EnumChatFormatting.GRAY;
- }
- else if (tempFuelLeft >= this.maximumFuel / 3 && tempFuelLeft <= this.maximumFuel / 3 * 2) {
- formattedFuelLeft = EnumChatFormatting.YELLOW + tempFuel + EnumChatFormatting.GRAY;
- }
- else if (tempFuelLeft >= this.maximumFuel / 3 * 2 && tempFuelLeft <= this.maximumFuel) {
- formattedFuelLeft = EnumChatFormatting.GREEN + tempFuel + EnumChatFormatting.GRAY;
+ }
+
+ String tempHeat = String.valueOf(NBT_Heat);
+ String tempMaxHeat = String.valueOf(NBT_MaxHeat);
+ String tempFuel = String.valueOf(NBT_Fuel);
+ String formattedType = EnumChatFormatting.DARK_RED+NBT_Type+EnumChatFormatting.GRAY;
+ String formattedHeat = EnumChatFormatting.RED+tempHeat+EnumChatFormatting.GRAY;
+ String formattedMaxHeat = EnumChatFormatting.RED+tempMaxHeat+EnumChatFormatting.GRAY;
+ String formattedFuelLeft = tempFuel+EnumChatFormatting.GRAY;
+
+ int tempMax = maximumFuel;
+ float tempCurrentHeat = heat;
+ int tempFuelLeft = fuelRemaining;
+
+ //Fuel Usage Formatting
+ if (tempFuelLeft <= maximumFuel/3){
+ formattedFuelLeft = EnumChatFormatting.RED+tempFuel+EnumChatFormatting.GRAY;
+ }
+ else if (tempFuelLeft >= maximumFuel/3 && tempFuelLeft <= (maximumFuel/3)*2){
+ formattedFuelLeft = EnumChatFormatting.YELLOW+tempFuel+EnumChatFormatting.GRAY;
+ }
+ else if (tempFuelLeft >= (maximumFuel/3)*2 && tempFuelLeft <= maximumFuel){
+ formattedFuelLeft = EnumChatFormatting.GREEN+tempFuel+EnumChatFormatting.GRAY;
}
else {
- formattedFuelLeft = EnumChatFormatting.GRAY + tempFuel + EnumChatFormatting.GRAY;
+ formattedFuelLeft = EnumChatFormatting.GRAY+tempFuel+EnumChatFormatting.GRAY;
}
-
- // Heat Formatting
- if (tempCurrentHeat <= 200 && tempCurrentHeat >= 0) {
- formattedHeat = EnumChatFormatting.GRAY + tempHeat + EnumChatFormatting.GRAY;
+
+ //Heat Formatting
+ if (tempCurrentHeat <= 200 && tempCurrentHeat >= 0){
+ formattedHeat = EnumChatFormatting.GRAY+tempHeat+EnumChatFormatting.GRAY;
}
- else if (tempCurrentHeat <= this.maxHeat / 3 && tempCurrentHeat > 200) {
- formattedHeat = EnumChatFormatting.YELLOW + tempHeat + EnumChatFormatting.GRAY;
+ else if (tempCurrentHeat <= maxHeat/3 && tempCurrentHeat > 200){
+ formattedHeat = EnumChatFormatting.YELLOW+tempHeat+EnumChatFormatting.GRAY;
}
- else if (tempCurrentHeat >= this.maxHeat / 3 && tempMax < this.maxHeat / 3 * 2 && tempCurrentHeat != 0) {
- formattedHeat = EnumChatFormatting.GOLD + tempHeat + EnumChatFormatting.GRAY;
+ else if (tempCurrentHeat >= maxHeat/3 && tempMax < (maxHeat/3)*2 && tempCurrentHeat != 0){
+ formattedHeat = EnumChatFormatting.GOLD+tempHeat+EnumChatFormatting.GRAY;
}
- else if (tempCurrentHeat >= this.maxHeat / 3 * 2 && tempMax <= this.maxHeat && tempCurrentHeat != 0) {
- formattedHeat = EnumChatFormatting.RED + tempHeat + EnumChatFormatting.GRAY;
+ else if (tempCurrentHeat >= ((maxHeat/3)*2) && tempMax <= maxHeat && tempCurrentHeat != 0){
+ formattedHeat = EnumChatFormatting.RED+tempHeat+EnumChatFormatting.GRAY;
}
else {
- formattedHeat = EnumChatFormatting.BLUE + tempHeat + EnumChatFormatting.GRAY;
+ formattedHeat = EnumChatFormatting.BLUE+tempHeat+EnumChatFormatting.GRAY;
}
- list.add(EnumChatFormatting.GRAY + "A " + formattedType + " Fuel Rod.");
- list.add(EnumChatFormatting.GRAY + "Running at " + formattedHeat + "/" + formattedMaxHeat + " Kelvin.");
- list.add(EnumChatFormatting.GRAY + "Fuel Remaining: " + formattedFuelLeft + "L.");
+ list.add(EnumChatFormatting.GRAY+"A "+formattedType+" Fuel Rod.");
+ list.add(EnumChatFormatting.GRAY+"Running at "+formattedHeat+"/"+formattedMaxHeat+" Kelvin.");
+ list.add(EnumChatFormatting.GRAY+"Fuel Remaining: "+formattedFuelLeft+"L.");
super.addInformation(stack, aPlayer, list, bool);
}
- public int getFuel(final ItemStack stack) {
- if (stack != null) {
- final int i = stack.getItemDamage();
- final int r = this.maximumFuel - i;
- return r;
- }
- return this.getFuelRemaining(stack);
+ public String getType(ItemStack stack){
+ if (stack.stackTagCompound != null){
+ return stack.stackTagCompound.getString("fuelType");
+ }
+ return fuelType;
}
- public int getFuelRemaining(final ItemStack stack) {
- if (stack.stackTagCompound != null) {
+ public int getFuelRemaining(ItemStack stack){
+ if (stack.stackTagCompound != null){
return stack.stackTagCompound.getInteger("fuelRemaining");
- }
- return 0;
+ }
+ return 0;
}
- public float getHeat(final ItemStack value) {
- if (value.stackTagCompound != null) {
- return value.stackTagCompound.getFloat("heat");
- }
- return 0f;
+ public int getMaxFuel(){
+ return maximumFuel;
}
- public int getMaxFuel() {
- return this.maximumFuel;
- }
-
- private float getMaxHeat() {
- float tempvar;
- if (this.fuelType == "Thorium") {
- tempvar = 2500;
+ public int getFuel(ItemStack stack){
+ if (stack != null){
+ int i = stack.getItemDamage();
+ int r = maximumFuel - i;
+ return r;
}
+ return getFuelRemaining(stack);
+ }
- else if (this.fuelType == "Uranium") {
- tempvar = 5000;
- }
+ public boolean setFuelRemainingExplicitly(int i){
+ int tempFuel = fuelRemaining;
+ fuelRemaining = i;
+ if (i != tempFuel){
+ return true;
+ }
+ return false;
+ }
- else if (this.fuelType == "Plutonium") {
- tempvar = 10000;
- }
+ public boolean addFuel(int i){
+ int tempFuel = fuelRemaining;
+ fuelRemaining = tempFuel+i;
+ if (fuelRemaining != tempFuel){
+ return true;
+ }
+ return false;
+ }
- else {
- tempvar = 5000;
+ public float getHeat(ItemStack value){
+ if (value.stackTagCompound != null){
+ return value.stackTagCompound.getFloat("heat");
}
- return tempvar;
-
+ return 0f;
}
- public String getType(final ItemStack stack) {
- if (stack.stackTagCompound != null) {
- return stack.stackTagCompound.getString("fuelType");
- }
- return this.fuelType;
+ public boolean addHeat(float i){
+ float tempFuel = heat;
+ heat = tempFuel+i;
+ if (heat != tempFuel){
+ return true;
+ }
+ return false;
}
- // Ticking and NBT Handling
- /*
- * Called each tick as long the item is on a player inventory. Uses by maps
- * to check if is on a player hand and update it's contents.
- *
- * public int fuelRemaining = 0; public int maximumFuel = 0; public String
- * fuelType = ""; public float heat = 0; public float maxHeat = 5000;
+
+ //Ticking and NBT Handling
+ /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
+ * update it's contents.
*
+ * public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = 5000;
+ *
*/
@Override
- public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {
+ public void onCreated(ItemStack itemStack, World world, EntityPlayer player) {
itemStack.stackTagCompound = new NBTTagCompound();
- itemStack.stackTagCompound.setInteger("fuelRemaining", this.getFuelRemaining(itemStack));
- itemStack.stackTagCompound.setInteger("maximumFuel", this.maximumFuel);
- itemStack.stackTagCompound.setFloat("heat", this.getHeat(itemStack));
- itemStack.stackTagCompound.setFloat("maxHeat", this.getMaxHeat());
- itemStack.stackTagCompound.setString("fuelType", this.getType(itemStack));
- this.updateVars(itemStack);
+ itemStack.stackTagCompound.setInteger("fuelRemaining", getFuelRemaining(itemStack));
+ itemStack.stackTagCompound.setInteger("maximumFuel", maximumFuel);
+ itemStack.stackTagCompound.setFloat("heat", getHeat(itemStack));
+ itemStack.stackTagCompound.setFloat("maxHeat", getMaxHeat());
+ itemStack.stackTagCompound.setString("fuelType", getType(itemStack));
+ updateVars(itemStack);
}
@Override
- public void onUpdate(final ItemStack itemStack, final World par2World, final Entity par3Entity, final int par4,
- final boolean par5) {
+ public void onUpdate(ItemStack itemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
itemStack.stackTagCompound = new NBTTagCompound();
- itemStack.stackTagCompound.setInteger("fuelRemaining", this.getFuelRemaining(itemStack));
- itemStack.stackTagCompound.setInteger("maximumFuel", this.maximumFuel);
- itemStack.stackTagCompound.setFloat("heat", this.getHeat(itemStack));
- itemStack.stackTagCompound.setFloat("maxHeat", this.getMaxHeat());
- itemStack.stackTagCompound.setString("fuelType", this.getType(itemStack));
- this.updateVars(itemStack);
- }
-
- public boolean setFuelRemainingExplicitly(final int i) {
- final int tempFuel = this.fuelRemaining;
- this.fuelRemaining = i;
- if (i != tempFuel) {
- return true;
- }
- return false;
- }
-
- private void updateVars(final ItemStack stack) {
- if (stack.stackTagCompound != null) {
- this.heat = stack.stackTagCompound.getFloat("heat");
- this.fuelRemaining = stack.stackTagCompound.getInteger("fuelRemaining");
- }
+ itemStack.stackTagCompound.setInteger("fuelRemaining", getFuelRemaining(itemStack));
+ itemStack.stackTagCompound.setInteger("maximumFuel", maximumFuel);
+ itemStack.stackTagCompound.setFloat("heat", getHeat(itemStack));
+ itemStack.stackTagCompound.setFloat("maxHeat", getMaxHeat());
+ itemStack.stackTagCompound.setString("fuelType", getType(itemStack));
+ updateVars(itemStack);
}
+
+
}
diff --git a/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java
index a90ca5db35..9b852cb1ea 100644
--- a/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java
+++ b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java
@@ -1,8 +1,8 @@
package gtPlusPlus.core.item.general.fuelrods;
-public class FuelRod_Thorium extends FuelRod_Base {
+public class FuelRod_Thorium extends FuelRod_Base{
- public FuelRod_Thorium(final String unlocalizedName, final String type, final int fuelLeft, final int maxFuel) {
+ public FuelRod_Thorium(String unlocalizedName, String type, int fuelLeft, int maxFuel) {
super(unlocalizedName, type, fuelLeft, maxFuel);
this.setMaxDamage(maxFuel);
this.maximumFuel = maxFuel;
diff --git a/src/Java/gtPlusPlus/core/item/init/ItemsFoods.java b/src/Java/gtPlusPlus/core/item/init/ItemsFoods.java
index bf6f98aed6..7fbfca0ac8 100644
--- a/src/Java/gtPlusPlus/core/item/init/ItemsFoods.java
+++ b/src/Java/gtPlusPlus/core/item/init/ItemsFoods.java
@@ -11,45 +11,33 @@ import net.minecraft.potion.PotionEffect;
public class ItemsFoods {
- public static void load() {
- ItemsFoods.run();
+ public static void load(){
+ run();
}
-
- private static void run() {
-
- // Raisin Bread
- ModItems.itemIngotRaisinBread = new BaseItemFood("itemIngotRaisinBread", "Raisin Bread", 3, 1.5f, false,
- new PotionEffect(Potion.weakness.id, 40, 1)).setAlwaysEdible();
- GT_OreDictUnificator.registerOre("foodRaisinBread",
- ItemUtils.getItemStack(CORE.MODID + ":itemIngotRaisinBread", 1));
- // Hot Raisin Bread
- ModItems.itemHotIngotRaisinBread = new BaseItemHotFood("itemHotIngotRaisinBread", 1, 0.5f, "Raisin Bread", 120,
- ModItems.itemIngotRaisinBread);
- GT_OreDictUnificator.registerOre("foodHotRaisinBread",
- ItemUtils.getItemStack(CORE.MODID + ":itemHotIngotRaisinBread", 1));
-
- // Raisin Bread
- ModItems.itemFoodRaisinToast = new BaseItemFood("itemFoodRaisinToast", "Raisin Toast", 1, 0.5f, false)
- .setAlwaysEdible();
- GT_OreDictUnificator.registerOre("foodRaisinToast",
- ItemUtils.getItemStack(CORE.MODID + ":itemFoodRaisinToast", 1));
- // Hot Raisin Bread
- ModItems.itemHotFoodRaisinToast = new BaseItemHotFood("itemHotFoodRaisinToast", 1, 0.5f, "Raisin Toast", 20,
- ModItems.itemFoodRaisinToast);
- GT_OreDictUnificator.registerOre("foodHotRaisinToast",
- ItemUtils.getItemStack(CORE.MODID + ":itemHotFoodRaisinToast", 1));
-
- // Raisin Bread
- ModItems.itemFoodCurriedSausages = new BaseItemFood("itemFoodCurriedSausages", "Curried Sausages", 5, 2f,
- false);
- GT_OreDictUnificator.registerOre("foodCurriedSausages",
- ItemUtils.getItemStack(CORE.MODID + ":itemFoodCurriedSausages", 1));
- // Hot Raisin Bread
- ModItems.itemHotFoodCurriedSausages = new BaseItemHotFood("itemHotFoodCurriedSausages", 1, 0.5f,
- "Curried Sausages", 240, ModItems.itemFoodCurriedSausages);
- GT_OreDictUnificator.registerOre("foodHotCurriedSausages",
- ItemUtils.getItemStack(CORE.MODID + ":itemHotFoodCurriedSausages", 1));
-
+
+ private static void run(){
+
+ //Raisin Bread
+ ModItems.itemIngotRaisinBread = new BaseItemFood("itemIngotRaisinBread", "Raisin Bread", 3, 1.5f, false, new PotionEffect(Potion.weakness.id, 40, 1)).setAlwaysEdible();
+ GT_OreDictUnificator.registerOre("foodRaisinBread", ItemUtils.getItemStack(CORE.MODID+":itemIngotRaisinBread", 1));
+ //Hot Raisin Bread
+ ModItems.itemHotIngotRaisinBread = new BaseItemHotFood("itemHotIngotRaisinBread", 1, 0.5f, "Raisin Bread", 120, ModItems.itemIngotRaisinBread);
+ GT_OreDictUnificator.registerOre("foodHotRaisinBread", ItemUtils.getItemStack(CORE.MODID+":itemHotIngotRaisinBread", 1));
+
+ //Raisin Bread
+ ModItems.itemFoodRaisinToast = new BaseItemFood("itemFoodRaisinToast", "Raisin Toast", 1, 0.5f, false).setAlwaysEdible();
+ GT_OreDictUnificator.registerOre("foodRaisinToast", ItemUtils.getItemStack(CORE.MODID+":itemFoodRaisinToast", 1));
+ //Hot Raisin Bread
+ ModItems.itemHotFoodRaisinToast = new BaseItemHotFood("itemHotFoodRaisinToast", 1, 0.5f, "Raisin Toast", 20, ModItems.itemFoodRaisinToast);
+ GT_OreDictUnificator.registerOre("foodHotRaisinToast", ItemUtils.getItemStack(CORE.MODID+":itemHotFoodRaisinToast", 1));
+
+ //Raisin Bread
+ ModItems.itemFoodCurriedSausages = new BaseItemFood("itemFoodCurriedSausages", "Curried Sausages", 5, 2f, false);
+ GT_OreDictUnificator.registerOre("foodCurriedSausages", ItemUtils.getItemStack(CORE.MODID+":itemFoodCurriedSausages", 1));
+ //Hot Raisin Bread
+ ModItems.itemHotFoodCurriedSausages = new BaseItemHotFood("itemHotFoodCurriedSausages", 1, 0.5f, "Curried Sausages", 240, ModItems.itemFoodCurriedSausages);
+ GT_OreDictUnificator.registerOre("foodHotCurriedSausages", ItemUtils.getItemStack(CORE.MODID+":itemHotFoodCurriedSausages", 1));
+
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/item/materials/MaterialHandler.java b/src/Java/gtPlusPlus/core/item/materials/MaterialHandler.java
index 09487e1546..0f89f2a0ff 100644
--- a/src/Java/gtPlusPlus/core/item/materials/MaterialHandler.java
+++ b/src/Java/gtPlusPlus/core/item/materials/MaterialHandler.java
@@ -4,5 +4,7 @@ public class MaterialHandler {
@SuppressWarnings("unused")
private String Staballoy;
-
+
+
+
}
diff --git a/src/Java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java b/src/Java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java
index 7e00895b32..108ac4b83d 100644
--- a/src/Java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java
+++ b/src/Java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java
@@ -1,54 +1,64 @@
package gtPlusPlus.core.item.tool.misc;
-import java.util.List;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.base.BaseItemWithDamageValue;
import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class SandstoneHammer extends BaseItemWithDamageValue {
+public class SandstoneHammer extends BaseItemWithDamageValue{
- public SandstoneHammer(final String unlocalizedName) {
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getColorFromItemStack(net.minecraft.item.ItemStack, int)
+ */
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ //Figure Out Damage
+
+
+ return super.getColorFromItemStack(stack, HEX_OxFFFFFF);
+ }
+
+ public SandstoneHammer(String unlocalizedName) {
super(unlocalizedName);
this.setTextureName(CORE.MODID + ":" + unlocalizedName);
this.setMaxStackSize(1);
this.setMaxDamage(2500);
}
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GRAY + "Allows you to craft sand from cobble, or sandstone from sand.");
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.GRAY+"Allows you to craft sand from cobble, or sandstone from sand.");
super.addInformation(stack, aPlayer, list, bool);
- }
+ }
@Override
- public boolean doesContainerItemLeaveCraftingGrid(final ItemStack itemStack) {
+ public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack)
+ {
return false;
}
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.item.Item#getColorFromItemStack(net.minecraft.item.
- * ItemStack, int)
- */
@Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- // Figure Out Damage
-
- return super.getColorFromItemStack(stack, HEX_OxFFFFFF);
+ public boolean getShareTag()
+ {
+ return true;
}
@Override
- public ItemStack getContainerItem(final ItemStack itemStack) {
+ public boolean hasContainerItem(ItemStack itemStack)
+ {
+ return true;
+ }
+ @Override
+ public ItemStack getContainerItem(ItemStack itemStack)
+ {
itemStack.setItemDamage(itemStack.getItemDamage() + 8);
return itemStack;
@@ -56,23 +66,14 @@ public class SandstoneHammer extends BaseItemWithDamageValue {
@Override
@SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ public EnumRarity getRarity(ItemStack par1ItemStack){
return EnumRarity.uncommon;
}
@Override
- public boolean getShareTag() {
- return true;
- }
-
- @Override
- public boolean hasContainerItem(final ItemStack itemStack) {
- return true;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
+ public boolean hasEffect(ItemStack par1ItemStack){
return false;
}
+
}
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
index b9736136bb..99ee699dcf 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.item.tool.staballoy;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
@@ -16,190 +13,167 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class MultiPickaxeBase extends StaballoyPickaxe {
+public class MultiPickaxeBase extends StaballoyPickaxe{
- protected Boolean FACING_HORIZONTAL = true;
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
+ */
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (super.getDurabilityForDisplay(stack) > 0){
+ return super.getDurabilityForDisplay(stack);}
+ return 0;
+ }
- protected String FACING = "north";
- protected EntityPlayer localPlayer;
- protected String lookingDirection;
- protected World localWorld;
- protected ItemStack thisPickaxe = null;
- protected final int colour;
- protected final String materialName;
- public boolean isValid = true;
- public MultiPickaxeBase(final String unlocalizedName, final ToolMaterial material, final int materialDurability,
- final int colour) {
+ protected Boolean FACING_HORIZONTAL = true;
+ protected String FACING = "north";
+ protected EntityPlayer localPlayer;
+ protected String lookingDirection;
+ protected World localWorld;
+ protected ItemStack thisPickaxe = null;
+ protected final int colour;
+ protected final String materialName;
+ public boolean isValid = true;
+
+ public MultiPickaxeBase(String unlocalizedName, ToolMaterial material, int materialDurability, int colour) {
super(Utils.sanitizeString(unlocalizedName), material);
this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName));
this.setTextureName(CORE.MODID + ":" + "itemPickaxe");
- this.FACING_HORIZONTAL = true;
+ this.FACING_HORIZONTAL=true;
this.setMaxStackSize(1);
this.setMaxDamage(materialDurability);
this.colour = colour;
- this.materialName = material.name();
+ this.materialName = material.name();
this.setCreativeTab(AddToCreativeTab.tabTools);
- try {
- this.isValid = this.addRecipe();
- }
- catch (final Throwable e) {
- }
- if (colour != 0 && this.isValid) {
- GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName));
+ try {isValid = addRecipe();} catch (Throwable e){}
+ if (colour != 0 && isValid){
+ GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName));
}
}
- private boolean addRecipe() {
- final String plateDense = "plateDense" + this.materialName;
- final String rodLong = "stickLong" + this.materialName;
- final String toolHammer = "craftingToolHardHammer";
- final String toolWrench = "craftingToolWrench";
- final String toolFile = "craftingToolFile";
- final String toolScrewDriver = "craftingToolScrewdriver";
+ /*
+ *
+ *
+ *
+ * Methods
+ *
+ *
+ *
+ */
+
+ private boolean addRecipe(){
+ String plateDense = "plateDense"+materialName;
+ String rodLong = "stickLong"+materialName;
+ String toolHammer = "craftingToolHardHammer";
+ String toolWrench = "craftingToolWrench";
+ String toolFile = "craftingToolFile";
+ String toolScrewDriver = "craftingToolScrewdriver";
- if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)) {
+ if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)){
return false;
}
- if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)) {
+ if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)){
return false;
}
- RecipeUtils.recipeBuilder(plateDense, plateDense, plateDense, toolFile, rodLong, toolHammer, toolWrench,
- rodLong, toolScrewDriver, ItemUtils.getSimpleStack(this));
+ RecipeUtils.recipeBuilder(
+ plateDense, plateDense, plateDense,
+ toolFile, rodLong, toolHammer,
+ toolWrench, rodLong, toolScrewDriver,
+ ItemUtils.getSimpleStack(this));
return true;
}
- /*
- *
- *
- *
- * Methods
- *
- *
- *
- */
-
- @SuppressWarnings("static-method")
- private float calculateDurabilityLoss(final World world, final int X, final int Y, final int Z) {
- float bDurabilityLoss = 0;
- Boolean correctTool = false;
- float bHardness = 0;
- if (!world.isRemote) {
- try {
- final Block removalist = world.getBlock(X, Y, Z);
- // Utils.LOG_WARNING(removalist.toString());
-
- bHardness = removalist.getBlockHardness(world, X, Y, Z) * 100;
- Utils.LOG_WARNING("Hardness: " + bHardness);
-
- bDurabilityLoss = 100;
- // Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
-
- correctTool = this.canPickaxeBlock(removalist, world);
- Utils.LOG_WARNING("" + correctTool);
-
- if (!correctTool) {
- return 0;
- }
-
- }
- catch (final NullPointerException e) {
-
- }
- }
- return bDurabilityLoss;
- }
-
- @Override
- public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer) {
- item.damageItem(damage, localPlayer);
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0) {
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colour;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.
- * ItemStack)
- */
- @Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- if (super.getDurabilityForDisplay(stack) > 0) {
- return super.getDurabilityForDisplay(stack);
- }
- return 0;
+ public final String getMaterialName() {
+ return materialName;
}
@Override
- public String getItemStackDisplayName(final ItemStack iStack) {
+ public String getItemStackDisplayName(ItemStack iStack) {
String name;
- if (this.getUnlocalizedName().toLowerCase().contains("wood")) {
+ if (getUnlocalizedName().toLowerCase().contains("wood")){
name = "Wooden";
}
- else if (this.getUnlocalizedName().toLowerCase().contains("cobblestone")) {
+ else if (getUnlocalizedName().toLowerCase().contains("cobblestone")){
name = "Cobblestone";
}
- else if (this.getUnlocalizedName().toLowerCase().contains("iron")) {
+ else if (getUnlocalizedName().toLowerCase().contains("iron")){
name = "Iron";
}
- else if (this.getUnlocalizedName().toLowerCase().contains("gold")) {
+ else if (getUnlocalizedName().toLowerCase().contains("gold")){
name = "Gold";
}
- else if (this.getUnlocalizedName().toLowerCase().contains("diamond")) {
+ else if (getUnlocalizedName().toLowerCase().contains("diamond")){
name = "Diamond";
}
else {
- name = this.materialName;
+ name = materialName;
}
- return name + " Multipickaxe";
- }
-
- public final String getMaterialName() {
- return this.materialName;
+ return name+" Multipickaxe";
}
@Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
- return EnumRarity.uncommon;
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
}
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
- return false;
+ @SuppressWarnings("static-method")
+ private float calculateDurabilityLoss(World world, int X, int Y, int Z){
+ float bDurabilityLoss = 0;
+ Boolean correctTool = false;
+ float bHardness = 0;
+ if (!world.isRemote){
+ try {
+ Block removalist = world.getBlock(X, Y, Z);
+ //Utils.LOG_WARNING(removalist.toString());
+
+ bHardness = removalist.getBlockHardness(world, X, Y, Z)*100;
+ Utils.LOG_WARNING("Hardness: "+bHardness);
+
+ bDurabilityLoss = 100;
+ //Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
+
+ correctTool = canPickaxeBlock(removalist, world);
+ Utils.LOG_WARNING(""+correctTool);
+
+ if (!correctTool){
+ return 0;
+ }
+
+ } catch (NullPointerException e){
+
+ }
+ }
+ return bDurabilityLoss;
}
- // Should clear up blocks quicker if I chain it.
+ //Should clear up blocks quicker if I chain it.
@Override
- public void removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z,
- final ItemStack heldItem) {
- this.localWorld = world;
+ public void removeBlockAndDropAsItem(World world, int X, int Y, int Z, ItemStack heldItem){
+ localWorld = world;
try {
- final Block block = world.getBlock(X, Y, Z);
- final float dur = this.calculateDurabilityLoss(world, X, Y, Z);
+ Block block = world.getBlock(X, Y, Z);
+ float dur = calculateDurabilityLoss(world, X, Y, Z);
Utils.LOG_WARNING(block.toString());
String removalTool = "";
removalTool = block.getHarvestTool(1);
- if (removalTool.equals("pickaxe") || UtilsMining.getBlockType(block)) {
- if (this.canPickaxeBlock(block, world)) {
- if (block != Blocks.bedrock && block.getBlockHardness(world, X, Y, Z) != -1
- && block.getBlockHardness(world, X, Y, Z) <= 100 && block != Blocks.water
- && block != Blocks.lava) {
+ if (removalTool.equals("pickaxe") || UtilsMining.getBlockType(block)){
+ if (canPickaxeBlock(block, world)){
+ if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
- if (heldItem.getItemDamage() <= heldItem.getMaxDamage() - dur) {
+ if (heldItem.getItemDamage() <= (heldItem.getMaxDamage()-dur)){
block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
world.setBlockToAir(X, Y, Z);
@@ -215,15 +189,29 @@ public class MultiPickaxeBase extends StaballoyPickaxe {
Utils.LOG_WARNING("Incorrect Tool for mining this block.");
}
}
- }
- catch (final NullPointerException e) {
+ } catch (NullPointerException e){
}
}
+ public void damageItem(ItemStack item, int damage, EntityPlayer localPlayer){
+ item.damageItem(damage, localPlayer);
+ }
+
+ public void setItemDamage(ItemStack item, int damage){
+ item.setItemDamage(damage-1);
+ }
+
+
@Override
- public void setItemDamage(final ItemStack item, final int damage) {
- item.setItemDamage(damage - 1);
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.uncommon;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return false;
}
}
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
index 0c7eba48e8..0560893490 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.item.tool.staballoy;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
@@ -13,108 +10,105 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class MultiSpadeBase extends StaballoySpade {
+public class MultiSpadeBase extends StaballoySpade{
- protected Boolean FACING_HORIZONTAL = true;
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
+ */
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (super.getDurabilityForDisplay(stack) > 0){
+ return super.getDurabilityForDisplay(stack);}
+ return 0;
+ }
- protected String FACING = "north";
- protected EntityPlayer localPlayer;
- protected String lookingDirection;
- protected World localWorld;
- protected ItemStack thisPickaxe = null;
- protected final int colour;
- protected final String materialName;
- public boolean isValid = true;
- public MultiSpadeBase(final String unlocalizedName, final ToolMaterial material, final int materialDurability,
- final int colour) {
+ protected Boolean FACING_HORIZONTAL = true;
+ protected String FACING = "north";
+ protected EntityPlayer localPlayer;
+ protected String lookingDirection;
+ protected World localWorld;
+ protected ItemStack thisPickaxe = null;
+ protected final int colour;
+ protected final String materialName;
+ public boolean isValid = true;
+
+ public MultiSpadeBase(String unlocalizedName, ToolMaterial material, int materialDurability, int colour) {
super(Utils.sanitizeString(unlocalizedName), material);
this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName));
this.setTextureName(CORE.MODID + ":" + "itemShovel");
- this.FACING_HORIZONTAL = true;
+ this.FACING_HORIZONTAL=true;
this.setMaxStackSize(1);
this.setMaxDamage(materialDurability);
this.colour = colour;
this.materialName = material.name();
this.setCreativeTab(AddToCreativeTab.tabTools);
- try {
- this.isValid = this.addRecipe();
- }
- catch (final Throwable e) {
- }
- if (colour != 0 && this.isValid) {
- GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName));
+ try {isValid = addRecipe();} catch (Throwable e){}
+ if (colour != 0 && isValid){
+ GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName));
}
}
-
- private boolean addRecipe() {
- final String plateDense = "plateDense" + this.materialName;
- final String rodLong = "stickLong" + this.materialName;
- final String toolHammer = "craftingToolHardHammer";
- final String toolWrench = "craftingToolWrench";
- final String toolFile = "craftingToolFile";
- final String toolScrewDriver = "craftingToolScrewdriver";
-
- if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)) {
+
+ private boolean addRecipe(){
+ String plateDense = "plateDense"+materialName;
+ String rodLong = "stickLong"+materialName;
+ String toolHammer = "craftingToolHardHammer";
+ String toolWrench = "craftingToolWrench";
+ String toolFile = "craftingToolFile";
+ String toolScrewDriver = "craftingToolScrewdriver";
+
+ if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)){
return false;
}
- if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)) {
+ if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)){
return false;
- }
-
- RecipeUtils.recipeBuilder(toolFile, plateDense, toolHammer, null, rodLong, null, toolWrench, rodLong,
- toolScrewDriver, ItemUtils.getSimpleStack(this));
-
+ }
+
+ RecipeUtils.recipeBuilder(
+ toolFile, plateDense, toolHammer,
+ null, rodLong, null,
+ toolWrench, rodLong, toolScrewDriver,
+ ItemUtils.getSimpleStack(this));
+
return true;
}
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0) {
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colour;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.
- * ItemStack)
- */
- @Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- if (super.getDurabilityForDisplay(stack) > 0) {
- return super.getDurabilityForDisplay(stack);
- }
- return 0;
+
+ public final String getMaterialName() {
+ return materialName;
}
-
+
@Override
- public String getItemStackDisplayName(final ItemStack iStack) {
+ public String getItemStackDisplayName(ItemStack iStack) {
String name;
- if (this.getUnlocalizedName().toLowerCase().contains("wood")) {
+ if (getUnlocalizedName().toLowerCase().contains("wood")){
name = "Wooden";
}
else {
- name = this.materialName;
+ name = materialName;
}
- return "Big " + name + " Spade";
+ return "Big "+name+" Spade";
}
- public final String getMaterialName() {
- return this.materialName;
- }
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+ }
@Override
@SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
+ public EnumRarity getRarity(ItemStack par1ItemStack){
return EnumRarity.uncommon;
}
@Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
+ public boolean hasEffect(ItemStack par1ItemStack){
return false;
}
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
index 16852b5090..07c5800a1f 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
@@ -1,366 +1,279 @@
package gtPlusPlus.core.item.tool.staballoy;
+import gtPlusPlus.core.lib.CORE;
+
import java.util.List;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.lib.CORE;
-import net.minecraft.block.*;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockAir;
+import net.minecraft.block.BlockCocoa;
+import net.minecraft.block.BlockDirt;
+import net.minecraft.block.BlockDoublePlant;
+import net.minecraft.block.BlockFlower;
+import net.minecraft.block.BlockGrass;
+import net.minecraft.block.BlockHugeMushroom;
+import net.minecraft.block.BlockLeavesBase;
+import net.minecraft.block.BlockLog;
+import net.minecraft.block.BlockMushroom;
+import net.minecraft.block.BlockSand;
+import net.minecraft.block.BlockSnow;
+import net.minecraft.block.BlockSnowBlock;
+import net.minecraft.block.BlockTallGrass;
+import net.minecraft.block.BlockVine;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.*;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.ItemAxe;
+import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class StaballoyAxe extends ItemAxe {
+public class StaballoyAxe extends ItemAxe{
public String mat;
- // EXPLODE TREE
- byte[] tre = new byte[32000];
-
- byte unchecked = 0;
- byte needcheck = 1;
- byte ignore = 2;
- byte harvest = 3;
- public StaballoyAxe(final String unlocalizedName, final ToolMaterial material) {
+ public StaballoyAxe(String unlocalizedName, ToolMaterial material) {
super(material);
this.setUnlocalizedName(unlocalizedName);
this.setTextureName(CORE.MODID + ":" + unlocalizedName);
}
-
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
+
+ // EXPLODE TREE
+ byte[] tre= new byte[32000];
+ byte unchecked=0;
+ byte needcheck=1;
+ byte ignore =2;
+ byte harvest =3;
+
+ private boolean setcheck(int x, int y, int z) {
+ if(x<0 || x>19 || z<0 || z>19 || y<0 || y>79) return false;
+ int o=x+z*20+y*400;
+ if (tre[o]==unchecked) tre[o]=needcheck;
+ return true;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GOLD + "Fells entire trees in a single swipe!..");
- list.add(EnumChatFormatting.GRAY + "Ask Alkalus for new trees to be supported.");
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.GOLD+"Fells entire trees in a single swipe!..");
+ list.add(EnumChatFormatting.GRAY+"Ask Alkalus for new trees to be supported.");
super.addInformation(stack, aPlayer, list, bool);
}
-
- private void breakMushroom(final World wld, final Block bit, final EntityPlayer plr, final boolean silk,
- final int x, final int y, final int z, final int met) {
- if (silk) {
- final ItemStack stk = null; // TODO
- /*
- * if (bit==Blocks.brown_mushroom_block) stk = new
- * ItemStack(LoonToolItems.brown_mushroom_block,1,met); else if
- * (bit==Blocks.red_mushroom_block) stk = new
- * ItemStack(LoonToolItems.red_mushroom_block,1,met); else stk = new
- * ItemStack(bit,1,met);
- */
- final EntityItem entityitem = new EntityItem(wld, x + 0.5, y + 0.5, z + 0.5, stk);
- entityitem.delayBeforeCanPickup = 10;
- wld.spawnEntityInWorld(entityitem);
- }
- else {
- bit.harvestBlock(wld, plr, x, y, z, met);
- }
- wld.setBlockToAir(x, y, z);
- }
-
- public boolean canIgnore(final Block bit) {
- if (bit instanceof BlockAir) {
- return true;
- }
- if (bit instanceof BlockGrass) {
- return true;
- }
- if (bit instanceof BlockSand) {
- return true;
- }
- if (bit instanceof BlockDirt) {
- return true;
- }
- if (bit instanceof BlockCocoa) {
- return true;
- }
- if (bit instanceof BlockVine) {
- return true;
- }
- if (bit instanceof BlockMushroom) {
- return true;
- }
- if (bit instanceof BlockSnow) {
- return true;
- }
- if (bit instanceof BlockSnowBlock) {
- return true;
- }
- if (bit instanceof BlockFlower) {
- return true;
- }
- if (bit instanceof BlockTallGrass) {
- return true;
- }
- if (bit instanceof BlockDoublePlant) {
- return true;
- }
-
- // LoonTools.log("Found uncuttable "+bit.getClass().getSimpleName());
+
+ public boolean canIgnore(Block bit){
+ if (bit instanceof BlockAir)return true;
+ if (bit instanceof BlockGrass)return true;
+ if (bit instanceof BlockSand)return true;
+ if (bit instanceof BlockDirt)return true;
+ if (bit instanceof BlockCocoa)return true;
+ if (bit instanceof BlockVine)return true;
+ if (bit instanceof BlockMushroom)return true;
+ if (bit instanceof BlockSnow)return true;
+ if (bit instanceof BlockSnowBlock)return true;
+ if (bit instanceof BlockFlower)return true;
+ if (bit instanceof BlockTallGrass)return true;
+ if (bit instanceof BlockDoublePlant)return true;
+
+ //LoonTools.log("Found uncuttable "+bit.getClass().getSimpleName());
return false;
}
-
- private int check(final World par1World, final int x, final int y, final int z, final int xo, final int yo,
- final int zo) {
- int f = 0;
- final int o = x + z * 20 + y * 400;
- if (this.tre[o] == this.needcheck) {
- this.tre[o] = this.ignore;
- final Block bit = par1World.getBlock(x + xo, y + yo, z + zo);
- if (bit instanceof BlockLog || bit instanceof BlockLeavesBase || bit instanceof BlockHugeMushroom
- || bit.getUnlocalizedName().toLowerCase().contains("log")
- || bit.getUnlocalizedName().toLowerCase().contains("wood")) {
- f = 1;
- this.tre[o] = this.harvest;
- // if (bit instanceof BlockLog){
- // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" ");
- // }
- for (int xb = -1; xb < 2; xb++) {
- for (int yb = -1; yb < 2; yb++) {
- for (int zb = -1; zb < 2; zb++) {
- if (!this.setcheck(x + xb, y + yb, z + zb)) {
- return 3;
- }
- }
- }
- }
- }
- else {
- if (!this.canIgnore(bit)) {
- return 2;
- }
+
+ private int check(World par1World, int x, int y, int z, int xo, int yo,int zo) {
+ int f=0;
+ int o=x+z*20+y*400;
+ if (tre[o]==needcheck){
+ tre[o]=ignore;
+ Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
+ if ((bit instanceof BlockLog)||(bit instanceof BlockLeavesBase)||(bit instanceof BlockHugeMushroom) || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
+ f=1;
+ tre[o]=harvest;
+ //if (bit instanceof BlockLog){
+ // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" ");
+ //}
+ for(int xb=-1;xb<2;xb++)
+ for(int yb=-1;yb<2;yb++)
+ for(int zb=-1;zb<2;zb++)
+ if (!setcheck(x+xb,y+yb,z+zb))return 3;
+ }else{
+ if (!canIgnore(bit)) return 2;
}
}
return f;
}
-
- private int check2(final World par1World, final int x, final int y, final int z, final int xo, final int yo,
- final int zo) {
- int f = 0;
- final int o = x + z * 20 + y * 400;
- if (this.tre[o] == this.needcheck) {
- this.tre[o] = this.ignore;
- final Block bit = par1World.getBlock(x + xo, y + yo, z + zo);
- if (bit instanceof BlockLog) {
- f = 1;
- this.tre[o] = this.harvest;
- // if (bit instanceof BlockLog){
- // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" ");
- // }
- for (int xb = -1; xb < 2; xb++) {
- for (int yb = -1; yb < 2; yb++) {
- for (int zb = -1; zb < 2; zb++) {
- if (!this.setcheck(x + xb, y + yb, z + zb)) {
- return 3;
- }
- }
+
+ public int checkTree(World par1World,int xo,int yo,int zo){
+ boolean f;
+ for (f=true;f==true;){
+ f=false;
+ for (int y=0;y<80;y++)
+ for(int z=0;z<20;z++)
+ for(int x=0;x<20;x++){
+ int r=check(par1World,x,y,z,xo,yo,zo);
+ if (r==3) return 3;
+ if (r==2) return 2;
+ if (r==1) f=true;
}
- }
- }
- else if (bit instanceof BlockLeavesBase) {
- }
- else {
- if (!this.canIgnore(bit)) {
- return 2;
- }
+
+ for (int y=79;y>=0;y--)
+ for(int z=19;z>=0;z--)
+ for(int x=19;x>=0;x--){
+ int r=check(par1World,x,y,z,xo,yo,zo);
+ if (r==2) return 3;
+ if (r==2) return 2;
+ if (r==1) f=true;
+ }
+ }
+ return 1;
+ }
+
+ private int check2(World par1World, int x, int y, int z, int xo, int yo,int zo) {
+ int f=0;
+ int o=x+z*20+y*400;
+ if (tre[o]==needcheck){
+ tre[o]=ignore;
+ Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
+ if (bit instanceof BlockLog){
+ f=1;
+ tre[o]=harvest;
+ //if (bit instanceof BlockLog){
+ // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" ");
+ //}
+ for(int xb=-1;xb<2;xb++)
+ for(int yb=-1;yb<2;yb++)
+ for(int zb=-1;zb<2;zb++)
+ if (!setcheck(x+xb,y+yb,z+zb))return 3;
+ }else if (bit instanceof BlockLeavesBase){
+ }else{
+ if (!canIgnore(bit)) return 2;
}
}
return f;
}
- public int checkTree(final World par1World, final int xo, final int yo, final int zo) {
+ public int checkTree2(World par1World,int xo,int yo,int zo){
boolean f;
- for (f = true; f == true;) {
- f = false;
- for (int y = 0; y < 80; y++) {
- for (int z = 0; z < 20; z++) {
- for (int x = 0; x < 20; x++) {
- final int r = this.check(par1World, x, y, z, xo, yo, zo);
- if (r == 3) {
- return 3;
- }
- if (r == 2) {
- return 2;
- }
- if (r == 1) {
- f = true;
- }
+ for (f=true;f==true;){
+ f=false;
+ for (int y=0;y<80;y++)
+ for(int z=0;z<20;z++)
+ for(int x=0;x<20;x++){
+ int r=check2(par1World,x,y,z,xo,yo,zo);
+ if (r==3) return 3;
+ if (r==2) return 2;
+ if (r==1) f=true;
}
- }
- }
-
- for (int y = 79; y >= 0; y--) {
- for (int z = 19; z >= 0; z--) {
- for (int x = 19; x >= 0; x--) {
- final int r = this.check(par1World, x, y, z, xo, yo, zo);
- if (r == 2) {
- return 3;
- }
- if (r == 2) {
- return 2;
- }
- if (r == 1) {
- f = true;
- }
+
+ for (int y=79;y>=0;y--)
+ for(int z=19;z>=0;z--)
+ for(int x=19;x>=0;x--){
+ int r=check2(par1World,x,y,z,xo,yo,zo);
+ if (r==2) return 3;
+ if (r==2) return 2;
+ if (r==1) f=true;
}
- }
- }
}
return 1;
}
-
- public int checkTree2(final World par1World, final int xo, final int yo, final int zo) {
- boolean f;
- for (f = true; f == true;) {
- f = false;
- for (int y = 0; y < 80; y++) {
- for (int z = 0; z < 20; z++) {
- for (int x = 0; x < 20; x++) {
- final int r = this.check2(par1World, x, y, z, xo, yo, zo);
- if (r == 3) {
- return 3;
- }
- if (r == 2) {
- return 2;
- }
- if (r == 1) {
- f = true;
+
+ public void exploadTree(World par1World,int xo,int yo,int zo, EntityPlayer plr){
+ for (int y=0;y<80;y++)
+ for(int z=0;z<20;z++)
+ for(int x=0;x<20;x++){
+ int o=x+z*20+y*400;
+ if (tre[o]==harvest){
+ Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
+ int met = par1World.getBlockMetadata(x+xo, y+yo, z+zo);
+
+ if ((bit instanceof BlockLog)||(bit instanceof BlockLeavesBase) || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
+ bit.harvestBlock(par1World, plr, x+xo, y+yo, z+zo,met);
+ par1World.setBlockToAir(x+xo, y+yo, z+zo);
}
}
}
- }
-
- for (int y = 79; y >= 0; y--) {
- for (int z = 19; z >= 0; z--) {
- for (int x = 19; x >= 0; x--) {
- final int r = this.check2(par1World, x, y, z, xo, yo, zo);
- if (r == 2) {
- return 3;
- }
- if (r == 2) {
- return 2;
- }
- if (r == 1) {
- f = true;
- }
- }
- }
- }
- }
- return 1;
}
- public void exploadMushroom(final World par1World, final int xo, final int yo, final int zo, final EntityPlayer plr,
- final boolean silk) {
- for (int y = 0; y < 80; y++) {
- for (int z = 0; z < 20; z++) {
- for (int x = 0; x < 20; x++) {
- final int o = x + z * 20 + y * 400;
- if (this.tre[o] == this.harvest) {
- final Block bit = par1World.getBlock(x + xo, y + yo, z + zo);
- final int met = par1World.getBlockMetadata(x + xo, y + yo, z + zo);
- if (bit instanceof BlockHugeMushroom) {
- this.breakMushroom(par1World, bit, plr, silk, x + xo, y + yo, z + zo, met);
- }
- else {
- bit.harvestBlock(par1World, plr, x + xo, y + yo, z + zo, met);
- par1World.setBlockToAir(x + xo, y + yo, z + zo);
- }
- }
- }
- }
+ private void breakMushroom(World wld, Block bit, EntityPlayer plr, boolean silk, int x, int y, int z, int met) {
+ if (silk){
+ ItemStack stk = null; //TODO
+ /*if (bit==Blocks.brown_mushroom_block) stk = new ItemStack(LoonToolItems.brown_mushroom_block,1,met);
+ else if (bit==Blocks.red_mushroom_block) stk = new ItemStack(LoonToolItems.red_mushroom_block,1,met);
+ else stk = new ItemStack(bit,1,met);*/
+ EntityItem entityitem = new EntityItem(wld, x+0.5, y+0.5, z+0.5, stk);
+ entityitem.delayBeforeCanPickup = 10;
+ wld.spawnEntityInWorld(entityitem);
+ }else{
+ bit.harvestBlock(wld, plr, x, y, z, met);
}
+ wld.setBlockToAir(x, y, z);
}
-
- public void exploadTree(final World par1World, final int xo, final int yo, final int zo, final EntityPlayer plr) {
- for (int y = 0; y < 80; y++) {
- for (int z = 0; z < 20; z++) {
- for (int x = 0; x < 20; x++) {
- final int o = x + z * 20 + y * 400;
- if (this.tre[o] == this.harvest) {
- final Block bit = par1World.getBlock(x + xo, y + yo, z + zo);
- final int met = par1World.getBlockMetadata(x + xo, y + yo, z + zo);
-
- if (bit instanceof BlockLog || bit instanceof BlockLeavesBase
- || bit.getUnlocalizedName().toLowerCase().contains("log")
- || bit.getUnlocalizedName().toLowerCase().contains("wood")) {
- bit.harvestBlock(par1World, plr, x + xo, y + yo, z + zo, met);
- par1World.setBlockToAir(x + xo, y + yo, z + zo);
+
+ public void exploadMushroom(World par1World,int xo,int yo,int zo, EntityPlayer plr, boolean silk){
+ for (int y=0;y<80;y++)
+ for(int z=0;z<20;z++)
+ for(int x=0;x<20;x++){
+ int o=x+z*20+y*400;
+ if (tre[o]==harvest){
+ Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
+ int met = par1World.getBlockMetadata(x+xo, y+yo, z+zo);
+ if (bit instanceof BlockHugeMushroom){
+ breakMushroom(par1World, bit, plr, silk, x+xo, y+yo, z+zo,met);
+ }else{
+ bit.harvestBlock(par1World, plr, x+xo, y+yo, z+zo,met);
+ par1World.setBlockToAir(x+xo, y+yo, z+zo);
}
}
}
- }
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
- return EnumRarity.rare;
}
+
@Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
- return true;
- }
-
- @Override
- public boolean onBlockDestroyed(final ItemStack itm, final World wld, final Block blk, final int x, final int y,
- final int z, final EntityLivingBase plr) {
- if (!wld.isRemote) {
- final Block bit = wld.getBlock(x, y, z);
- final boolean silk = EnchantmentHelper.getSilkTouchModifier(plr);
- if (bit instanceof BlockHugeMushroom) {
- for (int n = 0; n < 32000; n++) {
- this.tre[n] = this.unchecked;
- }
- final int met = wld.getBlockMetadata(x, y, z);
- this.breakMushroom(wld, bit, (EntityPlayer) plr, silk, x, y, z, met);
- wld.setBlockToAir(x, y, z);
- this.tre[2210] = this.needcheck;
- if (this.checkTree(wld, x - 10, y - 4, z - 10) == 1) {
- this.exploadMushroom(wld, x - 10, y - 4, z - 10, (EntityPlayer) plr, silk);
+ public boolean onBlockDestroyed(ItemStack itm, World wld,Block blk, int x, int y,int z, EntityLivingBase plr) {
+ if (!wld.isRemote){
+ Block bit = wld.getBlock(x, y, z);
+ boolean silk=EnchantmentHelper.getSilkTouchModifier(plr);
+ if ((bit instanceof BlockHugeMushroom)){
+ for (int n=0;n<32000;n++) tre[n]=unchecked;
+ int met = wld.getBlockMetadata(x, y, z);
+ breakMushroom(wld, bit, (EntityPlayer) plr, silk, x, y, z,met);
+ wld.setBlockToAir(x,y,z);
+ tre[2210]=needcheck;
+ if (checkTree(wld,x-10,y-4,z-10)==1){
+ exploadMushroom(wld,x-10,y-4,z-10,(EntityPlayer) plr,silk);
}
}
-
- if (bit instanceof BlockLog || bit.getUnlocalizedName().toLowerCase().contains("log")
- || bit.getUnlocalizedName().toLowerCase().contains("wood")) {
- // LoonTools.log("cutting tree @ "+x+" "+y+" "+z+" ");
- for (int n = 0; n < 32000; n++) {
- this.tre[n] = this.unchecked;
- }
- final int met = wld.getBlockMetadata(x, y, z);
- bit.harvestBlock(wld, (EntityPlayer) plr, x, y, z, met);
- wld.setBlockToAir(x, y, z);
- this.tre[2210] = this.needcheck;
- if (this.checkTree(wld, x - 10, y - 4, z - 10) == 1) {
- this.exploadTree(wld, x - 10, y - 4, z - 10, (EntityPlayer) plr);
- }
- else {
- for (int n = 0; n < 32000; n++) {
- this.tre[n] = this.unchecked;
- }
- this.tre[2210] = this.needcheck;
- if (this.checkTree2(wld, x - 10, y - 4, z - 10) == 1) {
- this.exploadTree(wld, x - 10, y - 4, z - 10, (EntityPlayer) plr);
+
+ if (bit instanceof BlockLog || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
+ //LoonTools.log("cutting tree @ "+x+" "+y+" "+z+" ");
+ for (int n=0;n<32000;n++) tre[n]=unchecked;
+ int met = wld.getBlockMetadata(x, y, z);
+ bit.harvestBlock(wld, (EntityPlayer) plr, x, y, z,met);
+ wld.setBlockToAir(x,y,z);
+ tre[2210]=needcheck;
+ if (checkTree(wld,x-10,y-4,z-10)==1){
+ exploadTree(wld,x-10,y-4,z-10,(EntityPlayer) plr);
+ }else{
+ for (int n=0;n<32000;n++) tre[n]=unchecked;
+ tre[2210]=needcheck;
+ if (checkTree2(wld,x-10,y-4,z-10)==1){
+ exploadTree(wld,x-10,y-4,z-10,(EntityPlayer) plr);
}
}
}
}
return super.onBlockDestroyed(itm, wld, blk, x, y, z, plr);
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.rare;
+ }
- private boolean setcheck(final int x, final int y, final int z) {
- if (x < 0 || x > 19 || z < 0 || z > 19 || y < 0 || y > 79) {
- return false;
- }
- final int o = x + z * 20 + y * 400;
- if (this.tre[o] == this.unchecked) {
- this.tre[o] = this.needcheck;
- }
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
return true;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
index 5096b94054..079e3cfc39 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
@@ -1,362 +1,350 @@
package gtPlusPlus.core.item.tool.staballoy;
-import java.util.List;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.player.UtilsMining;
+
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
-import net.minecraft.item.*;
-import net.minecraft.util.*;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.ItemPickaxe;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class StaballoyPickaxe extends ItemPickaxe {
-
- protected Boolean FACING_HORIZONTAL = true;
+public class StaballoyPickaxe extends ItemPickaxe{
- protected String FACING = "north";
- protected EntityPlayer localPlayer;
- protected String lookingDirection;
- protected World localWorld;
- public ItemStack thisPickaxe = null;
- public StaballoyPickaxe(final String unlocalizedName, final ToolMaterial material) {
- super(material);
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.FACING_HORIZONTAL = true;
- this.setMaxStackSize(1);
- this.setMaxDamage(3200);
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
+ */
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (super.getDurabilityForDisplay(stack) > 0){
+ return super.getDurabilityForDisplay(stack);}
+ return 0;
}
+ protected Boolean FACING_HORIZONTAL = true;
+ protected String FACING = "north";
+ protected EntityPlayer localPlayer;
+ protected String lookingDirection;
+ protected World localWorld;
+ public ItemStack thisPickaxe = null;
+
/*
- *
- *
- *
- * Methods
- *
- *
- *
+ *
+ *
+ *
+ * Methods
+ *
+ *
+ *
*/
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- this.thisPickaxe = stack;
- list.add(EnumChatFormatting.GRAY + "Mines a 3x3 at 100 durability per block mined.");
- list.add(EnumChatFormatting.GRAY + "Durability: " + (stack.getMaxDamage() - stack.getItemDamage()) + "/"
- + stack.getMaxDamage());
- // super.addInformation(stack, aPlayer, list, bool);
+ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer aPlayer) {
+ localPlayer = aPlayer;
+ localWorld = world;
+ thisPickaxe = stack;
+ return super.onItemRightClick(stack, world, aPlayer);
+ }
+
+
+
+ @Override
+ public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int X, int Y, int Z, EntityLivingBase entity) {
+ //super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
+ localWorld = world;
+ thisPickaxe = stack;
+ //checkFacing(world);
+ if (!world.isRemote){
+ GetDestroyOrientation(lookingDirection, world, X, Y, Z, stack);
+ }
+
+ return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
}
@SuppressWarnings("static-method")
- private float calculateDurabilityLoss(final World world, final int X, final int Y, final int Z) {
+ private float calculateDurabilityLoss(World world, int X, int Y, int Z){
float bDurabilityLoss = 0;
Boolean correctTool = false;
float bHardness = 0;
- if (!world.isRemote) {
+ if (!world.isRemote){
try {
- final Block removalist = world.getBlock(X, Y, Z);
- // Utils.LOG_WARNING(removalist.toString());
+ Block removalist = world.getBlock(X, Y, Z);
+ //Utils.LOG_WARNING(removalist.toString());
bHardness = removalist.getBlockHardness(world, X, Y, Z);
- Utils.LOG_WARNING("Hardness: " + bHardness);
+ Utils.LOG_WARNING("Hardness: "+bHardness);
- bDurabilityLoss = bDurabilityLoss + bHardness;
- // Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
+ bDurabilityLoss = (bDurabilityLoss + bHardness);
+ //Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
- correctTool = this.canPickaxeBlock(removalist, world);
- Utils.LOG_WARNING("" + correctTool);
+ correctTool = canPickaxeBlock(removalist, world);
+ Utils.LOG_WARNING(""+correctTool);
- if (!correctTool) {
+ if (!correctTool){
return 0;
}
- }
- catch (final NullPointerException e) {
+ } catch (NullPointerException e){
}
}
return 100;
}
- public Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld) {
+ public Boolean canPickaxeBlock(Block currentBlock, World currentWorld){
String correctTool = "";
- if (!currentWorld.isRemote) {
+ if (!currentWorld.isRemote){
try {
correctTool = currentBlock.getHarvestTool(0);
- // Utils.LOG_WARNING(correctTool);
- if (UtilsMining.getBlockType(currentBlock) || correctTool.equals("pickaxe")) {
- return true;
- }
- }
- catch (final NullPointerException e) {
- return false;
- }
+ //Utils.LOG_WARNING(correctTool);
+ if (UtilsMining.getBlockType(currentBlock) || correctTool.equals("pickaxe")){
+ return true;}
+ } catch (NullPointerException e){
+ return false;}
}
return false;
}
- public boolean checkFacing(final World world) {
- this.localWorld = world;
- if (this.localPlayer != null) {
- final int direction = MathHelper.floor_double(this.localPlayer.rotationYaw * 4F / 360F + 0.5D) & 3;
- // Utils.LOG_WARNING("Player - F: "+direction);
- // Utils.LOG_WARNING("Player - getLookVec():
- // "+localPlayer.getLookVec().yCoord);
-
- /*
- * if (localPlayer.getLookVec().yCoord > 0){
- * localPlayer.getLookVec().yCoord; }
- */
-
- final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world,
- this.localPlayer, false);
- if (movingobjectposition != null) {
- final int sideHit = movingobjectposition.sideHit;
- String playerStandingPosition = "";
- if (movingobjectposition != null) {
- // System.out.println("Side Hit:
- // "+movingobjectposition.sideHit);
- }
-
- if (sideHit == 0) {
- playerStandingPosition = "above";
- this.FACING_HORIZONTAL = false;
- }
- else if (sideHit == 1) {
- playerStandingPosition = "below";
- this.FACING_HORIZONTAL = false;
- }
- else if (sideHit == 2) {
- playerStandingPosition = "facingSouth";
- this.FACING_HORIZONTAL = true;
- }
- else if (sideHit == 3) {
- playerStandingPosition = "facingNorth";
- this.FACING_HORIZONTAL = true;
- }
- else if (sideHit == 4) {
- playerStandingPosition = "facingEast";
- this.FACING_HORIZONTAL = true;
- }
- else if (sideHit == 5) {
- playerStandingPosition = "facingWest";
- this.FACING_HORIZONTAL = true;
- }
- this.lookingDirection = playerStandingPosition;
-
- if (direction == 0) {
- this.FACING = "south";
- }
- else if (direction == 1) {
- this.FACING = "west";
- }
- else if (direction == 2) {
- this.FACING = "north";
- }
- else if (direction == 3) {
- this.FACING = "east";
- }
- }
-
- return true;
- }
- return false;
- }
-
- public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer) {
- item.damageItem(damage, localPlayer);
- }
-
- private void GetDestroyOrientation(final String FACING, final World world, final int X, final int Y, final int Z,
- final ItemStack heldItem) {
- this.localWorld = world;
+ private void GetDestroyOrientation(String FACING, World world, int X, int Y, int Z, ItemStack heldItem){
+ localWorld = world;
float DURABILITY_LOSS = 0;
- if (!world.isRemote) {
+ if (!world.isRemote){
- if (FACING.equals("below") || FACING.equals("above")) {
+ if (FACING.equals("below") || FACING.equals("above")){
DURABILITY_LOSS = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- final float dur = this.calculateDurabilityLoss(world, X + i, Y, Z + j);
- DURABILITY_LOSS = DURABILITY_LOSS + dur;
- Utils.LOG_WARNING("Added Loss: " + dur);
- this.removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem);
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ float dur = calculateDurabilityLoss(world, X + i, Y, Z + j);
+ DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+ Utils.LOG_WARNING("Added Loss: "+dur);
+ removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem);
}
}
}
- else if (FACING.equals("facingEast") || FACING.equals("facingWest")) {
+ else if (FACING.equals("facingEast") || FACING.equals("facingWest")){
DURABILITY_LOSS = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- final float dur = this.calculateDurabilityLoss(world, X, Y + i, Z + j);
- DURABILITY_LOSS = DURABILITY_LOSS + dur;
- Utils.LOG_WARNING("Added Loss: " + dur);
- this.removeBlockAndDropAsItem(world, X, Y + i, Z + j, heldItem);
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ float dur = calculateDurabilityLoss(world, X, Y + i, Z + j);
+ DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+ Utils.LOG_WARNING("Added Loss: "+dur);
+ removeBlockAndDropAsItem(world, X , Y + i, Z + j, heldItem);
}
}
}
- else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")) {
+ else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")){
DURABILITY_LOSS = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- final float dur = this.calculateDurabilityLoss(world, X + j, Y + i, Z);
- DURABILITY_LOSS = DURABILITY_LOSS + dur;
- Utils.LOG_WARNING("Added Loss: " + dur);
- this.removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem);
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ float dur = calculateDurabilityLoss(world, X + j, Y + i, Z);
+ DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+ Utils.LOG_WARNING("Added Loss: "+dur);
+ removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem);
}
}
}
- // int heldItemDurability = heldItem.getDamage(1);
- Utils.LOG_INFO("Total Loss: " + (int) DURABILITY_LOSS);
- // heldItem.setDamage(heldStack, DURABILITY_LOSS);
- // Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
- // Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack));
- Utils.LOG_INFO("1x: " + heldItem.getItemDamage());
- final int itemdmg = heldItem.getItemDamage();
- final int maxdmg = heldItem.getMaxDamage();
- final int dodmg = (int) DURABILITY_LOSS;
- final int durNow = maxdmg - itemdmg;
- final int durLeft = (int) (maxdmg - itemdmg - DURABILITY_LOSS);
-
- Utils.LOG_INFO("Current Damage: " + itemdmg + " Max Damage: " + maxdmg + " Durability to be lost: " + dodmg
- + " Current Durability: " + durNow + " Remaining Durability: " + durLeft);
-
- // Break Tool
- if (durNow - dodmg <= 99 && itemdmg != 0) {
- // TODO break tool
+ //int heldItemDurability = heldItem.getDamage(1);
+ Utils.LOG_INFO("Total Loss: "+(int)DURABILITY_LOSS);
+ //heldItem.setDamage(heldStack, DURABILITY_LOSS);
+ //Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
+ //Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack));
+ Utils.LOG_INFO("1x: "+(heldItem.getItemDamage()));
+ int itemdmg = heldItem.getItemDamage();
+ int maxdmg = heldItem.getMaxDamage();
+ int dodmg = (int)DURABILITY_LOSS;
+ int durNow = (int) maxdmg-itemdmg;
+ int durLeft = (int) ((maxdmg-itemdmg)-DURABILITY_LOSS);
+
+ Utils.LOG_INFO(
+ "Current Damage: " + itemdmg
+ + " Max Damage: " + maxdmg
+ + " Durability to be lost: " + dodmg
+ + " Current Durability: " + durNow
+ + " Remaining Durability: " + durLeft
+ );
+
+
+ //Break Tool
+ if ((durNow-dodmg) <= (99) && itemdmg != 0){
+ //TODO break tool
Utils.LOG_INFO("Breaking Tool");
heldItem.stackSize = 0;
}
- // Do Damage
+ //Do Damage
else {
- // setItemDamage(heldItem, durLeft);
- Utils.LOG_INFO("" + (durNow - durLeft));
- this.damageItem(heldItem, durNow - durLeft - 1, this.localPlayer);
+ //setItemDamage(heldItem, durLeft);
+ Utils.LOG_INFO(""+(durNow-durLeft));
+ damageItem(heldItem, (durNow-durLeft)-1, localPlayer);
}
-
- /*
- * if (heldItem.getItemDamage() <=
- * ((heldItem.getMaxDamage()-heldItem.getItemDamage())-
- * DURABILITY_LOSS)){ Utils.LOG_INFO("2: "+DURABILITY_LOSS+" 3: "
- * +((heldItem.getMaxDamage()-heldItem.getItemDamage())-
- * DURABILITY_LOSS)); setItemDamage(heldItem, (int)
- * (heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.
- * getItemDamage())-DURABILITY_LOSS)); } else { Utils.LOG_INFO("3: "
- * +( heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.
- * getItemDamage()))); setItemDamage(heldItem,
- * heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.
- * getItemDamage())); }
- */
- // Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
+
+
+ /*if (heldItem.getItemDamage() <= ((heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS)){
+ Utils.LOG_INFO("2: "+DURABILITY_LOSS+" 3: "+((heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS));
+ setItemDamage(heldItem, (int) (heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS));
+ }
+ else {
+ Utils.LOG_INFO("3: "+( heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage())));
+ setItemDamage(heldItem, heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage()));
+ }*/
+ //Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
DURABILITY_LOSS = 0;
}
}
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.
- * ItemStack)
- */
- @Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- if (super.getDurabilityForDisplay(stack) > 0) {
- return super.getDurabilityForDisplay(stack);
- }
- return 0;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
- return EnumRarity.rare;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
- return true;
- }
-
- @Override
- public boolean onBlockDestroyed(final ItemStack stack, final World world, final Block block, final int X,
- final int Y, final int Z, final EntityLivingBase entity) {
- // super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
- this.localWorld = world;
- this.thisPickaxe = stack;
- // checkFacing(world);
- if (!world.isRemote) {
- this.GetDestroyOrientation(this.lookingDirection, world, X, Y, Z, stack);
- }
-
- return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
- }
-
- @Override
- public boolean onBlockStartBreak(final ItemStack itemstack, final int X, final int Y, final int Z,
- final EntityPlayer aPlayer) {
- this.thisPickaxe = itemstack;
- this.localPlayer = aPlayer;
- this.checkFacing(this.localPlayer.worldObj);
- return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer);
+
+ public void damageItem(ItemStack item, int damage, EntityPlayer localPlayer){
+ item.damageItem(damage, localPlayer);
}
-
- @Override
- public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer aPlayer) {
- this.localPlayer = aPlayer;
- this.localWorld = world;
- this.thisPickaxe = stack;
- return super.onItemRightClick(stack, world, aPlayer);
+
+ public void setItemDamage(ItemStack item, int damage){
+ item.setItemDamage(damage-1);
}
- // Should clear up blocks quicker if I chain it.
- public void removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z,
- final ItemStack heldItem) {
- this.localWorld = world;
+ //Should clear up blocks quicker if I chain it.
+ public void removeBlockAndDropAsItem(World world, int X, int Y, int Z, ItemStack heldItem){
+ localWorld = world;
try {
- final Block block = world.getBlock(X, Y, Z);
- final float dur = this.calculateDurabilityLoss(world, X, Y, Z);
+ Block block = world.getBlock(X, Y, Z);
+ float dur = calculateDurabilityLoss(world, X, Y, Z);
Utils.LOG_WARNING(block.toString());
String removalTool = "";
removalTool = block.getHarvestTool(1);
-
- if (removalTool.equals("pickaxe") || UtilsMining.getBlockType(block)) {
- if (this.canPickaxeBlock(block, world)) {
- if (block != Blocks.bedrock && block.getBlockHardness(world, X, Y, Z) != -1
- && block.getBlockHardness(world, X, Y, Z) <= 100 && block != Blocks.water
- && block != Blocks.lava) {
-
- if (heldItem.getItemDamage() <= heldItem.getMaxDamage() - dur) {
-
- block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
- world.setBlockToAir(X, Y, Z);
-
+
+ if (removalTool.equals("pickaxe") || UtilsMining.getBlockType(block)){
+ if (canPickaxeBlock(block, world)){
+ if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
+
+ if (heldItem.getItemDamage() <= (heldItem.getMaxDamage()-dur)){
+
+ block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
+ world.setBlockToAir(X, Y, Z);
+
}
-
+
}
}
else {
Utils.LOG_WARNING("Incorrect Tool for mining this block.");
}
}
+ } catch (NullPointerException e){
+
}
- catch (final NullPointerException e) {
+ }
+
+ public boolean checkFacing(World world){
+ localWorld = world;
+ if (localPlayer != null){
+ int direction = MathHelper.floor_double((double)((localPlayer.rotationYaw * 4F) / 360F) + 0.5D) & 3;
+ //Utils.LOG_WARNING("Player - F: "+direction);
+ //Utils.LOG_WARNING("Player - getLookVec(): "+localPlayer.getLookVec().yCoord);
+
+ /*if (localPlayer.getLookVec().yCoord > 0){
+ localPlayer.getLookVec().yCoord;
+ }*/
+
+ MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, (EntityPlayer) localPlayer, false);
+ if (movingobjectposition != null){
+ int sideHit = movingobjectposition.sideHit;
+ String playerStandingPosition = "";
+ if (movingobjectposition != null) {
+ //System.out.println("Side Hit: "+movingobjectposition.sideHit);
+ }
+
+ if (sideHit == 0){
+ playerStandingPosition = "above";
+ FACING_HORIZONTAL = false;
+ }
+ else if (sideHit == 1){
+ playerStandingPosition = "below";
+ FACING_HORIZONTAL = false;
+ }
+ else if (sideHit == 2){
+ playerStandingPosition = "facingSouth";
+ FACING_HORIZONTAL = true;
+ }
+ else if (sideHit == 3){
+ playerStandingPosition = "facingNorth";
+ FACING_HORIZONTAL = true;
+ }
+ else if (sideHit == 4){
+ playerStandingPosition = "facingEast";
+ FACING_HORIZONTAL = true;
+ }
+ else if (sideHit == 5){
+ playerStandingPosition = "facingWest";
+ FACING_HORIZONTAL = true;
+ }
+ lookingDirection = playerStandingPosition;
+
+ if (direction == 0){
+ FACING = "south";
+ }
+ else if (direction == 1){
+ FACING = "west";
+ }
+ else if (direction == 2){
+ FACING = "north";
+ }
+ else if (direction == 3){
+ FACING = "east";
+ }
+ }
+
+ return true;
}
+ return false;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ thisPickaxe = stack;
+ list.add(EnumChatFormatting.GRAY+"Mines a 3x3 at 100 durability per block mined.");
+ list.add(EnumChatFormatting.GRAY+"Durability: "+(stack.getMaxDamage()-stack.getItemDamage())+"/"+stack.getMaxDamage());
+ //super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.rare;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return true;
}
- public void setItemDamage(final ItemStack item, final int damage) {
- item.setItemDamage(damage - 1);
+
+ @Override
+ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer aPlayer) {
+ thisPickaxe = itemstack;
+ localPlayer = aPlayer;
+ checkFacing(localPlayer.worldObj);
+ return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer);
+ }
+ public StaballoyPickaxe(String unlocalizedName, ToolMaterial material) {
+ super(material);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.FACING_HORIZONTAL=true;
+ this.setMaxStackSize(1);
+ this.setMaxDamage(3200);
}
}
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java
index 210bdcf378..79eac5816b 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java
@@ -1,327 +1,316 @@
package gtPlusPlus.core.item.tool.staballoy;
-import java.util.List;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.player.UtilsMining;
+
+import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
-import net.minecraft.item.*;
-import net.minecraft.util.*;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.ItemSpade;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class StaballoySpade extends ItemSpade {
-
- protected Boolean FACING_HORIZONTAL = true;
+public class StaballoySpade extends ItemSpade{
- protected String FACING = "north";
- protected EntityPlayer localPlayer;
- protected String lookingDirection;
- protected World localWorld;
- public ItemStack thisPickaxe = null;
- public StaballoySpade(final String unlocalizedName, final ToolMaterial material) {
- super(material);
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(CORE.MODID + ":" + unlocalizedName);
- this.FACING_HORIZONTAL = true;
- this.setMaxStackSize(1);
- this.setMaxDamage(3200);
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
+ */
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (super.getDurabilityForDisplay(stack) > 0){
+ return super.getDurabilityForDisplay(stack);}
+ return 0;
}
+ protected Boolean FACING_HORIZONTAL = true;
+ protected String FACING = "north";
+ protected EntityPlayer localPlayer;
+ protected String lookingDirection;
+ protected World localWorld;
+ public ItemStack thisPickaxe = null;
+
/*
- *
- *
- *
- * Methods
- *
- *
- *
+ *
+ *
+ *
+ * Methods
+ *
+ *
+ *
*/
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
@Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- this.thisPickaxe = stack;
- list.add(EnumChatFormatting.GOLD + "Spades a 3x3 area in the direction you are facing.");
- super.addInformation(stack, aPlayer, list, bool);
+ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer aPlayer) {
+ localPlayer = aPlayer;
+ localWorld = world;
+ thisPickaxe = stack;
+ return super.onItemRightClick(stack, world, aPlayer);
}
- public Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld) {
- String correctTool = "";
- if (!currentWorld.isRemote) {
- try {
- correctTool = currentBlock.getHarvestTool(0);
- // Utils.LOG_WARNING(correctTool);
- Utils.LOG_INFO(
- "Tool for Block: " + correctTool + " | Current block: " + currentBlock.getLocalizedName());
- if (UtilsMining.getBlockType(currentBlock) || correctTool.equals("shovel")) {
- return true;
- }
- }
- catch (final NullPointerException e) {
- return false;
- }
- }
- return false;
- }
- public boolean checkFacing(final World world) {
- this.localWorld = world;
- if (this.localPlayer != null) {
- final int direction = MathHelper.floor_double(this.localPlayer.rotationYaw * 4F / 360F + 0.5D) & 3;
- // Utils.LOG_WARNING("Player - F: "+direction);
- // Utils.LOG_WARNING("Player - getLookVec():
- // "+localPlayer.getLookVec().yCoord);
-
- /*
- * if (localPlayer.getLookVec().yCoord > 0){
- * localPlayer.getLookVec().yCoord; }
- */
-
- final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world,
- this.localPlayer, false);
- if (movingobjectposition != null) {
- final int sideHit = movingobjectposition.sideHit;
- String playerStandingPosition = "";
- if (movingobjectposition != null) {
- // System.out.println("Side Hit:
- // "+movingobjectposition.sideHit);
- }
+ @Override
+ public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int X, int Y, int Z, EntityLivingBase entity) {
+ //super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
+ localWorld = world;
+ thisPickaxe = stack;
+ //checkFacing(world);
+ if (!world.isRemote){
+ GetDestroyOrientation(lookingDirection, world, X, Y, Z, stack);
+ }
- if (sideHit == 0) {
- playerStandingPosition = "above";
- this.FACING_HORIZONTAL = false;
- }
- else if (sideHit == 1) {
- playerStandingPosition = "below";
- this.FACING_HORIZONTAL = false;
- }
- else if (sideHit == 2) {
- playerStandingPosition = "facingSouth";
- this.FACING_HORIZONTAL = true;
- }
- else if (sideHit == 3) {
- playerStandingPosition = "facingNorth";
- this.FACING_HORIZONTAL = true;
- }
- else if (sideHit == 4) {
- playerStandingPosition = "facingEast";
- this.FACING_HORIZONTAL = true;
- }
- else if (sideHit == 5) {
- playerStandingPosition = "facingWest";
- this.FACING_HORIZONTAL = true;
- }
- this.lookingDirection = playerStandingPosition;
+ return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
+ }
- if (direction == 0) {
- this.FACING = "south";
- }
- else if (direction == 1) {
- this.FACING = "west";
- }
- else if (direction == 2) {
- this.FACING = "north";
- }
- else if (direction == 3) {
- this.FACING = "east";
- }
- }
+ public Boolean canPickaxeBlock(Block currentBlock, World currentWorld){
+ String correctTool = "";
+ if (!currentWorld.isRemote){
+ try {
+ correctTool = currentBlock.getHarvestTool(0);
+ //Utils.LOG_WARNING(correctTool);
- return true;
+ Utils.LOG_INFO("Tool for Block: "+correctTool+" | Current block: "+currentBlock.getLocalizedName());
+ if (UtilsMining.getBlockType(currentBlock) || correctTool.equals("shovel")){
+ return true;}
+ } catch (NullPointerException e){
+ return false;}
}
return false;
}
- public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer) {
- item.damageItem(damage, localPlayer);
- }
-
- private void GetDestroyOrientation(final String FACING, final World world, final int X, final int Y, final int Z,
- final ItemStack heldItem) {
- this.localWorld = world;
+ private void GetDestroyOrientation(String FACING, World world, int X, int Y, int Z, ItemStack heldItem){
+ localWorld = world;
float DURABILITY_LOSS = 0;
- if (!world.isRemote) {
+ if (!world.isRemote){
- if (FACING.equals("below") || FACING.equals("above")) {
+ if (FACING.equals("below") || FACING.equals("above")){
DURABILITY_LOSS = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- DURABILITY_LOSS = DURABILITY_LOSS
- + this.removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem);
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ DURABILITY_LOSS = (DURABILITY_LOSS + removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem));
}
}
}
- else if (FACING.equals("facingEast") || FACING.equals("facingWest")) {
+ else if (FACING.equals("facingEast") || FACING.equals("facingWest")){
DURABILITY_LOSS = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- DURABILITY_LOSS = DURABILITY_LOSS
- + this.removeBlockAndDropAsItem(world, X, Y + i, Z + j, heldItem);
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ DURABILITY_LOSS = (DURABILITY_LOSS + removeBlockAndDropAsItem(world, X , Y + i, Z + j, heldItem));
}
}
}
- else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")) {
+ else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")){
DURABILITY_LOSS = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- DURABILITY_LOSS = DURABILITY_LOSS
- + this.removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem);
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ DURABILITY_LOSS = (DURABILITY_LOSS + removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem));
}
}
}
- // int heldItemDurability = heldItem.getDamage(1);
- Utils.LOG_INFO("Total Loss: " + (int) DURABILITY_LOSS);
- // heldItem.setDamage(heldStack, DURABILITY_LOSS);
- // Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
- // Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack));
- Utils.LOG_INFO("1x: " + heldItem.getItemDamage());
- final int itemdmg = heldItem.getItemDamage();
- final int maxdmg = heldItem.getMaxDamage();
- final int dodmg = (int) DURABILITY_LOSS;
- final int durNow = maxdmg - itemdmg;
- final int durLeft = (int) (maxdmg - itemdmg - DURABILITY_LOSS);
-
- Utils.LOG_INFO("Current Damage: " + itemdmg + " Max Damage: " + maxdmg + " Durability to be lost: " + dodmg
- + " Current Durability: " + durNow + " Remaining Durability: " + durLeft);
-
- // Break Tool
- if (durNow - dodmg <= 900 && itemdmg != 0) {
- // TODO break tool
+ //int heldItemDurability = heldItem.getDamage(1);
+ Utils.LOG_INFO("Total Loss: "+(int)DURABILITY_LOSS);
+ //heldItem.setDamage(heldStack, DURABILITY_LOSS);
+ //Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
+ //Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack));
+ Utils.LOG_INFO("1x: "+(heldItem.getItemDamage()));
+ int itemdmg = heldItem.getItemDamage();
+ int maxdmg = heldItem.getMaxDamage();
+ int dodmg = (int)DURABILITY_LOSS;
+ int durNow = (int) maxdmg-itemdmg;
+ int durLeft = (int) ((maxdmg-itemdmg)-DURABILITY_LOSS);
+
+ Utils.LOG_INFO(
+ "Current Damage: " + itemdmg
+ + " Max Damage: " + maxdmg
+ + " Durability to be lost: " + dodmg
+ + " Current Durability: " + durNow
+ + " Remaining Durability: " + durLeft
+ );
+
+
+ //Break Tool
+ if ((durNow-dodmg) <= (900) && itemdmg != 0){
+ //TODO break tool
Utils.LOG_INFO("Breaking Tool");
heldItem.stackSize = 0;
}
- // Do Damage
+ //Do Damage
else {
- // setItemDamage(heldItem, durLeft);
- Utils.LOG_INFO("" + (durNow - durLeft));
- this.damageItem(heldItem, durNow - durLeft - 1, this.localPlayer);
+ //setItemDamage(heldItem, durLeft);
+ Utils.LOG_INFO(""+(durNow-durLeft));
+ damageItem(heldItem, (durNow-durLeft)-1, localPlayer);
}
DURABILITY_LOSS = 0;
}
}
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.
- * ItemStack)
- */
- @Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- if (super.getDurabilityForDisplay(stack) > 0) {
- return super.getDurabilityForDisplay(stack);
- }
- return 0;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
- return EnumRarity.rare;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack) {
- return true;
- }
-
- @Override
- public boolean onBlockDestroyed(final ItemStack stack, final World world, final Block block, final int X,
- final int Y, final int Z, final EntityLivingBase entity) {
- // super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
- this.localWorld = world;
- this.thisPickaxe = stack;
- // checkFacing(world);
- if (!world.isRemote) {
- this.GetDestroyOrientation(this.lookingDirection, world, X, Y, Z, stack);
- }
-
- return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
- }
-
- @Override
- public boolean onBlockStartBreak(final ItemStack itemstack, final int X, final int Y, final int Z,
- final EntityPlayer aPlayer) {
- this.thisPickaxe = itemstack;
- this.localPlayer = aPlayer;
- this.checkFacing(this.localPlayer.worldObj);
- return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer);
+ public void damageItem(ItemStack item, int damage, EntityPlayer localPlayer){
+ item.damageItem(damage, localPlayer);
}
- @Override
- public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer aPlayer) {
- this.localPlayer = aPlayer;
- this.localWorld = world;
- this.thisPickaxe = stack;
- return super.onItemRightClick(stack, world, aPlayer);
+ public void setItemDamage(ItemStack item, int damage){
+ item.setItemDamage(damage-1);
}
- // Should clear up blocks quicker if I chain it.
- public int removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z,
- final ItemStack heldItem) {
- this.localWorld = world;
+ //Should clear up blocks quicker if I chain it.
+ public int removeBlockAndDropAsItem(World world, int X, int Y, int Z, ItemStack heldItem){
+ localWorld = world;
Utils.LOG_INFO("Trying to drop/remove a block.");
try {
- final Block block = world.getBlock(X, Y, Z);
+ Block block = world.getBlock(X, Y, Z);
Utils.LOG_WARNING(block.toString());
String removalTool = "";
removalTool = block.getHarvestTool(0);
- if (removalTool != null) {
- if (removalTool.equals("shovel")) {
- if (this.canPickaxeBlock(block, world)) {
- if (block != Blocks.bedrock && block.getBlockHardness(world, X, Y, Z) != -1
- && block.getBlockHardness(world, X, Y, Z) <= 100 && block != Blocks.water
- && block != Blocks.lava) {
-
- final int itemdmg = heldItem.getItemDamage();
- final int maxdmg = heldItem.getMaxDamage();
- final int dodmg = 100;
- final int durNow = maxdmg - itemdmg;
- final int durLeft = maxdmg - itemdmg - 100;
-
- if (durNow - dodmg <= 900 && itemdmg != 0) {
- // Do Nothing, Tool is useless.
- return 0;
- }
- block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
- world.setBlockToAir(X, Y, Z);
- Utils.LOG_INFO("Adding 100 damage to item.");
- return 100;
+ if (removalTool != null){
+ if (removalTool.equals("shovel")){
+ if (canPickaxeBlock(block, world)){
+ if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
+
+ int itemdmg = heldItem.getItemDamage();
+ int maxdmg = heldItem.getMaxDamage();
+ int dodmg = (int)100;
+ int durNow = (int) maxdmg-itemdmg;
+ int durLeft = (int) ((maxdmg-itemdmg)-100);
+
+ if ((durNow-dodmg) <= (900) && itemdmg != 0){
+ //Do Nothing, Tool is useless.
+ return 0;
}
- Utils.LOG_INFO(
- "Incorrect Tool for mining this block. Wrong Block Water/lava/bedrock/blacklist");
- return 0;
+ block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
+ world.setBlockToAir(X, Y, Z);
+ Utils.LOG_INFO("Adding 100 damage to item.");
+ return 100;
}
- Utils.LOG_INFO("Incorrect Tool for mining this block. Cannot Shovel this block type.");
+ Utils.LOG_INFO("Incorrect Tool for mining this block. Wrong Block Water/lava/bedrock/blacklist");
return 0;
}
- Utils.LOG_INFO("Incorrect Tool for mining this block. Blocks mining tool is now Shovel.");
+ Utils.LOG_INFO("Incorrect Tool for mining this block. Cannot Shovel this block type.");
return 0;
}
- Utils.LOG_INFO("Either the block was air or it declares an invalid mining tool.");
+ Utils.LOG_INFO("Incorrect Tool for mining this block. Blocks mining tool is now Shovel.");
return 0;
- }
- catch (final NullPointerException e) {
+ }
+ Utils.LOG_INFO("Either the block was air or it declares an invalid mining tool.");
+ return 0;
+ } catch (NullPointerException e){
Utils.LOG_INFO("Something Broke");
e.printStackTrace();
return 0;
}
}
- public void setItemDamage(final ItemStack item, final int damage) {
- item.setItemDamage(damage - 1);
+ public boolean checkFacing(World world){
+ localWorld = world;
+ if (localPlayer != null){
+ int direction = MathHelper.floor_double((double)((localPlayer.rotationYaw * 4F) / 360F) + 0.5D) & 3;
+ //Utils.LOG_WARNING("Player - F: "+direction);
+ //Utils.LOG_WARNING("Player - getLookVec(): "+localPlayer.getLookVec().yCoord);
+
+ /*if (localPlayer.getLookVec().yCoord > 0){
+ localPlayer.getLookVec().yCoord;
+ }*/
+
+ MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, (EntityPlayer) localPlayer, false);
+ if (movingobjectposition != null){
+ int sideHit = movingobjectposition.sideHit;
+ String playerStandingPosition = "";
+ if (movingobjectposition != null) {
+ //System.out.println("Side Hit: "+movingobjectposition.sideHit);
+ }
+
+ if (sideHit == 0){
+ playerStandingPosition = "above";
+ FACING_HORIZONTAL = false;
+ }
+ else if (sideHit == 1){
+ playerStandingPosition = "below";
+ FACING_HORIZONTAL = false;
+ }
+ else if (sideHit == 2){
+ playerStandingPosition = "facingSouth";
+ FACING_HORIZONTAL = true;
+ }
+ else if (sideHit == 3){
+ playerStandingPosition = "facingNorth";
+ FACING_HORIZONTAL = true;
+ }
+ else if (sideHit == 4){
+ playerStandingPosition = "facingEast";
+ FACING_HORIZONTAL = true;
+ }
+ else if (sideHit == 5){
+ playerStandingPosition = "facingWest";
+ FACING_HORIZONTAL = true;
+ }
+ lookingDirection = playerStandingPosition;
+
+ if (direction == 0){
+ FACING = "south";
+ }
+ else if (direction == 1){
+ FACING = "west";
+ }
+ else if (direction == 2){
+ FACING = "north";
+ }
+ else if (direction == 3){
+ FACING = "east";
+ }
+ }
+
+
+ return true;
+ }
+ return false;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ thisPickaxe = stack;
+ list.add(EnumChatFormatting.GOLD+"Spades a 3x3 area in the direction you are facing.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.rare;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return true;
+ }
+
+
+ @Override
+ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer aPlayer) {
+ thisPickaxe = itemstack;
+ localPlayer = aPlayer;
+ checkFacing(localPlayer.worldObj);
+ return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer);
+ }
+ public StaballoySpade(String unlocalizedName, ToolMaterial material) {
+ super(material);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.FACING_HORIZONTAL=true;
+ this.setMaxStackSize(1);
+ this.setMaxDamage(3200);
}
}
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java
index e634822dfc..68bf2ec445 100644
--- a/src/Java/gtPlusPlus/core/lib/CORE.java
+++ b/src/Java/gtPlusPlus/core/lib/CORE.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.lib;
-import java.util.HashMap;
-import java.util.Map;
-
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.gregtech.recipehandlers.GregtechRecipe;
import gtPlusPlus.core.util.networking.NetworkUtils;
@@ -10,109 +7,109 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator;
+
+import java.util.HashMap;
+import java.util.Map;
+
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.config.Configuration;
public class CORE {
- public static class configSwitches {
-
- // Debug
- public static boolean disableEnderIOIntegration = false;
-
- // Machine Related
- public static boolean enableAlternativeBatteryAlloy = false;
- public static boolean enableThaumcraftShardUnification = false;
- public static boolean disableIC2Recipes = false;
- public static boolean enableAlternativeDivisionSigilRecipe = false;
-
- // Feature Related
- public static boolean enableCustomAlvearyBlocks = false;
-
- // Single Block Machines
- public static boolean enableMachine_SolarGenerators = false;
- public static boolean enableMachine_Dehydrators = true;
- public static boolean enableMachine_SteamConverter = true;
- public static boolean enableMachine_FluidTanks = true;
- public static boolean enableMachine_RocketEngines = true;
- public static boolean enableMachine_GeothermalEngines = true;
- public static boolean enableCustom_Pipes = true;
- public static boolean enableCustom_Cables = true;
-
- // Multiblocks
- public static boolean enabledMultiblock_AlloyBlastSmelter = true;
- public static boolean enabledMultiblock_IndustrialCentrifuge = true;
- public static boolean enabledMultiblock_IndustrialCokeOven = true;
- public static boolean enabledMultiblock_IndustrialElectrolyzer = true;
- public static boolean enabledMultiblock_IndustrialMacerationStack = true;
- public static boolean enabledMultiblock_IndustrialPlatePress = true;
- public static boolean enabledMultiblock_IndustrialWireMill = true;
- public static boolean enabledMultiblock_IronBlastFurnace = true;
- public static boolean enabledMultiblock_MatterFabricator = true;
- public static boolean enabledMultiblock_MultiTank = true;
- public static boolean enabledMultiblock_PowerSubstation = true;
-
- }
- // GUIS
- public enum GUI_ENUM {
- ENERGYBUFFER, TOOLBUILDER, NULL, NULL1, NULL2
- }
- public static final String name = "GT++";
- public static final String MODID = "miscutils";
- public static final String VERSION = "1.4.9-release";
- public static final String MASTER_VERSION = NetworkUtils
- .getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt")
- .toLowerCase();
- public static boolean isModUpToDate = Utils
- .isModUpToDate();
- public static boolean DEBUG = false;
- public static final boolean LOAD_ALL_CONTENT = false;
- public static final int GREG_FIRST_ID = 760;
- public static Map PlayerCache;
- public static final String[] VOLTAGES = {
- "ULV", "LV", "MV", "HV", "EV", "IV", "LuV", "ZPM", "UV", "MAX"
- };
- public static final boolean MAIN_GREGTECH_5U_EXPERIMENTAL_FORK = Meta_GT_Proxy
- .areWeUsingGregtech5uExperimental();
- public static IGregtech_RecipeAdder RA;
-
+ public static final String name = "GT++";
+ public static final String MODID = "miscutils";
+ public static final String VERSION = "1.4.9-release";
+ public static final String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase();
+ public static boolean isModUpToDate = Utils.isModUpToDate();
+ public static boolean DEBUG = false;
+ public static final boolean LOAD_ALL_CONTENT = false;
+ public static final int GREG_FIRST_ID = 760;
+ public static Map PlayerCache;
+ public static final String[] VOLTAGES = {"ULV","LV","MV","HV","EV","IV","LuV","ZPM","UV","MAX"};
+ public static final boolean MAIN_GREGTECH_5U_EXPERIMENTAL_FORK = Meta_GT_Proxy.areWeUsingGregtech5uExperimental();
+ public static IGregtech_RecipeAdder RA;
@Deprecated
- public static IGregtech_RecipeAdder sRecipeAdder;
- public static GregtechRecipe GT_Recipe = new GregtechRecipe();
- public static Configuration Config;
- public static final String GT_Tooltip = "Added by: "
- + EnumChatFormatting.DARK_GREEN + "Alkalus " + EnumChatFormatting.GRAY + "- " + EnumChatFormatting.RED
- + "[GT++]";
-
- public static final String GT_Tooltip_Radioactive = EnumChatFormatting.GRAY
- + "Warning: " + EnumChatFormatting.GREEN + "Radioactive! " + EnumChatFormatting.GOLD
- + " Avoid direct handling without hazmat protection.";
-
- public static final String noItem = "";
-
+ public static IGregtech_RecipeAdder sRecipeAdder;
+ public static GregtechRecipe GT_Recipe = new GregtechRecipe();
+
+ public static Configuration Config;
+ public static final String GT_Tooltip = "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus "+EnumChatFormatting.GRAY+"- "+EnumChatFormatting.RED+"[GT++]";
+ public static final String GT_Tooltip_Radioactive = EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.GREEN+"Radioactive! "+EnumChatFormatting.GOLD+" Avoid direct handling without hazmat protection.";
+ public static final String noItem = "";
+
/**
- * A List containing all the Materials, which are somehow in use by GT and
- * therefor receive a specific Set of Items.
+ * A List containing all the Materials, which are somehow in use by GT and therefor receive a specific Set of Items.
*/
- public static final GT_Materials[] sMU_GeneratedMaterials = new GT_Materials[1000];
-
- // Tesseract map
- public static final Map<Integer, GT_MetaTileEntity_TesseractGenerator> sTesseractGenerators = new HashMap<Integer, GT_MetaTileEntity_TesseractGenerator>();
-
- // public static final Materials2[] MiscGeneratedMaterials = new
- // Materials2[1000];
+ public static final GT_Materials[] sMU_GeneratedMaterials = new GT_Materials[1000];
+
+ //Tesseract map
+ public static final Map<Integer, GT_MetaTileEntity_TesseractGenerator> sTesseractGenerators = new HashMap<Integer, GT_MetaTileEntity_TesseractGenerator>();
+
+ //GUIS
+ public enum GUI_ENUM
+ {
+ ENERGYBUFFER, TOOLBUILDER, NULL, NULL1, NULL2
+ }
/**
* File Paths and Resource Paths
*/
- public static final String TEX_DIR = "textures/", TEX_DIR_GUI = CORE.TEX_DIR + "gui/",
- TEX_DIR_ITEM = CORE.TEX_DIR + "items/", TEX_DIR_BLOCK = CORE.TEX_DIR + "blocks/",
- TEX_DIR_ENTITY = CORE.TEX_DIR + "entity/", TEX_DIR_ASPECTS = CORE.TEX_DIR + "aspects/",
- TEX_DIR_FLUIDS = CORE.TEX_DIR_BLOCK + "fluids/", RES_PATH = CORE.MODID + ":" + CORE.TEX_DIR,
- RES_PATH_GUI = CORE.MODID + ":" + CORE.TEX_DIR_GUI, RES_PATH_ITEM = CORE.MODID + ":" + CORE.TEX_DIR_ITEM,
- RES_PATH_BLOCK = CORE.MODID + ":" + CORE.TEX_DIR_BLOCK,
- RES_PATH_ENTITY = CORE.MODID + ":" + CORE.TEX_DIR_ENTITY,
- RES_PATH_ASPECTS = CORE.MODID + ":" + CORE.TEX_DIR_ASPECTS,
- RES_PATH_FLUIDS = CORE.MODID + ":" + CORE.TEX_DIR_FLUIDS;
+ public static final String
+ TEX_DIR = "textures/",
+ TEX_DIR_GUI = TEX_DIR + "gui/",
+ TEX_DIR_ITEM = TEX_DIR + "items/",
+ TEX_DIR_BLOCK = TEX_DIR + "blocks/",
+ TEX_DIR_ENTITY = TEX_DIR + "entity/",
+ TEX_DIR_ASPECTS = TEX_DIR + "aspects/",
+ TEX_DIR_FLUIDS = TEX_DIR_BLOCK + "fluids/",
+ RES_PATH = MODID + ":" + TEX_DIR,
+ RES_PATH_GUI = MODID + ":" + TEX_DIR_GUI,
+ RES_PATH_ITEM = MODID + ":" + TEX_DIR_ITEM,
+ RES_PATH_BLOCK = MODID + ":" + TEX_DIR_BLOCK,
+ RES_PATH_ENTITY = MODID + ":" + TEX_DIR_ENTITY,
+ RES_PATH_ASPECTS = MODID + ":" + TEX_DIR_ASPECTS,
+ RES_PATH_FLUIDS = MODID + ":" + TEX_DIR_FLUIDS;
+
+
+ //public static final Materials2[] MiscGeneratedMaterials = new Materials2[1000];
+ public static class configSwitches {
+
+ //Debug
+ public static boolean disableEnderIOIntegration = false;
+
+ //Machine Related
+ public static boolean enableAlternativeBatteryAlloy = false;
+ public static boolean enableThaumcraftShardUnification = false;
+ public static boolean disableIC2Recipes = false;
+ public static boolean enableAlternativeDivisionSigilRecipe = false;
+
+ //Feature Related
+ public static boolean enableCustomAlvearyBlocks = false;
+
+ //Single Block Machines
+ public static boolean enableMachine_SolarGenerators = false;
+ public static boolean enableMachine_Dehydrators = true;
+ public static boolean enableMachine_SteamConverter = true;
+ public static boolean enableMachine_FluidTanks = true;
+ public static boolean enableMachine_RocketEngines = true;
+ public static boolean enableMachine_GeothermalEngines = true;
+ public static boolean enableCustom_Pipes = true;
+ public static boolean enableCustom_Cables = true;
+
+ //Multiblocks
+ public static boolean enabledMultiblock_AlloyBlastSmelter = true;
+ public static boolean enabledMultiblock_IndustrialCentrifuge = true;
+ public static boolean enabledMultiblock_IndustrialCokeOven = true;
+ public static boolean enabledMultiblock_IndustrialElectrolyzer = true;
+ public static boolean enabledMultiblock_IndustrialMacerationStack = true;
+ public static boolean enabledMultiblock_IndustrialPlatePress = true;
+ public static boolean enabledMultiblock_IndustrialWireMill = true;
+ public static boolean enabledMultiblock_IronBlastFurnace = true;
+ public static boolean enabledMultiblock_MatterFabricator = true;
+ public static boolean enabledMultiblock_MultiTank = true;
+ public static boolean enabledMultiblock_PowerSubstation = true;
+
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/lib/LoadedMods.java b/src/Java/gtPlusPlus/core/lib/LoadedMods.java
index 37de718027..440f72d2c8 100644
--- a/src/Java/gtPlusPlus/core/lib/LoadedMods.java
+++ b/src/Java/gtPlusPlus/core/lib/LoadedMods.java
@@ -1,210 +1,206 @@
package gtPlusPlus.core.lib;
-import cpw.mods.fml.common.Loader;
import gtPlusPlus.core.lib.CORE.configSwitches;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechTextures;
import gtPlusPlus.xmod.gregtech.recipes.GregtechRecipeAdder;
+import cpw.mods.fml.common.Loader;
public class LoadedMods {
- // Initialize Variables
- public static boolean Gregtech = false;
- public static boolean EnderIO = false;
- public static boolean Big_Reactors = false;
- public static boolean IndustrialCraft2 = false;
- public static boolean Simply_Jetpacks = false;
- public static boolean RFTools = false;
- public static boolean Thaumcraft = false;
- public static boolean Baubles = false;
- public static boolean Extra_Utils = false;
- public static boolean PneumaticCraft = false;
- public static boolean MorePlanets = false;
- public static boolean ForbiddenMagic = false;
- public static boolean CompactWindmills = false;
- public static boolean Railcraft = false;
- public static boolean ImmersiveEngineering = false;
- public static boolean Growthcraft = false;
- public static boolean CoFHCore = false;
- public static boolean Forestry = false;
- public static boolean MagicBees = false;
- public static boolean ExtraBees = false;
- public static boolean Psychedelicraft = false;
- public static boolean MiscUtils = true; // Dummy For
- // MetaData
- // Lookups in MT
- // Wrapper
- public static boolean ThermalFoundation = false;
- public static boolean IHL = false;
- public static boolean OpenComputers = false; // OpenComputers
- public static boolean Computronics = false; // computronics
-
- private static int totalMods;
+
+ //Initialize Variables
+ public static boolean Gregtech = false;
+ public static boolean EnderIO = false;
+ public static boolean Big_Reactors = false;
+ public static boolean IndustrialCraft2 = false;
+ public static boolean Simply_Jetpacks = false;
+ public static boolean RFTools = false;
+ public static boolean Thaumcraft = false;
+ public static boolean Baubles = false;
+ public static boolean Extra_Utils = false;
+ public static boolean PneumaticCraft = false;
+ public static boolean MorePlanets = false;
+ public static boolean ForbiddenMagic = false;
+ public static boolean CompactWindmills = false;
+ public static boolean Railcraft = false;
+ public static boolean ImmersiveEngineering = false;
+ public static boolean Growthcraft = false;
+ public static boolean CoFHCore = false;
+ public static boolean Forestry = false;
+ public static boolean MagicBees = false;
+ public static boolean ExtraBees = false;
+ public static boolean Psychedelicraft = false;
+ public static boolean MiscUtils = true; //Dummy For MetaData Lookups in MT Wrapper
+ public static boolean ThermalFoundation = false;
+ public static boolean IHL = false;
+ public static boolean OpenComputers = false; //OpenComputers
+ public static boolean Computronics = false; //computronics
+
+
+ private static int totalMods;
@SuppressWarnings("deprecation")
- public static void checkLoaded() {
+ public static void checkLoaded(){
Utils.LOG_INFO("Looking for optional mod prereqs.");
- if (Loader.isModLoaded("gregtech") == true) {
- LoadedMods.Gregtech = true;
+ if (Loader.isModLoaded("gregtech") == true ){
+ Gregtech = true;
Utils.LOG_INFO("Components enabled for: Gregtech");
- if (LoadedMods.Gregtech) {
+ if (Gregtech){
try {
CORE.sRecipeAdder = CORE.RA = new GregtechRecipeAdder();
Utils.LOG_INFO("Created Gregtech recipe handler.");
GregtechTextures.BlockIcons.VOID.name();
GregtechTextures.ItemIcons.VOID.name();
Utils.LOG_INFO("Created Gregtech texture handler.");
- }
- catch (final NullPointerException e) {
+ } catch (NullPointerException e){
Utils.LOG_INFO("Could NOT create a Gregtech recipe handler.");
}
}
-
- LoadedMods.totalMods++;
+
+ totalMods++;
}
- if (Loader.isModLoaded("EnderIO") == true && !configSwitches.disableEnderIOIntegration) {
- LoadedMods.EnderIO = true;
+ if (Loader.isModLoaded("EnderIO") == true && !configSwitches.disableEnderIOIntegration){
+ EnderIO = true;
Utils.LOG_INFO("Components enabled for: EnderIO");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("BigReactors") == true) {
- LoadedMods.Big_Reactors = true;
+ if (Loader.isModLoaded("BigReactors") == true){
+ Big_Reactors = true;
Utils.LOG_INFO("Components enabled for: Big Reactors");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("IC2") == true) {
- LoadedMods.IndustrialCraft2 = true;
+ if (Loader.isModLoaded("IC2") == true){
+ IndustrialCraft2 = true;
Utils.LOG_INFO("Components enabled for: IndustrialCraft2");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("simplyjetpacks") == true) {
- LoadedMods.Simply_Jetpacks = true;
+ if (Loader.isModLoaded("simplyjetpacks") == true){
+ Simply_Jetpacks = true;
Utils.LOG_INFO("Components enabled for: Simply Jetpacks");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("rftools") == true) {
- LoadedMods.RFTools = true;
+ if (Loader.isModLoaded("rftools") == true){
+ RFTools = true;
Utils.LOG_INFO("Components enabled for: RFTools");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("Thaumcraft") == true) {
- LoadedMods.Thaumcraft = true;
+ if (Loader.isModLoaded("Thaumcraft") == true){
+ Thaumcraft = true;
Utils.LOG_INFO("Components enabled for: Thaumcraft");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("ExtraUtilities") == true) {
- LoadedMods.Extra_Utils = true;
+ if (Loader.isModLoaded("ExtraUtilities") == true){
+ Extra_Utils = true;
Utils.LOG_INFO("Components enabled for: Extra_Utils");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("PneumaticCraft") == true) {
- LoadedMods.PneumaticCraft = true;
+ if (Loader.isModLoaded("PneumaticCraft") == true){
+ PneumaticCraft = true;
Utils.LOG_INFO("Components enabled for: PneumaticCraft");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("MorePlanet") == true) {
- LoadedMods.MorePlanets = true;
+ if (Loader.isModLoaded("MorePlanet") == true){
+ MorePlanets = true;
Utils.LOG_INFO("Components enabled for: MorePlanets");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("ForbiddenMagic") == true) {
- LoadedMods.ForbiddenMagic = true;
+ if (Loader.isModLoaded("ForbiddenMagic") == true){
+ ForbiddenMagic = true;
Utils.LOG_INFO("Components enabled for: ForbiddenMagic");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("CompactWindmills") == true) {
- LoadedMods.CompactWindmills = true;
+ if (Loader.isModLoaded("CompactWindmills") == true){
+ CompactWindmills = true;
Utils.LOG_INFO("Components enabled for: CompactWindmills");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("Railcraft") == true) {
- LoadedMods.Railcraft = true;
+ if (Loader.isModLoaded("Railcraft") == true){
+ Railcraft = true;
Utils.LOG_INFO("Components enabled for: Railcraft");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("Growthcraft") == true) {
- Utils.LOG_INFO("Growthcraft Version: " + LoadedMods.getModVersion("Growthcraft"));
- if (LoadedMods.getModVersion("Growthcraft").equals("1.7.10-2.3.1")) {
- // Load Growthcraft Compat
- LoadedMods.Growthcraft = true;
+ if (Loader.isModLoaded("Growthcraft") == true){
+ Utils.LOG_INFO("Growthcraft Version: "+getModVersion("Growthcraft"));
+ if (getModVersion("Growthcraft").equals("1.7.10-2.3.1")){
+ //Load Growthcraft Compat
+ Growthcraft = true;
Utils.LOG_INFO("Components enabled for: Growthcraft");
- LoadedMods.totalMods++;
+ totalMods++;
}
else {
- LoadedMods.Growthcraft = false;
+ Growthcraft = false;
Utils.LOG_INFO("Growthcraft found, but the version was too new. I will update GC support eventually.");
}
}
- if (Loader.isModLoaded("CoFHCore") == true) {
- LoadedMods.CoFHCore = true;
+ if (Loader.isModLoaded("CoFHCore") == true){
+ CoFHCore = true;
Utils.LOG_INFO("Components enabled for: CoFHCore");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("Forestry") == true) {
- LoadedMods.Forestry = true;
+ if (Loader.isModLoaded("Forestry") == true){
+ Forestry = true;
Utils.LOG_INFO("Components enabled for: Forestry");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("MagicBees") == true) {
- LoadedMods.MagicBees = true;
+ if (Loader.isModLoaded("MagicBees") == true){
+ MagicBees = true;
Utils.LOG_INFO("Components enabled for: MagicBees");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("psychedelicraft") == true) {
- LoadedMods.Psychedelicraft = true;
+ if (Loader.isModLoaded("psychedelicraft") == true){
+ Psychedelicraft = true;
Utils.LOG_INFO("Components enabled for: Psychedelicraft");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("ImmersiveEngineering") == true) {
- LoadedMods.ImmersiveEngineering = true;
+ if (Loader.isModLoaded("ImmersiveEngineering") == true){
+ ImmersiveEngineering = true;
Utils.LOG_INFO("Components enabled for: ImmersiveEngineering");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("ExtraBees") == true) {
- LoadedMods.ExtraBees = true;
+ if (Loader.isModLoaded("ExtraBees") == true){
+ ExtraBees = true;
Utils.LOG_INFO("Components enabled for: ExtraBees");
- LoadedMods.totalMods++;
- }
- if (Loader.isModLoaded("ThermalFoundation") == false) {
- LoadedMods.ThermalFoundation = false;
- Utils.LOG_INFO(
- "Components enabled for: ThermalFoundation - This feature will disable itself if you add TF.");
- LoadedMods.totalMods++;
- }
- else if (Loader.isModLoaded("ThermalFoundation") == true) {
- LoadedMods.ThermalFoundation = true;
- Utils.LOG_INFO(
- "Components disabled for: ThermalFoundation - This feature will enable itself if you remove TF.");
- // totalMods++;
- }
- if (Loader.isModLoaded("ihl") == true) {
- LoadedMods.IHL = true;
- Utils.LOG_INFO("Components enabled for: IHL");
- LoadedMods.totalMods++;
+ totalMods++;
+ }
+ if (Loader.isModLoaded("ThermalFoundation") == false){
+ ThermalFoundation = false;
+ Utils.LOG_INFO("Components enabled for: ThermalFoundation - This feature will disable itself if you add TF.");
+ totalMods++;
}
- if (Loader.isModLoaded("Baubles") == true) {
- LoadedMods.Baubles = true;
+ else if (Loader.isModLoaded("ThermalFoundation") == true){
+ ThermalFoundation = true;
+ Utils.LOG_INFO("Components disabled for: ThermalFoundation - This feature will enable itself if you remove TF.");
+ //totalMods++;
+ }
+ if (Loader.isModLoaded("ihl") == true){
+ IHL = true;
+ Utils.LOG_INFO("Components enabled for: IHL");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("Baubles") == true){
+ Baubles = true;
Utils.LOG_INFO("Components enabled for: Baubles");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("OpenComputers") == true) {
- LoadedMods.OpenComputers = true;
+ if (Loader.isModLoaded("OpenComputers") == true){
+ OpenComputers = true;
Utils.LOG_INFO("Components enabled for: OpenComputers");
- LoadedMods.totalMods++;
+ totalMods++;
}
- if (Loader.isModLoaded("computronics") == true) {
- LoadedMods.Computronics = true;
+ if (Loader.isModLoaded("computronics") == true){
+ Computronics = true;
Utils.LOG_INFO("Components enabled for: Computronics");
- LoadedMods.totalMods++;
+ totalMods++;
}
-
- Utils.LOG_INFO("Content found for " + LoadedMods.totalMods + " mods");
-
+
+ Utils.LOG_INFO("Content found for "+totalMods+" mods");
+
}
-
- public static String getModVersion(final String modName) {
+
+ public static String getModVersion(String modName){
final String ver = cpw.mods.fml.common.FMLCommonHandler.instance().findContainerFor(modName).getVersion();
return ver;
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java
index 53711a3a9f..56cc6d1343 100644
--- a/src/Java/gtPlusPlus/core/material/ALLOY.java
+++ b/src/Java/gtPlusPlus/core/material/ALLOY.java
@@ -1,1015 +1,559 @@
package gtPlusPlus.core.material;
+
public final class ALLOY {
- public static final Material ENERGYCRYSTAL = new Material("Energy Crystal", // Material
- // Name
- new short[] {
- 228, 255, 0, 0
- }, // Material
- // Colour
- 5660, // Melting
- // Point
- // in
- // C
- 0, // Boiling
- // Point
- // in
- // C
- 100, // Protons
- 100, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
+ public static final Material ENERGYCRYSTAL = new Material(
+ "Energy Crystal", //Material Name
+ new short[]{228, 255, 0, 0}, //Material Colour
+ 5660, //Melting Point in C
+ 0, //Boiling Point in C
+ 100, //Protons
+ 100, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
null);
- public static final Material BLOODSTEEL = new Material("Blood Steel", // Material
- // Name
- new short[] {
- 142, 28, 0, 0
- }, // Material
- // Colour
- 2500, // Melting
- // Point
- // in
- // C
- 0, // Boiling
- // Point
- // in
- // C
- 100, // Protons
- 100, // Neutrons
- false, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
+ public static final Material BLOODSTEEL = new Material(
+ "Blood Steel", //Material Name
+ new short[]{142, 28, 0, 0}, //Material Colour
+ 2500, //Melting Point in C
+ 0, //Boiling Point in C
+ 100, //Protons
+ 100, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
null);
- public static final Material STABALLOY = new Material("Staballoy", // Material
- // Name
- new short[] {
- 68, 75, 66, 0
- }, // Material
- // Colour
- 3450, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().URANIUM.getBoilingPointC() * 9
- + ELEMENT.getInstance().TITANIUM.getBoilingPointC() * 1) / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().URANIUM.getProtons() * 9 + ELEMENT.getInstance().TITANIUM.getProtons()) / 10, // Protons
- (ELEMENT.getInstance().URANIUM.getNeutrons() * 9 + ELEMENT.getInstance().TITANIUM.getNeutrons()) / 10, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material STABALLOY = new Material(
+ "Staballoy", //Material Name
+ new short[]{68, 75, 66, 0}, //Material Colour
+ 3450, //Melting Point in C
+ ((ELEMENT.getInstance().URANIUM.getBoilingPointC()*9)+(ELEMENT.getInstance().TITANIUM.getBoilingPointC()*1))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().URANIUM.getProtons()*9)+ELEMENT.getInstance().TITANIUM.getProtons())/10, //Protons
+ ((ELEMENT.getInstance().URANIUM.getNeutrons()*9)+ELEMENT.getInstance().TITANIUM.getNeutrons())/10, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().URANIUM, 9),
new MaterialStack(ELEMENT.getInstance().TITANIUM, 1)
});
- public static final Material TANTALLOY_60 = new Material("Tantalloy-60", // Material
- // Name
- new short[] {
- 213, 231, 237, 0
- }, // Material
- // Colour
- 3025, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().TUNGSTEN.getBoilingPointC() * 1
- + ELEMENT.getInstance().TANTALUM.getBoilingPointC() * 8
- + ELEMENT.getInstance().TITANIUM.getBoilingPointC() * 1) / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().TUNGSTEN.getProtons() * 1 + ELEMENT.getInstance().TANTALUM.getProtons() * 8
- + ELEMENT.getInstance().TITANIUM.getProtons() * 1) / 10, // Protons
- (ELEMENT.getInstance().TUNGSTEN.getNeutrons() * 1 + ELEMENT.getInstance().TANTALUM.getNeutrons() * 8
- + ELEMENT.getInstance().TITANIUM.getNeutrons() * 1) / 10, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material TANTALLOY_60 = new Material(
+ "Tantalloy-60", //Material Name
+ new short[]{213, 231, 237, 0}, //Material Colour
+ 3025, //Melting Point in C
+ ((ELEMENT.getInstance().TUNGSTEN.getBoilingPointC()*1)+(ELEMENT.getInstance().TANTALUM.getBoilingPointC()*8)+(ELEMENT.getInstance().TITANIUM.getBoilingPointC()*1))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().TUNGSTEN.getProtons()*1)+(ELEMENT.getInstance().TANTALUM.getProtons()*8)+(ELEMENT.getInstance().TITANIUM.getProtons()*1))/10, //Protons
+ ((ELEMENT.getInstance().TUNGSTEN.getNeutrons()*1)+(ELEMENT.getInstance().TANTALUM.getNeutrons()*8)+(ELEMENT.getInstance().TITANIUM.getNeutrons()*1))/10, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 4),
new MaterialStack(ELEMENT.getInstance().TANTALUM, 46)
});
- public static final Material TANTALLOY_61 = new Material("Tantalloy-61", // Material
- // Name
- new short[] {
- 193, 211, 217, 0
- }, // Material
- // Colour
- 3030, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().TUNGSTEN.getBoilingPointC() * 1
- + ELEMENT.getInstance().TANTALUM.getBoilingPointC() * 7
- + ELEMENT.getInstance().TITANIUM.getBoilingPointC() * 1
- + ELEMENT.getInstance().YTTRIUM.getBoilingPointC() * 1) / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().TUNGSTEN.getProtons() * 1 + ELEMENT.getInstance().TANTALUM.getProtons() * 7
- + ELEMENT.getInstance().TITANIUM.getProtons() * 1 + ELEMENT.getInstance().YTTRIUM.getProtons() * 1)
- / 10, // Protons
- (ELEMENT.getInstance().TUNGSTEN.getNeutrons() * 1 + ELEMENT.getInstance().TANTALUM.getNeutrons() * 7
- + ELEMENT.getInstance().TITANIUM.getNeutrons() * 1
- + ELEMENT.getInstance().YTTRIUM.getNeutrons() * 1) / 10, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
- new MaterialStack(ALLOY.TANTALLOY_60, 2), new MaterialStack(ELEMENT.getInstance().TITANIUM, 12),
+ public static final Material TANTALLOY_61 = new Material(
+ "Tantalloy-61", //Material Name
+ new short[]{193, 211, 217, 0}, //Material Colour
+ 3030, //Melting Point in C
+ ((ELEMENT.getInstance().TUNGSTEN.getBoilingPointC()*1)+(ELEMENT.getInstance().TANTALUM.getBoilingPointC()*7)+(ELEMENT.getInstance().TITANIUM.getBoilingPointC()*1)+(ELEMENT.getInstance().YTTRIUM.getBoilingPointC()*1))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().TUNGSTEN.getProtons()*1)+(ELEMENT.getInstance().TANTALUM.getProtons()*7)+(ELEMENT.getInstance().TITANIUM.getProtons()*1)+(ELEMENT.getInstance().YTTRIUM.getProtons()*1))/10, //Protons
+ ((ELEMENT.getInstance().TUNGSTEN.getNeutrons()*1)+(ELEMENT.getInstance().TANTALUM.getNeutrons()*7)+(ELEMENT.getInstance().TITANIUM.getNeutrons()*1)+(ELEMENT.getInstance().YTTRIUM.getNeutrons()*1))/10, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ALLOY.TANTALLOY_60, 2),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 12),
new MaterialStack(ELEMENT.getInstance().YTTRIUM, 8)
});
- public static final Material BRONZE = new Material("Bronze", // Material
- // Name
- new short[] {
- 128, 128, 128, 0
- }, // Material
- // Colour
- (ELEMENT.getInstance().TIN.getMeltingPointC() * 1 + ELEMENT.getInstance().COPPER.getMeltingPointC() * 3)
- / 4, // Melting
- // point
- // in
- // C
- (ELEMENT.getInstance().TIN.getBoilingPointC() * 1 + ELEMENT.getInstance().COPPER.getBoilingPointC() * 3)
- / 4, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().TIN.getProtons() * 1 + ELEMENT.getInstance().COPPER.getProtons() * 3) / 4, // Protons
- (ELEMENT.getInstance().TIN.getNeutrons() * 1 + ELEMENT.getInstance().COPPER.getNeutrons() * 3) / 4, // Neutrons
- false, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material BRONZE = new Material(
+ "Bronze", //Material Name
+ new short[]{128, 128, 128, 0}, //Material Colour
+ ((ELEMENT.getInstance().TIN.getMeltingPointC()*1)+(ELEMENT.getInstance().COPPER.getMeltingPointC()*3))/4, //Melting point in C
+ ((ELEMENT.getInstance().TIN.getBoilingPointC()*1)+(ELEMENT.getInstance().COPPER.getBoilingPointC()*3))/4, //Boiling Point in C
+ ((ELEMENT.getInstance().TIN.getProtons()*1)+(ELEMENT.getInstance().COPPER.getProtons()*3))/4, //Protons
+ ((ELEMENT.getInstance().TIN.getNeutrons()*1)+(ELEMENT.getInstance().COPPER.getNeutrons()*3))/4, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().COPPER, 35),
new MaterialStack(ELEMENT.getInstance().COPPER, 40),
new MaterialStack(ELEMENT.getInstance().TIN, 25)
});
- public static final Material TUMBAGA = new Material("Tumbaga", // Material
- // Name
- new short[] {
- 255, 178, 15, 0
- }, // Material
- // Colour
- (ELEMENT.getInstance().GOLD.getMeltingPointC() * 7 + ELEMENT.getInstance().COPPER.getMeltingPointC() * 3)
- / 10, // Melting
- // point
- // in
- // C
- (ELEMENT.getInstance().GOLD.getBoilingPointC() * 7 + ELEMENT.getInstance().COPPER.getBoilingPointC() * 3)
- / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().GOLD.getProtons() * 7 + ELEMENT.getInstance().COPPER.getProtons() * 3) / 10, // Protons
- (ELEMENT.getInstance().GOLD.getNeutrons() * 7 + ELEMENT.getInstance().COPPER.getNeutrons() * 3) / 10, // Neutrons
- false, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material TUMBAGA = new Material(
+ "Tumbaga", //Material Name
+ new short[]{255,178,15, 0}, //Material Colour
+ ((ELEMENT.getInstance().GOLD.getMeltingPointC()*7)+(ELEMENT.getInstance().COPPER.getMeltingPointC()*3))/10, //Melting point in C
+ ((ELEMENT.getInstance().GOLD.getBoilingPointC()*7)+(ELEMENT.getInstance().COPPER.getBoilingPointC()*3))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().GOLD.getProtons()*7)+(ELEMENT.getInstance().COPPER.getProtons()*3))/10, //Protons
+ ((ELEMENT.getInstance().GOLD.getNeutrons()*7)+(ELEMENT.getInstance().COPPER.getNeutrons()*3))/10, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().GOLD, 30),
new MaterialStack(ELEMENT.getInstance().GOLD, 40),
new MaterialStack(ELEMENT.getInstance().COPPER, 30)
});
- public static final Material POTIN = new Material("Potin", // Material
- // Name
- new short[] {
- 201, 151, 129, 0
- }, // Material
- // Colour
- (ELEMENT.getInstance().LEAD.getMeltingPointC() * 4 + ALLOY.BRONZE.getMeltingPointC() * 4
- + ELEMENT.getInstance().TIN.getMeltingPointC() * 2) / 10, // Melting
- // point
- // in
- // C
- (ELEMENT.getInstance().LEAD.getBoilingPointC() * 4 + ALLOY.BRONZE.getBoilingPointC() * 4
- + ELEMENT.getInstance().TIN.getBoilingPointC() * 2) / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().LEAD.getProtons() * 4 + ALLOY.BRONZE.getProtons() * 4
- + ELEMENT.getInstance().TIN.getProtons() * 2) / 10, // Protons
- (ELEMENT.getInstance().LEAD.getNeutrons() * 4 + ALLOY.BRONZE.getNeutrons() * 4
- + ELEMENT.getInstance().TIN.getNeutrons() * 2) / 10, // Neutrons
- false, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
- new MaterialStack(ELEMENT.getInstance().LEAD, 40), new MaterialStack(ALLOY.BRONZE, 40),
+ public static final Material POTIN = new Material(
+ "Potin", //Material Name
+ new short[]{201,151,129, 0}, //Material Colour
+ ((ELEMENT.getInstance().LEAD.getMeltingPointC()*4)+(ALLOY.BRONZE.getMeltingPointC()*4)+(ELEMENT.getInstance().TIN.getMeltingPointC()*2))/10, //Melting point in C
+ ((ELEMENT.getInstance().LEAD.getBoilingPointC()*4)+(ALLOY.BRONZE.getBoilingPointC()*4)+(ELEMENT.getInstance().TIN.getBoilingPointC()*2))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().LEAD.getProtons()*4)+(ALLOY.BRONZE.getProtons()*4)+(ELEMENT.getInstance().TIN.getProtons()*2))/10, //Protons
+ ((ELEMENT.getInstance().LEAD.getNeutrons()*4)+(ALLOY.BRONZE.getNeutrons()*4)+(ELEMENT.getInstance().TIN.getNeutrons()*2))/10, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().LEAD, 40),
+ new MaterialStack(ALLOY.BRONZE, 40),
new MaterialStack(ELEMENT.getInstance().TIN, 20)
});
- public static final Material BEDROCKIUM = new Material("Bedrockium", // Material
- // Name
- new short[] {
- 32, 32, 32, 0
- }, // Material
- // Colour
- 7735, // Melting
- // Point
- // in
- // C
- 0, // Boiling
- // Point
- // in
- // C
- 100, // Protons
- 100, // Neutrons
- false, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
+ public static final Material BEDROCKIUM = new Material(
+ "Bedrockium", //Material Name
+ new short[]{32, 32, 32, 0}, //Material Colour
+ 7735, //Melting Point in C
+ 0, //Boiling Point in C
+ 100, //Protons
+ 100, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
null);
- public static final Material INCONEL_625 = new Material("Inconel-625", // Material
- // Name
- new short[] {
- 128, 200, 128, 0
- }, // Material
- // Colour
- 1425, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().NICKEL.getBoilingPointC() * 6 + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 2
- + ELEMENT.getInstance().IRON.getBoilingPointC() * 1
- + ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC() * 1) / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().NICKEL.getProtons() * 6 + ELEMENT.getInstance().CHROMIUM.getProtons() * 2
- + ELEMENT.getInstance().IRON.getProtons() * 1 + ELEMENT.getInstance().MOLYBDENUM.getProtons() * 1)
- / 10, // Protons
- (ELEMENT.getInstance().NICKEL.getNeutrons() * 6 + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 2
- + ELEMENT.getInstance().IRON.getNeutrons() * 1 + ELEMENT.getInstance().MOLYBDENUM.getNeutrons() * 1)
- / 10, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material INCONEL_625 = new Material(
+ "Inconel-625", //Material Name
+ new short[]{128, 200, 128, 0}, //Material Colour
+ 1425, //Melting Point in C
+ ((ELEMENT.getInstance().NICKEL.getBoilingPointC()*6)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*2)+(ELEMENT.getInstance().IRON.getBoilingPointC()*1)+(ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC()*1))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().NICKEL.getProtons()*6)+(ELEMENT.getInstance().CHROMIUM.getProtons()*2)+(ELEMENT.getInstance().IRON.getProtons()*1)+(ELEMENT.getInstance().MOLYBDENUM.getProtons()*1))/10, //Protons
+ ((ELEMENT.getInstance().NICKEL.getNeutrons()*6)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*2)+(ELEMENT.getInstance().IRON.getNeutrons()*1)+(ELEMENT.getInstance().MOLYBDENUM.getNeutrons()*1))/10, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().NICKEL, 60),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 20),
new MaterialStack(ELEMENT.getInstance().IRON, 10),
new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 10)
});
- public static final Material INCONEL_690 = new Material("Inconel-690", // Material
- // Name
- new short[] {
- 118, 220, 138, 0
- }, // Material
- // Colour
- 1425, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().NICKEL.getBoilingPointC() * 6 + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 2
- + ELEMENT.getInstance().NIOBIUM.getBoilingPointC() * 1
- + ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC() * 1) / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().NICKEL.getProtons() * 6 + ELEMENT.getInstance().CHROMIUM.getProtons() * 2
- + ELEMENT.getInstance().NIOBIUM.getProtons() * 1
- + ELEMENT.getInstance().MOLYBDENUM.getProtons() * 1) / 10, // Protons
- (ELEMENT.getInstance().NICKEL.getNeutrons() * 6 + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 2
- + ELEMENT.getInstance().NIOBIUM.getNeutrons() * 1
- + ELEMENT.getInstance().MOLYBDENUM.getNeutrons() * 1) / 10, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material INCONEL_690 = new Material(
+ "Inconel-690", //Material Name
+ new short[]{118, 220, 138, 0}, //Material Colour
+ 1425, //Melting Point in C
+ ((ELEMENT.getInstance().NICKEL.getBoilingPointC()*6)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*2)+(ELEMENT.getInstance().NIOBIUM.getBoilingPointC()*1)+(ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC()*1))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().NICKEL.getProtons()*6)+(ELEMENT.getInstance().CHROMIUM.getProtons()*2)+(ELEMENT.getInstance().NIOBIUM.getProtons()*1)+(ELEMENT.getInstance().MOLYBDENUM.getProtons()*1))/10, //Protons
+ ((ELEMENT.getInstance().NICKEL.getNeutrons()*6)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*2)+(ELEMENT.getInstance().NIOBIUM.getNeutrons()*1)+(ELEMENT.getInstance().MOLYBDENUM.getNeutrons()*1))/10, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().NICKEL, 60),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 20),
new MaterialStack(ELEMENT.getInstance().NIOBIUM, 10),
new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 10)
});
- public static final Material INCONEL_792 = new Material("Inconel-792", // Material
- // Name
- new short[] {
- 108, 240, 118, 0
- }, // Material
- // Colour
- 1425, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().NICKEL.getBoilingPointC() * 6 + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 1
- + ELEMENT.getInstance().IRON.getBoilingPointC() * 1
- + ELEMENT.getInstance().ALUMINIUM.getBoilingPointC() * 2) / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().NICKEL.getProtons() * 6 + ELEMENT.getInstance().CHROMIUM.getProtons() * 1
- + ELEMENT.getInstance().IRON.getProtons() * 1 + ELEMENT.getInstance().ALUMINIUM.getProtons() * 2)
- / 10, // Protons
- (ELEMENT.getInstance().NICKEL.getNeutrons() * 6 + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 1
- + ELEMENT.getInstance().IRON.getNeutrons() * 1 + ELEMENT.getInstance().ALUMINIUM.getNeutrons() * 2)
- / 10, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material INCONEL_792 = new Material(
+ "Inconel-792", //Material Name
+ new short[]{108, 240, 118, 0}, //Material Colour
+ 1425, //Melting Point in C
+ ((ELEMENT.getInstance().NICKEL.getBoilingPointC()*6)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*1)+(ELEMENT.getInstance().IRON.getBoilingPointC()*1)+(ELEMENT.getInstance().ALUMINIUM.getBoilingPointC()*2))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().NICKEL.getProtons()*6)+(ELEMENT.getInstance().CHROMIUM.getProtons()*1)+(ELEMENT.getInstance().IRON.getProtons()*1)+(ELEMENT.getInstance().ALUMINIUM.getProtons()*2))/10, //Protons
+ ((ELEMENT.getInstance().NICKEL.getNeutrons()*6)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*1)+(ELEMENT.getInstance().IRON.getNeutrons()*1)+(ELEMENT.getInstance().ALUMINIUM.getNeutrons()*2))/10, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().NICKEL, 60),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 10),
new MaterialStack(ELEMENT.getInstance().NIOBIUM, 10),
new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 20)
});
-
- public static final Material STEEL = new Material("Steel", // Material
- // Name
- new short[] {
- 180, 180, 20, 0
- }, // Material
- // Colour
- (ELEMENT.getInstance().CARBON.getMeltingPointC() * 5 + ELEMENT.getInstance().IRON.getMeltingPointC() * 95)
- / 100, // Melting
- // point
- // in
- // C
- (ELEMENT.getInstance().CARBON.getBoilingPointC() * 5 + ELEMENT.getInstance().IRON.getBoilingPointC() * 95)
- / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().CARBON.getProtons() * 5 + ELEMENT.getInstance().IRON.getProtons() * 95) / 100, // Protons
- (ELEMENT.getInstance().CARBON.getNeutrons() * 5 + ELEMENT.getInstance().IRON.getNeutrons() * 95) / 100, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+
+ public static final Material STEEL = new Material(
+ "Steel", //Material Name
+ new short[]{180, 180, 20, 0}, //Material Colour
+ ((ELEMENT.getInstance().CARBON.getMeltingPointC()*5)+(ELEMENT.getInstance().IRON.getMeltingPointC()*95))/100, //Melting point in C
+ ((ELEMENT.getInstance().CARBON.getBoilingPointC()*5)+(ELEMENT.getInstance().IRON.getBoilingPointC()*95))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().CARBON.getProtons()*5)+(ELEMENT.getInstance().IRON.getProtons()*95))/100, //Protons
+ ((ELEMENT.getInstance().CARBON.getNeutrons()*5)+(ELEMENT.getInstance().IRON.getNeutrons()*95))/100, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().CARBON, 10),
new MaterialStack(ELEMENT.getInstance().IRON, 30),
- new MaterialStack(ELEMENT.getInstance().IRON, 30), new MaterialStack(ELEMENT.getInstance().IRON, 30)
+ new MaterialStack(ELEMENT.getInstance().IRON, 30),
+ new MaterialStack(ELEMENT.getInstance().IRON, 30)
});
- public static final Material ZERON_100 = new Material("Zeron-100", // Material
- // Name
- new short[] {
- 180, 180, 20, 0
- }, // Material
- // Colour
- (ELEMENT.getInstance().CHROMIUM.getMeltingPointC() * 25
- + ELEMENT.getInstance().NICKEL.getMeltingPointC() * 6
- + ELEMENT.getInstance().COBALT.getMeltingPointC() * 9 + ALLOY.STEEL.getMeltingPointC() * 60) / 100, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 25
- + ELEMENT.getInstance().NICKEL.getBoilingPointC() * 6
- + ELEMENT.getInstance().COBALT.getBoilingPointC() * 9 + ALLOY.STEEL.getBoilingPointC() * 60) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().CHROMIUM.getProtons() * 25 + ELEMENT.getInstance().NICKEL.getProtons() * 6
- + ELEMENT.getInstance().COBALT.getProtons() * 9 + ALLOY.STEEL.getProtons() * 60) / 100, // Protons
- (ELEMENT.getInstance().CHROMIUM.getNeutrons() * 25 + ELEMENT.getInstance().NICKEL.getNeutrons() * 6
- + ELEMENT.getInstance().COBALT.getNeutrons() * 9 + ALLOY.STEEL.getNeutrons() * 60) / 100, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material ZERON_100 = new Material(
+ "Zeron-100", //Material Name
+ new short[]{180, 180, 20, 0}, //Material Colour
+ ((ELEMENT.getInstance().CHROMIUM.getMeltingPointC()*25)+(ELEMENT.getInstance().NICKEL.getMeltingPointC()*6)+(ELEMENT.getInstance().COBALT.getMeltingPointC()*9)+(ALLOY.STEEL.getMeltingPointC()*60))/100, //Melting Point in C
+ ((ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*25)+(ELEMENT.getInstance().NICKEL.getBoilingPointC()*6)+(ELEMENT.getInstance().COBALT.getBoilingPointC()*9)+(ALLOY.STEEL.getBoilingPointC()*60))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().CHROMIUM.getProtons()*25)+(ELEMENT.getInstance().NICKEL.getProtons()*6)+(ELEMENT.getInstance().COBALT.getProtons()*9)+(ALLOY.STEEL.getProtons()*60))/100, //Protons
+ ((ELEMENT.getInstance().CHROMIUM.getNeutrons()*25)+(ELEMENT.getInstance().NICKEL.getNeutrons()*6)+(ELEMENT.getInstance().COBALT.getNeutrons()*9)+(ALLOY.STEEL.getNeutrons()*60))/100, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 26),
new MaterialStack(ELEMENT.getInstance().NICKEL, 6),
new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 4),
new MaterialStack(ELEMENT.getInstance().COPPER, 20),
- new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 4), new MaterialStack(ALLOY.STEEL, 40)
- });
-
- public static final Material MARAGING250 = new Material("Maraging Steel 250", // Material
- // Name
- new short[] {
- 140, 140, 140, 0
- }, // Material
- // Colour
- 1413, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().TITANIUM.getBoilingPointC() * 5
- + ELEMENT.getInstance().NICKEL.getBoilingPointC() * 16
- + ELEMENT.getInstance().COBALT.getBoilingPointC() * 9 + ALLOY.STEEL.getBoilingPointC() * 70) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().TITANIUM.getProtons() * 5 + ELEMENT.getInstance().NICKEL.getProtons() * 16
- + ELEMENT.getInstance().COBALT.getProtons() * 9 + ALLOY.STEEL.getProtons() * 70) / 100, // Protons
- (ELEMENT.getInstance().TITANIUM.getNeutrons() * 5 + ELEMENT.getInstance().NICKEL.getNeutrons() * 16
- + ELEMENT.getInstance().COBALT.getNeutrons() * 9 + ALLOY.STEEL.getNeutrons() * 70) / 100, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
- new MaterialStack(ALLOY.STEEL, 64), new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 4),
+ new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 4),
+ new MaterialStack(ALLOY.STEEL, 40)
+ });
+
+ public static final Material MARAGING250 = new Material(
+ "Maraging Steel 250", //Material Name
+ new short[]{140, 140, 140, 0}, //Material Colour
+ 1413, //Melting Point in C
+ ((ELEMENT.getInstance().TITANIUM.getBoilingPointC()*5)+(ELEMENT.getInstance().NICKEL.getBoilingPointC()*16)+(ELEMENT.getInstance().COBALT.getBoilingPointC()*9)+(ALLOY.STEEL.getBoilingPointC()*70))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().TITANIUM.getProtons()*5)+(ELEMENT.getInstance().NICKEL.getProtons()*16)+(ELEMENT.getInstance().COBALT.getProtons()*9)+(ALLOY.STEEL.getProtons()*70))/100, //Protons
+ ((ELEMENT.getInstance().TITANIUM.getNeutrons()*5)+(ELEMENT.getInstance().NICKEL.getNeutrons()*16)+(ELEMENT.getInstance().COBALT.getNeutrons()*9)+(ALLOY.STEEL.getNeutrons()*70))/100, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ALLOY.STEEL, 64),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 4),
new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
new MaterialStack(ELEMENT.getInstance().NICKEL, 16),
new MaterialStack(ELEMENT.getInstance().COBALT, 8),
});
- public static final Material MARAGING300 = new Material("Maraging Steel 300", // Material
- // Name
- new short[] {
- 150, 150, 150, 0
- }, // Material
- // Colour
- 1413, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().TITANIUM.getBoilingPointC() * 10
- + ELEMENT.getInstance().NICKEL.getBoilingPointC() * 21
- + ELEMENT.getInstance().COBALT.getBoilingPointC() * 14 + ALLOY.STEEL.getBoilingPointC() * 55) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().TITANIUM.getProtons() * 10 + ELEMENT.getInstance().NICKEL.getProtons() * 21
- + ELEMENT.getInstance().COBALT.getProtons() * 14 + ALLOY.STEEL.getProtons() * 55) / 100, // Protons
- (ELEMENT.getInstance().TITANIUM.getNeutrons() * 10 + ELEMENT.getInstance().NICKEL.getNeutrons() * 21
- + ELEMENT.getInstance().COBALT.getNeutrons() * 14 + ALLOY.STEEL.getNeutrons() * 55) / 100, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
- new MaterialStack(ALLOY.STEEL, 64), new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
- new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 4),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 16),
- new MaterialStack(ELEMENT.getInstance().COBALT, 8),
+ public static final Material MARAGING300 = new Material(
+ "Maraging Steel 300", //Material Name
+ new short[]{150, 150, 150, 0}, //Material Colour
+ 1413, //Melting Point in C
+ ((ELEMENT.getInstance().TITANIUM.getBoilingPointC()*10)+(ELEMENT.getInstance().NICKEL.getBoilingPointC()*21)+(ELEMENT.getInstance().COBALT.getBoilingPointC()*14)+(ALLOY.STEEL.getBoilingPointC()*55))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().TITANIUM.getProtons()*10)+(ELEMENT.getInstance().NICKEL.getProtons()*21)+(ELEMENT.getInstance().COBALT.getProtons()*14)+(ALLOY.STEEL.getProtons()*55))/100, //Protons
+ ((ELEMENT.getInstance().TITANIUM.getNeutrons()*10)+(ELEMENT.getInstance().NICKEL.getNeutrons()*21)+(ELEMENT.getInstance().COBALT.getNeutrons()*14)+(ALLOY.STEEL.getNeutrons()*55))/100, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ALLOY.STEEL, 64),
+ new MaterialStack(ELEMENT.getInstance().TITANIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 16),
+ new MaterialStack(ELEMENT.getInstance().COBALT, 8),
});
- public static final Material MARAGING350 = new Material("Maraging Steel 350", // Material
- // Name
- new short[] {
- 160, 160, 160, 0
- }, // Material
- // Colour
- 1413, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().TITANIUM.getBoilingPointC() * 15
- + ELEMENT.getInstance().NICKEL.getBoilingPointC() * 21
- + ELEMENT.getInstance().COBALT.getBoilingPointC() * 9 + ALLOY.STEEL.getBoilingPointC() * 55) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().TITANIUM.getProtons() * 15 + ELEMENT.getInstance().NICKEL.getProtons() * 21
- + ELEMENT.getInstance().COBALT.getProtons() * 9 + ALLOY.STEEL.getProtons() * 55) / 100, // Protons
- (ELEMENT.getInstance().TITANIUM.getNeutrons() * 15 + ELEMENT.getInstance().NICKEL.getNeutrons() * 21
- + ELEMENT.getInstance().COBALT.getNeutrons() * 9 + ALLOY.STEEL.getNeutrons() * 55) / 100, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
- new MaterialStack(ALLOY.STEEL, 64), new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 4),
- new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 4),
- new MaterialStack(ELEMENT.getInstance().NICKEL, 16),
- new MaterialStack(ELEMENT.getInstance().COBALT, 8),
+ public static final Material MARAGING350 = new Material(
+ "Maraging Steel 350", //Material Name
+ new short[]{160, 160, 160, 0}, //Material Colour
+ 1413, //Melting Point in C
+ ((ELEMENT.getInstance().TITANIUM.getBoilingPointC()*15)+(ELEMENT.getInstance().NICKEL.getBoilingPointC()*21)+(ELEMENT.getInstance().COBALT.getBoilingPointC()*9)+(ALLOY.STEEL.getBoilingPointC()*55))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().TITANIUM.getProtons()*15)+(ELEMENT.getInstance().NICKEL.getProtons()*21)+(ELEMENT.getInstance().COBALT.getProtons()*9)+(ALLOY.STEEL.getProtons()*55))/100, //Protons
+ ((ELEMENT.getInstance().TITANIUM.getNeutrons()*15)+(ELEMENT.getInstance().NICKEL.getNeutrons()*21)+(ELEMENT.getInstance().COBALT.getNeutrons()*9)+(ALLOY.STEEL.getNeutrons()*55))/100, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ALLOY.STEEL, 64),
+ new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 4),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 4),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 16),
+ new MaterialStack(ELEMENT.getInstance().COBALT, 8),
});
- public static final Material STELLITE = new Material("Stellite", // Material
- // Name
- new short[] {
- 129, 75, 120, 0
- }, // Material
- // Colour
- 1310, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().TITANIUM.getBoilingPointC() * 10
- + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 35
- + ELEMENT.getInstance().COBALT.getBoilingPointC() * 35
- + ELEMENT.getInstance().MANGANESE.getBoilingPointC() * 20) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().TITANIUM.getProtons() * 10 + ELEMENT.getInstance().CHROMIUM.getProtons() * 35
- + ELEMENT.getInstance().COBALT.getProtons() * 35
- + ELEMENT.getInstance().MANGANESE.getProtons() * 20) / 100, // Protons
- (ELEMENT.getInstance().TITANIUM.getNeutrons() * 10 + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 35
- + ELEMENT.getInstance().COBALT.getNeutrons() * 35
- + ELEMENT.getInstance().MANGANESE.getNeutrons() * 20) / 100, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material STELLITE = new Material(
+ "Stellite", //Material Name
+ new short[]{129, 75, 120, 0}, //Material Colour
+ 1310, //Melting Point in C
+ ((ELEMENT.getInstance().TITANIUM.getBoilingPointC()*10)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*35)+(ELEMENT.getInstance().COBALT.getBoilingPointC()*35)+(ELEMENT.getInstance().MANGANESE.getBoilingPointC()*20))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().TITANIUM.getProtons()*10)+(ELEMENT.getInstance().CHROMIUM.getProtons()*35)+(ELEMENT.getInstance().COBALT.getProtons()*35)+(ELEMENT.getInstance().MANGANESE.getProtons()*20))/100, //Protons
+ ((ELEMENT.getInstance().TITANIUM.getNeutrons()*10)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*35)+(ELEMENT.getInstance().COBALT.getNeutrons()*35)+(ELEMENT.getInstance().MANGANESE.getNeutrons()*20))/100, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().COBALT, 35),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 35),
new MaterialStack(ELEMENT.getInstance().MANGANESE, 20),
new MaterialStack(ELEMENT.getInstance().TITANIUM, 10)
});
- public static final Material TALONITE = new Material("Talonite", // Material
- // Name
- new short[] {
- 228, 75, 120, 0
- }, // Material
- // Colour
- 1454, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC() * 10
- + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 30
- + ELEMENT.getInstance().COBALT.getBoilingPointC() * 40
- + ELEMENT.getInstance().PHOSPHORUS.getBoilingPointC() * 20) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().MOLYBDENUM.getProtons() * 10 + ELEMENT.getInstance().CHROMIUM.getProtons() * 30
- + ELEMENT.getInstance().COBALT.getProtons() * 40
- + ELEMENT.getInstance().PHOSPHORUS.getProtons() * 20) / 100, // Protons
- (ELEMENT.getInstance().MOLYBDENUM.getNeutrons() * 10 + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 30
- + ELEMENT.getInstance().COBALT.getNeutrons() * 40
- + ELEMENT.getInstance().PHOSPHORUS.getNeutrons() * 20) / 100, // Neutrons
- false, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material TALONITE = new Material(
+ "Talonite", //Material Name
+ new short[]{228, 75, 120, 0}, //Material Colour
+ 1454, //Melting Point in C
+ ((ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC()*10)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*30)+(ELEMENT.getInstance().COBALT.getBoilingPointC()*40)+(ELEMENT.getInstance().PHOSPHORUS.getBoilingPointC()*20))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().MOLYBDENUM.getProtons()*10)+(ELEMENT.getInstance().CHROMIUM.getProtons()*30)+(ELEMENT.getInstance().COBALT.getProtons()*40)+(ELEMENT.getInstance().PHOSPHORUS.getProtons()*20))/100, //Protons
+ ((ELEMENT.getInstance().MOLYBDENUM.getNeutrons()*10)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*30)+(ELEMENT.getInstance().COBALT.getNeutrons()*40)+(ELEMENT.getInstance().PHOSPHORUS.getNeutrons()*20))/100, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().COBALT, 40),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 30),
new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 20),
new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 10)
});
- public static final Material HASTELLOY_W = new Material("Hastelloy-W", // Material
- // Name
- new short[] {
- 218, 165, 32, 0
- }, // Material
- // Colour
- 1350, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().IRON.getBoilingPointC() * 6
- + ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC() * 24
- + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 5
- + ELEMENT.getInstance().NICKEL.getBoilingPointC() * 65) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().IRON.getProtons() * 6 + ELEMENT.getInstance().MOLYBDENUM.getProtons() * 24
- + ELEMENT.getInstance().CHROMIUM.getProtons() * 5 + ELEMENT.getInstance().NICKEL.getProtons() * 65)
- / 100, // Protons
- (ELEMENT.getInstance().IRON.getNeutrons() * 6 + ELEMENT.getInstance().MOLYBDENUM.getNeutrons() * 24
- + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 5
- + ELEMENT.getInstance().NICKEL.getNeutrons() * 65) / 100, // Neutrons
- false, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material HASTELLOY_W = new Material(
+ "Hastelloy-W", //Material Name
+ new short[]{218, 165, 32, 0}, //Material Colour
+ 1350, //Melting Point in C
+ ((ELEMENT.getInstance().IRON.getBoilingPointC()*6)+(ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC()*24)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*5)+(ELEMENT.getInstance().NICKEL.getBoilingPointC()*65))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().IRON.getProtons()*6)+(ELEMENT.getInstance().MOLYBDENUM.getProtons()*24)+(ELEMENT.getInstance().CHROMIUM.getProtons()*5)+(ELEMENT.getInstance().NICKEL.getProtons()*65))/100, //Protons
+ ((ELEMENT.getInstance().IRON.getNeutrons()*6)+(ELEMENT.getInstance().MOLYBDENUM.getNeutrons()*24)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*5)+(ELEMENT.getInstance().NICKEL.getNeutrons()*65))/100, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().IRON, 06),
new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 24),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 8),
new MaterialStack(ELEMENT.getInstance().NICKEL, 62)
});
- /*
- * public static final Material HASTELLOY_X = new Material( "Hastelloy-X",
- * //Material Name new short[]{255, 193, 37, 0}, //Material Colour 1350,
- * //Melting Point in C
- * ((ELEMENT.getInstance().IRON.getBoilingPoint_C()*18)+(ELEMENT.getInstance
- * ().MOLYBDENUM.getBoilingPoint_C()*9)+(ELEMENT.getInstance().CHROMIUM.
- * getBoilingPoint_C()*22)+(ELEMENT.getInstance().NICKEL.getBoilingPoint_C()
- * *51))/100, //Boiling Point in C
- * ((ELEMENT.getInstance().IRON.getProtons()*18)+(ELEMENT.getInstance().
- * MOLYBDENUM.getProtons()*9)+(ELEMENT.getInstance().CHROMIUM.getProtons()*
- * 22)+(ELEMENT.getInstance().NICKEL.getProtons()*51))/100, //Protons
- * ((ELEMENT.getInstance().IRON.getNeutrons()*18)+(ELEMENT.getInstance().
- * MOLYBDENUM.getNeutrons()*9)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()
- * *22)+(ELEMENT.getInstance().NICKEL.getNeutrons()*51))/100, //Neutrons
- * false, //Uses Blast furnace? //Material Stacks with Percentage of
- * required elements. new MaterialStack[]{ new
- * MaterialStack(ELEMENT.getInstance().IRON, 18), new
- * MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 9), new
- * MaterialStack(ELEMENT.getInstance().CHROMIUM, 22), new
- * MaterialStack(ELEMENT.getInstance().NICKEL, 51) });
- */
-
- public static final Material HASTELLOY_X = new Material("Hastelloy-X", // Material
- // Name
- new short[] {
- 255, 193, 37, 0
- }, // Material
- // Colour
- 1350, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().IRON.getBoilingPointC() * 18
- + ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC() * 9
- + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 22
- + ELEMENT.getInstance().NICKEL.getBoilingPointC() * 51) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().IRON.getProtons() * 18 + ELEMENT.getInstance().MOLYBDENUM.getProtons() * 9
- + ELEMENT.getInstance().CHROMIUM.getProtons() * 22 + ELEMENT.getInstance().NICKEL.getProtons() * 51)
- / 100, // Protons
- (ELEMENT.getInstance().IRON.getNeutrons() * 18 + ELEMENT.getInstance().MOLYBDENUM.getNeutrons() * 9
- + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 22
- + ELEMENT.getInstance().NICKEL.getNeutrons() * 51) / 100, // Neutrons
- false, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ /*public static final Material HASTELLOY_X = new Material(
+ "Hastelloy-X", //Material Name
+ new short[]{255, 193, 37, 0}, //Material Colour
+ 1350, //Melting Point in C
+ ((ELEMENT.getInstance().IRON.getBoilingPoint_C()*18)+(ELEMENT.getInstance().MOLYBDENUM.getBoilingPoint_C()*9)+(ELEMENT.getInstance().CHROMIUM.getBoilingPoint_C()*22)+(ELEMENT.getInstance().NICKEL.getBoilingPoint_C()*51))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().IRON.getProtons()*18)+(ELEMENT.getInstance().MOLYBDENUM.getProtons()*9)+(ELEMENT.getInstance().CHROMIUM.getProtons()*22)+(ELEMENT.getInstance().NICKEL.getProtons()*51))/100, //Protons
+ ((ELEMENT.getInstance().IRON.getNeutrons()*18)+(ELEMENT.getInstance().MOLYBDENUM.getNeutrons()*9)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*22)+(ELEMENT.getInstance().NICKEL.getNeutrons()*51))/100, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().IRON, 18),
+ new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 9),
+ new MaterialStack(ELEMENT.getInstance().CHROMIUM, 22),
+ new MaterialStack(ELEMENT.getInstance().NICKEL, 51)
+ });*/
+
+ public static final Material HASTELLOY_X = new Material(
+ "Hastelloy-X", //Material Name
+ new short[]{255, 193, 37, 0}, //Material Colour
+ 1350, //Melting Point in C
+ ((ELEMENT.getInstance().IRON.getBoilingPointC()*18)+(ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC()*9)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*22)+(ELEMENT.getInstance().NICKEL.getBoilingPointC()*51))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().IRON.getProtons()*18)+(ELEMENT.getInstance().MOLYBDENUM.getProtons()*9)+(ELEMENT.getInstance().CHROMIUM.getProtons()*22)+(ELEMENT.getInstance().NICKEL.getProtons()*51))/100, //Protons
+ ((ELEMENT.getInstance().IRON.getNeutrons()*18)+(ELEMENT.getInstance().MOLYBDENUM.getNeutrons()*9)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*22)+(ELEMENT.getInstance().NICKEL.getNeutrons()*51))/100, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().IRON, 18),
new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 9),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 22),
new MaterialStack(ELEMENT.getInstance().NICKEL, 51)
});
- public static final Material HASTELLOY_N = new Material("Hastelloy-N", // Material
- // Name
- new short[] {
- 236, 213, 48, 0
- }, // Material
- // Colour
- 1350, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().YTTRIUM.getBoilingPointC() * 5
- + ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC() * 16
- + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 7
- + ELEMENT.getInstance().NICKEL.getBoilingPointC() * 72) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().YTTRIUM.getProtons() * 5 + ELEMENT.getInstance().MOLYBDENUM.getProtons() * 16
- + ELEMENT.getInstance().CHROMIUM.getProtons() * 7 + ELEMENT.getInstance().NICKEL.getProtons() * 72)
- / 100, // Protons
- (ELEMENT.getInstance().YTTRIUM.getNeutrons() * 5 + ELEMENT.getInstance().MOLYBDENUM.getNeutrons() * 16
- + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 7
- + ELEMENT.getInstance().NICKEL.getNeutrons() * 72) / 100, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material HASTELLOY_N = new Material(
+ "Hastelloy-N", //Material Name
+ new short[]{236, 213, 48, 0}, //Material Colour
+ 1350, //Melting Point in C
+ ((ELEMENT.getInstance().YTTRIUM.getBoilingPointC()*5)+(ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC()*16)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*7)+(ELEMENT.getInstance().NICKEL.getBoilingPointC()*72))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().YTTRIUM.getProtons()*5)+(ELEMENT.getInstance().MOLYBDENUM.getProtons()*16)+(ELEMENT.getInstance().CHROMIUM.getProtons()*7)+(ELEMENT.getInstance().NICKEL.getProtons()*72))/100, //Protons
+ ((ELEMENT.getInstance().YTTRIUM.getNeutrons()*5)+(ELEMENT.getInstance().MOLYBDENUM.getNeutrons()*16)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*7)+(ELEMENT.getInstance().NICKEL.getNeutrons()*72))/100, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().YTTRIUM, 10),
new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 16),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 10),
new MaterialStack(ELEMENT.getInstance().NICKEL, 64)
});
- public static final Material HASTELLOY_C276 = new Material("Hastelloy-C276", // Material
- // Name
- new short[] {
- 238, 180, 34, 0
- }, // Material
- // Colour
- 1350, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().COBALT.getBoilingPointC() * 2
- + ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC() * 16
- + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 16
- + ELEMENT.getInstance().NICKEL.getBoilingPointC() * 66) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().COBALT.getProtons() * 2 + ELEMENT.getInstance().MOLYBDENUM.getProtons() * 16
- + ELEMENT.getInstance().CHROMIUM.getProtons() * 16 + ELEMENT.getInstance().NICKEL.getProtons() * 66)
- / 100, // Protons
- (ELEMENT.getInstance().COBALT.getNeutrons() * 2 + ELEMENT.getInstance().MOLYBDENUM.getNeutrons() * 16
- + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 16
- + ELEMENT.getInstance().NICKEL.getNeutrons() * 66) / 100, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material HASTELLOY_C276 = new Material(
+ "Hastelloy-C276", //Material Name
+ new short[]{238, 180, 34, 0}, //Material Colour
+ 1350, //Melting Point in C
+ ((ELEMENT.getInstance().COBALT.getBoilingPointC()*2)+(ELEMENT.getInstance().MOLYBDENUM.getBoilingPointC()*16)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*16)+(ELEMENT.getInstance().NICKEL.getBoilingPointC()*66))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().COBALT.getProtons()*2)+(ELEMENT.getInstance().MOLYBDENUM.getProtons()*16)+(ELEMENT.getInstance().CHROMIUM.getProtons()*16)+(ELEMENT.getInstance().NICKEL.getProtons()*66))/100, //Protons
+ ((ELEMENT.getInstance().COBALT.getNeutrons()*2)+(ELEMENT.getInstance().MOLYBDENUM.getNeutrons()*16)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*16)+(ELEMENT.getInstance().NICKEL.getNeutrons()*66))/100, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().COBALT, 02),
new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 16),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 16),
new MaterialStack(ELEMENT.getInstance().NICKEL, 66)
});
- public static final Material INCOLOY_020 = new Material("Incoloy-020", // Material
- // Name
- new short[] {
- 101, 81, 71, 0
- }, // Material
- // Colour
- 1425, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().IRON.getBoilingPointC() * 40 + ELEMENT.getInstance().COPPER.getBoilingPointC() * 4
- + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 20
- + ELEMENT.getInstance().NICKEL.getBoilingPointC() * 36) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().IRON.getProtons() * 40 + ELEMENT.getInstance().COPPER.getProtons() * 4
- + ELEMENT.getInstance().CHROMIUM.getProtons() * 20 + ELEMENT.getInstance().NICKEL.getProtons() * 36)
- / 100, // Protons
- (ELEMENT.getInstance().IRON.getNeutrons() * 40 + ELEMENT.getInstance().COPPER.getNeutrons() * 4
- + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 20
- + ELEMENT.getInstance().NICKEL.getNeutrons() * 36) / 100, // Neutrons
- false, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material INCOLOY_020 = new Material(
+ "Incoloy-020", //Material Name
+ new short[]{101, 81, 71, 0}, //Material Colour
+ 1425, //Melting Point in C
+ ((ELEMENT.getInstance().IRON.getBoilingPointC()*40)+(ELEMENT.getInstance().COPPER.getBoilingPointC()*4)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*20)+(ELEMENT.getInstance().NICKEL.getBoilingPointC()*36))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().IRON.getProtons()*40)+(ELEMENT.getInstance().COPPER.getProtons()*4)+(ELEMENT.getInstance().CHROMIUM.getProtons()*20)+(ELEMENT.getInstance().NICKEL.getProtons()*36))/100, //Protons
+ ((ELEMENT.getInstance().IRON.getNeutrons()*40)+(ELEMENT.getInstance().COPPER.getNeutrons()*4)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*20)+(ELEMENT.getInstance().NICKEL.getNeutrons()*36))/100, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().IRON, 40),
new MaterialStack(ELEMENT.getInstance().COPPER, 4),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 20),
new MaterialStack(ELEMENT.getInstance().NICKEL, 36)
});
- public static final Material INCOLOY_DS = new Material("Incoloy-DS", // Material
- // Name
- new short[] {
- 71, 101, 81, 0
- }, // Material
- // Colour
- 1425, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().IRON.getBoilingPointC() * 46 + ELEMENT.getInstance().COBALT.getBoilingPointC() * 18
- + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 18
- + ELEMENT.getInstance().NICKEL.getBoilingPointC() * 18) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().IRON.getProtons() * 46 + ELEMENT.getInstance().COBALT.getProtons() * 18
- + ELEMENT.getInstance().CHROMIUM.getProtons() * 18 + ELEMENT.getInstance().NICKEL.getProtons() * 18)
- / 100, // Protons
- (ELEMENT.getInstance().IRON.getNeutrons() * 46 + ELEMENT.getInstance().COBALT.getNeutrons() * 18
- + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 18
- + ELEMENT.getInstance().NICKEL.getNeutrons() * 18) / 100, // Neutrons
- false, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material INCOLOY_DS = new Material(
+ "Incoloy-DS", //Material Name
+ new short[]{71, 101, 81, 0}, //Material Colour
+ 1425, //Melting Point in C
+ ((ELEMENT.getInstance().IRON.getBoilingPointC()*46)+(ELEMENT.getInstance().COBALT.getBoilingPointC()*18)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*18)+(ELEMENT.getInstance().NICKEL.getBoilingPointC()*18))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().IRON.getProtons()*46)+(ELEMENT.getInstance().COBALT.getProtons()*18)+(ELEMENT.getInstance().CHROMIUM.getProtons()*18)+(ELEMENT.getInstance().NICKEL.getProtons()*18))/100, //Protons
+ ((ELEMENT.getInstance().IRON.getNeutrons()*46)+(ELEMENT.getInstance().COBALT.getNeutrons()*18)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*18)+(ELEMENT.getInstance().NICKEL.getNeutrons()*18))/100, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().IRON, 46),
new MaterialStack(ELEMENT.getInstance().COBALT, 18),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 18),
new MaterialStack(ELEMENT.getInstance().NICKEL, 18)
});
- public static final Material INCOLOY_MA956 = new Material("Incoloy-MA956", // Material
- // Name
- new short[] {
- 81, 71, 101, 0
- }, // Material
- // Colour
- 1425, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().IRON.getBoilingPointC() * 75 + ELEMENT.getInstance().ALUMINIUM.getBoilingPointC() * 4
- + ELEMENT.getInstance().CHROMIUM.getBoilingPointC() * 20
- + ELEMENT.getInstance().YTTRIUM.getBoilingPointC() * 1) / 100, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().IRON.getProtons() * 75 + ELEMENT.getInstance().ALUMINIUM.getProtons() * 4
- + ELEMENT.getInstance().CHROMIUM.getProtons() * 20 + ELEMENT.getInstance().YTTRIUM.getProtons() * 1)
- / 100, // Protons
- (ELEMENT.getInstance().IRON.getNeutrons() * 75 + ELEMENT.getInstance().ALUMINIUM.getNeutrons() * 4
- + ELEMENT.getInstance().CHROMIUM.getNeutrons() * 20
- + ELEMENT.getInstance().YTTRIUM.getNeutrons() * 1) / 100, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material INCOLOY_MA956 = new Material(
+ "Incoloy-MA956", //Material Name
+ new short[]{81, 71, 101, 0}, //Material Colour
+ 1425, //Melting Point in C
+ ((ELEMENT.getInstance().IRON.getBoilingPointC()*75)+(ELEMENT.getInstance().ALUMINIUM.getBoilingPointC()*4)+(ELEMENT.getInstance().CHROMIUM.getBoilingPointC()*20)+(ELEMENT.getInstance().YTTRIUM.getBoilingPointC()*1))/100, //Boiling Point in C
+ ((ELEMENT.getInstance().IRON.getProtons()*75)+(ELEMENT.getInstance().ALUMINIUM.getProtons()*4)+(ELEMENT.getInstance().CHROMIUM.getProtons()*20)+(ELEMENT.getInstance().YTTRIUM.getProtons()*1))/100, //Protons
+ ((ELEMENT.getInstance().IRON.getNeutrons()*75)+(ELEMENT.getInstance().ALUMINIUM.getNeutrons()*4)+(ELEMENT.getInstance().CHROMIUM.getNeutrons()*20)+(ELEMENT.getInstance().YTTRIUM.getNeutrons()*1))/100, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().IRON, 64),
new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 12),
new MaterialStack(ELEMENT.getInstance().CHROMIUM, 20),
new MaterialStack(ELEMENT.getInstance().YTTRIUM, 4)
});
- public static final Material TUNGSTEN_CARBIDE = new Material("Tungsten Carbide", // Material
- // Name
- new short[] {
- 44, 44, 44, 0
- }, // Material
- // Colour
- 3422, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().TUNGSTEN.getBoilingPointC() * 5
- + ELEMENT.getInstance().CARBON.getBoilingPointC() * 5) / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().TUNGSTEN.getProtons() * 5 + ELEMENT.getInstance().CARBON.getProtons() * 5) / 10, // Protons
- (ELEMENT.getInstance().TUNGSTEN.getNeutrons() * 5 + ELEMENT.getInstance().CARBON.getNeutrons() * 5) / 10, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material TUNGSTEN_CARBIDE = new Material(
+ "Tungsten Carbide", //Material Name
+ new short[]{44, 44, 44, 0}, //Material Colour
+ 3422, //Melting Point in C
+ ((ELEMENT.getInstance().TUNGSTEN.getBoilingPointC()*5)+(ELEMENT.getInstance().CARBON.getBoilingPointC()*5))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().TUNGSTEN.getProtons()*5)+(ELEMENT.getInstance().CARBON.getProtons()*5))/10, //Protons
+ ((ELEMENT.getInstance().TUNGSTEN.getNeutrons()*5)+(ELEMENT.getInstance().CARBON.getNeutrons()*5))/10, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().CARBON, 50),
new MaterialStack(ELEMENT.getInstance().TUNGSTEN, 50)
});
- public static final Material SILICON_CARBIDE = new Material("Silicon Carbide", // Material
- // Name
- new short[] {
- 40, 48, 36, 0
- }, // Material
- // Colour
- 1414, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().SILICON.getBoilingPointC() * 5 + ELEMENT.getInstance().CARBON.getBoilingPointC() * 5)
- / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().SILICON.getProtons() * 5 + ELEMENT.getInstance().CARBON.getProtons() * 5) / 10, // Protons
- (ELEMENT.getInstance().SILICON.getNeutrons() * 5 + ELEMENT.getInstance().CARBON.getNeutrons() * 5) / 10, // Neutrons
- false, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material SILICON_CARBIDE = new Material(
+ "Silicon Carbide", //Material Name
+ new short[]{40, 48, 36, 0}, //Material Colour
+ 1414, //Melting Point in C
+ ((ELEMENT.getInstance().SILICON.getBoilingPointC()*5)+(ELEMENT.getInstance().CARBON.getBoilingPointC()*5))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().SILICON.getProtons()*5)+(ELEMENT.getInstance().CARBON.getProtons()*5))/10, //Protons
+ ((ELEMENT.getInstance().SILICON.getNeutrons()*5)+(ELEMENT.getInstance().CARBON.getNeutrons()*5))/10, //Neutrons
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().SILICON, 40),
new MaterialStack(ELEMENT.getInstance().CARBON, 50),
new MaterialStack(ELEMENT.getInstance().OXYGEN, 10)
});
- public static final Material TANTALUM_CARBIDE = new Material("Tantalum Carbide", // Material
- // Name
- new short[] {
- 139, 136, 120, 0
- }, // Material
- // Colour
- 2980, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().TANTALUM.getBoilingPointC() * 5
- + ELEMENT.getInstance().CARBON.getBoilingPointC() * 5) / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().TANTALUM.getProtons() * 5 + ELEMENT.getInstance().CARBON.getProtons() * 5) / 10, // Protons
- (ELEMENT.getInstance().TANTALUM.getNeutrons() * 5 + ELEMENT.getInstance().CARBON.getNeutrons() * 5) / 10, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material TANTALUM_CARBIDE = new Material(
+ "Tantalum Carbide", //Material Name
+ new short[]{139, 136, 120, 0}, //Material Colour
+ 2980, //Melting Point in C
+ ((ELEMENT.getInstance().TANTALUM.getBoilingPointC()*5)+(ELEMENT.getInstance().CARBON.getBoilingPointC()*5))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().TANTALUM.getProtons()*5)+(ELEMENT.getInstance().CARBON.getProtons()*5))/10, //Protons
+ ((ELEMENT.getInstance().TANTALUM.getNeutrons()*5)+(ELEMENT.getInstance().CARBON.getNeutrons()*5))/10, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().TANTALUM, 40),
new MaterialStack(ELEMENT.getInstance().CARBON, 50),
new MaterialStack(ELEMENT.getInstance().OXYGEN, 10)
});
- public static final Material ZIRCONIUM_CARBIDE = new Material("Zirconium Carbide", // Material
- // Name
- new short[] {
- 222, 202, 180, 0
- }, // Material
- // Colour
- 1855, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().ZIRCONIUM.getBoilingPointC() * 5
- + ELEMENT.getInstance().CARBON.getBoilingPointC() * 5) / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().ZIRCONIUM.getProtons() * 5 + ELEMENT.getInstance().CARBON.getProtons() * 5) / 10, // Protons
- (ELEMENT.getInstance().ZIRCONIUM.getNeutrons() * 5 + ELEMENT.getInstance().CARBON.getNeutrons() * 5) / 10, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material ZIRCONIUM_CARBIDE = new Material(
+ "Zirconium Carbide", //Material Name
+ new short[]{222, 202, 180, 0}, //Material Colour
+ 1855, //Melting Point in C
+ ((ELEMENT.getInstance().ZIRCONIUM.getBoilingPointC()*5)+(ELEMENT.getInstance().CARBON.getBoilingPointC()*5))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().ZIRCONIUM.getProtons()*5)+(ELEMENT.getInstance().CARBON.getProtons()*5))/10, //Protons
+ ((ELEMENT.getInstance().ZIRCONIUM.getNeutrons()*5)+(ELEMENT.getInstance().CARBON.getNeutrons()*5))/10, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 40),
new MaterialStack(ELEMENT.getInstance().CARBON, 50),
new MaterialStack(ELEMENT.getInstance().OXYGEN, 10)
});
- public static final Material NIOBIUM_CARBIDE = new Material("Niobium Carbide", // Material
- // Name
- new short[] {
- 205, 197, 191, 0
- }, // Material
- // Colour
- 2477, // Melting
- // Point
- // in
- // C
- (ELEMENT.getInstance().NIOBIUM.getBoilingPointC() * 5 + ELEMENT.getInstance().CARBON.getBoilingPointC() * 5)
- / 10, // Boiling
- // Point
- // in
- // C
- (ELEMENT.getInstance().NIOBIUM.getProtons() * 5 + ELEMENT.getInstance().CARBON.getProtons() * 5) / 10, // Protons
- (ELEMENT.getInstance().NIOBIUM.getNeutrons() * 5 + ELEMENT.getInstance().CARBON.getNeutrons() * 5) / 10, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
+ public static final Material NIOBIUM_CARBIDE = new Material(
+ "Niobium Carbide", //Material Name
+ new short[]{205, 197, 191, 0}, //Material Colour
+ 2477, //Melting Point in C
+ ((ELEMENT.getInstance().NIOBIUM.getBoilingPointC()*5)+(ELEMENT.getInstance().CARBON.getBoilingPointC()*5))/10, //Boiling Point in C
+ ((ELEMENT.getInstance().NIOBIUM.getProtons()*5)+(ELEMENT.getInstance().CARBON.getProtons()*5))/10, //Protons
+ ((ELEMENT.getInstance().NIOBIUM.getNeutrons()*5)+(ELEMENT.getInstance().CARBON.getNeutrons()*5))/10, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().NIOBIUM, 40),
new MaterialStack(ELEMENT.getInstance().CARBON, 50),
new MaterialStack(ELEMENT.getInstance().OXYGEN, 10)
});
-
- public static final Material LEAGRISIUM = new Material("Grisium", // Material
- // Name
- new short[] {
- 53, 93, 106, 0
- }, // Material
- // Colour
- 9001, // Melting
- // Point
- // in
- // C
- 25000, // Boiling
- // Point
- // in
- // C
- 96, // Protons
- 128, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- new MaterialStack[] {
+
+
+ public static final Material LEAGRISIUM = new Material(
+ "Grisium", //Material Name
+ new short[]{53, 93, 106, 0}, //Material Colour
+ 9001, //Melting Point in C
+ 25000, //Boiling Point in C
+ 96, //Protons
+ 128, //Neutrons
+ true, //Uses Blast furnace?
+ new MaterialStack[]{
new MaterialStack(ELEMENT.getInstance().TITANIUM, 18),
new MaterialStack(ELEMENT.getInstance().CARBON, 18),
new MaterialStack(ELEMENT.getInstance().POTASSIUM, 18),
new MaterialStack(ELEMENT.getInstance().LITHIUM, 18),
new MaterialStack(ELEMENT.getInstance().SULFUR, 18),
new MaterialStack(ELEMENT.getInstance().HYDROGEN, 10)
- }); // Material
- // Stacks
- // with
- // Percentage
- // of
- // required
- // elements.
-
- // Quantum
- public static final Material QUANTUM = new Material("Quantum", // Material
- // Name
- new short[] {
- 128, 128, 255, 50
- }, // Material
- // Colour
- 9999, // Melting
- // Point
- // in
- // C
- 25000, // Boiling
- // Point
- // in
- // C
- 150, // Protons
- 200, // Neutrons
- true, // Uses
- // Blast
- // furnace?
- // Material Stacks with Percentage of required elements.
- new MaterialStack[] {
- new MaterialStack(ALLOY.LEAGRISIUM, 25), new MaterialStack(ALLOY.ENERGYCRYSTAL, 25),
+ }); //Material Stacks with Percentage of required elements.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ //Quantum
+ public static final Material QUANTUM = new Material(
+ "Quantum", //Material Name
+ new short[]{128, 128, 255, 50}, //Material Colour
+ 9999, //Melting Point in C
+ 25000, //Boiling Point in C
+ 150, //Protons
+ 200, //Neutrons
+ true, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ALLOY.LEAGRISIUM, 25),
+ new MaterialStack(ALLOY.ENERGYCRYSTAL, 25),
new MaterialStack(ALLOY.ZIRCONIUM_CARBIDE, 25),
new MaterialStack(ELEMENT.getInstance().MANGANESE, 5),
new MaterialStack(ELEMENT.getInstance().MOLYBDENUM, 5),
@@ -1017,5 +561,7 @@ public final class ALLOY {
new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 5),
new MaterialStack(ELEMENT.getInstance().BISMUTH, 5)
});
+
+
}
diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java
index a8a474a6c2..73d49e2694 100644
--- a/src/Java/gtPlusPlus/core/material/ELEMENT.java
+++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java
@@ -4,102 +4,91 @@ import gregtech.api.enums.Materials;
import gtPlusPlus.core.util.materials.MaterialUtils;
public final class ELEMENT {
-
+
private static final ELEMENT thisClass = new ELEMENT();
-
- public static ELEMENT getInstance() {
- return ELEMENT.thisClass;
+
+ public ELEMENT(){
+
+ }
+
+ public static ELEMENT getInstance(){
+ return thisClass;
}
- // First 50 Elements
- public final Material HYDROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Hydrogen);
+ //First 50 Elements
+ public final Material HYDROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Hydrogen);
+ public final Material HELIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Helium);
+ public final Material LITHIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lithium);
+ public final Material BERYLLIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Beryllium);
+ public final Material BORON = MaterialUtils.generateMaterialFromGtENUM(Materials.Boron);
+ public final Material CARBON = MaterialUtils.generateMaterialFromGtENUM(Materials.Carbon);
+ public final Material NITROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Nitrogen);
+ public final Material OXYGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Oxygen);
+ public final Material FLUORINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Fluorine);
+ //public final Material NEON = MaterialUtils.generateMaterialFromGtENUM(Materials.Ne);
+ public final Material SODIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Sodium);
+ public final Material MAGNESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Magnesium);
+ public final Material ALUMINIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Aluminium);
+ public final Material SILICON = MaterialUtils.generateMaterialFromGtENUM(Materials.Silicon);
+ public final Material PHOSPHORUS = MaterialUtils.generateMaterialFromGtENUM(Materials.Phosphorus);
+ public final Material SULFUR = MaterialUtils.generateMaterialFromGtENUM(Materials.Sulfur);
+ public final Material CHLORINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Chlorine);
+ public final Material ARGON = MaterialUtils.generateMaterialFromGtENUM(Materials.Argon);
+ public final Material POTASSIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Potassium);
+ public final Material CALCIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Calcium);
+ public final Material SCANDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Scandium);
+ public final Material TITANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Titanium);
+ public final Material VANADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Vanadium);
+ public final Material CHROMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Chrome);
+ public final Material MANGANESE = MaterialUtils.generateMaterialFromGtENUM(Materials.Manganese);
+ public final Material IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.Iron);
+ public final Material COBALT = MaterialUtils.generateMaterialFromGtENUM(Materials.Cobalt);
+ public final Material NICKEL = MaterialUtils.generateMaterialFromGtENUM(Materials.Nickel);
+ public final Material COPPER = MaterialUtils.generateMaterialFromGtENUM(Materials.Copper);
+ public final Material ZINC = MaterialUtils.generateMaterialFromGtENUM(Materials.Zinc);
+ public final Material GALLIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Gallium);
+ //public final Material GERMANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Germanium);
+ public final Material ARSENIC = MaterialUtils.generateMaterialFromGtENUM(Materials.Arsenic);
+ //public final Material SELENIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Selenium);
+ //public final Material BROMINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Bromine);
+ //public final Material KRYPTON = MaterialUtils.generateMaterialFromGtENUM(Materials.Krypton);
+ public final Material RUBIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubidium);
+ public final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Strontium);
+ public final Material YTTRIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yttrium);
+ public final Material ZIRCONIUM = new Material("Zirconium", new short[]{255, 250, 205}, 1855, 4377, 40, 51, false, "Zr", 0);//Not a GT Inherited Material
+ public final Material NIOBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Niobium);
+ public final Material MOLYBDENUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Molybdenum);
+ //public final Material TECHNETIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Technetium);
+ //public final Material RUTHENIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Ruthenium);
+ //public final Material RHODIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rhodium);
+ public final Material PALLADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Palladium);
+ public final Material SILVER = MaterialUtils.generateMaterialFromGtENUM(Materials.Silver);
+ public final Material CADMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Cadmium);
+ public final Material INDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Indium);
+ public final Material TIN = MaterialUtils.generateMaterialFromGtENUM(Materials.Tin);
- public final Material HELIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Helium);
- public final Material LITHIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lithium);
- public final Material BERYLLIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Beryllium);
- public final Material BORON = MaterialUtils.generateMaterialFromGtENUM(Materials.Boron);
- public final Material CARBON = MaterialUtils.generateMaterialFromGtENUM(Materials.Carbon);
- public final Material NITROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Nitrogen);
- public final Material OXYGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Oxygen);
- public final Material FLUORINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Fluorine);
- // public final Material NEON =
- // MaterialUtils.generateMaterialFromGtENUM(Materials.Ne);
- public final Material SODIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Sodium);
- public final Material MAGNESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Magnesium);
- public final Material ALUMINIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Aluminium);
- public final Material SILICON = MaterialUtils.generateMaterialFromGtENUM(Materials.Silicon);
- public final Material PHOSPHORUS = MaterialUtils.generateMaterialFromGtENUM(Materials.Phosphorus);
- public final Material SULFUR = MaterialUtils.generateMaterialFromGtENUM(Materials.Sulfur);
- public final Material CHLORINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Chlorine);
- public final Material ARGON = MaterialUtils.generateMaterialFromGtENUM(Materials.Argon);
- public final Material POTASSIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Potassium);
- public final Material CALCIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Calcium);
- public final Material SCANDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Scandium);
- public final Material TITANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Titanium);
- public final Material VANADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Vanadium);
- public final Material CHROMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Chrome);
- public final Material MANGANESE = MaterialUtils.generateMaterialFromGtENUM(Materials.Manganese);
- public final Material IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.Iron);
- public final Material COBALT = MaterialUtils.generateMaterialFromGtENUM(Materials.Cobalt);
- public final Material NICKEL = MaterialUtils.generateMaterialFromGtENUM(Materials.Nickel);
- public final Material COPPER = MaterialUtils.generateMaterialFromGtENUM(Materials.Copper);
- public final Material ZINC = MaterialUtils.generateMaterialFromGtENUM(Materials.Zinc);
- public final Material GALLIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Gallium);
- // public final Material GERMANIUM =
- // MaterialUtils.generateMaterialFromGtENUM(Materials.Germanium);
- public final Material ARSENIC = MaterialUtils.generateMaterialFromGtENUM(Materials.Arsenic);
- // public final Material SELENIUM =
- // MaterialUtils.generateMaterialFromGtENUM(Materials.Selenium);
- // public final Material BROMINE =
- // MaterialUtils.generateMaterialFromGtENUM(Materials.Bromine);
- // public final Material KRYPTON =
- // MaterialUtils.generateMaterialFromGtENUM(Materials.Krypton);
- public final Material RUBIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubidium);
- public final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Strontium);
- public final Material YTTRIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yttrium);
- public final Material ZIRCONIUM = new Material("Zirconium", new short[] {
- 255, 250, 205
- }, 1855, 4377, 40, 51, false, "Zr", 0); // Not
- // a
- // GT
- // Inherited
- // Material
- public final Material NIOBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Niobium);
- public final Material MOLYBDENUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Molybdenum);
- // public final Material TECHNETIUM =
- // MaterialUtils.generateMaterialFromGtENUM(Materials.Technetium);
- // public final Material RUTHENIUM =
- // MaterialUtils.generateMaterialFromGtENUM(Materials.Ruthenium);
- // public final Material RHODIUM =
- // MaterialUtils.generateMaterialFromGtENUM(Materials.Rhodium);
- public final Material PALLADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Palladium);
- public final Material SILVER = MaterialUtils.generateMaterialFromGtENUM(Materials.Silver);
- public final Material CADMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Cadmium);
- public final Material INDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Indium);
- public final Material TIN = MaterialUtils.generateMaterialFromGtENUM(Materials.Tin);
- // Second 50 elements
- public final Material TANTALUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Tantalum);
- public final Material TUNGSTEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Tungsten);
- public final Material OSMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Osmium);
- public final Material IRIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Iridium);
- public final Material PLATINUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Platinum);
- public final Material GOLD = MaterialUtils.generateMaterialFromGtENUM(Materials.Gold);
- public final Material LEAD = MaterialUtils.generateMaterialFromGtENUM(Materials.Lead);
- public final Material BISMUTH = MaterialUtils.generateMaterialFromGtENUM(Materials.Bismuth);
- public final Material RADON = MaterialUtils.generateMaterialFromGtENUM(Materials.Radon);
- public final Material THORIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Thorium);
- public final Material URANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium);
- public final Material PLUTONIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium);
- public final Material URANIUM233 = new Material("Uranium-233", new short[] {
- 73, 220, 83, 0
- }, 1132, 4131, 92, 141, false, MaterialUtils.superscript("233U"), 2); // Not
- // a
- // GT
- // Inherited
- // Material
- public ELEMENT() {
- }
+
+
+
+
+
+
+ //Second 50 elements
+ public final Material TANTALUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Tantalum);
+ public final Material TUNGSTEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Tungsten);
+ public final Material OSMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Osmium);
+ public final Material IRIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Iridium);
+ public final Material PLATINUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Platinum);
+ public final Material GOLD = MaterialUtils.generateMaterialFromGtENUM(Materials.Gold);
+ public final Material LEAD = MaterialUtils.generateMaterialFromGtENUM(Materials.Lead);
+ public final Material BISMUTH = MaterialUtils.generateMaterialFromGtENUM(Materials.Bismuth);
+ public final Material RADON = MaterialUtils.generateMaterialFromGtENUM(Materials.Radon);
+ public final Material THORIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Thorium);
+ public final Material URANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium);
+ public final Material PLUTONIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium);
+ public final Material URANIUM233 = new Material("Uranium-233", new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, MaterialUtils.superscript("233U"), 2);//Not a GT Inherited Material
+
}
diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java
index 20ffd9cb6b..893b310ba4 100644
--- a/src/Java/gtPlusPlus/core/material/Material.java
+++ b/src/Java/gtPlusPlus/core/material/Material.java
@@ -1,14 +1,18 @@
package gtPlusPlus.core.material;
-import java.util.ArrayList;
-
-import gregtech.api.enums.*;
+import static gregtech.api.enums.GT_Values.M;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gtPlusPlus.core.item.base.cell.BaseItemCell;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.fluid.FluidUtils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.materials.MaterialUtils;
import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.ArrayList;
+
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
@@ -16,76 +20,63 @@ import net.minecraftforge.fluids.FluidStack;
public class Material {
- private final String unlocalizedName;
- private final String localizedName;
-
- private final Fluid vMoltenFluid;
-
- protected Object dataVar;
-
- private ArrayList<MaterialStack> vMaterialInput = new ArrayList<MaterialStack>();
- public final long[] vSmallestRatio;
-
- private final short[] RGBA;
-
- private final boolean usesBlastFurnace;
- public final boolean isRadioactive;
- public final byte vRadioationLevel;
-
- private final int meltingPointK;
- private final int boilingPointK;
- private final int meltingPointC;
- private final int boilingPointC;
- private final long vProtons;
- private final long vNeutrons;
- private final long vMass;
- public final int smallestStackSizeWhenProcessing; // Add
- // a
- // check
- // for
- // <=0
- // ||
- // >
- // 64
- public final int vTier;
- public final int vVoltageMultiplier;
- public final String vChemicalFormula;
- public final String vChemicalSymbol;
-
- public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint,
- final long protons, final long neutrons, final boolean blastFurnace, final int radiationLevel,
- final MaterialStack... inputs) {
- this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", radiationLevel,
- inputs);
- }
-
- public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint,
- final long protons, final long neutrons, final boolean blastFurnace, final MaterialStack... inputs) {
+ private final String unlocalizedName;
+ private final String localizedName;
+
+ private final Fluid vMoltenFluid;
+
+ protected Object dataVar;
+
+ private ArrayList<MaterialStack> vMaterialInput = new ArrayList<MaterialStack>();
+ public final long[] vSmallestRatio;
+
+ private final short[] RGBA;
+
+ private final boolean usesBlastFurnace;
+ public final boolean isRadioactive;
+ public final byte vRadioationLevel;
+
+ private final int meltingPointK;
+ private final int boilingPointK;
+ private final int meltingPointC;
+ private final int boilingPointC;
+ private final long vProtons;
+ private final long vNeutrons;
+ private final long vMass;
+ public final int smallestStackSizeWhenProcessing; //Add a check for <=0 || > 64
+ public final int vTier;
+ public final int vVoltageMultiplier;
+ public final String vChemicalFormula;
+ public final String vChemicalSymbol;
+
+ public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final MaterialStack... inputs){
this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", 0, inputs);
}
- public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint,
- final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol,
- final int radiationLevel, final MaterialStack... inputs) {
+ public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final int radiationLevel, MaterialStack... inputs){
+ this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", radiationLevel, inputs);
+ }
+
+ public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){
this.unlocalizedName = Utils.sanitizeString(materialName);
this.localizedName = materialName;
this.RGBA = rgba;
this.meltingPointC = meltingPoint;
- if (boilingPoint != 0) {
+ if (boilingPoint != 0){
this.boilingPointC = boilingPoint;
}
else {
- this.boilingPointC = meltingPoint * 4;
+ this.boilingPointC = meltingPoint*4;
}
- this.meltingPointK = (int) MathUtils.celsiusToKelvin(this.meltingPointC);
- this.boilingPointK = (int) MathUtils.celsiusToKelvin(this.boilingPointC);
+ this.meltingPointK = (int) MathUtils.celsiusToKelvin(meltingPointC);
+ this.boilingPointK = (int) MathUtils.celsiusToKelvin(boilingPointC);
this.vProtons = protons;
this.vNeutrons = neutrons;
- this.vMass = this.getMass();
+ this.vMass = getMass();
- // Sets the Rad level
- if (radiationLevel != 0) {
+ //Sets the Rad level
+ if (radiationLevel != 0){
this.isRadioactive = true;
this.vRadioationLevel = (byte) radiationLevel;
}
@@ -94,384 +85,339 @@ public class Material {
this.vRadioationLevel = (byte) radiationLevel;
}
- // Sets the materials 'tier'. Will probably replace this logic.
+ //Sets the materials 'tier'. Will probably replace this logic.
this.vTier = MaterialUtils.getTierOfMaterial((int) MathUtils.celsiusToKelvin(meltingPoint));
this.usesBlastFurnace = blastFurnace;
this.vVoltageMultiplier = this.getMeltingPointK() >= 2800 ? 64 : 16;
- if (inputs == null) {
- this.vMaterialInput = null;
+ if (inputs == null){
+ this.vMaterialInput = null;
}
else {
- if (inputs.length != 0) {
- for (int i = 0; i < inputs.length; i++) {
- if (inputs[i] != null) {
+ if (inputs.length != 0){
+ for (int i=0; i < inputs.length; i++){
+ if (inputs[i] != null){
this.vMaterialInput.add(i, inputs[i]);
}
}
}
}
- this.vSmallestRatio = this.getSmallestRatio(this.vMaterialInput);
+ this.vSmallestRatio = getSmallestRatio(vMaterialInput);
int tempSmallestSize = 0;
- if (this.vSmallestRatio != null) {
- for (int v = 0; v < this.vSmallestRatio.length; v++) {
- tempSmallestSize = (int) (tempSmallestSize + this.vSmallestRatio[v]);
+ if (vSmallestRatio != null){
+ for (int v=0;v<this.vSmallestRatio.length;v++){
+ tempSmallestSize=(int) (tempSmallestSize+vSmallestRatio[v]);
}
- this.smallestStackSizeWhenProcessing = tempSmallestSize; // Valid
- // stacksizes
+ this.smallestStackSizeWhenProcessing = tempSmallestSize; //Valid stacksizes
}
else {
- this.smallestStackSizeWhenProcessing = 1; // Valid stacksizes
+ this.smallestStackSizeWhenProcessing = 1; //Valid stacksizes
}
- // Makes a Fancy Chemical Tooltip
+
+ //Makes a Fancy Chemical Tooltip
this.vChemicalSymbol = chemicalSymbol;
- if (this.vMaterialInput != null) {
- this.vChemicalFormula = this.getToolTip(chemicalSymbol, OrePrefixes.dust.mMaterialAmount / GT_Values.M,
- true);
+ if (vMaterialInput != null){
+ this.vChemicalFormula = getToolTip(chemicalSymbol, OrePrefixes.dust.mMaterialAmount / M, true);
}
- else if (!this.vChemicalSymbol.equals("")) {
+ else if (!this.vChemicalSymbol.equals("")){
Utils.LOG_WARNING("materialInput is null, using a valid chemical symbol.");
this.vChemicalFormula = this.vChemicalSymbol;
}
- else {
+ else{
Utils.LOG_WARNING("MaterialInput == null && chemicalSymbol probably equals nothing");
this.vChemicalFormula = "??";
}
- final Materials isValid = Materials.get(this.getLocalizedName());
- if (isValid == Materials._NULL) {
- this.vMoltenFluid = this.generateFluid();
+ Materials isValid = Materials.get(getLocalizedName());
+ if (isValid == Materials._NULL){
+ this.vMoltenFluid = generateFluid();
}
else {
- if (isValid.mFluid != null) {
+ if (isValid.mFluid != null){
this.vMoltenFluid = isValid.mFluid;
}
- else if (isValid.mGas != null) {
+ else if (isValid.mGas != null){
this.vMoltenFluid = isValid.mGas;
}
- else if (isValid.mPlasma != null) {
+ else if (isValid.mPlasma != null){
this.vMoltenFluid = isValid.mPlasma;
}
else {
- this.vMoltenFluid = this.generateFluid();
+ this.vMoltenFluid = generateFluid();
}
}
- // dataVar = MathUtils.generateSingularRandomHexValue();
+ //dataVar = MathUtils.generateSingularRandomHexValue();
String ratio = "";
- if (this.vSmallestRatio != null) {
- for (int hu = 0; hu < this.vSmallestRatio.length; hu++) {
- if (ratio.equals("")) {
- ratio = String.valueOf(this.vSmallestRatio[hu]);
+ if (vSmallestRatio != null)
+ for (int hu=0;hu<vSmallestRatio.length;hu++){
+ if (ratio.equals("")){
+ ratio = String.valueOf(vSmallestRatio[hu]);
}
else {
- ratio = ratio + ":" + this.vSmallestRatio[hu];
- }
+ ratio = ratio + ":" +vSmallestRatio[hu];
+ }
}
- }
- Utils.LOG_INFO("Creating a Material instance for " + materialName);
- Utils.LOG_INFO("Formula: " + this.vChemicalFormula + " Smallest Stack: " + this.smallestStackSizeWhenProcessing
- + " Smallest Ratio:" + ratio);
- Utils.LOG_INFO("Protons: " + this.vProtons);
- Utils.LOG_INFO("Neutrons: " + this.vNeutrons);
- Utils.LOG_INFO("Mass: " + this.vMass + "/units");
- Utils.LOG_INFO("Melting Point: " + this.meltingPointC + "C.");
- Utils.LOG_INFO("Boiling Point: " + this.boilingPointC + "C.");
+ Utils.LOG_INFO("Creating a Material instance for "+materialName);
+ Utils.LOG_INFO("Formula: "+vChemicalFormula + " Smallest Stack: "+smallestStackSizeWhenProcessing+" Smallest Ratio:"+ratio);
+ Utils.LOG_INFO("Protons: "+vProtons);
+ Utils.LOG_INFO("Neutrons: "+vNeutrons);
+ Utils.LOG_INFO("Mass: "+vMass+"/units");
+ Utils.LOG_INFO("Melting Point: "+meltingPointC+"C.");
+ Utils.LOG_INFO("Boiling Point: "+boilingPointC+"C.");
}
- final Fluid generateFluid() {
- if (Materials.get(this.localizedName).mFluid == null) {
- Utils.LOG_WARNING("Generating our own fluid.");
-
- // Generate a Cell if we need to
- if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + this.getUnlocalizedName(), 1) == null) {
- @SuppressWarnings("unused")
- final Item temp = new BaseItemCell(this);
- }
- return FluidUtils.addGTFluid(this.getUnlocalizedName(), "Molten " + this.getLocalizedName(), this.RGBA, 4,
- this.getMeltingPointK(),
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + this.getUnlocalizedName(), 1),
- ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
- }
- Utils.LOG_WARNING("Getting the fluid from a GT material instead.");
- return Materials.get(this.localizedName).mFluid;
+ final public String getLocalizedName(){
+ return localizedName;
}
- final public int getBoilingPointC() {
- return this.boilingPointC;
+ final public String getUnlocalizedName(){
+ return unlocalizedName;
}
- final public int getBoilingPointK() {
- return this.boilingPointK;
+ final public short[] getRGBA(){
+ return this.RGBA;
}
- final public ItemStack getBolt(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("bolt" + this.unlocalizedName, stacksize);
- }
+ final public int getRgbAsHex(){
- final public ArrayList<MaterialStack> getComposites() {
- return this.vMaterialInput;
+ int returnValue = Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]);
+ if (returnValue == 0){
+ return (int) dataVar;
+ }
+ return Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]);
}
- final public ItemStack getDust(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust" + this.unlocalizedName, stacksize);
+ final public long getProtons() {
+ return vProtons;
}
- final public FluidStack getFluid(final int fluidAmount) {
- Utils.LOG_WARNING("Attempting to get " + fluidAmount + "L of " + this.vMoltenFluid.getName());
+ final public long getNeutrons() {
+ return vNeutrons;
+ }
- final FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount);
+ final public long getMass() {
+ return vProtons + vNeutrons;
+ }
- Utils.LOG_WARNING("Info: " + moltenFluid.getFluid().getName() + " Info: " + moltenFluid.amount + " Info: "
- + moltenFluid.getFluidID());
+ final public int getMeltingPointC() {
+ return meltingPointC;
+ }
- // FluidStack moltenFluid =
- // FluidUtils.getFluidStack(this.vMoltenFluid.getName(), fluidAmount);
- /*
- * boolean isNull = (moltenFluid == null); if (isNull)
- * Utils.LOG_WARNING("Did not obtain fluid."); else Utils.LOG_WARNING(
- * "Found fluid."); if (isNull){ return null; }
- */
- return moltenFluid;
+ final public int getBoilingPointC() {
+ return boilingPointC;
}
- final public ItemStack getFrameBox(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("frameGt" + this.unlocalizedName, stacksize);
+ final public int getMeltingPointK() {
+ return meltingPointK;
}
- final public ItemStack getGear(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gear" + this.unlocalizedName, stacksize);
+ final public int getBoilingPointK() {
+ return boilingPointK;
}
- final public ItemStack getIngot(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingot" + this.unlocalizedName, stacksize);
+ final public boolean requiresBlastFurnace(){
+ return usesBlastFurnace;
}
- final public String getLocalizedName() {
- return this.localizedName;
+ final public ItemStack getDust(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize);
}
- final public ItemStack getLongRod(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stickLong" + this.unlocalizedName, stacksize);
+ final public ItemStack getSmallDust(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+unlocalizedName, stacksize);
}
- final public long getMass() {
- return this.vProtons + this.vNeutrons;
- }
-
- final public ItemStack[] getMaterialComposites() {
- // Utils.LOG_WARNING("Something requested the materials needed for
- // "+localizedName);
- if (this.vMaterialInput != null) {
- if (!this.vMaterialInput.isEmpty()) {
- final ItemStack[] temp = new ItemStack[this.vMaterialInput.size()];
- for (int i = 0; i < this.vMaterialInput.size(); i++) {
- // Utils.LOG_WARNING("i:"+i);
- ItemStack testNull = null;
- try {
- testNull = this.vMaterialInput.get(i).getDustStack();
- }
- catch (final Throwable r) {
- Utils.LOG_WARNING("Failed gathering material stack for " + this.localizedName + ".");
- Utils.LOG_WARNING("What Failed: Length:" + this.vMaterialInput.size() + " current:" + i);
- }
- try {
- if (testNull != null) {
- // Utils.LOG_WARNING("not null");
- temp[i] = this.vMaterialInput.get(i).getDustStack();
- }
- }
- catch (final Throwable r) {
- Utils.LOG_WARNING("Failed setting slot " + i + ", using " + this.localizedName);
- }
- }
- return temp;
- }
- }
- return new ItemStack[] {};
+ final public ItemStack getTinyDust(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+unlocalizedName, stacksize);
}
- final public int[] getMaterialCompositeStackSizes() {
- if (!this.vMaterialInput.isEmpty()) {
- final int[] temp = new int[this.vMaterialInput.size()];
- for (int i = 0; i < this.vMaterialInput.size(); i++) {
- if (this.vMaterialInput.get(i) != null) {
- temp[i] = this.vMaterialInput.get(i).getDustStack().stackSize;
- }
- else {
- temp[i] = 0;
- }
- }
- return temp;
- }
- return new int[] {};
+ final public ItemStack[] getValidInputStacks(){
+ return ItemUtils.validItemsForOreDict(unlocalizedName);
}
- final public int getMeltingPointC() {
- return this.meltingPointC;
+ final public ItemStack getIngot(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingot"+unlocalizedName, stacksize);
}
- final public int getMeltingPointK() {
- return this.meltingPointK;
+ final public ItemStack getPlate(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plate"+unlocalizedName, stacksize);
}
- final public long getNeutrons() {
- return this.vNeutrons;
+ final public ItemStack getPlateDouble(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDouble"+unlocalizedName, stacksize);
}
- final public ItemStack getPlate(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plate" + this.unlocalizedName, stacksize);
+ final public ItemStack getGear(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gear"+unlocalizedName, stacksize);
}
- final public ItemStack getPlateDouble(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDouble" + this.unlocalizedName, stacksize);
+ final public ItemStack getRod(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stick"+unlocalizedName, stacksize);
}
- final public long getProtons() {
- return this.vProtons;
+ final public ItemStack getLongRod(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stickLong"+unlocalizedName, stacksize);
}
- final public short[] getRGBA() {
- return this.RGBA;
+ final public ItemStack getBolt(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("bolt"+unlocalizedName, stacksize);
}
- final public int getRgbAsHex() {
+ final public ItemStack getScrew(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("screw"+unlocalizedName, stacksize);
+ }
- final int returnValue = Utils.rgbtoHexValue(this.RGBA[0], this.RGBA[1], this.RGBA[2]);
- if (returnValue == 0) {
- return (int) this.dataVar;
- }
- return Utils.rgbtoHexValue(this.RGBA[0], this.RGBA[1], this.RGBA[2]);
+ final public ItemStack getRing(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ring"+unlocalizedName, stacksize);
}
- final public ItemStack getRing(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ring" + this.unlocalizedName, stacksize);
+ final public ItemStack getRotor(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("rotor"+unlocalizedName, stacksize);
}
- final public ItemStack getRod(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stick" + this.unlocalizedName, stacksize);
+ final public ItemStack getFrameBox(int stacksize){
+ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("frameGt"+unlocalizedName, stacksize);
}
- final public ItemStack getRotor(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("rotor" + this.unlocalizedName, stacksize);
+ final public ItemStack[] getMaterialComposites(){
+ //Utils.LOG_WARNING("Something requested the materials needed for "+localizedName);
+ if (vMaterialInput != null){
+ if (!vMaterialInput.isEmpty()){
+ ItemStack[] temp = new ItemStack[vMaterialInput.size()];
+ for (int i=0;i<vMaterialInput.size();i++){
+ //Utils.LOG_WARNING("i:"+i);
+ ItemStack testNull = null;
+ try {
+ testNull = vMaterialInput.get(i).getDustStack();
+ } catch (Throwable r){
+ Utils.LOG_WARNING("Failed gathering material stack for "+localizedName+".");
+ Utils.LOG_WARNING("What Failed: Length:"+vMaterialInput.size()+" current:"+i);
+ }
+ try {
+ if (testNull != null){
+ //Utils.LOG_WARNING("not null");
+ temp[i] = vMaterialInput.get(i).getDustStack();
+ }
+ } catch (Throwable r){
+ Utils.LOG_WARNING("Failed setting slot "+i+", using "+localizedName);
+ }
+ }
+ return temp;
+ }
+ }
+ return new ItemStack[]{};
}
- final public ItemStack getScrew(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("screw" + this.unlocalizedName, stacksize);
+ final public ArrayList<MaterialStack> getComposites(){
+ return this.vMaterialInput;
}
- final public ItemStack getSmallDust(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSmall" + this.unlocalizedName, stacksize);
+ final public int[] getMaterialCompositeStackSizes(){
+ if (!vMaterialInput.isEmpty()){
+ int[] temp = new int[vMaterialInput.size()];
+ for (int i=0;i<vMaterialInput.size();i++){
+ if (vMaterialInput.get(i) != null)
+ temp[i] = vMaterialInput.get(i).getDustStack().stackSize;
+ else
+ temp[i]=0;
+ }
+ return temp;
+ }
+ return new int[]{};
}
+
@SuppressWarnings("static-method")
- final public long[] getSmallestRatio(final ArrayList<MaterialStack> tempInput) {
- if (tempInput != null) {
- if (!tempInput.isEmpty()) {
- Utils.LOG_WARNING("length: " + tempInput.size());
- Utils.LOG_WARNING("(inputs != null): " + (tempInput != null));
- // Utils.LOG_WARNING("length: "+inputs.length);
- final long[] tempRatio = new long[tempInput.size()];
- for (int x = 0; x < tempInput.size(); x++) {
- // tempPercentage =
- // tempPercentage+inputs[x].percentageToUse;
- // this.mMaterialList.add(inputs[x]);
- if (tempInput.get(x) != null) {
- tempRatio[x] = tempInput.get(x).getPartsPerOneHundred();
+ final public long[] getSmallestRatio(ArrayList<MaterialStack> tempInput){
+ if (tempInput != null){
+ if (!tempInput.isEmpty()){
+ Utils.LOG_WARNING("length: "+tempInput.size());
+ Utils.LOG_WARNING("(inputs != null): "+(tempInput != null));
+ //Utils.LOG_WARNING("length: "+inputs.length);
+ long[] tempRatio = new long[tempInput.size()];
+ for (int x=0;x<tempInput.size();x++){
+ //tempPercentage = tempPercentage+inputs[x].percentageToUse;
+ //this.mMaterialList.add(inputs[x]);
+ if (tempInput.get(x) != null){
+ tempRatio[x] = tempInput.get(x).getPartsPerOneHundred();
}
}
- final long[] smallestRatio = MathUtils.simplifyNumbersToSmallestForm(tempRatio);
+ long[] smallestRatio = MathUtils.simplifyNumbersToSmallestForm(tempRatio);
- if (smallestRatio.length > 0) {
+ if (smallestRatio.length > 0){
String tempRatioStringThing1 = "";
- for (int r = 0; r < tempRatio.length; r++) {
- tempRatioStringThing1 = tempRatioStringThing1 + tempRatio[r] + " : ";
+ for (int r=0;r<tempRatio.length;r++){
+ tempRatioStringThing1 = tempRatioStringThing1 + tempRatio[r] +" : ";
}
- Utils.LOG_WARNING("Default Ratio: " + tempRatioStringThing1);
+ Utils.LOG_WARNING("Default Ratio: "+tempRatioStringThing1);
String tempRatioStringThing = "";
int tempSmallestCraftingUseSize = 0;
- for (int r = 0; r < smallestRatio.length; r++) {
- tempRatioStringThing = tempRatioStringThing + smallestRatio[r] + " : ";
+ for (int r=0;r<smallestRatio.length;r++){
+ tempRatioStringThing = tempRatioStringThing + smallestRatio[r] +" : ";
tempSmallestCraftingUseSize = (int) (tempSmallestCraftingUseSize + smallestRatio[r]);
}
- // this.smallestStackSizeWhenProcessing =
- // tempSmallestCraftingUseSize;
- Utils.LOG_WARNING("Smallest Ratio: " + tempRatioStringThing);
+ //this.smallestStackSizeWhenProcessing = tempSmallestCraftingUseSize;
+ Utils.LOG_WARNING("Smallest Ratio: "+tempRatioStringThing);
return smallestRatio;
}
- }
+ }
}
return null;
}
- final public ItemStack getTinyDust(final int stacksize) {
- return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustTiny" + this.unlocalizedName, stacksize);
- }
-
@SuppressWarnings("unused")
- final String getToolTip(final String chemSymbol, final long aMultiplier, final boolean aShowQuestionMarks) {
- if (!aShowQuestionMarks && (this.vChemicalFormula.equals("?") || this.vChemicalFormula.equals("??"))) {
- return "";
- }
- Utils.LOG_WARNING(
- "===============| Calculating Atomic Formula for " + this.localizedName + " |===============");
- if (!chemSymbol.equals("")) {
+ final String getToolTip(String chemSymbol, long aMultiplier, boolean aShowQuestionMarks) {
+ if (!aShowQuestionMarks && (vChemicalFormula.equals("?")||vChemicalFormula.equals("??"))) return "";
+ Utils.LOG_WARNING("===============| Calculating Atomic Formula for "+this.localizedName+" |===============");
+ if (!chemSymbol.equals(""))
return chemSymbol;
- }
- final ArrayList<MaterialStack> tempInput = this.vMaterialInput;
- if (tempInput != null) {
- if (!tempInput.isEmpty()) {
+ ArrayList<MaterialStack> tempInput = vMaterialInput;
+ if (tempInput != null){
+ if (!tempInput.isEmpty()){
String dummyFormula = "";
- final long[] dummyFormulaArray = this.getSmallestRatio(tempInput);
- if (dummyFormulaArray != null) {
- if (dummyFormulaArray.length >= 1) {
- for (int e = 0; e < tempInput.size(); e++) {
- if (tempInput.get(e) != null) {
- if (tempInput.get(e).getStackMaterial() != null) {
- if (!tempInput.get(e).getStackMaterial().vChemicalSymbol.equals("??")) {
- if (dummyFormulaArray[e] > 1) {
-
- if (tempInput.get(e).getStackMaterial().vChemicalFormula.length() > 3) {
- dummyFormula = dummyFormula + "("
- + tempInput.get(e).getStackMaterial().vChemicalFormula + ")"
- + dummyFormulaArray[e];
+ long[] dummyFormulaArray = getSmallestRatio(tempInput);
+ if (dummyFormulaArray != null){
+ if (dummyFormulaArray.length >= 1){
+ for (int e=0;e<tempInput.size();e++){
+ if (tempInput.get(e) != null){
+ if (tempInput.get(e).getStackMaterial() != null){
+ if (!tempInput.get(e).getStackMaterial().vChemicalSymbol.equals("??")){
+ if (dummyFormulaArray[e] > 1){
+
+ if (tempInput.get(e).getStackMaterial().vChemicalFormula.length() > 3){
+ dummyFormula = dummyFormula + "(" + tempInput.get(e).getStackMaterial().vChemicalFormula + ")" + dummyFormulaArray[e];
}
else {
- dummyFormula = dummyFormula
- + tempInput.get(e).getStackMaterial().vChemicalFormula
- + dummyFormulaArray[e];
+ dummyFormula = dummyFormula + tempInput.get(e).getStackMaterial().vChemicalFormula + dummyFormulaArray[e];
}
}
- else if (dummyFormulaArray[e] == 1) {
- if (tempInput.get(e).getStackMaterial().vChemicalFormula.length() > 3) {
- dummyFormula = dummyFormula + "("
- + tempInput.get(e).getStackMaterial().vChemicalFormula + ")";
+ else if (dummyFormulaArray[e] == 1){
+ if (tempInput.get(e).getStackMaterial().vChemicalFormula.length() > 3){
+ dummyFormula = dummyFormula + "(" +tempInput.get(e).getStackMaterial().vChemicalFormula + ")";
}
else {
- dummyFormula = dummyFormula
- + tempInput.get(e).getStackMaterial().vChemicalFormula;
+ dummyFormula = dummyFormula +tempInput.get(e).getStackMaterial().vChemicalFormula;
}
}
}
- else {
+ else
dummyFormula = dummyFormula + "??";
- }
}
- else {
+ else
dummyFormula = dummyFormula + "â–“â–“";
- }
}
}
return MaterialUtils.subscript(dummyFormula);
- // return dummyFormula;
+ //return dummyFormula;
}
Utils.LOG_WARNING("dummyFormulaArray <= 0");
}
@@ -484,16 +430,74 @@ public class Material {
}
- final public String getUnlocalizedName() {
- return this.unlocalizedName;
- }
+ final Fluid generateFluid(){
+ if (Materials.get(localizedName).mFluid == null){
+ Utils.LOG_WARNING("Generating our own fluid.");
- final public ItemStack[] getValidInputStacks() {
- return ItemUtils.validItemsForOreDict(this.unlocalizedName);
+ //Generate a Cell if we need to
+ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+getUnlocalizedName(), 1) == null){
+ @SuppressWarnings("unused")
+ Item temp = new BaseItemCell(this);
+ }
+ return FluidUtils.addGTFluid(
+ this.getUnlocalizedName(),
+ "Molten "+this.getLocalizedName(),
+ this.RGBA,
+ 4,
+ this.getMeltingPointK(),
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+getUnlocalizedName(), 1),
+ ItemList.Cell_Empty.get(1L, new Object[0]),
+ 1000);
+ }
+ Utils.LOG_WARNING("Getting the fluid from a GT material instead.");
+ return Materials.get(localizedName).mFluid;
}
- final public boolean requiresBlastFurnace() {
- return this.usesBlastFurnace;
+ final public FluidStack getFluid(int fluidAmount) {
+ Utils.LOG_WARNING("Attempting to get "+fluidAmount+"L of "+this.vMoltenFluid.getName());
+
+ FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount);
+
+ Utils.LOG_WARNING("Info: "+moltenFluid.getFluid().getName()+" Info: "+moltenFluid.amount+" Info: "+moltenFluid.getFluidID());
+
+ //FluidStack moltenFluid = FluidUtils.getFluidStack(this.vMoltenFluid.getName(), fluidAmount);
+ /*boolean isNull = (moltenFluid == null);
+ if (isNull) Utils.LOG_WARNING("Did not obtain fluid.");
+ else Utils.LOG_WARNING("Found fluid.");
+ if (isNull){
+ return null;
+ }*/
+ return moltenFluid;
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
}
diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
index 472acd5abe..d5b5cf34ab 100644
--- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
+++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
@@ -17,65 +17,62 @@ import gtPlusPlus.core.item.base.rotors.BaseItemRotor;
import gtPlusPlus.core.item.base.screws.BaseItemScrew;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
-import gtPlusPlus.xmod.gregtech.loaders.*;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelter;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_DustGeneration;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Extruder;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
-public class MaterialGenerator {
+public class MaterialGenerator {
@SuppressWarnings("unused")
- public static void generate(final Material matInfo) {
- final String unlocalizedName = matInfo.getUnlocalizedName();
- final String materialName = matInfo.getLocalizedName();
- final short[] C = matInfo.getRGBA();
- final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
- final boolean hotIngot = matInfo.requiresBlastFurnace();
- int materialTier = matInfo.vTier; // TODO
-
- if (materialTier > 10 || materialTier <= 0) {
+ public static void generate(final Material matInfo){
+ String unlocalizedName = matInfo.getUnlocalizedName();
+ String materialName = matInfo.getLocalizedName();
+ short[] C = matInfo.getRGBA();
+ int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]);
+ boolean hotIngot = matInfo.requiresBlastFurnace();
+ int materialTier = matInfo.vTier; //TODO
+
+ if (materialTier > 10 || materialTier <= 0){
materialTier = 2;
- }
-
+ }
+
int sRadiation = 0;
- if (ItemUtils.isRadioactive(materialName)) {
+ if (ItemUtils.isRadioactive(materialName)){
sRadiation = ItemUtils.getRadioactivityLevel(materialName);
}
-
- if (sRadiation >= 1) {
+
+ if (sRadiation >= 1){
Item temp;
Block tempBlock;
- tempBlock = new BlockBaseModular(unlocalizedName, materialName, BlockTypes.STANDARD, Colour);
- temp = new BaseItemIngot("itemIngot" + unlocalizedName, materialName, Colour, sRadiation);
-
- temp = new BaseItemDust("itemDust" + unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier,
- sRadiation);
- temp = new BaseItemDust("itemDustTiny" + unlocalizedName, materialName, matInfo, Colour, "Tiny",
- materialTier, sRadiation);
- temp = new BaseItemDust("itemDustSmall" + unlocalizedName, materialName, matInfo, Colour, "Small",
- materialTier, sRadiation);
+ tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
+ temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation);
+
+ temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation);
temp = new BaseItemNugget(matInfo);
temp = new BaseItemPlate(matInfo);
temp = new BaseItemRod(matInfo);
temp = new BaseItemRodLong(matInfo);
}
-
+
else {
Item temp;
Block tempBlock;
- tempBlock = new BlockBaseModular(unlocalizedName, materialName, BlockTypes.STANDARD, Colour);
- tempBlock = new BlockBaseModular(unlocalizedName, materialName, BlockTypes.FRAME, Colour);
- temp = new BaseItemIngot("itemIngot" + unlocalizedName, materialName, Colour, sRadiation);
- if (hotIngot) {
- final Item tempIngot = temp;
- temp = new BaseItemIngotHot("itemHotIngot" + unlocalizedName, materialName,
- ItemUtils.getSimpleStack(tempIngot, 1), materialTier);
+ tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
+ tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour);
+ temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation);
+ if (hotIngot){
+ Item tempIngot = temp;
+ temp = new BaseItemIngotHot("itemHotIngot"+unlocalizedName, materialName, ItemUtils.getSimpleStack(tempIngot, 1), materialTier);
}
- temp = new BaseItemDust("itemDust" + unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier,
- sRadiation);
- temp = new BaseItemDust("itemDustTiny" + unlocalizedName, materialName, matInfo, Colour, "Tiny",
- materialTier, sRadiation);
- temp = new BaseItemDust("itemDustSmall" + unlocalizedName, materialName, matInfo, Colour, "Small",
- materialTier, sRadiation);
+ temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation);
temp = new BaseItemNugget(matInfo);
temp = new BaseItemPlate(matInfo);
temp = new BaseItemPlateDouble(matInfo);
@@ -86,15 +83,18 @@ public class MaterialGenerator {
temp = new BaseItemScrew(matInfo);
temp = new BaseItemRotor(matInfo);
temp = new BaseItemGear(matInfo);
- }
-
- // Add A jillion Recipes - old code
+ }
+
+
+
+
+ //Add A jillion Recipes - old code
RecipeGen_Plates.generateRecipes(matInfo);
RecipeGen_Extruder.generateRecipes(matInfo);
RecipeGen_ShapedCrafting.generateRecipes(matInfo);
RecipeGen_DustGeneration.generateRecipes(matInfo);
- RecipeGen_BlastSmelter.generateARecipe(matInfo);
-
+ RecipeGen_BlastSmelter.generateARecipe(matInfo);
+
}
}
diff --git a/src/Java/gtPlusPlus/core/material/MaterialStack.java b/src/Java/gtPlusPlus/core/material/MaterialStack.java
index 85b5fca748..f2f8ff4e5a 100644
--- a/src/Java/gtPlusPlus/core/material/MaterialStack.java
+++ b/src/Java/gtPlusPlus/core/material/MaterialStack.java
@@ -1,84 +1,89 @@
package gtPlusPlus.core.material;
+import gtPlusPlus.core.util.item.ItemUtils;
+
import java.math.BigDecimal;
import java.math.RoundingMode;
-import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.item.ItemStack;
public class MaterialStack {
- private transient final int[] vAmount;
- private final Material stackMaterial;
- private final double vPercentageToUse;
+ private transient final int[] vAmount;
+ private final Material stackMaterial;
+ private final double vPercentageToUse;
- public MaterialStack(final Material inputs, final double partOutOf100) {
+ public MaterialStack(final Material inputs, final double partOutOf100){
this.stackMaterial = inputs;
this.vPercentageToUse = partOutOf100;
- this.vAmount = this.math(partOutOf100);
+ this.vAmount = math(partOutOf100);
}
- public ItemStack getDustStack() {
- return this.stackMaterial.getDust(this.vAmount[0]);
+ @SuppressWarnings("static-method")
+ private int[] math(final double val){
+ double i;
+ //Cast to a BigDecimal to round it.
+ final BigDecimal bd = new BigDecimal(val).setScale(2, RoundingMode.HALF_EVEN);
+ i = bd.doubleValue();
+ //Split the string into xx.xx
+ final String[] arr=String.valueOf(i).split("\\.");
+ int[] intArr=new int[2];
+ intArr[0]=Integer.parseInt(arr[0]);
+ intArr[1]=Integer.parseInt(arr[1]);
+ return intArr;
}
- public ItemStack getDustStack(final int amount) {
+ public ItemStack getDustStack(){
+ return this.stackMaterial.getDust(this.vAmount[0]);
+ }
+
+ public ItemStack getDustStack(final int amount){
return this.stackMaterial.getDust(amount);
}
-
- public ItemStack getLeftOverStacksFromDecimalValue() {
+
+ public Material getStackMaterial(){
+ return this.stackMaterial;
+ }
+
+ public double getvPercentageToUse(){
+ return this.vPercentageToUse;
+ }
+
+ public long[] getSmallestStackSizes(){
+ return this.stackMaterial.getSmallestRatio(stackMaterial.getComposites());
+ }
+
+ public int getPartsPerOneHundred(){
+ if (this.vAmount != null){
+ if (this.vAmount[0] >= 1 && this.vAmount[0] <= 100){
+ return this.vAmount[0];
+ }
+ }
+ return 100;
+ }
+ public ItemStack getLeftOverStacksFromDecimalValue(){
final int temp = this.vAmount[1];
int getCount;
- if (temp >= 25 && temp <= 99) {
- getCount = temp / 25;
+ if (temp >= 25 && temp <=99){
+ getCount = temp/25;
return this.stackMaterial.getSmallDust(getCount);
}
- else if (temp >= 11 && temp <= 24) {
- getCount = temp / 11;
+ else if (temp >= 11 && temp <= 24){
+ getCount = temp/11;
return this.stackMaterial.getTinyDust(getCount);
}
else {
return null;
- }
+ }
}
- public int getPartsPerOneHundred() {
- if (this.vAmount != null) {
- if (this.vAmount[0] >= 1 && this.vAmount[0] <= 100) {
- return this.vAmount[0];
- }
- }
- return 100;
+ public ItemStack[] getValidItemStacks(){
+ return ItemUtils.validItemsForOreDict(stackMaterial.getUnlocalizedName());
}
- public long[] getSmallestStackSizes() {
- return this.stackMaterial.getSmallestRatio(this.stackMaterial.getComposites());
- }
- public Material getStackMaterial() {
- return this.stackMaterial;
- }
- public ItemStack[] getValidItemStacks() {
- return ItemUtils.validItemsForOreDict(this.stackMaterial.getUnlocalizedName());
- }
- public double getvPercentageToUse() {
- return this.vPercentageToUse;
- }
- @SuppressWarnings("static-method")
- private int[] math(final double val) {
- double i;
- // Cast to a BigDecimal to round it.
- final BigDecimal bd = new BigDecimal(val).setScale(2, RoundingMode.HALF_EVEN);
- i = bd.doubleValue();
- // Split the string into xx.xx
- final String[] arr = String.valueOf(i).split("\\.");
- final int[] intArr = new int[2];
- intArr[0] = Integer.parseInt(arr[0]);
- intArr[1] = Integer.parseInt(arr[1]);
- return intArr;
- }
}
diff --git a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java
index cc165e2d78..06401f53ba 100644
--- a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java
+++ b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java
@@ -1,86 +1,90 @@
package gtPlusPlus.core.proxy;
-import cpw.mods.fml.client.registry.RenderingRegistry;
-import cpw.mods.fml.common.event.*;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.core.common.CommonProxy;
import gtPlusPlus.core.util.particles.EntityParticleFXMysterious;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.Entity;
+import cpw.mods.fml.client.registry.RenderingRegistry;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.event.FMLServerStartingEvent;
-public class ClientProxy extends CommonProxy {
+public class ClientProxy extends CommonProxy{
@Override
- public int addArmor(final String armor) {
- return RenderingRegistry.addNewArmourRendererPrefix(armor);
- }
-
- @Override
- public void generateMysteriousParticles(final Entity theEntity) {
- final double motionX = theEntity.worldObj.rand.nextGaussian() * 0.02D;
- final double motionY = theEntity.worldObj.rand.nextGaussian() * 0.02D;
- final double motionZ = theEntity.worldObj.rand.nextGaussian() * 0.02D;
- final EntityFX particleMysterious = new EntityParticleFXMysterious(
-
- theEntity.worldObj, theEntity.posX + theEntity.worldObj.rand.nextFloat() * theEntity.width
-
- * 2.0F - theEntity.width,
- theEntity.posY + 0.5D + theEntity.worldObj.rand.nextFloat()
-
- * theEntity.height,
- theEntity.posZ + theEntity.worldObj.rand.nextFloat() * theEntity.width
-
- * 2.0F - theEntity.width,
-
- motionX,
-
- motionY,
-
- motionZ);
- Minecraft.getMinecraft().effectRenderer.addEffect(particleMysterious);
+ public void preInit(FMLPreInitializationEvent e) {
+ // TODO Auto-generated method stub
+ super.preInit(e);
+ //Do this weird things for textures.
+ GTplusplus.loadTextures();
}
@Override
- public void init(final FMLInitializationEvent e) {
+ public void init(FMLInitializationEvent e) {
// TODO Auto-generated method stub
super.init(e);
}
@Override
- public void postInit(final FMLPostInitializationEvent e) {
+ public void postInit(FMLPostInitializationEvent e) {
// TODO Auto-generated method stub
super.postInit(e);
}
@Override
- public void preInit(final FMLPreInitializationEvent e) {
- // TODO Auto-generated method stub
- super.preInit(e);
- // Do this weird things for textures.
- GTplusplus.loadTextures();
+ public void registerRenderThings(){
+ //MinecraftForgeClient.registerItemRenderer(ModItems.FluidCell.getItem(), new RenderLiquidCell());
+ //RenderingRegistry.registerEntityRenderingHandler(EntityBloodSteelMob.class, new RenderBloodSteelMob(new ModelBloodSteelMob(), 0));
+ //RenderingRegistry.registerEntityRenderingHandler(EntityBloodSteelHostileMob.class, new RenderBloodSteelMobHostile(new ModelBloodSteelMob(), 0));
+ //RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new RenderSnowball(ModItems.tutGrenade));
+
+ //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBloodSteelChest.class, new BloodSteelChestRenderer());
+ //MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.tutChest), new ItemRenderBloodSteelChest());
}
@Override
- public void registerRenderThings() {
- // MinecraftForgeClient.registerItemRenderer(ModItems.FluidCell.getItem(),
- // new RenderLiquidCell());
- // RenderingRegistry.registerEntityRenderingHandler(EntityBloodSteelMob.class,
- // new RenderBloodSteelMob(new ModelBloodSteelMob(), 0));
- // RenderingRegistry.registerEntityRenderingHandler(EntityBloodSteelHostileMob.class,
- // new RenderBloodSteelMobHostile(new ModelBloodSteelMob(), 0));
- // RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class,
- // new RenderSnowball(ModItems.tutGrenade));
-
- // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBloodSteelChest.class,
- // new BloodSteelChestRenderer());
- // MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.tutChest),
- // new ItemRenderBloodSteelChest());
+ public int addArmor(String armor){
+ return RenderingRegistry.addNewArmourRendererPrefix(armor);
}
+
+
@Override
- public void serverStarting(final FMLServerStartingEvent e) {
+ public void generateMysteriousParticles(Entity theEntity)
+ {
+ double motionX = theEntity.worldObj.rand.nextGaussian() * 0.02D;
+ double motionY = theEntity.worldObj.rand.nextGaussian() * 0.02D;
+ double motionZ = theEntity.worldObj.rand.nextGaussian() * 0.02D;
+ EntityFX particleMysterious = new EntityParticleFXMysterious(
+
+ theEntity.worldObj,
+ theEntity.posX + theEntity.worldObj.rand.nextFloat() * theEntity.width
+
+ * 2.0F - theEntity.width,
+ theEntity.posY + 0.5D + theEntity.worldObj.rand.nextFloat()
+
+ * theEntity.height,
+ theEntity.posZ + theEntity.worldObj.rand.nextFloat() * theEntity.width
+
+ * 2.0F - theEntity.width,
+ motionX,
+
+ motionY,
+
+ motionZ);
+ Minecraft.getMinecraft().effectRenderer.addEffect(particleMysterious);
+ }
+
+ @Override
+ public void serverStarting(FMLServerStartingEvent e)
+ {
+
}
+
+
}
diff --git a/src/Java/gtPlusPlus/core/proxy/ServerProxy.java b/src/Java/gtPlusPlus/core/proxy/ServerProxy.java
index ac1f9d65c8..1f912b9022 100644
--- a/src/Java/gtPlusPlus/core/proxy/ServerProxy.java
+++ b/src/Java/gtPlusPlus/core/proxy/ServerProxy.java
@@ -1,26 +1,28 @@
package gtPlusPlus.core.proxy;
-import cpw.mods.fml.common.event.*;
import gtPlusPlus.core.common.CommonProxy;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-public class ServerProxy extends CommonProxy {
+public class ServerProxy extends CommonProxy{
@Override
- public void init(final FMLInitializationEvent e) {
+ public void preInit(FMLPreInitializationEvent e) {
// TODO Auto-generated method stub
- super.init(e);
+ super.preInit(e);
}
@Override
- public void postInit(final FMLPostInitializationEvent e) {
+ public void init(FMLInitializationEvent e) {
// TODO Auto-generated method stub
- super.postInit(e);
+ super.init(e);
}
@Override
- public void preInit(final FMLPreInitializationEvent e) {
+ public void postInit(FMLPostInitializationEvent e) {
// TODO Auto-generated method stub
- super.preInit(e);
+ super.postInit(e);
}
}
diff --git a/src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java b/src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java
index bbd235d5dd..bb5732c319 100644
--- a/src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java
+++ b/src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java
@@ -9,88 +9,90 @@ import net.minecraft.item.ItemStack;
public class Gregtech_Recipe_Adder {
- private static int euT;
- private static int ticks;
- private static ItemStack inputStack1;
- private static ItemStack inputStack2;
- private static ItemStack outputStack1;
- private static ItemStack outputStack2;
+ private static int euT;
+ private static int ticks;
+ private static ItemStack inputStack1;
+ private static ItemStack inputStack2;
+ private static ItemStack outputStack1;
+ private static ItemStack outputStack2;
- private static void addBlastFurnaceRecipe(final ItemStack input1, final ItemStack input2, final ItemStack output1,
- final ItemStack output2, final int tempRequired) {
- Utils.LOG_INFO("Registering Blast Furnace Recipes.");
- GT_Values.RA.addBlastRecipe(input1, input2, GT_Values.NF, GT_Values.NF, output1, output2,
- Gregtech_Recipe_Adder.ticks, Gregtech_Recipe_Adder.euT, tempRequired);
- }
+ public static void addRecipe(
+ Item maceratorInput, int maceratorInputAmount1,
+ Item maceratorOutput, int maceratorOutputAmount1,
+ Item compressorInput, int compressorInputAmount1,
+ Item compressorOutput, int compressorOutputAmount1,
+ Item blastFurnaceInput, int blastFurnaceInputAmount1,
+ Item blastFurnaceOutput, int blastFurnaceOutputAmount1,
+ Item blastFurnaceInput2, int blastFurnaceInputAmount2,
+ Item blastFurnaceOutput2, int blastFurnaceOutputAmount2,
+ Item smeltingInput, int smeltingInputAmount1,
+ Item smeltingOutput, int smeltingOutputAmount1,
+
+ int euPerTick, int timeInTicks,
+ boolean addMaceratorRecipe, boolean addCompressorRecipe, boolean addBlastFurnaceRecipe, int blastFurnaceTemp, boolean addSmeltingRecipe, boolean addMixerRecipe){
+ euT = euPerTick;
+ ticks = timeInTicks;
+
+ resetVars();
+ if (addMaceratorRecipe){
+ inputStack1 = ItemUtils.getSimpleStack(maceratorInput, maceratorInputAmount1);
+ outputStack1 = ItemUtils.getSimpleStack(maceratorOutput, maceratorOutputAmount1);
+ addMaceratorRecipe(inputStack1, outputStack1);
+ }
+ resetVars();
+ if (addCompressorRecipe){
+ inputStack1 = ItemUtils.getSimpleStack(compressorInput, compressorInputAmount1);
+ outputStack1 = ItemUtils.getSimpleStack(compressorOutput, compressorOutputAmount1);
+ addCompressorRecipe(inputStack1, outputStack1);
+ }
+ resetVars();
+ if (addBlastFurnaceRecipe){
+ inputStack1 = ItemUtils.getSimpleStack(blastFurnaceInput, blastFurnaceInputAmount1);
+ inputStack2 = ItemUtils.getSimpleStack(blastFurnaceInput2, blastFurnaceInputAmount2);
+ outputStack1 = ItemUtils.getSimpleStack(blastFurnaceOutput, blastFurnaceOutputAmount1);
+ outputStack2 = ItemUtils.getSimpleStack(blastFurnaceOutput2, blastFurnaceOutputAmount2);
+ addBlastFurnaceRecipe(inputStack1, inputStack2, outputStack1, outputStack2, blastFurnaceTemp);
+ }
+ resetVars();
+ if (addSmeltingRecipe){
+ inputStack1 = ItemUtils.getSimpleStack(smeltingInput, smeltingInputAmount1);
+ outputStack1 = ItemUtils.getSimpleStack(smeltingOutput, smeltingOutputAmount1);
+ addSmeltingRecipe(inputStack1, outputStack1);
+ }
+ resetVars();
- private static void addCompressorRecipe(final ItemStack input1, final ItemStack output1) {
- GT_ModHandler.addCompressionRecipe(input1, output1);
+ }
+
+ private static void resetVars(){
+ inputStack1 = null;
+ inputStack2 = null;
+ outputStack1 = null;
+ outputStack2 = null;
}
- private static void addMaceratorRecipe(final ItemStack input1, final ItemStack output1) {
+ private static void addMaceratorRecipe(ItemStack input1, ItemStack output1){
GT_ModHandler.addPulverisationRecipe(input1, output1);
}
- public static void addRecipe(final Item maceratorInput, final int maceratorInputAmount1, final Item maceratorOutput,
- final int maceratorOutputAmount1, final Item compressorInput, final int compressorInputAmount1,
- final Item compressorOutput, final int compressorOutputAmount1, final Item blastFurnaceInput,
- final int blastFurnaceInputAmount1, final Item blastFurnaceOutput, final int blastFurnaceOutputAmount1,
- final Item blastFurnaceInput2, final int blastFurnaceInputAmount2, final Item blastFurnaceOutput2,
- final int blastFurnaceOutputAmount2, final Item smeltingInput, final int smeltingInputAmount1,
- final Item smeltingOutput, final int smeltingOutputAmount1,
-
- final int euPerTick, final int timeInTicks, final boolean addMaceratorRecipe,
- final boolean addCompressorRecipe, final boolean addBlastFurnaceRecipe, final int blastFurnaceTemp,
- final boolean addSmeltingRecipe, final boolean addMixerRecipe) {
- Gregtech_Recipe_Adder.euT = euPerTick;
- Gregtech_Recipe_Adder.ticks = timeInTicks;
-
- Gregtech_Recipe_Adder.resetVars();
- if (addMaceratorRecipe) {
- Gregtech_Recipe_Adder.inputStack1 = ItemUtils.getSimpleStack(maceratorInput, maceratorInputAmount1);
- Gregtech_Recipe_Adder.outputStack1 = ItemUtils.getSimpleStack(maceratorOutput, maceratorOutputAmount1);
- Gregtech_Recipe_Adder.addMaceratorRecipe(Gregtech_Recipe_Adder.inputStack1,
- Gregtech_Recipe_Adder.outputStack1);
- }
- Gregtech_Recipe_Adder.resetVars();
- if (addCompressorRecipe) {
- Gregtech_Recipe_Adder.inputStack1 = ItemUtils.getSimpleStack(compressorInput, compressorInputAmount1);
- Gregtech_Recipe_Adder.outputStack1 = ItemUtils.getSimpleStack(compressorOutput, compressorOutputAmount1);
- Gregtech_Recipe_Adder.addCompressorRecipe(Gregtech_Recipe_Adder.inputStack1,
- Gregtech_Recipe_Adder.outputStack1);
- }
- Gregtech_Recipe_Adder.resetVars();
- if (addBlastFurnaceRecipe) {
- Gregtech_Recipe_Adder.inputStack1 = ItemUtils.getSimpleStack(blastFurnaceInput, blastFurnaceInputAmount1);
- Gregtech_Recipe_Adder.inputStack2 = ItemUtils.getSimpleStack(blastFurnaceInput2, blastFurnaceInputAmount2);
- Gregtech_Recipe_Adder.outputStack1 = ItemUtils.getSimpleStack(blastFurnaceOutput,
- blastFurnaceOutputAmount1);
- Gregtech_Recipe_Adder.outputStack2 = ItemUtils.getSimpleStack(blastFurnaceOutput2,
- blastFurnaceOutputAmount2);
- Gregtech_Recipe_Adder.addBlastFurnaceRecipe(Gregtech_Recipe_Adder.inputStack1,
- Gregtech_Recipe_Adder.inputStack2, Gregtech_Recipe_Adder.outputStack1,
- Gregtech_Recipe_Adder.outputStack2, blastFurnaceTemp);
- }
- Gregtech_Recipe_Adder.resetVars();
- if (addSmeltingRecipe) {
- Gregtech_Recipe_Adder.inputStack1 = ItemUtils.getSimpleStack(smeltingInput, smeltingInputAmount1);
- Gregtech_Recipe_Adder.outputStack1 = ItemUtils.getSimpleStack(smeltingOutput, smeltingOutputAmount1);
- Gregtech_Recipe_Adder.addSmeltingRecipe(Gregtech_Recipe_Adder.inputStack1,
- Gregtech_Recipe_Adder.outputStack1);
- }
- Gregtech_Recipe_Adder.resetVars();
-
+ private static void addCompressorRecipe(ItemStack input1, ItemStack output1){
+ GT_ModHandler.addCompressionRecipe(input1, output1);
}
- private static void addSmeltingRecipe(final ItemStack input1, final ItemStack output1) {
- GT_ModHandler.addSmeltingRecipe(input1, output1);
+ private static void addBlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tempRequired){
+ Utils.LOG_INFO("Registering Blast Furnace Recipes.");
+ GT_Values.RA.addBlastRecipe(
+ input1,
+ input2,
+ GT_Values.NF, GT_Values.NF,
+ output1,
+ output2,
+ ticks,
+ euT,
+ tempRequired);
}
- private static void resetVars() {
- Gregtech_Recipe_Adder.inputStack1 = null;
- Gregtech_Recipe_Adder.inputStack2 = null;
- Gregtech_Recipe_Adder.outputStack1 = null;
- Gregtech_Recipe_Adder.outputStack2 = null;
+ private static void addSmeltingRecipe(ItemStack input1, ItemStack output1){
+ GT_ModHandler.addSmeltingRecipe(input1, output1);
}
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
index 5ff8a1201e..46cf4e0a7d 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -1,6 +1,9 @@
package gtPlusPlus.core.recipe;
-import gregtech.api.enums.*;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.item.ModItems;
@@ -15,387 +18,326 @@ import net.minecraft.item.ItemStack;
public class RECIPES_GREGTECH {
- private static void addFuels() {
- Utils.LOG_INFO("Registering New Fuels.");
- GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketFire_water", 0, 1), null, 120, 0);
- GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0);
- GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketHootch", 0, 1), null, 36, 0);
-
- // CORE.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel",
- // 0, 1), null, 112, 0);
- GT_Values.RA.addFuel(ItemUtils.getSimpleStack(Items.lava_bucket), null, 32, 2);
- GT_Values.RA.addFuel(ItemUtils.getIC2Cell(2), null, 32, 2);
- GT_Values.RA.addFuel(ItemUtils.getIC2Cell(11), null, 24, 2);
- // System.exit(1);
- }
-
- private static void assemblerRecipes() {
- // GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate,
- // Materials.Titanium, 6L), ItemList.Casing_Turbine.get(1L, new
- // Object[0]), ItemList.Casing_Turbine2.get(1L, new Object[0]), 50, 16);
- // GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate,
- // Materials.TungstenSteel, 6L), ItemList.Casing_Turbine.get(1L, new
- // Object[0]), ItemList.Casing_Turbine3.get(1L, new Object[0]), 50, 16);
-
+ public static void run(){
+ Utils.LOG_INFO("Loading Recipes through GregAPI for Industrial Multiblocks.");
+ execute();
}
- private static void blastFurnaceRecipes() {
- GT_Values.RA.addBlastRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustBerylliumFluoride", 1), GT_Values.NF, GT_Values.NF,
- ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 3), null, 60 * 20, 2000, 3000);
+ private static void execute(){
+ cokeOvenRecipes();
+ matterFabRecipes();
+ assemblerRecipes();
+ distilleryRecipes();
+ extractorRecipes();
+ chemicalBathRecipes();
+ chemicalReactorRecipes();
+ dehydratorRecipes();
+ blastFurnaceRecipes();
+ addFuels();
}
- private static void chemicalBathRecipes() {
- final int[] chances = {
- 10000, 5000, 2500
- };
- GT_Values.RA.addChemicalBathRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 12),
- FluidUtils.getFluidStack("chlorine", 2400),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), chances, 30 * 20, 240);
+ private static void cokeOvenRecipes(){
+ Utils.LOG_INFO("Loading Recipes for Industrial Coking Oven.");
- GT_Values.RA.addChemicalBathRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 10),
- FluidUtils.getFluidStack("hydrofluoricacid", 20000),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5), null, null, new int[] {}, 90 * 20,
- 500);
- }
+ try {
- private static void chemicalReactorRecipes() {
- GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 5), // Input
- // Stack
- // 1
- ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5), // Input
- // Stack
- // 2
- null, // Fluid Input
- null, // Fluid Output
- ItemUtils.getItemStackOfAmountFromOreDict("dust2LiOHCaCO3", 10), // Output
- // Stack
- 600 * 20);
-
- GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 5), // Input
- // Stack
- // 1
- null, // Input Stack 2
- FluidUtils.getFluidStack("hydrofluoricacid", 2500), // Fluid
- // Input
- FluidUtils.getFluidStack("water", 2500), // Fluid Output
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5), // Output
- // Stack
- 600 * 20);
- }
+ //GT Logs to Charcoal Recipe
+ //With Sulfuric Acid
+ CORE.RA.addCokeOvenRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), //Input 1
+ GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), //Input 2
+ Materials.SulfuricAcid.getFluid(20L), //Fluid Input
+ Materials.Creosote.getFluid(175L), //Fluid Output
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 2L), //Item Output
+ 800, //Time in ticks
+ 30); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+ try {
- private static void cokeOvenRecipes() {
- Utils.LOG_INFO("Loading Recipes for Industrial Coking Oven.");
+ //Coal -> Coke Recipe
+ //With Sulfuric Acid
+ CORE.RA.addCokeOvenRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), //Input 1
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), //Input 2
+ Materials.SulfuricAcid.getFluid(60L), //Fluid Input
+ Materials.Creosote.getFluid(250L), //Fluid Output
+ ItemUtils.getItemStack("Railcraft:fuel.coke", 2), //Item Output
+ 600, //Time in ticks
+ 120); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
try {
+ //GT Logs to Charcoal Recipe
+ //Without Sulfuric Acid
+ CORE.RA.addCokeOvenRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), //Input 1
+ GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), //Input 2
+ FluidUtils.getFluidStack("oxygen", 80), //Fluid Input
+ Materials.Creosote.getFluid(145L), //Fluid Output
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 2L), //Item Output
+ 1200, //Time in ticks
+ 30); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
- // GT Logs to Charcoal Recipe
- // With Sulfuric Acid
- CORE.RA.addCokeOvenRecipe(GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), // Input
- // 1
- GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), // Input
- // 2
- Materials.SulfuricAcid.getFluid(20L), // Fluid Input
- Materials.Creosote.getFluid(175L), // Fluid Output
- GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 2L), // Item
- // Output
- 800, // Time in ticks
- 30); // EU
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
try {
+ //Coal -> Coke Recipe
+ //Without Sulfuric Acid
+ CORE.RA.addCokeOvenRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), //Input 1
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), //Input 2
+ FluidUtils.getFluidStack("oxygen", 185), //Fluid Input
+ Materials.Creosote.getFluid(200L), //Fluid Output
+ ItemUtils.getItemStack("Railcraft:fuel.coke", 2), //Item Output
+ 900, //Time in ticks
+ 120); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+ }
- // Coal -> Coke Recipe
- // With Sulfuric Acid
- CORE.RA.addCokeOvenRecipe(GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), // Input
- // 1
- GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), // Input
- // 2
- Materials.SulfuricAcid.getFluid(60L), // Fluid Input
- Materials.Creosote.getFluid(250L), // Fluid Output
- ItemUtils.getItemStack("Railcraft:fuel.coke", 2), // Item
- // Output
- 600, // Time in ticks
- 120); // EU
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
+ private static void matterFabRecipes(){
+ Utils.LOG_INFO("Loading Recipes for Matter Fabricator.");
try {
- // GT Logs to Charcoal Recipe
- // Without Sulfuric Acid
- CORE.RA.addCokeOvenRecipe(GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), // Input
- // 1
- GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), // Input
- // 2
- FluidUtils.getFluidStack("oxygen", 80), // Fluid Input
- Materials.Creosote.getFluid(145L), // Fluid Output
- GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 2L), // Item
- // Output
- 1200, // Time in ticks
- 30); // EU
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
+ CORE.RA.addMatterFabricatorRecipe(
+ Materials.UUAmplifier.getFluid(1L), //Fluid Input
+ Materials.UUMatter.getFluid(1L), //Fluid Output
+ 800, //Time in ticks
+ 32); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
try {
- // Coal -> Coke Recipe
- // Without Sulfuric Acid
- CORE.RA.addCokeOvenRecipe(GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), // Input
- // 1
- GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), // Input
- // 2
- FluidUtils.getFluidStack("oxygen", 185), // Fluid Input
- Materials.Creosote.getFluid(200L), // Fluid Output
- ItemUtils.getItemStack("Railcraft:fuel.coke", 2), // Item
- // Output
- 900, // Time in ticks
- 120); // EU
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
+
+ CORE.RA.addMatterFabricatorRecipe(
+ null, //Fluid Input
+ Materials.UUMatter.getFluid(1L), //Fluid Output
+ 3200, //Time in ticks
+ 32); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+
}
- private static void dehydratorRecipes() {
+ private static void dehydratorRecipes(){
Utils.LOG_INFO("Loading Recipes for Chemical Dehydrator.");
- /*
- * try {
- *
- * //Makes Lithium Carbonate CORE.RA.addDehydratorRecipe(
- * FluidUtils.getFluidStack("sulfuriclithium", 1000), //Item input (slot
- * 1) null, //Fluid Input new ItemStack[]{
- * UtilsItems.getItemStackOfAmountFromOreDict("dustSodium", 1),
- * UtilsItems.getItemStackOfAmountFromOreDict("dustCarbon", 1),
- * UtilsItems.getItemStackOfAmountFromOreDict("dustLithium", 1) },
- * //Output Array of Items - Upto 9 10*20, //Time in ticks 30); //EU
- * }catch (NullPointerException e){Utils.LOG_INFO(
- * "FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
- */
+ /*try {
+
+ //Makes Lithium Carbonate
+ CORE.RA.addDehydratorRecipe(
+ FluidUtils.getFluidStack("sulfuriclithium", 1000), //Item input (slot 1)
+ null, //Fluid Input
+ new ItemStack[]{
+ UtilsItems.getItemStackOfAmountFromOreDict("dustSodium", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustCarbon", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustLithium", 1)
+ }, //Output Array of Items - Upto 9
+ 10*20, //Time in ticks
+ 30); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}*/
try {
- ItemStack cells = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:itemCellEmpty",
- "Empty Fluid Cells", 0, 12);
+ ItemStack cells = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:itemCellEmpty", "Empty Fluid Cells", 0, 12);
- if (cells == null) {
+ if (cells == null){
cells = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 12);
}
- final ItemStack[] input = {
- cells, ItemUtils.getItemStackOfAmountFromOreDict("dustLepidolite", 20)
- };
-
- CORE.RA.addDehydratorRecipe(input, // Item input (Array, up to 2)
- FluidUtils.getFluidStack("sulfuricacid", 10000), // Fluid
- // input
- // (slot
- // 1)
- FluidUtils.getFluidStack("sulfuriclithium", 10000), // Fluid
- // output
- // (slot
- // 2)
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustPotassium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4),
- ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 10),
- ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 3), // LithiumCarbonate
- }, // Output Array of Items - Upto 9,
- new int[] {
- 0
- }, 75 * 20, // Time in ticks
- 1000); // EU
-
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
+ ItemStack[] input = {cells, ItemUtils.getItemStackOfAmountFromOreDict("dustLepidolite", 20)};
+
+ CORE.RA.addDehydratorRecipe(
+ input, //Item input (Array, up to 2)
+ FluidUtils.getFluidStack("sulfuricacid", 10000), //Fluid input (slot 1)
+ FluidUtils.getFluidStack("sulfuriclithium", 10000), //Fluid output (slot 2)
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("dustPotassium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 10),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 3), //LithiumCarbonate
+ }, //Output Array of Items - Upto 9,
+ new int[]{0},
+ 75*20, //Time in ticks
+ 1000); //EU
+
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
try {
- CORE.RA.addDehydratorRecipe(new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10)
- }, // Item input (Array, up to 2)
- FluidUtils.getFluidStack("uraniumtetrafluoride", 1440), // Fluid
- // input
- // (slot
- // 1)
- null, // Fluid output (slot 2)
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustUraniumTetrafluoride", 10),
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 10)
- }, // Output Array of Items - Upto 9,
- new int[] {
- 0
- }, 150 * 20, // Time in ticks
- 2000); // EU
-
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10)
+ }, //Item input (Array, up to 2)
+ FluidUtils.getFluidStack("uraniumtetrafluoride", 1440), //Fluid input (slot 1)
+ null, //Fluid output (slot 2)
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("dustUraniumTetrafluoride", 10),
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 10)
+ }, //Output Array of Items - Upto 9,
+ new int[]{0},
+ 150*20, //Time in ticks
+ 2000); //EU
+
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
try {
- CORE.RA.addDehydratorRecipe(new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10)
- }, // Item input (Array, up to 2)
- FluidUtils.getFluidStack("uraniumhexafluoride", 1440), // Fluid
- // input
- // (slot
- // 1)
- null, // Fluid output (slot 2)
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustUraniumHexafluoride", 10),
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 10)
- }, // Output Array of Items - Upto 9,
- new int[] {
- 0
- }, 300 * 20, // Time in ticks
- 4000); // EU
-
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
-
- // Raisins from Grapes
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10)
+ }, //Item input (Array, up to 2)
+ FluidUtils.getFluidStack("uraniumhexafluoride", 1440), //Fluid input (slot 1)
+ null, //Fluid output (slot 2)
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("dustUraniumHexafluoride", 10),
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellEmpty", 10)
+ }, //Output Array of Items - Upto 9,
+ new int[]{0},
+ 300*20, //Time in ticks
+ 4000); //EU
+
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+
+ //Raisins from Grapes
try {
-
- CORE.RA.addDehydratorRecipe(new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("cropGrape", 1)
- }, // Item input (Array, up to 2)
- null, // Fluid input (slot 1)
- null, // Fluid output (slot 2)
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("foodRaisins", 1)
- }, // Output Array of Items - Upto 9,
- new int[] {
- 0
- }, 10 * 20, // Time in ticks
- 8); // EU
-
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
-
- // Calcium Hydroxide
- if (ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() != ModItems.AAA_Broken
- || LoadedMods.IHL) {
+
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("cropGrape", 1)
+ }, //Item input (Array, up to 2)
+ null, //Fluid input (slot 1)
+ null, //Fluid output (slot 2)
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("foodRaisins", 1)
+ }, //Output Array of Items - Upto 9,
+ new int[]{0},
+ 10*20, //Time in ticks
+ 8); //EU
+
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+
+ //Calcium Hydroxide
+ if (ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1).getItem() != ModItems.AAA_Broken || LoadedMods.IHL){
try {
-
- CORE.RA.addDehydratorRecipe(new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 10)
- }, // Item input (Array, up to 2)
- FluidUtils.getFluidStack("water", 10000), // Fluid input
- // (slot 1)
- null, // Fluid output (slot 2)
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 20)
- }, // Output Array of Items - Upto 9,
- new int[] {
- 0
- }, 120 * 20, // Time in ticks
- 120); // EU
-
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
-
- // 2 LiOH + CaCO3
+
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 10)
+ }, //Item input (Array, up to 2)
+ FluidUtils.getFluidStack("water", 10000), //Fluid input (slot 1)
+ null, //Fluid output (slot 2)
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 20)
+ }, //Output Array of Items - Upto 9,
+ new int[]{0},
+ 120*20, //Time in ticks
+ 120); //EU
+
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+
+ //2 LiOH + CaCO3
try {
-
- CORE.RA.addDehydratorRecipe(new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dust2LiOHCaCO3", 5)
- }, // Item input (Array, up to 2)
- null, // Fluid input (slot 1)
- null, // Fluid output (slot 2)
- new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 3)
- }, // Output Array of Items - Upto 9,
- new int[] {
- 0
- }, 120 * 20, // Time in ticks
- 1000); // EU
-
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
+
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("dust2LiOHCaCO3", 5)
+ }, //Item input (Array, up to 2)
+ null, //Fluid input (slot 1)
+ null, //Fluid output (slot 2)
+ new ItemStack[]{
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 3)
+ }, //Output Array of Items - Upto 9,
+ new int[]{0},
+ 120*20, //Time in ticks
+ 1000); //EU
+
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
}
-
+
}
- private static void distilleryRecipes() {
- Utils.LOG_INFO("Registering Distillery/Distillation Tower Recipes.");
- GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]),
- FluidUtils.getFluidStack("air", 1000), FluidUtils.getFluidStack("helium", 1), 400, 30, false);
- GT_Values.RA.addDistillationTowerRecipe(FluidUtils.getFluidStack("air", 20000),
- FluidUtils.getFluidStackArray("helium", 25), ItemUtils.getSimpleStack(ModItems.itemHeliumBlob, 1), 200,
- 60);
- }
+ private static void assemblerRecipes(){
+ //GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 6L), ItemList.Casing_Turbine.get(1L, new Object[0]), ItemList.Casing_Turbine2.get(1L, new Object[0]), 50, 16);
+ //GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 6L), ItemList.Casing_Turbine.get(1L, new Object[0]), ItemList.Casing_Turbine3.get(1L, new Object[0]), 50, 16);
- private static void execute() {
- RECIPES_GREGTECH.cokeOvenRecipes();
- RECIPES_GREGTECH.matterFabRecipes();
- RECIPES_GREGTECH.assemblerRecipes();
- RECIPES_GREGTECH.distilleryRecipes();
- RECIPES_GREGTECH.extractorRecipes();
- RECIPES_GREGTECH.chemicalBathRecipes();
- RECIPES_GREGTECH.chemicalReactorRecipes();
- RECIPES_GREGTECH.dehydratorRecipes();
- RECIPES_GREGTECH.blastFurnaceRecipes();
- RECIPES_GREGTECH.addFuels();
}
- private static void extractorRecipes() {
- Utils.LOG_INFO("Registering Extractor Recipes.");
- GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Sodium.get(1L, new Object[0]),
- ItemList.Battery_Hull_HV.get(4L, new Object[0]));
- GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Cadmium.get(1L, new Object[0]),
- ItemList.Battery_Hull_HV.get(4L, new Object[0]));
- GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Lithium.get(1L, new Object[0]),
- ItemList.Battery_Hull_HV.get(4L, new Object[0]));
+ private static void distilleryRecipes(){
+ Utils.LOG_INFO("Registering Distillery/Distillation Tower Recipes.");
+ GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), FluidUtils.getFluidStack("air", 1000), FluidUtils.getFluidStack("helium", 1), 400, 30, false);
+ GT_Values.RA.addDistillationTowerRecipe(FluidUtils.getFluidStack("air", 20000), FluidUtils.getFluidStackArray("helium", 25), ItemUtils.getSimpleStack(ModItems.itemHeliumBlob, 1), 200, 60);
}
- private static void matterFabRecipes() {
- Utils.LOG_INFO("Loading Recipes for Matter Fabricator.");
+ private static void addFuels(){
+ Utils.LOG_INFO("Registering New Fuels.");
+ GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketFire_water", 0, 1), null, 120, 0);
+ GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0);
+ GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketHootch", 0, 1), null, 36, 0);
- try {
- CORE.RA.addMatterFabricatorRecipe(Materials.UUAmplifier.getFluid(1L), // Fluid
- // Input
- Materials.UUMatter.getFluid(1L), // Fluid Output
- 800, // Time in ticks
- 32); // EU
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
- try {
- CORE.RA.addMatterFabricatorRecipe(null, // Fluid Input
- Materials.UUMatter.getFluid(1L), // Fluid Output
- 3200, // Time in ticks
- 32); // EU
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");
- }
+ //CORE.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0);
+ GT_Values.RA.addFuel(ItemUtils.getSimpleStack(Items.lava_bucket), null, 32, 2);
+ GT_Values.RA.addFuel(ItemUtils.getIC2Cell(2), null, 32, 2);
+ GT_Values.RA.addFuel(ItemUtils.getIC2Cell(11), null, 24, 2);
+ //System.exit(1);
+ }
+ private static void extractorRecipes(){
+ Utils.LOG_INFO("Registering Extractor Recipes.");
+ GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Sodium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0]));
+ GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Cadmium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0]));
+ GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Lithium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0]));
}
- public static void run() {
- Utils.LOG_INFO("Loading Recipes through GregAPI for Industrial Multiblocks.");
- RECIPES_GREGTECH.execute();
+ private static void chemicalBathRecipes(){
+ int[] chances = {10000, 5000, 2500};
+ GT_Values.RA.addChemicalBathRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 12), FluidUtils.getFluidStack("chlorine", 2400),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ chances,
+ 30*20,
+ 240);
+
+ GT_Values.RA.addChemicalBathRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 10),
+ FluidUtils.getFluidStack("hydrofluoricacid", 20000),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5),
+ null,
+ null,
+ new int[]{},
+ 90*20,
+ 500);
+ }
+
+ private static void chemicalReactorRecipes(){
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 5), //Input Stack 1
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5), //Input Stack 2
+ null, //Fluid Input
+ null, //Fluid Output
+ ItemUtils.getItemStackOfAmountFromOreDict("dust2LiOHCaCO3", 10), //Output Stack
+ 600*20
+ );
+
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 5), //Input Stack 1
+ null, //Input Stack 2
+ FluidUtils.getFluidStack("hydrofluoricacid", 2500), //Fluid Input
+ FluidUtils.getFluidStack("water", 2500), //Fluid Output
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5), //Output Stack
+ 600*20
+ );
}
+
+ private static void blastFurnaceRecipes(){
+ GT_Values.RA.addBlastRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustBerylliumFluoride", 1),
+ GT_Values.NF, GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 3),
+ null,
+ 60*20,
+ 2000,
+ 3000);
+ }
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java
index e62931db25..aa3026133e 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java
@@ -12,37 +12,37 @@ import net.minecraft.item.ItemStack;
public class RECIPES_General {
- static ItemStack RECIPE_Paper = ItemUtils.getSimpleStack(Items.paper);
- static String RECIPE_LapisDust = "dustLazurite";
- static ItemStack OUTPUT_Blueprint = ItemUtils.getSimpleStack(ModItems.itemBlueprintBase);
- static ItemStack RECIPE_CraftingTable = ItemUtils
- .getSimpleStack(Item.getItemFromBlock(Blocks.crafting_table));
- static String RECIPE_BronzePlate = "plateAnyBronze";
- static ItemStack RECIPE_BasicCasingIC2;
- static ItemStack OUTPUT_Workbench_Bronze = ItemUtils
- .getSimpleStack(Item.getItemFromBlock(ModBlocks.blockWorkbench));
- static ItemStack NULL = null;
-
- public static void RECIPES_LOAD() {
-
- if (LoadedMods.Gregtech) {
- RECIPES_General.RECIPE_BasicCasingIC2 = ItemUtils.getItemStack("IC2:blockMachine", 1);
- RECIPES_General.run();
+ static ItemStack RECIPE_Paper = ItemUtils.getSimpleStack(Items.paper);
+ static String RECIPE_LapisDust = "dustLazurite";
+ static ItemStack OUTPUT_Blueprint = ItemUtils.getSimpleStack(ModItems.itemBlueprintBase);
+ static ItemStack RECIPE_CraftingTable = ItemUtils.getSimpleStack(Item.getItemFromBlock(Blocks.crafting_table));
+ static String RECIPE_BronzePlate = "plateAnyBronze";
+ static ItemStack RECIPE_BasicCasingIC2;
+ static ItemStack OUTPUT_Workbench_Bronze = ItemUtils.getSimpleStack(Item.getItemFromBlock(ModBlocks.blockWorkbench));
+ static ItemStack NULL = null;
+
+ public static void RECIPES_LOAD(){
+
+ if (LoadedMods.Gregtech){
+ RECIPE_BasicCasingIC2 = ItemUtils.getItemStack("IC2:blockMachine", 1);
+ run();
}
}
-
- private static void run() {
-
- RecipeUtils.recipeBuilder(RECIPES_General.RECIPE_Paper, RECIPES_General.RECIPE_LapisDust, RECIPES_General.NULL,
- RECIPES_General.RECIPE_Paper, RECIPES_General.RECIPE_LapisDust, RECIPES_General.NULL,
- RECIPES_General.RECIPE_LapisDust, RECIPES_General.RECIPE_LapisDust, RECIPES_General.NULL,
- RECIPES_General.OUTPUT_Blueprint);
-
- RecipeUtils.recipeBuilder(RECIPES_General.RECIPE_BronzePlate, RECIPES_General.RECIPE_CraftingTable,
- RECIPES_General.RECIPE_BronzePlate, RECIPES_General.RECIPE_BronzePlate,
- RECIPES_General.RECIPE_BasicCasingIC2, RECIPES_General.RECIPE_BronzePlate,
- RECIPES_General.RECIPE_BronzePlate, RECIPES_General.RECIPE_BronzePlate,
- RECIPES_General.RECIPE_BronzePlate, RECIPES_General.OUTPUT_Workbench_Bronze);
+
+ private static void run(){
+
+
+ RecipeUtils.recipeBuilder(
+ RECIPE_Paper, RECIPE_LapisDust, NULL,
+ RECIPE_Paper, RECIPE_LapisDust, NULL,
+ RECIPE_LapisDust, RECIPE_LapisDust, NULL,
+ OUTPUT_Blueprint);
+
+ RecipeUtils.recipeBuilder(
+ RECIPE_BronzePlate, RECIPE_CraftingTable, RECIPE_BronzePlate,
+ RECIPE_BronzePlate, RECIPE_BasicCasingIC2, RECIPE_BronzePlate,
+ RECIPE_BronzePlate, RECIPE_BronzePlate, RECIPE_BronzePlate,
+ OUTPUT_Workbench_Bronze);
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java
index 43d879bbd1..94a1d85ae3 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java
@@ -1,6 +1,9 @@
package gtPlusPlus.core.recipe;
-import gregtech.api.enums.*;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OreDictNames;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.IOreRecipeRegistrator;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
@@ -13,32 +16,16 @@ public class RECIPES_LaserEngraver implements IOreRecipeRegistrator {
}
@Override
- public void registerOre(final OrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName,
- final String aModName, final ItemStack aStack) {
+ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
if (aOreDictName.equals(OreDictNames.craftingLensBlue.toString())) {
- GT_Values.RA.addLaserEngraverRecipe(
- GT_OreDictUnificator.get(OrePrefixes.foil, Materials.YttriumBariumCuprate, 2L),
- GT_Utility.copyAmount(0L, new Object[] {
- aStack
- }), GregtechItemList.Circuit_Parts_Wiring_IV.get(1L, new Object[0]), 64, 480);
- }
- else if (aOreDictName.equals(OreDictNames.craftingLensYellow.toString())) {
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 2L),
- GT_Utility.copyAmount(0L, new Object[] {
- aStack
- }), GregtechItemList.Circuit_Parts_Wiring_LuV.get(1L, new Object[0]), 64, 1024);
- }
- else if (aOreDictName.equals(OreDictNames.craftingLensCyan.toString())) {
- }
- else if (aOreDictName.equals(OreDictNames.craftingLensRed.toString())) {
- }
- else if (aOreDictName.equals(OreDictNames.craftingLensGreen.toString())) {
- GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Naquadah, 2L),
- GT_Utility.copyAmount(0L, new Object[] {
- aStack
- }), GregtechItemList.Circuit_Parts_Wiring_ZPM.get(1L, new Object[0]), 64, 2000);
- }
- else if (aOreDictName.equals(OreDictNames.craftingLensWhite.toString())) {
+ GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.YttriumBariumCuprate, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_IV.get(1L, new Object[0]), 64, 480);
+ } else if (aOreDictName.equals(OreDictNames.craftingLensYellow.toString())) {
+ GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_LuV.get(1L, new Object[0]), 64, 1024);
+ } else if (aOreDictName.equals(OreDictNames.craftingLensCyan.toString())) {
+ } else if (aOreDictName.equals(OreDictNames.craftingLensRed.toString())) {
+ } else if (aOreDictName.equals(OreDictNames.craftingLensGreen.toString())) {
+ GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Naquadah, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_ZPM.get(1L, new Object[0]), 64, 2000);
+ } else if (aOreDictName.equals(OreDictNames.craftingLensWhite.toString())) {
}
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java
index 7c2bcc5d99..14f4a1c998 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java
@@ -1,172 +1,115 @@
package gtPlusPlus.core.recipe;
-import java.util.ArrayList;
-
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.recipe.RecipeUtils;
import gtPlusPlus.core.util.wrapper.var;
+
+import java.util.ArrayList;
+
import net.minecraft.item.ItemStack;
public class RECIPES_MTWRAPPER {
- public static int MT_RECIPES_LOADED = 0;
- public static int MT_RECIPES_FAILED = 0;
+ public static int MT_RECIPES_LOADED = 0;
+ public static int MT_RECIPES_FAILED = 0;
- static var chestWood = new var("minecraft:chest>");
- static var slabWood = new var("ore:slabWood>");
- static var gemNetherQuartz = new var("ore:gemNetherQuartz>");
- static var glass = new var("ore:blockGlass>");
- static var sensorDaylight = new var("minecraft:daylight_detector>");
- static var blazeRod = new var("minecraft:blaze_rod>");
- static var saw = new var("ore:craftingToolSaw>");
- static var logWood = new var("ore:logWood>");
- static var button = new var("minecraft:stone_button>");
- static var stoneBlock = new var("minecraft:stone>");
+ static var chestWood = new var("minecraft:chest>");
+ static var slabWood = new var("ore:slabWood>");
+ static var gemNetherQuartz = new var("ore:gemNetherQuartz>");
+ static var glass = new var("ore:blockGlass>");
+ static var sensorDaylight = new var("minecraft:daylight_detector>");
+ static var blazeRod = new var("minecraft:blaze_rod>");
+ static var saw = new var("ore:craftingToolSaw>");
+ static var logWood = new var("ore:logWood>");
+ static var button = new var("minecraft:stone_button>");
+ static var stoneBlock = new var("minecraft:stone>");
+
+ public static void run(){
+ /*addShaped(button.getStack(2),
+ null, stoneBlock, null,
+ null, stoneBlock, null,
+ null, null, null);*/
+ /*addShaped(stoneStick.getStack(1),
+ stoneBlock, null, null,
+ stoneBlock, null, null,
+ null, null, null);*/
+ addShaped(chestWood.getStack(2),
+ logWood, logWood, logWood,
+ logWood, null, logWood,
+ logWood, logWood, logWood);
+ addShaped(chestWood.getStack(4),
+ logWood, logWood, logWood,
+ logWood, saw, logWood,
+ logWood, logWood, logWood);
+ //Recipe Fixes
+ //remove(sensorDaylight);
+ addShaped(sensorDaylight.getStack(1),
+ glass, glass, glass,
+ gemNetherQuartz, gemNetherQuartz, gemNetherQuartz,
+ slabWood, slabWood, slabWood);
+ /*addShaped(ironBars .getStack( 8),
+ null, "<ore:craftingToolWrench>", null,
+ "<ore:stickAnyIron>", "<ore:stickAnyIron>", "<ore:stickAnyIron>",
+ "<ore:stickAnyIron>", "<ore:stickAnyIron>", "<ore:stickAnyIron>");*/
+ }
+
+
+ public static void addShaped(Object item_Output,
+ Object item_1, Object item_2, Object item_3,
+ Object item_4, Object item_5, Object item_6,
+ Object item_7, Object item_8, Object item_9){
- public static void addShaped(final Object item_Output, final Object item_1, final Object item_2,
- final Object item_3, final Object item_4, final Object item_5, final Object item_6, final Object item_7,
- final Object item_8, final Object item_9) {
/*
- *
- * var item_1, var item_2, var item_3, var item_4, var item_5, var
- * item_6, var item_7, var item_8, var item_9
- *
- *
+ *
+ * var item_1, var item_2, var item_3,
+ var item_4, var item_5, var item_6,
+ var item_7, var item_8, var item_9
+ *
+ *
*/
- final ItemStack outputItem = ItemUtils.getCorrectStacktype(item_Output, 1);
+ ItemStack outputItem = ItemUtils.getCorrectStacktype(item_Output, 1);
- final ArrayList<Object> validSlots = new ArrayList<Object>();
- String a, b, c, d, e, f, g, h, i;
- if (item_1 == null) {
- a = " ";
- }
- else {
- a = "1";
- validSlots.add('1');
- validSlots.add(item_1);
- }
- if (item_2 == null) {
- b = " ";
- }
- else {
- b = "2";
- validSlots.add('2');
- validSlots.add(item_2);
- }
- if (item_3 == null) {
- c = " ";
- }
- else {
- c = "3";
- validSlots.add('3');
- validSlots.add(item_3);
- }
- if (item_4 == null) {
- d = " ";
- }
- else {
- d = "4";
- validSlots.add('4');
- validSlots.add(item_4);
- }
- if (item_5 == null) {
- e = " ";
- }
- else {
- e = "5";
- validSlots.add('5');
- validSlots.add(item_5);
- }
- if (item_6 == null) {
- f = " ";
- }
- else {
- f = "6";
- validSlots.add('6');
- validSlots.add(item_6);
- }
- if (item_7 == null) {
- g = " ";
- }
- else {
- g = "7";
- validSlots.add('7');
- validSlots.add(item_7);
- }
- if (item_8 == null) {
- h = " ";
- }
- else {
- h = "8";
- validSlots.add('8');
- validSlots.add(item_8);
- }
- if (item_9 == null) {
- i = " ";
- }
- else {
- i = "9";
- validSlots.add('9');
- validSlots.add(item_9);
- }
+ ArrayList<Object> validSlots = new ArrayList<Object>();
+ String a,b,c,d,e,f,g,h,i;
+ if (item_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(item_1);}
+ if (item_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(item_2);}
+ if (item_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(item_3);}
+ if (item_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(item_4);}
+ if (item_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(item_5);}
+ if (item_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(item_6);}
+ if (item_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(item_7);}
+ if (item_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(item_8);}
+ if (item_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(item_9);}
- final String lineOne = a + b + c;
- final String lineTwo = d + e + f;
- final String lineThree = g + h + i;
+ String lineOne = a+b+c;
+ String lineTwo = d+e+f;
+ String lineThree = g+h+i;
validSlots.add(0, lineOne);
validSlots.add(1, lineTwo);
validSlots.add(2, lineThree);
try {
- RecipeUtils.recipeBuilder(validSlots.toArray(), outputItem.copy());
- RECIPES_MTWRAPPER.MT_RECIPES_LOADED++;
+ RecipeUtils.recipeBuilder((Object[]) validSlots.toArray(), outputItem.copy());
+ MT_RECIPES_LOADED++;
}
- catch (NullPointerException | ClassCastException k) {
+ catch(NullPointerException | ClassCastException k){
k.getMessage();
k.getClass();
k.printStackTrace();
k.getLocalizedMessage();
- Utils.LOG_WARNING("@@@: Invalid Recipe detected for: " + ((var) item_Output).getsanitizedName());
- RECIPES_MTWRAPPER.MT_RECIPES_FAILED++;
- }
+ Utils.LOG_WARNING("@@@: Invalid Recipe detected for: "+((var) item_Output).getsanitizedName());
+ MT_RECIPES_FAILED++;
+ }
}
- public static void addShapeless() {
+ public static void addShapeless(){
}
- public static void run() {
- /*
- * addShaped(button.getStack(2), null, stoneBlock, null, null,
- * stoneBlock, null, null, null, null);
- */
- /*
- * addShaped(stoneStick.getStack(1), stoneBlock, null, null, stoneBlock,
- * null, null, null, null, null);
- */
- RECIPES_MTWRAPPER.addShaped(RECIPES_MTWRAPPER.chestWood.getStack(2), RECIPES_MTWRAPPER.logWood,
- RECIPES_MTWRAPPER.logWood, RECIPES_MTWRAPPER.logWood, RECIPES_MTWRAPPER.logWood, null,
- RECIPES_MTWRAPPER.logWood, RECIPES_MTWRAPPER.logWood, RECIPES_MTWRAPPER.logWood,
- RECIPES_MTWRAPPER.logWood);
- RECIPES_MTWRAPPER.addShaped(RECIPES_MTWRAPPER.chestWood.getStack(4), RECIPES_MTWRAPPER.logWood,
- RECIPES_MTWRAPPER.logWood, RECIPES_MTWRAPPER.logWood, RECIPES_MTWRAPPER.logWood, RECIPES_MTWRAPPER.saw,
- RECIPES_MTWRAPPER.logWood, RECIPES_MTWRAPPER.logWood, RECIPES_MTWRAPPER.logWood,
- RECIPES_MTWRAPPER.logWood);
- // Recipe Fixes
- // remove(sensorDaylight);
- RECIPES_MTWRAPPER.addShaped(RECIPES_MTWRAPPER.sensorDaylight.getStack(1), RECIPES_MTWRAPPER.glass,
- RECIPES_MTWRAPPER.glass, RECIPES_MTWRAPPER.glass, RECIPES_MTWRAPPER.gemNetherQuartz,
- RECIPES_MTWRAPPER.gemNetherQuartz, RECIPES_MTWRAPPER.gemNetherQuartz, RECIPES_MTWRAPPER.slabWood,
- RECIPES_MTWRAPPER.slabWood, RECIPES_MTWRAPPER.slabWood);
- /*
- * addShaped(ironBars .getStack( 8), null, "<ore:craftingToolWrench>",
- * null, "<ore:stickAnyIron>", "<ore:stickAnyIron>",
- * "<ore:stickAnyIron>", "<ore:stickAnyIron>", "<ore:stickAnyIron>",
- * "<ore:stickAnyIron>");
- */
- }
+
}
+
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java
index 6df9618927..e3f47844c7 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java
@@ -1,6 +1,10 @@
package gtPlusPlus.core.recipe;
-import gregtech.api.enums.*;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
@@ -8,371 +12,334 @@ import gtPlusPlus.core.util.recipe.RecipeUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
public class RECIPES_MachineComponents {
+
+ //Wire
+ static String wireTier6 = "wireGt08NiobiumTitanium";
+ static String wireTier7 = "wireGt08Osmium";
+ static String wireTier8 = "wireGt08Naquadah";
+ static String wireTier9 = "wireGt08Superconductor";
+ static String wireTier10 = "wireGt16Superconductor";
- // Wire
- static String wireTier6 = "wireGt08NiobiumTitanium";
- static String wireTier7 = "wireGt08Osmium";
- static String wireTier8 = "wireGt08Naquadah";
- static String wireTier9 = "wireGt08Superconductor";
- static String wireTier10 = "wireGt16Superconductor";
+ //Wire
+ static String cableTier6 = "cableGt04Tungsten";
+ static String cableTier7 = "cableGt04NiobiumTitanium";
+ static String cableTier8 = "cableGt04Osmium";
+ static String cableTier9 = "cableGt04Naquadah";
+ static String cableTier10 = "wireGt08Superconductor";
- // Wire
- static String cableTier6 = "cableGt04Tungsten";
- static String cableTier7 = "cableGt04NiobiumTitanium";
- static String cableTier8 = "cableGt04Osmium";
- static String cableTier9 = "cableGt04Naquadah";
- static String cableTier10 = "wireGt08Superconductor";
+ //Plates
+ static String plateTier7 = "plateChrome";
+ static String plateTier8 = "plateIridium";
+ static String plateTier9 = "plateOsmium";
+ static String plateTier10 = "plateNeutronium";
- // Plates
- static String plateTier7 = "plateChrome";
- static String plateTier8 = "plateIridium";
- static String plateTier9 = "plateOsmium";
- static String plateTier10 = "plateNeutronium";
+ //rods
+ static String rodTier7a = "stickChrome";
+ static String rodTier8a = "stickIridium";
+ static String rodTier9a = "stickOsmium";
+ static String rodTier10a = "stickNeutronium";
+ static String rodTier7b = "stickPlatinum";
+ static String rodTier8b = "stickChrome";
+ static String rodTier9b = "stickIridium";
+ static String rodTier10b = "stickOsmium";
+ static String rodTier7c = "stickTitanium";
+ static String rodTier8c = "stickTungstenSteel";
+ static String rodTier9c = "stickNaquadah";
+ static String rodTier10c = "stickOsmium";
- // rods
- static String rodTier7a = "stickChrome";
- static String rodTier8a = "stickIridium";
- static String rodTier9a = "stickOsmium";
- static String rodTier10a = "stickNeutronium";
- static String rodTier7b = "stickPlatinum";
- static String rodTier8b = "stickChrome";
- static String rodTier9b = "stickIridium";
- static String rodTier10b = "stickOsmium";
- static String rodTier7c = "stickTitanium";
- static String rodTier8c = "stickTungstenSteel";
- static String rodTier9c = "stickNaquadah";
- static String rodTier10c = "stickOsmium";
+ //Screws
+ static String screwTier7 = "screwChrome";
+ static String screwTier8 = "screwIridium";
+ static String screwTier9 = "screwOsmium";
+ static String screwTier10 = "screwNeutronium";
- // Screws
- static String screwTier7 = "screwChrome";
- static String screwTier8 = "screwIridium";
- static String screwTier9 = "screwOsmium";
- static String screwTier10 = "screwNeutronium";
+ //Rotors
+ static String rotorTier7 = "rotorChrome";
+ static String rotorTier8 = "rotorIridium";
+ static String rotorTier9 = "rotorOsmium";
+ static String rotorTier10 = "rotorNeutronium";
- // Rotors
- static String rotorTier7 = "rotorChrome";
- static String rotorTier8 = "rotorIridium";
- static String rotorTier9 = "rotorOsmium";
- static String rotorTier10 = "rotorNeutronium";
+ //Fluid Pipe
+ static String pipeTier7 = "pipeHugeSteel";
+ static String pipeTier8 = "pipeHugeStainlessSteel";
+ static String pipeTier9 = "pipeHugeTitanium";
+ static String pipeTier10 = "pipeHugeTungstenSteel";
- // Fluid Pipe
- static String pipeTier7 = "pipeHugeSteel";
- static String pipeTier8 = "pipeHugeStainlessSteel";
- static String pipeTier9 = "pipeHugeTitanium";
- static String pipeTier10 = "pipeHugeTungstenSteel";
+ //Rubber Ring/Plate
+ static String itemRubberRing = "ringRubber";
+ static String plateRubber = "plateRubber";
- // Rubber Ring/Plate
- static String itemRubberRing = "ringRubber";
- static String plateRubber = "plateRubber";
+ //Circuits
+ static String circuitTier6 = "circuitMaster";
+ static String circuitTier7 = "circuitUltimate";
+ static String circuitTier8 = "circuitSymbiotic";
+ static String circuitTier9 = "circuitNeutronic";
+ static String circuitTier10 = "circuitQuantum";
- // Circuits
- static String circuitTier6 = "circuitMaster";
- static String circuitTier7 = "circuitUltimate";
- static String circuitTier8 = "circuitSymbiotic";
- static String circuitTier9 = "circuitNeutronic";
- static String circuitTier10 = "circuitQuantum";
+ //small gears
+ static String smallGearTier7 = "gearGtSmallChrome";
+ static String smallGearTier8 = "gearGtSmallIridium";
+ static String smallGearTier9 = "gearGtSmallOsmium";
+ static String smallGearTier10 = "gearGtSmallNeutronium";
- // small gears
- static String smallGearTier7 = "gearGtSmallChrome";
- static String smallGearTier8 = "gearGtSmallIridium";
- static String smallGearTier9 = "gearGtSmallOsmium";
- static String smallGearTier10 = "gearGtSmallNeutronium";
+ //Crafting Tools
+ static String craftingToolWrench = "craftingToolWrench";
+ static String craftingToolScrewdriver = "craftingToolScrewdriver";
- // Crafting Tools
- static String craftingToolWrench = "craftingToolWrench";
- static String craftingToolScrewdriver = "craftingToolScrewdriver";
-
- private static void GregtechMachinePhase() {
- Utils.LOG_INFO("Adding Gregtech machine recipes for the circuits.");
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L),
- GregtechItemList.Circuit_Parts_Wiring_IV.get(4L, new Object[0]),
- GregtechItemList.Circuit_Board_IV.get(1L, new Object[0]), 32, 256);
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L),
- GregtechItemList.Circuit_Parts_Wiring_LuV.get(4L, new Object[0]),
- GregtechItemList.Circuit_Board_LuV.get(1L, new Object[0]), 64, 512);
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 2L),
- GregtechItemList.Circuit_Parts_Wiring_ZPM.get(4L, new Object[0]),
- GregtechItemList.Circuit_Board_ZPM.get(1L, new Object[0]), 96, 1024);
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L),
- GregtechItemList.Circuit_Parts_Crystal_Chip_IV.get(3L, new Object[0]),
- GregtechItemList.Circuit_Parts_IV.get(1L, new Object[0]), 32, 512);
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L),
- GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.get(3L, new Object[0]),
- GregtechItemList.Circuit_Parts_LuV.get(1L, new Object[0]), 64, 1024);
- GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L),
- GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.get(3L, new Object[0]),
- GregtechItemList.Circuit_Parts_ZPM.get(1L, new Object[0]), 96, 2048);
- GT_Values.RA.addForgeHammerRecipe(ItemList.Circuit_Master.get(1L, new Object[0]),
- GregtechItemList.Circuit_Parts_Crystal_Chip_IV.get(5L, new Object[0]), 32, 256);
- GT_Values.RA.addForgeHammerRecipe(GregtechItemList.Circuit_IV.get(1L, new Object[0]),
- GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.get(5L, new Object[0]), 64, 512);
- GT_Values.RA.addForgeHammerRecipe(GregtechItemList.Circuit_LuV.get(1L, new Object[0]),
- GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.get(5L, new Object[0]), 128, 1024);
- for (final Materials tMat : Materials.values()) {
- if (tMat.mStandardMoltenFluid != null && tMat.contains(SubTag.SOLDERING_MATERIAL)) {
- final int tMultiplier = tMat.contains(SubTag.SOLDERING_MATERIAL_GOOD) ? 1
- : tMat.contains(SubTag.SOLDERING_MATERIAL_BAD) ? 4 : 2;
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_IV.get(1L, new Object[0]),
- GregtechItemList.Circuit_Parts_IV.get(1L, new Object[0]),
- tMat.getMolten(144L * tMultiplier / 4L), GregtechItemList.Circuit_IV.get(1L, new Object[0]), 32,
- 512);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_LuV.get(1L, new Object[0]),
- GregtechItemList.Circuit_Parts_LuV.get(1L, new Object[0]),
- tMat.getMolten(144L * tMultiplier / 4L), GregtechItemList.Circuit_LuV.get(1L, new Object[0]),
- 64, 1024);
- GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_ZPM.get(1L, new Object[0]),
- GregtechItemList.Circuit_Parts_ZPM.get(1L, new Object[0]),
- tMat.getMolten(144L * tMultiplier / 4L), GregtechItemList.Circuit_ZPM.get(1L, new Object[0]),
- 96, 2048);
-
- }
- }
- }
-
- private static void onlyMaxComponents() {
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier10, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.rodTier10a, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.rodTier10b, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.rodTier10a, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.cableTier10, RECIPE_CONSTANTS.electricMotor_MAX);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier10,
- RECIPES_MachineComponents.rotorTier10, RECIPES_MachineComponents.itemRubberRing,
- RECIPES_MachineComponents.craftingToolScrewdriver, RECIPES_MachineComponents.pipeTier10,
- RECIPES_MachineComponents.craftingToolWrench, RECIPES_MachineComponents.itemRubberRing,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPES_MachineComponents.cableTier10,
- RECIPE_CONSTANTS.electricPump_MAX);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateTier10,
- RECIPES_MachineComponents.plateTier10, RECIPES_MachineComponents.plateTier10,
- RECIPES_MachineComponents.cableTier10, RECIPES_MachineComponents.rodTier10a,
- RECIPES_MachineComponents.rodTier10a, RECIPES_MachineComponents.cableTier10,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPES_MachineComponents.smallGearTier10,
- RECIPE_CONSTANTS.electricPiston_MAX);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier10,
- RECIPES_MachineComponents.cableTier10, RECIPES_MachineComponents.cableTier10,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPES_MachineComponents.rodTier10a,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPE_CONSTANTS.electricPiston_MAX,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.rodTier10a,
- RECIPE_CONSTANTS.robotArm_MAX);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateRubber,
- RECIPES_MachineComponents.plateRubber, RECIPES_MachineComponents.plateRubber,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPES_MachineComponents.cableTier10,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPES_MachineComponents.plateRubber,
- RECIPES_MachineComponents.plateRubber, RECIPES_MachineComponents.plateRubber,
- RECIPE_CONSTANTS.conveyorModule_MAX);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.rodTier10c, RECIPES_MachineComponents.rodTier10c,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.cableTier10,
- RECIPES_MachineComponents.circuitTier9, RECIPES_MachineComponents.rodTier10c,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.cableTier10,
- RECIPES_MachineComponents.rodTier10c, RECIPE_CONSTANTS.emitter_MAX);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.circuitTier9,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.wireTier10,
- RECIPE_CONSTANTS.fieldGenerator_MAX);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateTier10, null,
- RECIPES_MachineComponents.circuitTier9, RECIPES_MachineComponents.plateTier10,
- RECIPES_MachineComponents.rodTier10c, null, RECIPES_MachineComponents.circuitTier10,
- RECIPES_MachineComponents.plateTier10, RECIPES_MachineComponents.plateTier10,
- RECIPE_CONSTANTS.sensor_MAX);
- }
-
- public static final void RECIPES_LOAD() {
- Utils.LOG_INFO("Loading Recipes for the Various Circuits and Machine components.");
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- RECIPES_MachineComponents.run();
+ public static final void RECIPES_LOAD(){
+ Utils.LOG_INFO("Loading Recipes for the Various Circuits and Machine components.");
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ run();
}
else {
- RECIPES_MachineComponents.onlyMaxComponents();
+ onlyMaxComponents();
}
- RECIPES_MachineComponents.GregtechMachinePhase();
+ GregtechMachinePhase();
}
- private static void run() {
- // Electric Motors
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier7, RECIPES_MachineComponents.wireTier7,
- RECIPES_MachineComponents.rodTier7a, RECIPES_MachineComponents.wireTier7,
- RECIPES_MachineComponents.rodTier7b, RECIPES_MachineComponents.wireTier7,
- RECIPES_MachineComponents.rodTier7a, RECIPES_MachineComponents.wireTier7,
- RECIPES_MachineComponents.cableTier7, RECIPE_CONSTANTS.electricMotor_LuV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier8, RECIPES_MachineComponents.wireTier8,
- RECIPES_MachineComponents.rodTier8a, RECIPES_MachineComponents.wireTier8,
- RECIPES_MachineComponents.rodTier8b, RECIPES_MachineComponents.wireTier8,
- RECIPES_MachineComponents.rodTier8a, RECIPES_MachineComponents.wireTier8,
- RECIPES_MachineComponents.cableTier8, RECIPE_CONSTANTS.electricMotor_ZPM);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier9, RECIPES_MachineComponents.wireTier9,
- RECIPES_MachineComponents.rodTier9a, RECIPES_MachineComponents.wireTier9,
- RECIPES_MachineComponents.rodTier9b, RECIPES_MachineComponents.wireTier9,
- RECIPES_MachineComponents.rodTier9a, RECIPES_MachineComponents.wireTier9,
- RECIPES_MachineComponents.cableTier9, RECIPE_CONSTANTS.electricMotor_UV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier10, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.rodTier10a, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.rodTier10b, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.rodTier10a, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.cableTier10, RECIPE_CONSTANTS.electricMotor_MAX);
+ private static void run(){
+ //Electric Motors
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier7, wireTier7, rodTier7a,
+ wireTier7, rodTier7b, wireTier7,
+ rodTier7a, wireTier7, cableTier7,
+ RECIPE_CONSTANTS.electricMotor_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier8, wireTier8, rodTier8a,
+ wireTier8, rodTier8b, wireTier8,
+ rodTier8a, wireTier8, cableTier8,
+ RECIPE_CONSTANTS.electricMotor_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier9, wireTier9, rodTier9a,
+ wireTier9, rodTier9b, wireTier9,
+ rodTier9a, wireTier9, cableTier9,
+ RECIPE_CONSTANTS.electricMotor_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10, wireTier10, rodTier10a,
+ wireTier10, rodTier10b, wireTier10,
+ rodTier10a, wireTier10, cableTier10,
+ RECIPE_CONSTANTS.electricMotor_MAX);
- // Electric Pump
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier7, RECIPES_MachineComponents.rotorTier7,
- RECIPES_MachineComponents.itemRubberRing, RECIPES_MachineComponents.craftingToolScrewdriver,
- RECIPES_MachineComponents.pipeTier7, RECIPES_MachineComponents.craftingToolWrench,
- RECIPES_MachineComponents.itemRubberRing, RECIPE_CONSTANTS.electricMotor_LuV,
- RECIPES_MachineComponents.cableTier7, RECIPE_CONSTANTS.electricPump_LuV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier8, RECIPES_MachineComponents.rotorTier8,
- RECIPES_MachineComponents.itemRubberRing, RECIPES_MachineComponents.craftingToolScrewdriver,
- RECIPES_MachineComponents.pipeTier8, RECIPES_MachineComponents.craftingToolWrench,
- RECIPES_MachineComponents.itemRubberRing, RECIPE_CONSTANTS.electricMotor_ZPM,
- RECIPES_MachineComponents.cableTier8, RECIPE_CONSTANTS.electricPump_ZPM);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier9, RECIPES_MachineComponents.rotorTier9,
- RECIPES_MachineComponents.itemRubberRing, RECIPES_MachineComponents.craftingToolScrewdriver,
- RECIPES_MachineComponents.pipeTier9, RECIPES_MachineComponents.craftingToolWrench,
- RECIPES_MachineComponents.itemRubberRing, RECIPE_CONSTANTS.electricMotor_UV,
- RECIPES_MachineComponents.cableTier9, RECIPE_CONSTANTS.electricPump_UV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier10,
- RECIPES_MachineComponents.rotorTier10, RECIPES_MachineComponents.itemRubberRing,
- RECIPES_MachineComponents.craftingToolScrewdriver, RECIPES_MachineComponents.pipeTier10,
- RECIPES_MachineComponents.craftingToolWrench, RECIPES_MachineComponents.itemRubberRing,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPES_MachineComponents.cableTier10,
+ //Electric Pump
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier7, rotorTier7, itemRubberRing,
+ craftingToolScrewdriver, pipeTier7, craftingToolWrench,
+ itemRubberRing, RECIPE_CONSTANTS.electricMotor_LuV, cableTier7,
+ RECIPE_CONSTANTS.electricPump_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier8, rotorTier8, itemRubberRing,
+ craftingToolScrewdriver, pipeTier8, craftingToolWrench,
+ itemRubberRing, RECIPE_CONSTANTS.electricMotor_ZPM, cableTier8,
+ RECIPE_CONSTANTS.electricPump_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier9, rotorTier9, itemRubberRing,
+ craftingToolScrewdriver, pipeTier9, craftingToolWrench,
+ itemRubberRing, RECIPE_CONSTANTS.electricMotor_UV, cableTier9,
+ RECIPE_CONSTANTS.electricPump_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10, rotorTier10, itemRubberRing,
+ craftingToolScrewdriver, pipeTier10, craftingToolWrench,
+ itemRubberRing, RECIPE_CONSTANTS.electricMotor_MAX, cableTier10,
RECIPE_CONSTANTS.electricPump_MAX);
- // Electric Pump
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateTier7, RECIPES_MachineComponents.plateTier7,
- RECIPES_MachineComponents.plateTier7, RECIPES_MachineComponents.cableTier7,
- RECIPES_MachineComponents.rodTier7a, RECIPES_MachineComponents.rodTier7a,
- RECIPES_MachineComponents.cableTier7, RECIPE_CONSTANTS.electricMotor_LuV,
- RECIPES_MachineComponents.smallGearTier7, RECIPE_CONSTANTS.electricPiston_LuV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateTier8, RECIPES_MachineComponents.plateTier8,
- RECIPES_MachineComponents.plateTier8, RECIPES_MachineComponents.cableTier8,
- RECIPES_MachineComponents.rodTier8a, RECIPES_MachineComponents.rodTier8a,
- RECIPES_MachineComponents.cableTier8, RECIPE_CONSTANTS.electricMotor_ZPM,
- RECIPES_MachineComponents.smallGearTier8, RECIPE_CONSTANTS.electricPiston_ZPM);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateTier9, RECIPES_MachineComponents.plateTier9,
- RECIPES_MachineComponents.plateTier9, RECIPES_MachineComponents.cableTier9,
- RECIPES_MachineComponents.rodTier9a, RECIPES_MachineComponents.rodTier9a,
- RECIPES_MachineComponents.cableTier9, RECIPE_CONSTANTS.electricMotor_UV,
- RECIPES_MachineComponents.smallGearTier9, RECIPE_CONSTANTS.electricPiston_UV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateTier10,
- RECIPES_MachineComponents.plateTier10, RECIPES_MachineComponents.plateTier10,
- RECIPES_MachineComponents.cableTier10, RECIPES_MachineComponents.rodTier10a,
- RECIPES_MachineComponents.rodTier10a, RECIPES_MachineComponents.cableTier10,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPES_MachineComponents.smallGearTier10,
+ //Electric Pump
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier7, plateTier7, plateTier7,
+ cableTier7, rodTier7a, rodTier7a,
+ cableTier7, RECIPE_CONSTANTS.electricMotor_LuV, smallGearTier7,
+ RECIPE_CONSTANTS.electricPiston_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier8, plateTier8, plateTier8,
+ cableTier8, rodTier8a, rodTier8a,
+ cableTier8, RECIPE_CONSTANTS.electricMotor_ZPM, smallGearTier8,
+ RECIPE_CONSTANTS.electricPiston_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier9, plateTier9, plateTier9,
+ cableTier9, rodTier9a, rodTier9a,
+ cableTier9, RECIPE_CONSTANTS.electricMotor_UV, smallGearTier9,
+ RECIPE_CONSTANTS.electricPiston_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier10, plateTier10, plateTier10,
+ cableTier10, rodTier10a, rodTier10a,
+ cableTier10, RECIPE_CONSTANTS.electricMotor_MAX, smallGearTier10,
RECIPE_CONSTANTS.electricPiston_MAX);
- // Robot Arms
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier7, RECIPES_MachineComponents.cableTier7,
- RECIPES_MachineComponents.cableTier7, RECIPE_CONSTANTS.electricMotor_LuV,
- RECIPES_MachineComponents.rodTier7a, RECIPE_CONSTANTS.electricMotor_LuV,
- RECIPE_CONSTANTS.electricPiston_LuV, RECIPES_MachineComponents.circuitTier7,
- RECIPES_MachineComponents.rodTier7a, RECIPE_CONSTANTS.robotArm_LuV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier8, RECIPES_MachineComponents.cableTier8,
- RECIPES_MachineComponents.cableTier8, RECIPE_CONSTANTS.electricMotor_ZPM,
- RECIPES_MachineComponents.rodTier8a, RECIPE_CONSTANTS.electricMotor_ZPM,
- RECIPE_CONSTANTS.electricPiston_ZPM, RECIPES_MachineComponents.circuitTier8,
- RECIPES_MachineComponents.rodTier8a, RECIPE_CONSTANTS.robotArm_ZPM);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier9, RECIPES_MachineComponents.cableTier9,
- RECIPES_MachineComponents.cableTier9, RECIPE_CONSTANTS.electricMotor_UV,
- RECIPES_MachineComponents.rodTier9a, RECIPE_CONSTANTS.electricMotor_UV,
- RECIPE_CONSTANTS.electricPiston_UV, RECIPES_MachineComponents.circuitTier9,
- RECIPES_MachineComponents.rodTier9a, RECIPE_CONSTANTS.robotArm_UV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.cableTier10,
- RECIPES_MachineComponents.cableTier10, RECIPES_MachineComponents.cableTier10,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPES_MachineComponents.rodTier10a,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPE_CONSTANTS.electricPiston_MAX,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.rodTier10a,
+ //Robot Arms
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier7, cableTier7, cableTier7,
+ RECIPE_CONSTANTS.electricMotor_LuV, rodTier7a, RECIPE_CONSTANTS.electricMotor_LuV,
+ RECIPE_CONSTANTS.electricPiston_LuV, circuitTier7, rodTier7a,
+ RECIPE_CONSTANTS.robotArm_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier8, cableTier8, cableTier8,
+ RECIPE_CONSTANTS.electricMotor_ZPM, rodTier8a, RECIPE_CONSTANTS.electricMotor_ZPM,
+ RECIPE_CONSTANTS.electricPiston_ZPM, circuitTier8, rodTier8a,
+ RECIPE_CONSTANTS.robotArm_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier9, cableTier9, cableTier9,
+ RECIPE_CONSTANTS.electricMotor_UV, rodTier9a, RECIPE_CONSTANTS.electricMotor_UV,
+ RECIPE_CONSTANTS.electricPiston_UV, circuitTier9, rodTier9a,
+ RECIPE_CONSTANTS.robotArm_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10, cableTier10, cableTier10,
+ RECIPE_CONSTANTS.electricMotor_MAX, rodTier10a, RECIPE_CONSTANTS.electricMotor_MAX,
+ RECIPE_CONSTANTS.electricPiston_MAX, circuitTier10, rodTier10a,
RECIPE_CONSTANTS.robotArm_MAX);
- // Conveyor Modules
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateRubber,
- RECIPES_MachineComponents.plateRubber, RECIPES_MachineComponents.plateRubber,
- RECIPE_CONSTANTS.electricMotor_LuV, RECIPES_MachineComponents.cableTier7,
- RECIPE_CONSTANTS.electricMotor_LuV, RECIPES_MachineComponents.plateRubber,
- RECIPES_MachineComponents.plateRubber, RECIPES_MachineComponents.plateRubber,
+ //Conveyor Modules
+ RecipeUtils.addShapedGregtechRecipe(
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.electricMotor_LuV, cableTier7, RECIPE_CONSTANTS.electricMotor_LuV,
+ plateRubber, plateRubber, plateRubber,
RECIPE_CONSTANTS.conveyorModule_LuV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateRubber,
- RECIPES_MachineComponents.plateRubber, RECIPES_MachineComponents.plateRubber,
- RECIPE_CONSTANTS.electricMotor_ZPM, RECIPES_MachineComponents.cableTier8,
- RECIPE_CONSTANTS.electricMotor_ZPM, RECIPES_MachineComponents.plateRubber,
- RECIPES_MachineComponents.plateRubber, RECIPES_MachineComponents.plateRubber,
+ RecipeUtils.addShapedGregtechRecipe(
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.electricMotor_ZPM, cableTier8, RECIPE_CONSTANTS.electricMotor_ZPM,
+ plateRubber, plateRubber, plateRubber,
RECIPE_CONSTANTS.conveyorModule_ZPM);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateRubber,
- RECIPES_MachineComponents.plateRubber, RECIPES_MachineComponents.plateRubber,
- RECIPE_CONSTANTS.electricMotor_UV, RECIPES_MachineComponents.cableTier9,
- RECIPE_CONSTANTS.electricMotor_UV, RECIPES_MachineComponents.plateRubber,
- RECIPES_MachineComponents.plateRubber, RECIPES_MachineComponents.plateRubber,
+ RecipeUtils.addShapedGregtechRecipe(
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.electricMotor_UV, cableTier9, RECIPE_CONSTANTS.electricMotor_UV,
+ plateRubber, plateRubber, plateRubber,
RECIPE_CONSTANTS.conveyorModule_UV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateRubber,
- RECIPES_MachineComponents.plateRubber, RECIPES_MachineComponents.plateRubber,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPES_MachineComponents.cableTier10,
- RECIPE_CONSTANTS.electricMotor_MAX, RECIPES_MachineComponents.plateRubber,
- RECIPES_MachineComponents.plateRubber, RECIPES_MachineComponents.plateRubber,
+ RecipeUtils.addShapedGregtechRecipe(
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.electricMotor_MAX, cableTier10, RECIPE_CONSTANTS.electricMotor_MAX,
+ plateRubber, plateRubber, plateRubber,
RECIPE_CONSTANTS.conveyorModule_MAX);
- // Emitter Modules
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.rodTier7c, RECIPES_MachineComponents.rodTier7c,
- RECIPES_MachineComponents.circuitTier7, RECIPES_MachineComponents.cableTier7,
- RECIPES_MachineComponents.circuitTier6, RECIPES_MachineComponents.rodTier7c,
- RECIPES_MachineComponents.circuitTier7, RECIPES_MachineComponents.cableTier7,
- RECIPES_MachineComponents.rodTier7c, RECIPE_CONSTANTS.emitter_LuV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.rodTier8c, RECIPES_MachineComponents.rodTier8c,
- RECIPES_MachineComponents.circuitTier8, RECIPES_MachineComponents.cableTier8,
- RECIPES_MachineComponents.circuitTier7, RECIPES_MachineComponents.rodTier8c,
- RECIPES_MachineComponents.circuitTier8, RECIPES_MachineComponents.cableTier8,
- RECIPES_MachineComponents.rodTier8c, RECIPE_CONSTANTS.emitter_ZPM);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.rodTier9c, RECIPES_MachineComponents.rodTier9c,
- RECIPES_MachineComponents.circuitTier9, RECIPES_MachineComponents.cableTier9,
- RECIPES_MachineComponents.circuitTier8, RECIPES_MachineComponents.rodTier9c,
- RECIPES_MachineComponents.circuitTier9, RECIPES_MachineComponents.cableTier9,
- RECIPES_MachineComponents.rodTier9c, RECIPE_CONSTANTS.emitter_UV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.rodTier10c, RECIPES_MachineComponents.rodTier10c,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.cableTier10,
- RECIPES_MachineComponents.circuitTier9, RECIPES_MachineComponents.rodTier10c,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.cableTier10,
- RECIPES_MachineComponents.rodTier10c, RECIPE_CONSTANTS.emitter_MAX);
+ //Emitter Modules
+ RecipeUtils.addShapedGregtechRecipe(
+ rodTier7c, rodTier7c, circuitTier7,
+ cableTier7, circuitTier6, rodTier7c,
+ circuitTier7, cableTier7, rodTier7c,
+ RECIPE_CONSTANTS.emitter_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ rodTier8c, rodTier8c, circuitTier8,
+ cableTier8, circuitTier7, rodTier8c,
+ circuitTier8, cableTier8, rodTier8c,
+ RECIPE_CONSTANTS.emitter_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ rodTier9c, rodTier9c, circuitTier9,
+ cableTier9, circuitTier8, rodTier9c,
+ circuitTier9, cableTier9, rodTier9c,
+ RECIPE_CONSTANTS.emitter_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ rodTier10c, rodTier10c, circuitTier10,
+ cableTier10, circuitTier9, rodTier10c,
+ circuitTier10, cableTier10, rodTier10c,
+ RECIPE_CONSTANTS.emitter_MAX);
- // Field Generator Modules
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.wireTier7, RECIPES_MachineComponents.circuitTier7,
- RECIPES_MachineComponents.wireTier7, RECIPES_MachineComponents.circuitTier7,
- RECIPES_MachineComponents.circuitTier6, RECIPES_MachineComponents.circuitTier7,
- RECIPES_MachineComponents.wireTier7, RECIPES_MachineComponents.circuitTier7,
- RECIPES_MachineComponents.wireTier7, RECIPE_CONSTANTS.fieldGenerator_LuV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.wireTier8, RECIPES_MachineComponents.circuitTier8,
- RECIPES_MachineComponents.wireTier8, RECIPES_MachineComponents.circuitTier8,
- RECIPES_MachineComponents.circuitTier7, RECIPES_MachineComponents.circuitTier8,
- RECIPES_MachineComponents.wireTier8, RECIPES_MachineComponents.circuitTier8,
- RECIPES_MachineComponents.wireTier8, RECIPE_CONSTANTS.fieldGenerator_ZPM);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.wireTier9, RECIPES_MachineComponents.circuitTier9,
- RECIPES_MachineComponents.wireTier9, RECIPES_MachineComponents.circuitTier9,
- RECIPES_MachineComponents.circuitTier8, RECIPES_MachineComponents.circuitTier9,
- RECIPES_MachineComponents.wireTier9, RECIPES_MachineComponents.circuitTier9,
- RECIPES_MachineComponents.wireTier9, RECIPE_CONSTANTS.fieldGenerator_UV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.circuitTier9,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.wireTier10,
- RECIPES_MachineComponents.circuitTier10, RECIPES_MachineComponents.wireTier10,
+ //Field Generator Modules
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier7, circuitTier7, wireTier7,
+ circuitTier7, circuitTier6, circuitTier7,
+ wireTier7, circuitTier7, wireTier7,
+ RECIPE_CONSTANTS.fieldGenerator_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier8, circuitTier8, wireTier8,
+ circuitTier8, circuitTier7, circuitTier8,
+ wireTier8, circuitTier8, wireTier8,
+ RECIPE_CONSTANTS.fieldGenerator_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier9, circuitTier9, wireTier9,
+ circuitTier9, circuitTier8, circuitTier9,
+ wireTier9, circuitTier9, wireTier9,
+ RECIPE_CONSTANTS.fieldGenerator_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier10, circuitTier10, wireTier10,
+ circuitTier10, circuitTier9, circuitTier10,
+ wireTier10, circuitTier10, wireTier10,
RECIPE_CONSTANTS.fieldGenerator_MAX);
- // Sensor Modules
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateTier7, null,
- RECIPES_MachineComponents.circuitTier6, RECIPES_MachineComponents.plateTier7,
- RECIPES_MachineComponents.rodTier7c, null, RECIPES_MachineComponents.circuitTier7,
- RECIPES_MachineComponents.plateTier7, RECIPES_MachineComponents.plateTier7,
+ //Sensor Modules
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier7, null, circuitTier6,
+ plateTier7, rodTier7c, null,
+ circuitTier7, plateTier7, plateTier7,
RECIPE_CONSTANTS.sensor_LuV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateTier8, null,
- RECIPES_MachineComponents.circuitTier7, RECIPES_MachineComponents.plateTier8,
- RECIPES_MachineComponents.rodTier8c, null, RECIPES_MachineComponents.circuitTier8,
- RECIPES_MachineComponents.plateTier8, RECIPES_MachineComponents.plateTier8,
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier8, null, circuitTier7,
+ plateTier8, rodTier8c, null,
+ circuitTier8, plateTier8, plateTier8,
RECIPE_CONSTANTS.sensor_ZPM);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateTier9, null,
- RECIPES_MachineComponents.circuitTier8, RECIPES_MachineComponents.plateTier9,
- RECIPES_MachineComponents.rodTier9c, null, RECIPES_MachineComponents.circuitTier9,
- RECIPES_MachineComponents.plateTier9, RECIPES_MachineComponents.plateTier9, RECIPE_CONSTANTS.sensor_UV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_MachineComponents.plateTier10, null,
- RECIPES_MachineComponents.circuitTier9, RECIPES_MachineComponents.plateTier10,
- RECIPES_MachineComponents.rodTier10c, null, RECIPES_MachineComponents.circuitTier10,
- RECIPES_MachineComponents.plateTier10, RECIPES_MachineComponents.plateTier10,
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier9, null, circuitTier8,
+ plateTier9, rodTier9c, null,
+ circuitTier9, plateTier9, plateTier9,
+ RECIPE_CONSTANTS.sensor_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier10, null, circuitTier9,
+ plateTier10, rodTier10c, null,
+ circuitTier10, plateTier10, plateTier10,
RECIPE_CONSTANTS.sensor_MAX);
Utils.LOG_INFO("Done loading recipes for the Various machine components.");
+ }
+
+ private static void onlyMaxComponents(){
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10, wireTier10, rodTier10a,
+ wireTier10, rodTier10b, wireTier10,
+ rodTier10a, wireTier10, cableTier10,
+ RECIPE_CONSTANTS.electricMotor_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10, rotorTier10, itemRubberRing,
+ craftingToolScrewdriver, pipeTier10, craftingToolWrench,
+ itemRubberRing, RECIPE_CONSTANTS.electricMotor_MAX, cableTier10,
+ RECIPE_CONSTANTS.electricPump_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier10, plateTier10, plateTier10,
+ cableTier10, rodTier10a, rodTier10a,
+ cableTier10, RECIPE_CONSTANTS.electricMotor_MAX, smallGearTier10,
+ RECIPE_CONSTANTS.electricPiston_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ cableTier10, cableTier10, cableTier10,
+ RECIPE_CONSTANTS.electricMotor_MAX, rodTier10a, RECIPE_CONSTANTS.electricMotor_MAX,
+ RECIPE_CONSTANTS.electricPiston_MAX, circuitTier10, rodTier10a,
+ RECIPE_CONSTANTS.robotArm_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.electricMotor_MAX, cableTier10, RECIPE_CONSTANTS.electricMotor_MAX,
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.conveyorModule_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ rodTier10c, rodTier10c, circuitTier10,
+ cableTier10, circuitTier9, rodTier10c,
+ circuitTier10, cableTier10, rodTier10c,
+ RECIPE_CONSTANTS.emitter_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier10, circuitTier10, wireTier10,
+ circuitTier10, circuitTier9, circuitTier10,
+ wireTier10, circuitTier10, wireTier10,
+ RECIPE_CONSTANTS.fieldGenerator_MAX);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier10, null, circuitTier9,
+ plateTier10, rodTier10c, null,
+ circuitTier10, plateTier10, plateTier10,
+ RECIPE_CONSTANTS.sensor_MAX);
+ }
+
+ private static void GregtechMachinePhase(){
+ Utils.LOG_INFO("Adding Gregtech machine recipes for the circuits.");
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L), GregtechItemList.Circuit_Parts_Wiring_IV.get(4L, new Object[0]), GregtechItemList.Circuit_Board_IV.get(1L, new Object[0]), 32, 256);
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L), GregtechItemList.Circuit_Parts_Wiring_LuV.get(4L, new Object[0]), GregtechItemList.Circuit_Board_LuV.get(1L, new Object[0]), 64, 512);
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 2L), GregtechItemList.Circuit_Parts_Wiring_ZPM.get(4L, new Object[0]), GregtechItemList.Circuit_Board_ZPM.get(1L, new Object[0]), 96, 1024);
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L), GregtechItemList.Circuit_Parts_Crystal_Chip_IV.get(3L, new Object[0]), GregtechItemList.Circuit_Parts_IV.get(1L, new Object[0]), 32, 512);
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L), GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.get(3L, new Object[0]), GregtechItemList.Circuit_Parts_LuV.get(1L, new Object[0]), 64, 1024);
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L), GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.get(3L, new Object[0]), GregtechItemList.Circuit_Parts_ZPM.get(1L, new Object[0]), 96, 2048);
+ GT_Values.RA.addForgeHammerRecipe(ItemList.Circuit_Master.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_Crystal_Chip_IV.get(5L, new Object[0]), 32, 256);
+ GT_Values.RA.addForgeHammerRecipe(GregtechItemList.Circuit_IV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.get(5L, new Object[0]), 64, 512);
+ GT_Values.RA.addForgeHammerRecipe(GregtechItemList.Circuit_LuV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.get(5L, new Object[0]), 128, 1024);
+ for (Materials tMat : Materials.values()) {
+ if ((tMat.mStandardMoltenFluid != null) && (tMat.contains(SubTag.SOLDERING_MATERIAL))) {
+ int tMultiplier = tMat.contains(SubTag.SOLDERING_MATERIAL_GOOD) ? 1 : tMat.contains(SubTag.SOLDERING_MATERIAL_BAD) ? 4 : 2;
+ GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_IV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_IV.get(1L, new Object[0]), tMat.getMolten(144L * tMultiplier / 4L), GregtechItemList.Circuit_IV.get(1L, new Object[0]), 32, 512);
+ GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_LuV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_LuV.get(1L, new Object[0]), tMat.getMolten(144L * tMultiplier / 4L), GregtechItemList.Circuit_LuV.get(1L, new Object[0]), 64, 1024);
+ GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_ZPM.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_ZPM.get(1L, new Object[0]), tMat.getMolten(144L * tMultiplier / 4L), GregtechItemList.Circuit_ZPM.get(1L, new Object[0]), 96, 2048);
+
+ }
+ }
}
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
index 83ecd14d46..c8aa454e9a 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
@@ -13,635 +13,682 @@ import net.minecraft.item.ItemStack;
public class RECIPES_Machines {
- // Outputs
- // static ItemStack RECIPE_BufferCore_ULV = new
- // ItemStack(GregtechEnergyBuffer.itemBufferCore);
- static ItemStack RECIPE_SteamCondenser = GregtechItemList.Condensor_MAX.get(1);
- static ItemStack RECIPE_IronBlastFurnace = GregtechItemList.Machine_Iron_BlastFurnace
- .get(1);
- static ItemStack RECIPE_IronPlatedBricks = GregtechItemList.Casing_IronPlatedBricks
- .get(1);
- static ItemStack RECIPE_Buffer_ULV = GregtechItemList.Energy_Buffer_1by1_ULV
- .get(1);
- static ItemStack RECIPE_Buffer_LV = GregtechItemList.Energy_Buffer_1by1_LV.get(1);
- static ItemStack RECIPE_Buffer_MV = GregtechItemList.Energy_Buffer_1by1_MV.get(1);
- static ItemStack RECIPE_Buffer_HV = GregtechItemList.Energy_Buffer_1by1_HV.get(1);
- static ItemStack RECIPE_Buffer_EV = GregtechItemList.Energy_Buffer_1by1_EV.get(1);
- static ItemStack RECIPE_Buffer_IV = GregtechItemList.Energy_Buffer_1by1_IV.get(1);
- static ItemStack RECIPE_Buffer_LuV = GregtechItemList.Energy_Buffer_1by1_LuV
- .get(1);
- static ItemStack RECIPE_Buffer_ZPM = GregtechItemList.Energy_Buffer_1by1_ZPM
- .get(1);
- static ItemStack RECIPE_Buffer_UV = GregtechItemList.Energy_Buffer_1by1_UV.get(1);
- static ItemStack RECIPE_Buffer_MAX = GregtechItemList.Energy_Buffer_1by1_MAX
- .get(1);
- // Industrial Centrifuge
- static ItemStack RECIPE_IndustrialCentrifugeController = GregtechItemList.Industrial_Centrifuge.get(1);
- static ItemStack RECIPE_IndustrialCentrifugeCasing = GregtechItemList.Casing_Centrifuge1.get(1);
- // Industrial Coke Oven
- static ItemStack RECIPE_IndustrialCokeOvenController = GregtechItemList.Industrial_CokeOven.get(1);
- static ItemStack RECIPE_IndustrialCokeOvenFrame = GregtechItemList.Casing_CokeOven.get(1);
- static ItemStack RECIPE_IndustrialCokeOvenCasingA = GregtechItemList.Casing_CokeOven_Coil1.get(1);
- static ItemStack RECIPE_IndustrialCokeOvenCasingB = GregtechItemList.Casing_CokeOven_Coil2.get(1);
+ //Outputs
+ //static ItemStack RECIPE_BufferCore_ULV = new ItemStack(GregtechEnergyBuffer.itemBufferCore);
+ static ItemStack RECIPE_SteamCondenser = GregtechItemList.Condensor_MAX.get(1);
+ static ItemStack RECIPE_IronBlastFurnace = GregtechItemList.Machine_Iron_BlastFurnace.get(1);
+ static ItemStack RECIPE_IronPlatedBricks = GregtechItemList.Casing_IronPlatedBricks.get(1);
+ static ItemStack RECIPE_Buffer_ULV = GregtechItemList.Energy_Buffer_1by1_ULV.get(1);
+ static ItemStack RECIPE_Buffer_LV = GregtechItemList.Energy_Buffer_1by1_LV.get(1);
+ static ItemStack RECIPE_Buffer_MV = GregtechItemList.Energy_Buffer_1by1_MV.get(1);
+ static ItemStack RECIPE_Buffer_HV = GregtechItemList.Energy_Buffer_1by1_HV.get(1);
+ static ItemStack RECIPE_Buffer_EV = GregtechItemList.Energy_Buffer_1by1_EV.get(1);
+ static ItemStack RECIPE_Buffer_IV = GregtechItemList.Energy_Buffer_1by1_IV.get(1);
+ static ItemStack RECIPE_Buffer_LuV = GregtechItemList.Energy_Buffer_1by1_LuV.get(1);
+ static ItemStack RECIPE_Buffer_ZPM = GregtechItemList.Energy_Buffer_1by1_ZPM.get(1);
+ static ItemStack RECIPE_Buffer_UV = GregtechItemList.Energy_Buffer_1by1_UV.get(1);
+ static ItemStack RECIPE_Buffer_MAX = GregtechItemList.Energy_Buffer_1by1_MAX.get(1);
+ //Industrial Centrifuge
+ static ItemStack RECIPE_IndustrialCentrifugeController = GregtechItemList.Industrial_Centrifuge.get(1);
+ static ItemStack RECIPE_IndustrialCentrifugeCasing = GregtechItemList.Casing_Centrifuge1.get(1);
+ //Industrial Coke Oven
+ static ItemStack RECIPE_IndustrialCokeOvenController = GregtechItemList.Industrial_CokeOven.get(1);
+ static ItemStack RECIPE_IndustrialCokeOvenFrame = GregtechItemList.Casing_CokeOven.get(1);
+ static ItemStack RECIPE_IndustrialCokeOvenCasingA = GregtechItemList.Casing_CokeOven_Coil1.get(1);
+ static ItemStack RECIPE_IndustrialCokeOvenCasingB = GregtechItemList.Casing_CokeOven_Coil2.get(1);
//
- static ItemStack RECIPE_IndustrialElectrolyzerController = GregtechItemList.Industrial_Electrolyzer
- .get(1);
- static ItemStack RECIPE_IndustrialElectrolyzerFrame = GregtechItemList.Casing_Electrolyzer.get(1);
+ static ItemStack RECIPE_IndustrialElectrolyzerController = GregtechItemList.Industrial_Electrolyzer.get(1);
+ static ItemStack RECIPE_IndustrialElectrolyzerFrame = GregtechItemList.Casing_Electrolyzer.get(1);
//
- static ItemStack RECIPE_IndustrialMaterialPressController = GregtechItemList.Industrial_PlatePress.get(1);
- static ItemStack RECIPE_IndustrialMaterialPressFrame = GregtechItemList.Casing_MaterialPress.get(1);
+ static ItemStack RECIPE_IndustrialMaterialPressController = GregtechItemList.Industrial_PlatePress.get(1);
+ static ItemStack RECIPE_IndustrialMaterialPressFrame = GregtechItemList.Casing_MaterialPress.get(1);
//
- static ItemStack RECIPE_IndustrialMacerationStackController = GregtechItemList.Industrial_MacerationStack
- .get(1);
- static ItemStack RECIPE_IndustrialMacerationStackFrame = GregtechItemList.Casing_MacerationStack
- .get(1);
+ static ItemStack RECIPE_IndustrialMacerationStackController = GregtechItemList.Industrial_MacerationStack.get(1);
+ static ItemStack RECIPE_IndustrialMacerationStackFrame = GregtechItemList.Casing_MacerationStack.get(1);
//
- static ItemStack RECIPE_IndustrialWireFactoryController = GregtechItemList.Industrial_WireFactory
- .get(1);
- static ItemStack RECIPE_IndustrialWireFactoryFrame = GregtechItemList.Casing_WireFactory.get(1);
- // Industrial Coke Oven
- static ItemStack RECIPE_IndustrialBlastSmelterController = GregtechItemList.Industrial_AlloyBlastSmelter
- .get(1);
- static ItemStack RECIPE_IndustrialBlastSmelterFrame = GregtechItemList.Casing_BlastSmelter.get(1);
- static ItemStack RECIPE_IndustrialBlastSmelterCoil = GregtechItemList.Casing_Coil_BlastSmelter
- .get(1);
-
- // Buffer Cores
- static ItemStack RECIPE_BufferCore_ULV = ItemUtils
- .getItemStack("miscutils:item.itemBufferCore1", 1);
- static ItemStack RECIPE_BufferCore_LV = ItemUtils
- .getItemStack("miscutils:item.itemBufferCore2", 1);
- static ItemStack RECIPE_BufferCore_MV = ItemUtils
- .getItemStack("miscutils:item.itemBufferCore3", 1);
- static ItemStack RECIPE_BufferCore_HV = ItemUtils
- .getItemStack("miscutils:item.itemBufferCore4", 1);
- static ItemStack RECIPE_BufferCore_EV = ItemUtils
- .getItemStack("miscutils:item.itemBufferCore5", 1);
- static ItemStack RECIPE_BufferCore_IV = ItemUtils
- .getItemStack("miscutils:item.itemBufferCore6", 1);
- static ItemStack RECIPE_BufferCore_LuV = ItemUtils
- .getItemStack("miscutils:item.itemBufferCore7", 1);
- static ItemStack RECIPE_BufferCore_ZPM = ItemUtils
- .getItemStack("miscutils:item.itemBufferCore8", 1);
- static ItemStack RECIPE_BufferCore_UV = ItemUtils
- .getItemStack("miscutils:item.itemBufferCore9", 1);
- static ItemStack RECIPE_BufferCore_MAX = ItemUtils
- .getItemStack("miscutils:item.itemBufferCore10", 1);
-
- // Wire
- static String wireTier1 = "wireGt08Lead";
- static String wireTier2 = "wireGt08Tin";
- static String wireTier3 = "wireGt08Copper";
- static String wireTier4 = "wireGt08Gold";
- static String wireTier5 = "wireGt08Aluminium";
- static String wireTier6 = "wireGt08Tungsten";
- static String wireTier7 = "wireGt08Naquadah";
- static String wireTier8 = "wireGt08Osmium";
- static String wireTier9 = "wireGt08Superconductor";
- static String wireTier10 = "wireGt16Superconductor";
-
- // Wire
- static String cableTier1 = "cableGt04Lead";
- static String cableTier2 = "cableGt04Tin";
- static String cableTier3 = "cableGt04Copper";
- static String cableTier4 = "cableGt04Gold";
- static String cableTier5 = "cableGt04Aluminium";
- static String cableTier6 = "cableGt04Tungsten";
- static String cableTier7 = "cableGt04Naquadah";
- static String cableTier8 = "cableGt04Osmium";
- static String cableTier9 = "cableGt04NiobiumTitanium";
- static String cableTier10 = "cableGt08NiobiumTitanium";
-
- // Plates
- static String plateTier1 = "plateLead";
- static String plateTier2 = "plateTin";
- static String plateTier3 = "plateCopper";
- static String plateTier4 = "plateGold";
- static String plateTier5 = "plateAluminium";
- static String plateTier6 = "plateMaragingSteel250";
- static String plateTier7 = "plateTantalloy61";
- static String plateTier8 = "plateInconel792";
- static String plateTier9 = "plateZeron100";
- static String plateTier10 = "plateNaquadahEnriched";
- static String plateTier11 = "plateNeutronium";
-
- // rods
- static String rodTier1 = "stickLead";
- static String rodTier2 = "stickTin";
- static String rodTier3 = "stickCopper";
- static String rodTier4 = "stickGold";
- static String rodTier5 = "stickAluminium";
- static String rodTier6 = "stickMaragingSteel250";
- static String rodTier7 = "stickTantalloy61";
- static String rodTier8 = "stickInconel792";
- static String rodTier9 = "stickZeron100";
- static String rodTier10 = "stickNaquadahEnriched";
- static String rodTier11 = "stickNeutronium";
-
- static String pipeTier1 = "pipeHuge" + "Potin";
- static String pipeTier2 = "pipeHuge" + "Steel";
- static String pipeTier3 = "pipeHuge" + "StainlessSteel";
- static String pipeTier4 = "pipeHuge" + "Titanium";
- static String pipeTier5 = "pipeHuge" + "TungstenSteel";
- static String pipeTier6 = "pipeHuge" + "MaragingSteel300";
- static String pipeTier7 = "pipeHuge" + "Tantalloy60";
- static String pipeTier8 = "pipeHuge" + "Tantalloy61";
- static String pipeTier9 = "pipeHuge" + "Inconel792";
- static String pipeTier10 = "pipeHuge" + "HastelloyX";
- static String pipeTier11 = "pipeHuge" + "Europium";
-
- // Machine Casings
- static ItemStack machineCasing_ULV;
- static ItemStack machineCasing_LV;
- static ItemStack machineCasing_MV;
- static ItemStack machineCasing_HV;
- static ItemStack machineCasing_EV;
- static ItemStack machineCasing_IV;
- static ItemStack machineCasing_LuV;
- static ItemStack machineCasing_ZPM;
- static ItemStack machineCasing_UV;
- static ItemStack machineCasing_MAX;
-
- // Gearbox Casings
- static ItemStack gearboxCasing_Tier_1;
- static ItemStack gearboxCasing_Tier_2;
- static ItemStack gearboxCasing_Tier_3;
- static ItemStack gearboxCasing_Tier_4;
-
- // IV MACHINES
- public static ItemStack IV_MACHINE_Electrolyzer;
- public static ItemStack IV_MACHINE_Centrifuge;
- public static ItemStack IV_MACHINE_BendingMachine;
- public static ItemStack IV_MACHINE_Wiremill;
- public static ItemStack IV_MACHINE_Macerator;
- public static ItemStack IV_MACHINE_MassFabricator;
-
- // Cables
- static String cableGt02Electrum = "cableGt02Electrum";
-
- // Plates
- static String plateElectricalSteel = "plateElectricalSteel";
- static String plateEnergeticAlloy = "plateEnergeticAlloy";
- static String plateCobalt = "plateCobalt";
- static String plateBronze = "plateBronze";
- static String plateSteel = "plateSteel";
-
- // Pipes
- static String pipeLargeCopper = "pipeLargeCopper";
- static String pipeHugeSteel = "pipeHugeSteel";
- static String pipeHugeStainlessSteel = "pipeHugeStainlessSteel";
- static String pipeHugeTitanium = "pipeHugeTitanium";
-
- // Lava Boiler
- static ItemStack boiler_Coal;
- static ItemStack blockBricks = ItemUtils
- .getItemStack("minecraft:brick_block", 1);
-
- // Batteries
- static String batteryBasic = "batteryBasic";
- static String batteryAdvanced = "batteryAdvanced";
- static String batteryElite = "batteryElite";
- static String batteryMaster = "batteryMaster";
- static String batteryUltimate = "batteryUltimate";
- static ItemStack IC2MFE;
- static ItemStack IC2MFSU;
-
- // Circuits
- static String circuitPrimitive = "circuitBasic";
- static String circuitTier1 = "circuitGood";
- static String circuitTier2 = "circuitAdvanced";
- static String circuitTier3 = "circuitData";
- static String circuitTier4 = "circuitElite";
- static String circuitTier5 = "circuitMaster";
- static String circuitTier6 = "circuitUltimate";
- static String circuitTier7 = "circuitSymbiotic";
- static String circuitTier8 = "circuitNeutronic";
- static String circuitTier9 = "circuitQuantum";
-
- // Machine Components
- static ItemStack electricMotor_LV;
- static ItemStack electricMotor_MV;
- static ItemStack electricMotor_HV;
- static ItemStack electricMotor_EV;
- static ItemStack electricMotor_IV;
- static ItemStack electricPump_LV;
- static ItemStack electricPump_MV;
- static ItemStack electricPump_HV;
- static ItemStack electricPump_EV;
- static ItemStack electricPump_IV;
- static ItemStack electricPiston_LV;
- static ItemStack electricPiston_MV;
- static ItemStack electricPiston_HV;
- static ItemStack electricPiston_EV;
- static ItemStack electricPiston_IV;
- static ItemStack robotArm_LV;
- static ItemStack robotArm_MV;
- static ItemStack robotArm_HV;
- static ItemStack robotArm_EV;
- static ItemStack robotArm_IV;
- static ItemStack conveyorModule_LV;
- static ItemStack conveyorModule_MV;
- static ItemStack conveyorModule_HV;
- static ItemStack conveyorModule_EV;
- static ItemStack conveyorModule_IV;
- static ItemStack emitter_LV;
- static ItemStack emitter_MV;
- static ItemStack emitter_HV;
- static ItemStack emitter_EV;
- static ItemStack emitter_IV;
- static ItemStack fieldGenerator_LV;
- static ItemStack fieldGenerator_MV;
- static ItemStack fieldGenerator_HV;
- static ItemStack fieldGenerator_EV;
- static ItemStack fieldGenerator_IV;
- static ItemStack sensor_LV;
- static ItemStack sensor_MV;
- static ItemStack sensor_HV;
- static ItemStack sensor_EV;
- static ItemStack sensor_IV;
-
- // Misc
- static ItemStack INPUT_RCCokeOvenBlock;
- static ItemStack INPUT_IECokeOvenBlock;
-
- // RobotArm, Conveyor, Emitter, Sensor, Field Generator
-
- private static void initModItems() {
- if (LoadedMods.IndustrialCraft2) {
- RECIPES_Machines.IC2MFE = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric",
- "IC2_MFE", 1, 1);
- RECIPES_Machines.IC2MFSU = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric",
- "IC2_MFSU", 2, 1);
+ static ItemStack RECIPE_IndustrialWireFactoryController = GregtechItemList.Industrial_WireFactory.get(1);
+ static ItemStack RECIPE_IndustrialWireFactoryFrame = GregtechItemList.Casing_WireFactory.get(1);
+ //Industrial Coke Oven
+ static ItemStack RECIPE_IndustrialBlastSmelterController = GregtechItemList.Industrial_AlloyBlastSmelter.get(1);
+ static ItemStack RECIPE_IndustrialBlastSmelterFrame = GregtechItemList.Casing_BlastSmelter.get(1);
+ static ItemStack RECIPE_IndustrialBlastSmelterCoil = GregtechItemList.Casing_Coil_BlastSmelter.get(1);
+
+
+ //Buffer Cores
+ static ItemStack RECIPE_BufferCore_ULV = ItemUtils.getItemStack("miscutils:item.itemBufferCore1", 1);
+ static ItemStack RECIPE_BufferCore_LV = ItemUtils.getItemStack("miscutils:item.itemBufferCore2", 1);
+ static ItemStack RECIPE_BufferCore_MV = ItemUtils.getItemStack("miscutils:item.itemBufferCore3", 1);
+ static ItemStack RECIPE_BufferCore_HV = ItemUtils.getItemStack("miscutils:item.itemBufferCore4", 1);
+ static ItemStack RECIPE_BufferCore_EV = ItemUtils.getItemStack("miscutils:item.itemBufferCore5", 1);
+ static ItemStack RECIPE_BufferCore_IV = ItemUtils.getItemStack("miscutils:item.itemBufferCore6", 1);
+ static ItemStack RECIPE_BufferCore_LuV = ItemUtils.getItemStack("miscutils:item.itemBufferCore7", 1);
+ static ItemStack RECIPE_BufferCore_ZPM = ItemUtils.getItemStack("miscutils:item.itemBufferCore8", 1);
+ static ItemStack RECIPE_BufferCore_UV = ItemUtils.getItemStack("miscutils:item.itemBufferCore9", 1);
+ static ItemStack RECIPE_BufferCore_MAX = ItemUtils.getItemStack("miscutils:item.itemBufferCore10", 1);
+
+
+ //Wire
+ static String wireTier1 = "wireGt08Lead";
+ static String wireTier2 = "wireGt08Tin";
+ static String wireTier3 = "wireGt08Copper";
+ static String wireTier4 = "wireGt08Gold";
+ static String wireTier5 = "wireGt08Aluminium";
+ static String wireTier6 = "wireGt08Tungsten";
+ static String wireTier7 = "wireGt08Naquadah";
+ static String wireTier8 = "wireGt08Osmium";
+ static String wireTier9 = "wireGt08Superconductor";
+ static String wireTier10 = "wireGt16Superconductor";
+
+ //Wire
+ static String cableTier1 = "cableGt04Lead";
+ static String cableTier2 = "cableGt04Tin";
+ static String cableTier3 = "cableGt04Copper";
+ static String cableTier4 = "cableGt04Gold";
+ static String cableTier5 = "cableGt04Aluminium";
+ static String cableTier6 = "cableGt04Tungsten";
+ static String cableTier7 = "cableGt04Naquadah";
+ static String cableTier8 = "cableGt04Osmium";
+ static String cableTier9 = "cableGt04NiobiumTitanium";
+ static String cableTier10 = "cableGt08NiobiumTitanium";
+
+
+ //Plates
+ static String plateTier1 = "plateLead";
+ static String plateTier2 = "plateTin";
+ static String plateTier3 = "plateCopper";
+ static String plateTier4 = "plateGold";
+ static String plateTier5 = "plateAluminium";
+ static String plateTier6 = "plateMaragingSteel250";
+ static String plateTier7 = "plateTantalloy61";
+ static String plateTier8 = "plateInconel792";
+ static String plateTier9 = "plateZeron100";
+ static String plateTier10 = "plateNaquadahEnriched";
+ static String plateTier11 = "plateNeutronium";
+
+ //rods
+ static String rodTier1 = "stickLead";
+ static String rodTier2 = "stickTin";
+ static String rodTier3 = "stickCopper";
+ static String rodTier4 = "stickGold";
+ static String rodTier5 = "stickAluminium";
+ static String rodTier6 = "stickMaragingSteel250";
+ static String rodTier7 = "stickTantalloy61";
+ static String rodTier8 = "stickInconel792";
+ static String rodTier9 = "stickZeron100";
+ static String rodTier10 = "stickNaquadahEnriched";
+ static String rodTier11 = "stickNeutronium";
+
+ static String pipeTier1 = "pipeHuge"+"Potin";
+ static String pipeTier2 = "pipeHuge"+"Steel";
+ static String pipeTier3 = "pipeHuge"+"StainlessSteel";
+ static String pipeTier4 = "pipeHuge"+"Titanium";
+ static String pipeTier5 = "pipeHuge"+"TungstenSteel";
+ static String pipeTier6 = "pipeHuge"+"MaragingSteel300";
+ static String pipeTier7 = "pipeHuge"+"Tantalloy60";
+ static String pipeTier8 = "pipeHuge"+"Tantalloy61";
+ static String pipeTier9 = "pipeHuge"+"Inconel792";
+ static String pipeTier10 = "pipeHuge"+"HastelloyX";
+ static String pipeTier11 = "pipeHuge"+"Europium";
+
+
+ //Machine Casings
+ static ItemStack machineCasing_ULV;
+ static ItemStack machineCasing_LV;
+ static ItemStack machineCasing_MV;
+ static ItemStack machineCasing_HV;
+ static ItemStack machineCasing_EV;
+ static ItemStack machineCasing_IV;
+ static ItemStack machineCasing_LuV;
+ static ItemStack machineCasing_ZPM;
+ static ItemStack machineCasing_UV;
+ static ItemStack machineCasing_MAX;
+
+ //Gearbox Casings
+ static ItemStack gearboxCasing_Tier_1;
+ static ItemStack gearboxCasing_Tier_2;
+ static ItemStack gearboxCasing_Tier_3;
+ static ItemStack gearboxCasing_Tier_4;
+
+ //IV MACHINES
+ public static ItemStack IV_MACHINE_Electrolyzer;
+ public static ItemStack IV_MACHINE_Centrifuge;
+ public static ItemStack IV_MACHINE_BendingMachine;
+ public static ItemStack IV_MACHINE_Wiremill;
+ public static ItemStack IV_MACHINE_Macerator;
+ public static ItemStack IV_MACHINE_MassFabricator;
+
+
+ //Cables
+ static String cableGt02Electrum = "cableGt02Electrum";
+
+
+ //Plates
+ static String plateElectricalSteel= "plateElectricalSteel";
+ static String plateEnergeticAlloy= "plateEnergeticAlloy";
+ static String plateCobalt = "plateCobalt";
+ static String plateBronze = "plateBronze";
+ static String plateSteel = "plateSteel";
+
+ //Pipes
+ static String pipeLargeCopper="pipeLargeCopper";
+ static String pipeHugeSteel="pipeHugeSteel";
+ static String pipeHugeStainlessSteel="pipeHugeStainlessSteel";
+ static String pipeHugeTitanium="pipeHugeTitanium";
+
+ //Lava Boiler
+ static ItemStack boiler_Coal;
+ static ItemStack blockBricks = ItemUtils.getItemStack("minecraft:brick_block", 1);
+
+ //Batteries
+ static String batteryBasic = "batteryBasic";
+ static String batteryAdvanced = "batteryAdvanced";
+ static String batteryElite = "batteryElite";
+ static String batteryMaster = "batteryMaster";
+ static String batteryUltimate = "batteryUltimate";
+ static ItemStack IC2MFE;
+ static ItemStack IC2MFSU;
+
+ //Circuits
+ static String circuitPrimitive = "circuitBasic";
+ static String circuitTier1 = "circuitGood";
+ static String circuitTier2 = "circuitAdvanced";
+ static String circuitTier3 = "circuitData";
+ static String circuitTier4 = "circuitElite";
+ static String circuitTier5 = "circuitMaster";
+ static String circuitTier6 = "circuitUltimate";
+ static String circuitTier7 = "circuitSymbiotic";
+ static String circuitTier8 = "circuitNeutronic";
+ static String circuitTier9 = "circuitQuantum";
+
+ //Machine Components
+ static ItemStack electricMotor_LV;
+ static ItemStack electricMotor_MV;
+ static ItemStack electricMotor_HV;
+ static ItemStack electricMotor_EV;
+ static ItemStack electricMotor_IV;
+ static ItemStack electricPump_LV;
+ static ItemStack electricPump_MV;
+ static ItemStack electricPump_HV;
+ static ItemStack electricPump_EV;
+ static ItemStack electricPump_IV;
+ static ItemStack electricPiston_LV;
+ static ItemStack electricPiston_MV;
+ static ItemStack electricPiston_HV;
+ static ItemStack electricPiston_EV;
+ static ItemStack electricPiston_IV;
+ static ItemStack robotArm_LV;
+ static ItemStack robotArm_MV;
+ static ItemStack robotArm_HV;
+ static ItemStack robotArm_EV;
+ static ItemStack robotArm_IV;
+ static ItemStack conveyorModule_LV;
+ static ItemStack conveyorModule_MV;
+ static ItemStack conveyorModule_HV;
+ static ItemStack conveyorModule_EV;
+ static ItemStack conveyorModule_IV;
+ static ItemStack emitter_LV;
+ static ItemStack emitter_MV;
+ static ItemStack emitter_HV;
+ static ItemStack emitter_EV;
+ static ItemStack emitter_IV;
+ static ItemStack fieldGenerator_LV;
+ static ItemStack fieldGenerator_MV;
+ static ItemStack fieldGenerator_HV;
+ static ItemStack fieldGenerator_EV;
+ static ItemStack fieldGenerator_IV;
+ static ItemStack sensor_LV;
+ static ItemStack sensor_MV;
+ static ItemStack sensor_HV;
+ static ItemStack sensor_EV;
+ static ItemStack sensor_IV;
+
+ //Misc
+ static ItemStack INPUT_RCCokeOvenBlock;
+ static ItemStack INPUT_IECokeOvenBlock;
+
+
+
+ //RobotArm, Conveyor, Emitter, Sensor, Field Generator
+
+
+ public static final void RECIPES_LOAD(){
+ run();
+ Utils.LOG_INFO("Loading Recipes for the Various machine blocks.");
+ }
+
+ private static void run(){
+ initModItems();
+ }
+
+ private static void initModItems(){
+ if (LoadedMods.IndustrialCraft2){
+ IC2MFE = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFE", 1, 1);
+ IC2MFSU = ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFSU", 2, 1);
}
- if (LoadedMods.Gregtech) {
- RECIPES_Shapeless.dustStaballoy = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils,
- "gregtech:gt.metaitem.01", "Staballoy Dust", 2319, 2);
- RECIPES_Machines.machineCasing_ULV = ItemList.Casing_ULV.get(1);
- RECIPES_Machines.machineCasing_LV = ItemList.Casing_LV.get(1);
- RECIPES_Machines.machineCasing_MV = ItemList.Casing_MV.get(1);
- RECIPES_Machines.machineCasing_HV = ItemList.Casing_HV.get(1);
- RECIPES_Machines.machineCasing_EV = ItemList.Casing_EV.get(1);
- RECIPES_Machines.machineCasing_IV = ItemList.Casing_IV.get(1);
- RECIPES_Machines.machineCasing_LuV = ItemList.Casing_LuV.get(1);
- RECIPES_Machines.machineCasing_ZPM = ItemList.Casing_ZPM.get(1);
- RECIPES_Machines.machineCasing_UV = ItemList.Casing_UV.get(1);
- RECIPES_Machines.machineCasing_MAX = ItemList.Casing_MAX.get(1);
-
- // Gearbox Casings
- RECIPES_Machines.gearboxCasing_Tier_1 = ItemList.Casing_Gearbox_Bronze.get(1);
- RECIPES_Machines.gearboxCasing_Tier_2 = ItemList.Casing_Gearbox_Steel.get(1);
- RECIPES_Machines.gearboxCasing_Tier_3 = ItemList.Casing_Gearbox_Titanium.get(1);
- RECIPES_Machines.gearboxCasing_Tier_4 = ItemList.Casing_Gearbox_TungstenSteel.get(1);
-
- // Lava Boiler
- RECIPES_Machines.boiler_Coal = ItemList.Machine_Bronze_Boiler.get(1);
-
- // Machine Components
- RECIPES_Machines.electricMotor_LV = ItemList.Electric_Motor_LV.get(1);
- RECIPES_Machines.electricMotor_MV = ItemList.Electric_Motor_MV.get(1);
- RECIPES_Machines.electricMotor_HV = ItemList.Electric_Motor_HV.get(1);
- RECIPES_Machines.electricMotor_EV = ItemList.Electric_Motor_EV.get(1);
- RECIPES_Machines.electricMotor_IV = ItemList.Electric_Motor_IV.get(1);
- RECIPES_Machines.electricPump_LV = ItemList.Electric_Pump_LV.get(1);
- RECIPES_Machines.electricPump_MV = ItemList.Electric_Pump_MV.get(1);
- RECIPES_Machines.electricPump_HV = ItemList.Electric_Pump_HV.get(1);
- RECIPES_Machines.electricPump_EV = ItemList.Electric_Pump_EV.get(1);
- RECIPES_Machines.electricPump_IV = ItemList.Electric_Pump_IV.get(1);
- RECIPES_Machines.electricPiston_LV = ItemList.Electric_Piston_LV.get(1);
- RECIPES_Machines.electricPiston_MV = ItemList.Electric_Piston_MV.get(1);
- RECIPES_Machines.electricPiston_HV = ItemList.Electric_Piston_HV.get(1);
- RECIPES_Machines.electricPiston_EV = ItemList.Electric_Piston_EV.get(1);
- RECIPES_Machines.electricPiston_IV = ItemList.Electric_Piston_IV.get(1);
- RECIPES_Machines.robotArm_LV = ItemList.Robot_Arm_LV.get(1);
- RECIPES_Machines.robotArm_MV = ItemList.Robot_Arm_MV.get(1);
- RECIPES_Machines.robotArm_HV = ItemList.Robot_Arm_HV.get(1);
- RECIPES_Machines.robotArm_EV = ItemList.Robot_Arm_EV.get(1);
- RECIPES_Machines.robotArm_IV = ItemList.Robot_Arm_IV.get(1);
- RECIPES_Machines.conveyorModule_LV = ItemList.Conveyor_Module_LV.get(1);
- RECIPES_Machines.conveyorModule_MV = ItemList.Conveyor_Module_MV.get(1);
- RECIPES_Machines.conveyorModule_HV = ItemList.Conveyor_Module_HV.get(1);
- RECIPES_Machines.conveyorModule_EV = ItemList.Conveyor_Module_EV.get(1);
- RECIPES_Machines.conveyorModule_IV = ItemList.Conveyor_Module_IV.get(1);
- RECIPES_Machines.emitter_LV = ItemList.Emitter_LV.get(1);
- RECIPES_Machines.emitter_MV = ItemList.Emitter_MV.get(1);
- RECIPES_Machines.emitter_HV = ItemList.Emitter_HV.get(1);
- RECIPES_Machines.emitter_EV = ItemList.Emitter_EV.get(1);
- RECIPES_Machines.emitter_IV = ItemList.Emitter_IV.get(1);
- RECIPES_Machines.fieldGenerator_LV = ItemList.Field_Generator_LV.get(1);
- RECIPES_Machines.fieldGenerator_MV = ItemList.Field_Generator_MV.get(1);
- RECIPES_Machines.fieldGenerator_HV = ItemList.Field_Generator_HV.get(1);
- RECIPES_Machines.fieldGenerator_EV = ItemList.Field_Generator_EV.get(1);
- RECIPES_Machines.fieldGenerator_IV = ItemList.Field_Generator_IV.get(1);
- RECIPES_Machines.sensor_LV = ItemList.Sensor_LV.get(1);
- RECIPES_Machines.sensor_MV = ItemList.Sensor_MV.get(1);
- RECIPES_Machines.sensor_HV = ItemList.Sensor_HV.get(1);
- RECIPES_Machines.sensor_EV = ItemList.Sensor_EV.get(1);
- RECIPES_Machines.sensor_IV = ItemList.Sensor_IV.get(1);
-
- // IV MACHINES
- RECIPES_Machines.IV_MACHINE_Electrolyzer = ItemList.Machine_IV_Electrolyzer.get(1);
- RECIPES_Machines.IV_MACHINE_BendingMachine = ItemList.Machine_IV_Bender.get(1);
- RECIPES_Machines.IV_MACHINE_Wiremill = ItemList.Machine_IV_Wiremill.get(1);
- RECIPES_Machines.IV_MACHINE_Macerator = ItemList.Machine_IV_Macerator.get(1);
- RECIPES_Machines.IV_MACHINE_MassFabricator = ItemList.Machine_IV_Massfab.get(1);
- RECIPES_Machines.IV_MACHINE_Centrifuge = ItemList.Machine_IV_Centrifuge.get(1);
+ if (LoadedMods.Gregtech){
+ RECIPES_Shapeless.dustStaballoy = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, "gregtech:gt.metaitem.01", "Staballoy Dust", 2319, 2);
+ machineCasing_ULV = ItemList.Casing_ULV.get(1);
+ machineCasing_LV = ItemList.Casing_LV.get(1);
+ machineCasing_MV = ItemList.Casing_MV.get(1);
+ machineCasing_HV = ItemList.Casing_HV.get(1);
+ machineCasing_EV = ItemList.Casing_EV.get(1);
+ machineCasing_IV = ItemList.Casing_IV.get(1);
+ machineCasing_LuV = ItemList.Casing_LuV.get(1);
+ machineCasing_ZPM = ItemList.Casing_ZPM.get(1);
+ machineCasing_UV = ItemList.Casing_UV.get(1);
+ machineCasing_MAX = ItemList.Casing_MAX.get(1);
+
+ //Gearbox Casings
+ gearboxCasing_Tier_1 = ItemList.Casing_Gearbox_Bronze.get(1);
+ gearboxCasing_Tier_2 = ItemList.Casing_Gearbox_Steel.get(1);
+ gearboxCasing_Tier_3 = ItemList.Casing_Gearbox_Titanium.get(1);
+ gearboxCasing_Tier_4 = ItemList.Casing_Gearbox_TungstenSteel.get(1);
+
+ //Lava Boiler
+ boiler_Coal = ItemList.Machine_Bronze_Boiler.get(1);
+
+ //Machine Components
+ electricMotor_LV = ItemList.Electric_Motor_LV.get(1);
+ electricMotor_MV = ItemList.Electric_Motor_MV.get(1);
+ electricMotor_HV = ItemList.Electric_Motor_HV.get(1);
+ electricMotor_EV = ItemList.Electric_Motor_EV.get(1);
+ electricMotor_IV = ItemList.Electric_Motor_IV.get(1);
+ electricPump_LV = ItemList.Electric_Pump_LV.get(1);
+ electricPump_MV = ItemList.Electric_Pump_MV.get(1);
+ electricPump_HV = ItemList.Electric_Pump_HV.get(1);
+ electricPump_EV = ItemList.Electric_Pump_EV.get(1);
+ electricPump_IV = ItemList.Electric_Pump_IV.get(1);
+ electricPiston_LV = ItemList.Electric_Piston_LV.get(1);
+ electricPiston_MV = ItemList.Electric_Piston_MV.get(1);
+ electricPiston_HV = ItemList.Electric_Piston_HV.get(1);
+ electricPiston_EV = ItemList.Electric_Piston_EV.get(1);
+ electricPiston_IV = ItemList.Electric_Piston_IV.get(1);
+ robotArm_LV = ItemList.Robot_Arm_LV.get(1);
+ robotArm_MV = ItemList.Robot_Arm_MV.get(1);
+ robotArm_HV = ItemList.Robot_Arm_HV.get(1);
+ robotArm_EV = ItemList.Robot_Arm_EV.get(1);
+ robotArm_IV = ItemList.Robot_Arm_IV.get(1);
+ conveyorModule_LV = ItemList.Conveyor_Module_LV.get(1);
+ conveyorModule_MV = ItemList.Conveyor_Module_MV.get(1);
+ conveyorModule_HV = ItemList.Conveyor_Module_HV.get(1);
+ conveyorModule_EV = ItemList.Conveyor_Module_EV.get(1);
+ conveyorModule_IV = ItemList.Conveyor_Module_IV.get(1);
+ emitter_LV = ItemList.Emitter_LV.get(1);
+ emitter_MV = ItemList.Emitter_MV.get(1);
+ emitter_HV = ItemList.Emitter_HV.get(1);
+ emitter_EV = ItemList.Emitter_EV.get(1);
+ emitter_IV = ItemList.Emitter_IV.get(1);
+ fieldGenerator_LV = ItemList.Field_Generator_LV.get(1);
+ fieldGenerator_MV = ItemList.Field_Generator_MV.get(1);
+ fieldGenerator_HV = ItemList.Field_Generator_HV.get(1);
+ fieldGenerator_EV = ItemList.Field_Generator_EV.get(1);
+ fieldGenerator_IV = ItemList.Field_Generator_IV.get(1);
+ sensor_LV = ItemList.Sensor_LV.get(1);
+ sensor_MV = ItemList.Sensor_MV.get(1);
+ sensor_HV = ItemList.Sensor_HV.get(1);
+ sensor_EV = ItemList.Sensor_EV.get(1);
+ sensor_IV = ItemList.Sensor_IV.get(1);
+
+
+ //IV MACHINES
+ IV_MACHINE_Electrolyzer = ItemList.Machine_IV_Electrolyzer.get(1);
+ IV_MACHINE_BendingMachine= ItemList.Machine_IV_Bender.get(1);
+ IV_MACHINE_Wiremill= ItemList.Machine_IV_Wiremill.get(1);
+ IV_MACHINE_Macerator= ItemList.Machine_IV_Macerator.get(1);
+ IV_MACHINE_MassFabricator= ItemList.Machine_IV_Massfab.get(1);
+ IV_MACHINE_Centrifuge= ItemList.Machine_IV_Centrifuge.get(1);
+
}
- if (LoadedMods.Railcraft) {
- // Misc
- RECIPES_Machines.INPUT_RCCokeOvenBlock = ItemUtils.getItemStackWithMeta(LoadedMods.Railcraft,
- "Railcraft:machine.alpha", "Coke_Oven_RC", 7, 1);
+ if(LoadedMods.Railcraft){
+ //Misc
+ INPUT_RCCokeOvenBlock = ItemUtils.getItemStackWithMeta(LoadedMods.Railcraft, "Railcraft:machine.alpha", "Coke_Oven_RC", 7, 1);
}
- if (LoadedMods.ImmersiveEngineering) {
- // Misc
- RECIPES_Machines.INPUT_IECokeOvenBlock = ItemUtils.getItemStackWithMeta(LoadedMods.ImmersiveEngineering,
- "ImmersiveEngineering:stoneDecoration", "Coke_Oven_IE", 1, 1);
+ if(LoadedMods.ImmersiveEngineering){
+ //Misc
+ INPUT_IECokeOvenBlock = ItemUtils.getItemStackWithMeta(LoadedMods.ImmersiveEngineering, "ImmersiveEngineering:stoneDecoration", "Coke_Oven_IE", 1, 1);
}
- RECIPES_Machines.runModRecipes();
- }
+ runModRecipes();
+ }
- public static final void RECIPES_LOAD() {
- RECIPES_Machines.run();
- Utils.LOG_INFO("Loading Recipes for the Various machine blocks.");
- }
-
- private static void run() {
- RECIPES_Machines.initModItems();
- }
+ private static void runModRecipes(){
+ if (LoadedMods.Gregtech){
- private static void runModRecipes() {
- if (LoadedMods.Gregtech) {
-
- RecipeUtils.addShapedGregtechRecipe(ItemList.Electric_Piston_EV,
- GregtechOrePrefixes.circuit.get(Materials.Ultimate), ItemList.Electric_Piston_EV,
- ItemList.Electric_Motor_EV, RECIPES_Machines.machineCasing_EV, ItemList.Electric_Motor_EV,
+ RecipeUtils.addShapedGregtechRecipe(
+ ItemList.Electric_Piston_EV, GregtechOrePrefixes.circuit.get(Materials.Ultimate), ItemList.Electric_Piston_EV,
+ ItemList.Electric_Motor_EV, machineCasing_EV, ItemList.Electric_Motor_EV,
"gearGtTitanium", "cableGt02Aluminium", "gearGtTitanium",
ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 793, 1));
- RecipeUtils.addShapedGregtechRecipe(ItemList.Electric_Piston_IV,
- GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic), ItemList.Electric_Piston_IV,
- ItemList.Electric_Motor_IV, RECIPES_Machines.machineCasing_IV, ItemList.Electric_Motor_IV,
+ RecipeUtils.addShapedGregtechRecipe(
+ ItemList.Electric_Piston_IV, GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic), ItemList.Electric_Piston_IV,
+ ItemList.Electric_Motor_IV, machineCasing_IV, ItemList.Electric_Motor_IV,
"gearGtTungstenSteel", "cableGt02Platinum", "gearGtTungstenSteel",
ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 794, 1));
- RecipeUtils.addShapedGregtechRecipe(RECIPE_CONSTANTS.electricPiston_LuV,
- GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic), RECIPE_CONSTANTS.electricPiston_LuV,
- RECIPE_CONSTANTS.electricMotor_LuV, RECIPES_Machines.machineCasing_LuV,
- RECIPE_CONSTANTS.electricMotor_LuV, "gearGtChrome", "cableGt02Tungsten", "gearGtChrome",
+ RecipeUtils.addShapedGregtechRecipe(
+ RECIPE_CONSTANTS.electricPiston_LuV, GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic), RECIPE_CONSTANTS.electricPiston_LuV,
+ RECIPE_CONSTANTS.electricMotor_LuV, machineCasing_LuV, RECIPE_CONSTANTS.electricMotor_LuV,
+ "gearGtChrome", "cableGt02Tungsten", "gearGtChrome",
ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 795, 1));
- // Buffer Core
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier1, RECIPES_Machines.cableTier1,
- RECIPES_Machines.plateTier1, RECIPES_Machines.circuitPrimitive, RECIPES_Machines.IC2MFE,
- RECIPES_Machines.circuitPrimitive, RECIPES_Machines.plateTier1, RECIPES_Machines.cableTier1,
- RECIPES_Machines.plateTier1, RECIPES_Machines.RECIPE_BufferCore_ULV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier2, RECIPES_Machines.cableTier2,
- RECIPES_Machines.plateTier2, RECIPES_Machines.circuitTier1, RECIPES_Machines.IC2MFE,
- RECIPES_Machines.circuitTier1, RECIPES_Machines.plateTier2, RECIPES_Machines.cableTier2,
- RECIPES_Machines.plateTier2, RECIPES_Machines.RECIPE_BufferCore_LV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier3, RECIPES_Machines.cableTier3,
- RECIPES_Machines.plateTier3, RECIPES_Machines.RECIPE_BufferCore_LV, RECIPES_Machines.circuitTier2,
- RECIPES_Machines.RECIPE_BufferCore_LV, RECIPES_Machines.plateTier3, RECIPES_Machines.cableTier3,
- RECIPES_Machines.plateTier3, RECIPES_Machines.RECIPE_BufferCore_MV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier4, RECIPES_Machines.cableTier4,
- RECIPES_Machines.plateTier4, RECIPES_Machines.RECIPE_BufferCore_MV, RECIPES_Machines.circuitTier3,
- RECIPES_Machines.RECIPE_BufferCore_MV, RECIPES_Machines.plateTier4, RECIPES_Machines.cableTier4,
- RECIPES_Machines.plateTier4, RECIPES_Machines.RECIPE_BufferCore_HV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier5, RECIPES_Machines.cableTier5,
- RECIPES_Machines.plateTier5, RECIPES_Machines.RECIPE_BufferCore_HV, RECIPES_Machines.circuitTier4,
- RECIPES_Machines.RECIPE_BufferCore_HV, RECIPES_Machines.plateTier5, RECIPES_Machines.cableTier5,
- RECIPES_Machines.plateTier5, RECIPES_Machines.RECIPE_BufferCore_EV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier6, RECIPES_Machines.cableTier6,
- RECIPES_Machines.plateTier6, RECIPES_Machines.RECIPE_BufferCore_EV, RECIPES_Machines.circuitTier5,
- RECIPES_Machines.RECIPE_BufferCore_EV, RECIPES_Machines.plateTier6, RECIPES_Machines.cableTier6,
- RECIPES_Machines.plateTier6, RECIPES_Machines.RECIPE_BufferCore_IV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier7, RECIPES_Machines.cableTier7,
- RECIPES_Machines.plateTier7, RECIPES_Machines.RECIPE_BufferCore_IV, RECIPES_Machines.circuitTier6,
- RECIPES_Machines.RECIPE_BufferCore_IV, RECIPES_Machines.plateTier7, RECIPES_Machines.cableTier7,
- RECIPES_Machines.plateTier7, RECIPES_Machines.RECIPE_BufferCore_LuV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier8, RECIPES_Machines.cableTier8,
- RECIPES_Machines.plateTier8, RECIPES_Machines.RECIPE_BufferCore_LuV, RECIPES_Machines.circuitTier7,
- RECIPES_Machines.RECIPE_BufferCore_LuV, RECIPES_Machines.plateTier8, RECIPES_Machines.cableTier8,
- RECIPES_Machines.plateTier8, RECIPES_Machines.RECIPE_BufferCore_ZPM);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier9, RECIPES_Machines.cableTier9,
- RECIPES_Machines.plateTier9, RECIPES_Machines.RECIPE_BufferCore_ZPM, RECIPES_Machines.circuitTier8,
- RECIPES_Machines.RECIPE_BufferCore_ZPM, RECIPES_Machines.plateTier9, RECIPES_Machines.cableTier9,
- RECIPES_Machines.plateTier9, RECIPES_Machines.RECIPE_BufferCore_UV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier10, RECIPES_Machines.cableTier10,
- RECIPES_Machines.plateTier10, RECIPES_Machines.RECIPE_BufferCore_UV, RECIPES_Machines.circuitTier9,
- RECIPES_Machines.RECIPE_BufferCore_UV, RECIPES_Machines.plateTier10, RECIPES_Machines.cableTier10,
- RECIPES_Machines.plateTier10, RECIPES_Machines.RECIPE_BufferCore_MAX);
-
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.wireTier1, RECIPES_Machines.RECIPE_BufferCore_ULV,
- RECIPES_Machines.wireTier1, RECIPES_Machines.wireTier1, RECIPES_Machines.machineCasing_ULV,
- RECIPES_Machines.wireTier1, RECIPES_Machines.circuitPrimitive, RECIPES_Machines.circuitTier1,
- RECIPES_Machines.circuitPrimitive, RECIPES_Machines.RECIPE_Buffer_ULV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.wireTier2, RECIPES_Machines.RECIPE_BufferCore_LV,
- RECIPES_Machines.wireTier2, RECIPES_Machines.wireTier2, RECIPES_Machines.machineCasing_LV,
- RECIPES_Machines.wireTier2, RECIPES_Machines.circuitTier1, RECIPES_Machines.RECIPE_BufferCore_LV,
- RECIPES_Machines.circuitTier1, RECIPES_Machines.RECIPE_Buffer_LV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.wireTier3, RECIPES_Machines.RECIPE_BufferCore_MV,
- RECIPES_Machines.wireTier3, RECIPES_Machines.wireTier3, RECIPES_Machines.machineCasing_MV,
- RECIPES_Machines.wireTier3, RECIPES_Machines.circuitTier2, RECIPES_Machines.RECIPE_BufferCore_MV,
- RECIPES_Machines.circuitTier2, RECIPES_Machines.RECIPE_Buffer_MV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.wireTier4, RECIPES_Machines.RECIPE_BufferCore_HV,
- RECIPES_Machines.wireTier4, RECIPES_Machines.wireTier4, RECIPES_Machines.machineCasing_HV,
- RECIPES_Machines.wireTier4, RECIPES_Machines.circuitTier3, RECIPES_Machines.RECIPE_BufferCore_HV,
- RECIPES_Machines.circuitTier3, RECIPES_Machines.RECIPE_Buffer_HV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.wireTier5, RECIPES_Machines.RECIPE_BufferCore_EV,
- RECIPES_Machines.wireTier5, RECIPES_Machines.wireTier5, RECIPES_Machines.machineCasing_EV,
- RECIPES_Machines.wireTier5, RECIPES_Machines.circuitTier4, RECIPES_Machines.RECIPE_BufferCore_EV,
- RECIPES_Machines.circuitTier4, RECIPES_Machines.RECIPE_Buffer_EV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.wireTier6, RECIPES_Machines.RECIPE_BufferCore_IV,
- RECIPES_Machines.wireTier6, RECIPES_Machines.wireTier6, RECIPES_Machines.machineCasing_IV,
- RECIPES_Machines.wireTier6, RECIPES_Machines.circuitTier5, RECIPES_Machines.RECIPE_BufferCore_IV,
- RECIPES_Machines.circuitTier5, RECIPES_Machines.RECIPE_Buffer_IV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.wireTier7, RECIPES_Machines.RECIPE_BufferCore_LuV,
- RECIPES_Machines.wireTier7, RECIPES_Machines.wireTier7, RECIPES_Machines.machineCasing_LuV,
- RECIPES_Machines.wireTier7, RECIPES_Machines.circuitTier6, RECIPES_Machines.RECIPE_BufferCore_LuV,
- RECIPES_Machines.circuitTier6, RECIPES_Machines.RECIPE_Buffer_LuV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.wireTier8, RECIPES_Machines.RECIPE_BufferCore_ZPM,
- RECIPES_Machines.wireTier8, RECIPES_Machines.wireTier8, RECIPES_Machines.machineCasing_ZPM,
- RECIPES_Machines.wireTier8, RECIPES_Machines.circuitTier7, RECIPES_Machines.RECIPE_BufferCore_ZPM,
- RECIPES_Machines.circuitTier7, RECIPES_Machines.RECIPE_Buffer_ZPM);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.wireTier9, RECIPES_Machines.RECIPE_BufferCore_UV,
- RECIPES_Machines.wireTier9, RECIPES_Machines.wireTier9, RECIPES_Machines.machineCasing_UV,
- RECIPES_Machines.wireTier9, RECIPES_Machines.circuitTier8, RECIPES_Machines.RECIPE_BufferCore_UV,
- RECIPES_Machines.circuitTier8, RECIPES_Machines.RECIPE_Buffer_UV);
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier11, RECIPES_Machines.RECIPE_BufferCore_MAX,
- RECIPES_Machines.plateTier11, RECIPES_Machines.wireTier10, RECIPES_Machines.machineCasing_MAX,
- RECIPES_Machines.wireTier10, RECIPES_Machines.circuitTier9, RECIPES_Machines.RECIPE_BufferCore_MAX,
- RECIPES_Machines.circuitTier9, RECIPES_Machines.RECIPE_Buffer_MAX);
-
- // Steam Condenser
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.pipeLargeCopper, RECIPES_Machines.pipeHugeSteel,
- RECIPES_Machines.pipeLargeCopper, RECIPES_Machines.plateEnergeticAlloy,
- RECIPES_Machines.electricPump_HV, RECIPES_Machines.plateEnergeticAlloy,
- RECIPES_Machines.plateEnergeticAlloy, RECIPES_Machines.pipeLargeCopper,
- RECIPES_Machines.plateEnergeticAlloy, RECIPES_Machines.RECIPE_SteamCondenser);
-
- // Iron BF
- RecipeUtils.addShapedGregtechRecipe("plateDoubleAnyIron", "craftingFurnace", "plateDoubleAnyIron",
- RECIPES_Machines.boiler_Coal, RECIPES_Machines.machineCasing_ULV, RECIPES_Machines.boiler_Coal,
- "plateDoubleAnyIron", "bucketLava", "plateDoubleAnyIron", RECIPES_Machines.RECIPE_IronBlastFurnace);
- // Iron plated Bricks
- RecipeUtils.addShapedGregtechRecipe("plateAnyIron", RECIPES_Tools.craftingToolHardHammer, "plateAnyIron",
- "plateAnyIron", RECIPES_Machines.blockBricks, "plateAnyIron", "plateAnyIron",
- RECIPES_Tools.craftingToolWrench, "plateAnyIron", RECIPES_Machines.RECIPE_IronPlatedBricks);
-
- /*
- * //Electrolyzer Frame Casing UtilsRecipe.addShapedGregtechRecipe(
- * "platePotin", "stickLongChrome", "platePotin", "stickLongPotin",
- * "frameGtPotin", "stickLongPotin", "platePotin", "stickLongPotin",
- * "platePotin", RECIPE_IndustrialCentrifugeCasing); //Industrial
- * Electrolyzer UtilsRecipe.addShapedGregtechRecipe(
- * "plateStellite", circuitTier6, "plateStellite", machineCasing_EV,
- * IV_MACHINE_Electrolyzer, machineCasing_EV, "plateStellite",
- * "rotorStellite", "plateStellite",
- * RECIPE_IndustrialCentrifugeController);
- */
-
- // Industrial Centrifuge
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.circuitTier6, RECIPES_Machines.pipeHugeStainlessSteel,
- RECIPES_Machines.circuitTier6, RECIPES_Machines.plateTier6, RECIPES_Machines.IV_MACHINE_Centrifuge,
- RECIPES_Machines.plateTier6, RECIPES_Machines.plateTier8, RECIPES_Machines.machineCasing_IV,
- RECIPES_Machines.plateTier8, RECIPES_Machines.RECIPE_IndustrialCentrifugeController);
- // Centrifuge Casing
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier6, "stickTumbaga",
- RECIPES_Machines.plateTier6, RECIPES_Machines.plateTier8, "stickTumbaga",
- RECIPES_Machines.plateTier8, RECIPES_Machines.plateTier6, "stickTumbaga",
- RECIPES_Machines.plateTier6, RECIPES_Machines.RECIPE_IndustrialCentrifugeCasing);
-
- if (LoadedMods.Railcraft) {
- // Industrial Coke Oven
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateCobalt, RECIPES_Machines.circuitTier4,
- RECIPES_Machines.plateCobalt, RECIPES_Machines.machineCasing_HV,
- RECIPES_Machines.INPUT_RCCokeOvenBlock, RECIPES_Machines.machineCasing_HV,
- RECIPES_Machines.plateCobalt, RECIPES_Machines.circuitTier5, RECIPES_Machines.plateCobalt,
- RECIPES_Machines.RECIPE_IndustrialCokeOvenController);
+ //Buffer Core
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier1, cableTier1, plateTier1,
+ circuitPrimitive, IC2MFE, circuitPrimitive,
+ plateTier1, cableTier1, plateTier1,
+ RECIPE_BufferCore_ULV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier2, cableTier2, plateTier2,
+ circuitTier1, IC2MFE, circuitTier1,
+ plateTier2, cableTier2, plateTier2,
+ RECIPE_BufferCore_LV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier3, cableTier3, plateTier3,
+ RECIPE_BufferCore_LV, circuitTier2, RECIPE_BufferCore_LV,
+ plateTier3, cableTier3, plateTier3,
+ RECIPE_BufferCore_MV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier4, cableTier4, plateTier4,
+ RECIPE_BufferCore_MV, circuitTier3, RECIPE_BufferCore_MV,
+ plateTier4, cableTier4, plateTier4,
+ RECIPE_BufferCore_HV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier5, cableTier5, plateTier5,
+ RECIPE_BufferCore_HV, circuitTier4, RECIPE_BufferCore_HV,
+ plateTier5, cableTier5, plateTier5,
+ RECIPE_BufferCore_EV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier6, cableTier6, plateTier6,
+ RECIPE_BufferCore_EV, circuitTier5, RECIPE_BufferCore_EV,
+ plateTier6, cableTier6, plateTier6,
+ RECIPE_BufferCore_IV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier7, cableTier7, plateTier7,
+ RECIPE_BufferCore_IV, circuitTier6, RECIPE_BufferCore_IV,
+ plateTier7, cableTier7, plateTier7,
+ RECIPE_BufferCore_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier8, cableTier8, plateTier8,
+ RECIPE_BufferCore_LuV, circuitTier7, RECIPE_BufferCore_LuV,
+ plateTier8, cableTier8, plateTier8,
+ RECIPE_BufferCore_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier9, cableTier9, plateTier9,
+ RECIPE_BufferCore_ZPM, circuitTier8, RECIPE_BufferCore_ZPM,
+ plateTier9, cableTier9, plateTier9,
+ RECIPE_BufferCore_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier10, cableTier10, plateTier10,
+ RECIPE_BufferCore_UV, circuitTier9, RECIPE_BufferCore_UV,
+ plateTier10, cableTier10, plateTier10,
+ RECIPE_BufferCore_MAX);
+
+
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier1, RECIPE_BufferCore_ULV, wireTier1,
+ wireTier1, machineCasing_ULV, wireTier1,
+ circuitPrimitive, circuitTier1, circuitPrimitive,
+ RECIPE_Buffer_ULV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier2, RECIPE_BufferCore_LV, wireTier2,
+ wireTier2, machineCasing_LV, wireTier2,
+ circuitTier1, RECIPE_BufferCore_LV, circuitTier1,
+ RECIPE_Buffer_LV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier3, RECIPE_BufferCore_MV, wireTier3,
+ wireTier3, machineCasing_MV, wireTier3,
+ circuitTier2, RECIPE_BufferCore_MV, circuitTier2,
+ RECIPE_Buffer_MV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier4, RECIPE_BufferCore_HV, wireTier4,
+ wireTier4, machineCasing_HV, wireTier4,
+ circuitTier3, RECIPE_BufferCore_HV, circuitTier3,
+ RECIPE_Buffer_HV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier5, RECIPE_BufferCore_EV, wireTier5,
+ wireTier5, machineCasing_EV, wireTier5,
+ circuitTier4, RECIPE_BufferCore_EV, circuitTier4,
+ RECIPE_Buffer_EV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier6, RECIPE_BufferCore_IV, wireTier6,
+ wireTier6, machineCasing_IV, wireTier6,
+ circuitTier5, RECIPE_BufferCore_IV, circuitTier5,
+ RECIPE_Buffer_IV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier7, RECIPE_BufferCore_LuV, wireTier7,
+ wireTier7, machineCasing_LuV, wireTier7,
+ circuitTier6, RECIPE_BufferCore_LuV, circuitTier6,
+ RECIPE_Buffer_LuV);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier8, RECIPE_BufferCore_ZPM, wireTier8,
+ wireTier8, machineCasing_ZPM, wireTier8,
+ circuitTier7, RECIPE_BufferCore_ZPM, circuitTier7,
+ RECIPE_Buffer_ZPM);
+ RecipeUtils.addShapedGregtechRecipe(
+ wireTier9, RECIPE_BufferCore_UV, wireTier9,
+ wireTier9, machineCasing_UV, wireTier9,
+ circuitTier8, RECIPE_BufferCore_UV, circuitTier8,
+ RECIPE_Buffer_UV);
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier11, RECIPE_BufferCore_MAX, plateTier11,
+ wireTier10, machineCasing_MAX, wireTier10,
+ circuitTier9, RECIPE_BufferCore_MAX, circuitTier9,
+ RECIPE_Buffer_MAX);
+
+ //Steam Condenser
+ RecipeUtils.addShapedGregtechRecipe(
+ pipeLargeCopper, pipeHugeSteel, pipeLargeCopper,
+ plateEnergeticAlloy, electricPump_HV, plateEnergeticAlloy,
+ plateEnergeticAlloy, pipeLargeCopper, plateEnergeticAlloy,
+ RECIPE_SteamCondenser);
+
+ //Iron BF
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateDoubleAnyIron", "craftingFurnace", "plateDoubleAnyIron",
+ boiler_Coal, machineCasing_ULV, boiler_Coal,
+ "plateDoubleAnyIron", "bucketLava", "plateDoubleAnyIron",
+ RECIPE_IronBlastFurnace);
+ //Iron plated Bricks
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateAnyIron", RECIPES_Tools.craftingToolHardHammer, "plateAnyIron",
+ "plateAnyIron", blockBricks, "plateAnyIron",
+ "plateAnyIron", RECIPES_Tools.craftingToolWrench, "plateAnyIron",
+ RECIPE_IronPlatedBricks);
+
+ /*//Electrolyzer Frame Casing
+ UtilsRecipe.addShapedGregtechRecipe(
+ "platePotin", "stickLongChrome", "platePotin",
+ "stickLongPotin", "frameGtPotin", "stickLongPotin",
+ "platePotin", "stickLongPotin", "platePotin",
+ RECIPE_IndustrialCentrifugeCasing);
+ //Industrial Electrolyzer
+ UtilsRecipe.addShapedGregtechRecipe(
+ "plateStellite", circuitTier6, "plateStellite",
+ machineCasing_EV, IV_MACHINE_Electrolyzer, machineCasing_EV,
+ "plateStellite", "rotorStellite", "plateStellite",
+ RECIPE_IndustrialCentrifugeController);*/
+
+ //Industrial Centrifuge
+ RecipeUtils.addShapedGregtechRecipe(
+ circuitTier6, pipeHugeStainlessSteel, circuitTier6,
+ plateTier6, IV_MACHINE_Centrifuge, plateTier6,
+ plateTier8, machineCasing_IV, plateTier8,
+ RECIPE_IndustrialCentrifugeController);
+ //Centrifuge Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier6, "stickTumbaga", plateTier6,
+ plateTier8, "stickTumbaga", plateTier8,
+ plateTier6, "stickTumbaga", plateTier6,
+ RECIPE_IndustrialCentrifugeCasing);
+
+ if (LoadedMods.Railcraft){
+ //Industrial Coke Oven
+ RecipeUtils.addShapedGregtechRecipe(
+ plateCobalt, circuitTier4, plateCobalt,
+ machineCasing_HV, INPUT_RCCokeOvenBlock, machineCasing_HV,
+ plateCobalt, circuitTier5, plateCobalt,
+ RECIPE_IndustrialCokeOvenController);
}
- if (LoadedMods.ImmersiveEngineering) {
- // Industrial Coke Oven
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier8, RECIPES_Machines.circuitTier4,
- RECIPES_Machines.plateTier8, RECIPES_Machines.machineCasing_HV,
- RECIPES_Machines.INPUT_IECokeOvenBlock, RECIPES_Machines.machineCasing_HV,
- RECIPES_Machines.plateTier8, RECIPES_Machines.circuitTier3, RECIPES_Machines.plateTier8,
- RECIPES_Machines.RECIPE_IndustrialCokeOvenController);
+ if (LoadedMods.ImmersiveEngineering){
+ //Industrial Coke Oven
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier8, circuitTier4, plateTier8,
+ machineCasing_HV, INPUT_IECokeOvenBlock, machineCasing_HV,
+ plateTier8, circuitTier3, plateTier8,
+ RECIPE_IndustrialCokeOvenController);
}
- // Coke Oven Frame Casing
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier7, RECIPES_Machines.rodTier7,
- RECIPES_Machines.plateTier7, RECIPES_Machines.rodTier7, "frameGtTantalloy61",
- RECIPES_Machines.rodTier7, RECIPES_Machines.plateTier7, RECIPES_Machines.rodTier7,
- RECIPES_Machines.plateTier7, RECIPES_Machines.RECIPE_IndustrialCokeOvenFrame);
- // Coke Oven Coil 1
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateBronze, RECIPES_Machines.plateBronze,
- RECIPES_Machines.plateBronze, "frameGtBronze", RECIPES_Machines.gearboxCasing_Tier_1,
- "frameGtBronze", RECIPES_Machines.plateBronze, RECIPES_Machines.plateBronze,
- RECIPES_Machines.plateBronze, RECIPES_Machines.RECIPE_IndustrialCokeOvenCasingA);
- // Coke Oven Coil 2
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateSteel, RECIPES_Machines.plateSteel,
- RECIPES_Machines.plateSteel, "frameGtSteel", RECIPES_Machines.gearboxCasing_Tier_2, "frameGtSteel",
- RECIPES_Machines.plateSteel, RECIPES_Machines.plateSteel, RECIPES_Machines.plateSteel,
- RECIPES_Machines.RECIPE_IndustrialCokeOvenCasingB);
-
- // Electrolyzer Frame Casing
- RecipeUtils.addShapedGregtechRecipe("platePotin", "stickLongChrome", "platePotin", "stickLongPotin",
- "frameGtPotin", "stickLongPotin", "platePotin", "stickLongPotin", "platePotin",
- RECIPES_Machines.RECIPE_IndustrialElectrolyzerFrame);
- // Industrial Electrolyzer
- RecipeUtils.addShapedGregtechRecipe("plateStellite", RECIPES_Machines.circuitTier6, "plateStellite",
- RECIPES_Machines.machineCasing_EV, RECIPES_Machines.IV_MACHINE_Electrolyzer,
- RECIPES_Machines.machineCasing_EV, "plateStellite", "rotorStellite", "plateStellite",
- RECIPES_Machines.RECIPE_IndustrialElectrolyzerController);
-
- // Material Press Frame Casing
- RecipeUtils.addShapedGregtechRecipe("plateTitanium", "stickLongTumbaga", "plateTitanium",
- "stickTantalloy60", "frameGtTumbaga", "stickTantalloy60", "plateTitanium", "stickLongTumbaga",
- "plateTitanium", RECIPES_Machines.RECIPE_IndustrialMaterialPressFrame);
- // Industrial Material Press
- RecipeUtils.addShapedGregtechRecipe("plateTitanium", RECIPES_Machines.circuitTier5, "plateTitanium",
- RECIPES_Machines.machineCasing_EV, RECIPES_Machines.IV_MACHINE_BendingMachine,
- RECIPES_Machines.machineCasing_EV, "plateTitanium", RECIPES_Machines.circuitTier5, "plateTitanium",
- RECIPES_Machines.RECIPE_IndustrialMaterialPressController);
-
- // Maceration Frame Casing
- RecipeUtils.addShapedGregtechRecipe("platePalladium", "platePalladium", "platePalladium", "stickPlatinum",
- "frameGtInconel625", "stickPlatinum", "platePalladium", "stickLongPalladium", "platePalladium",
- RECIPES_Machines.RECIPE_IndustrialMacerationStackFrame);
- // Industrial Maceration stack
- RecipeUtils.addShapedGregtechRecipe("plateTungstenCarbide", RECIPES_Machines.IV_MACHINE_Macerator,
- "plateTungstenCarbide", RECIPES_Machines.IV_MACHINE_Macerator, RECIPES_Machines.circuitTier8,
- RECIPES_Machines.IV_MACHINE_Macerator, "plateTungstenCarbide", RECIPES_Machines.machineCasing_IV,
- "plateTungstenCarbide", RECIPES_Machines.RECIPE_IndustrialMacerationStackController);
-
- // Wire Factory Frame Casing
- RecipeUtils.addShapedGregtechRecipe("plateBlueSteel", "stickBlueSteel", "plateBlueSteel", "stickBlueSteel",
- "frameGtBlueSteel", "stickBlueSteel", "plateBlueSteel", "stickBlueSteel", "plateBlueSteel",
- RECIPES_Machines.RECIPE_IndustrialWireFactoryFrame);
- // Industrial Wire Factory
- RecipeUtils.addShapedGregtechRecipe("plateZeron100", RECIPES_Machines.machineCasing_IV, "plateZeron100",
- RECIPES_Machines.circuitTier6, RECIPES_Machines.IV_MACHINE_Wiremill, RECIPES_Machines.circuitTier6,
- "plateZeron100", RECIPES_Machines.machineCasing_IV, "plateZeron100",
- RECIPES_Machines.RECIPE_IndustrialWireFactoryController);
-
- // Tiered Tanks
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier1, RECIPES_Machines.plateTier1,
- RECIPES_Machines.plateTier1, RECIPES_Machines.plateTier1, RECIPES_Machines.pipeTier1,
- RECIPES_Machines.plateTier1, RECIPES_Machines.plateTier1, GregtechItemList.Fluid_Cell_144L.get(1),
- RECIPES_Machines.plateTier1, GregtechItemList.GT_FluidTank_ULV.get(1));
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier2, RECIPES_Machines.plateTier2,
- RECIPES_Machines.plateTier2, RECIPES_Machines.plateTier2, RECIPES_Machines.pipeTier2,
- RECIPES_Machines.plateTier2, RECIPES_Machines.plateTier2, RECIPES_Machines.electricPump_LV,
- RECIPES_Machines.plateTier2, GregtechItemList.GT_FluidTank_LV.get(1));
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier3, RECIPES_Machines.plateTier3,
- RECIPES_Machines.plateTier3, RECIPES_Machines.plateTier3, RECIPES_Machines.pipeTier3,
- RECIPES_Machines.plateTier3, RECIPES_Machines.plateTier3, RECIPES_Machines.electricPump_MV,
- RECIPES_Machines.plateTier3, GregtechItemList.GT_FluidTank_MV.get(1));
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier4, RECIPES_Machines.plateTier4,
- RECIPES_Machines.plateTier4, RECIPES_Machines.plateTier4, RECIPES_Machines.pipeTier4,
- RECIPES_Machines.plateTier4, RECIPES_Machines.plateTier4, RECIPES_Machines.electricPump_HV,
- RECIPES_Machines.plateTier4, GregtechItemList.GT_FluidTank_HV.get(1));
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier5, RECIPES_Machines.plateTier5,
- RECIPES_Machines.plateTier5, RECIPES_Machines.plateTier5, RECIPES_Machines.pipeTier5,
- RECIPES_Machines.plateTier5, RECIPES_Machines.plateTier5, RECIPES_Machines.electricPump_EV,
- RECIPES_Machines.plateTier5, GregtechItemList.GT_FluidTank_EV.get(1));
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier6, RECIPES_Machines.plateTier6,
- RECIPES_Machines.plateTier6, RECIPES_Machines.plateTier6, RECIPES_Machines.pipeTier6,
- RECIPES_Machines.plateTier6, RECIPES_Machines.plateTier6, RECIPES_Machines.electricPump_IV,
- RECIPES_Machines.plateTier6, GregtechItemList.GT_FluidTank_IV.get(1));
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier7, RECIPES_Machines.plateTier7,
- RECIPES_Machines.plateTier7, RECIPES_Machines.plateTier7, RECIPES_Machines.pipeTier7,
- RECIPES_Machines.plateTier7, RECIPES_Machines.plateTier7, RECIPE_CONSTANTS.electricPump_LuV,
- RECIPES_Machines.plateTier7, GregtechItemList.GT_FluidTank_LuV.get(1));
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier8, RECIPES_Machines.plateTier8,
- RECIPES_Machines.plateTier8, RECIPES_Machines.plateTier8, RECIPES_Machines.pipeTier8,
- RECIPES_Machines.plateTier8, RECIPES_Machines.plateTier8, RECIPE_CONSTANTS.electricPump_ZPM,
- RECIPES_Machines.plateTier8, GregtechItemList.GT_FluidTank_ZPM.get(1));
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier9, RECIPES_Machines.plateTier9,
- RECIPES_Machines.plateTier9, RECIPES_Machines.plateTier9, RECIPES_Machines.pipeTier9,
- RECIPES_Machines.plateTier9, RECIPES_Machines.plateTier9, RECIPE_CONSTANTS.electricPump_UV,
- RECIPES_Machines.plateTier9, GregtechItemList.GT_FluidTank_UV.get(1));
- RecipeUtils.addShapedGregtechRecipe(RECIPES_Machines.plateTier10, RECIPES_Machines.plateTier10,
- RECIPES_Machines.plateTier10, RECIPES_Machines.plateTier10, RECIPES_Machines.pipeTier10,
- RECIPES_Machines.plateTier10, RECIPES_Machines.plateTier10, RECIPE_CONSTANTS.electricPump_MAX,
- RECIPES_Machines.plateTier10, GregtechItemList.GT_FluidTank_MAX.get(1));
-
- // Blast Smelter
- RecipeUtils.addShapedGregtechRecipe("plateZirconiumCarbide", RECIPES_Machines.circuitTier4,
- "plateZirconiumCarbide", RECIPES_Machines.cableTier4, RECIPES_Machines.machineCasing_EV,
- RECIPES_Machines.cableTier4, "plateZirconiumCarbide", RECIPES_Machines.circuitTier3,
- "plateZirconiumCarbide", RECIPES_Machines.RECIPE_IndustrialBlastSmelterController);
- // Blast Smelter Frame Casing
- RecipeUtils.addShapedGregtechRecipe("plateZirconiumCarbide", RECIPES_Machines.rodTier5,
- "plateZirconiumCarbide", RECIPES_Machines.rodTier5, "frameGtTumbaga", RECIPES_Machines.rodTier5,
- "plateZirconiumCarbide", RECIPES_Machines.rodTier5, "plateZirconiumCarbide",
- RECIPES_Machines.RECIPE_IndustrialBlastSmelterFrame);
- // Blast Smelter Coil
- RecipeUtils.addShapedGregtechRecipe("plateStaballoy", "plateStaballoy", "plateStaballoy",
- "frameGtStaballoy", RECIPES_Machines.gearboxCasing_Tier_3, "frameGtStaballoy", "plateStaballoy",
- "plateStaballoy", "plateStaballoy", RECIPES_Machines.RECIPE_IndustrialBlastSmelterCoil);
+ //Coke Oven Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier7, rodTier7, plateTier7,
+ rodTier7, "frameGtTantalloy61", rodTier7,
+ plateTier7, rodTier7, plateTier7,
+ RECIPE_IndustrialCokeOvenFrame);
+ //Coke Oven Coil 1
+ RecipeUtils.addShapedGregtechRecipe(
+ plateBronze, plateBronze, plateBronze,
+ "frameGtBronze", gearboxCasing_Tier_1, "frameGtBronze",
+ plateBronze, plateBronze, plateBronze,
+ RECIPE_IndustrialCokeOvenCasingA);
+ //Coke Oven Coil 2
+ RecipeUtils.addShapedGregtechRecipe(
+ plateSteel, plateSteel, plateSteel,
+ "frameGtSteel", gearboxCasing_Tier_2, "frameGtSteel",
+ plateSteel, plateSteel, plateSteel,
+ RECIPE_IndustrialCokeOvenCasingB);
+
+ //Electrolyzer Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "platePotin", "stickLongChrome", "platePotin",
+ "stickLongPotin", "frameGtPotin", "stickLongPotin",
+ "platePotin", "stickLongPotin", "platePotin",
+ RECIPE_IndustrialElectrolyzerFrame);
+ //Industrial Electrolyzer
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateStellite", circuitTier6, "plateStellite",
+ machineCasing_EV, IV_MACHINE_Electrolyzer, machineCasing_EV,
+ "plateStellite", "rotorStellite", "plateStellite",
+ RECIPE_IndustrialElectrolyzerController);
+
+ //Material Press Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateTitanium", "stickLongTumbaga", "plateTitanium",
+ "stickTantalloy60", "frameGtTumbaga", "stickTantalloy60",
+ "plateTitanium", "stickLongTumbaga", "plateTitanium",
+ RECIPE_IndustrialMaterialPressFrame);
+ //Industrial Material Press
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateTitanium", circuitTier5, "plateTitanium",
+ machineCasing_EV, IV_MACHINE_BendingMachine, machineCasing_EV,
+ "plateTitanium", circuitTier5, "plateTitanium",
+ RECIPE_IndustrialMaterialPressController);
+
+ //Maceration Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "platePalladium", "platePalladium", "platePalladium",
+ "stickPlatinum", "frameGtInconel625", "stickPlatinum",
+ "platePalladium", "stickLongPalladium", "platePalladium",
+ RECIPE_IndustrialMacerationStackFrame);
+ //Industrial Maceration stack
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateTungstenCarbide", IV_MACHINE_Macerator, "plateTungstenCarbide",
+ IV_MACHINE_Macerator, circuitTier8, IV_MACHINE_Macerator,
+ "plateTungstenCarbide", machineCasing_IV, "plateTungstenCarbide",
+ RECIPE_IndustrialMacerationStackController);
+
+ //Wire Factory Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateBlueSteel", "stickBlueSteel", "plateBlueSteel",
+ "stickBlueSteel", "frameGtBlueSteel", "stickBlueSteel",
+ "plateBlueSteel", "stickBlueSteel", "plateBlueSteel",
+ RECIPE_IndustrialWireFactoryFrame);
+ //Industrial Wire Factory
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateZeron100", machineCasing_IV, "plateZeron100",
+ circuitTier6, IV_MACHINE_Wiremill, circuitTier6,
+ "plateZeron100", machineCasing_IV, "plateZeron100",
+ RECIPE_IndustrialWireFactoryController);
+
+
+
+ //Tiered Tanks
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier1, plateTier1, plateTier1,
+ plateTier1, pipeTier1, plateTier1,
+ plateTier1, GregtechItemList.Fluid_Cell_144L.get(1), plateTier1,
+ GregtechItemList.GT_FluidTank_ULV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier2, plateTier2, plateTier2,
+ plateTier2, pipeTier2, plateTier2,
+ plateTier2, electricPump_LV, plateTier2,
+ GregtechItemList.GT_FluidTank_LV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier3, plateTier3, plateTier3,
+ plateTier3, pipeTier3, plateTier3,
+ plateTier3, electricPump_MV, plateTier3,
+ GregtechItemList.GT_FluidTank_MV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier4, plateTier4, plateTier4,
+ plateTier4, pipeTier4, plateTier4,
+ plateTier4, electricPump_HV, plateTier4,
+ GregtechItemList.GT_FluidTank_HV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier5, plateTier5, plateTier5,
+ plateTier5, pipeTier5, plateTier5,
+ plateTier5, electricPump_EV, plateTier5,
+ GregtechItemList.GT_FluidTank_EV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier6, plateTier6, plateTier6,
+ plateTier6, pipeTier6, plateTier6,
+ plateTier6, electricPump_IV, plateTier6,
+ GregtechItemList.GT_FluidTank_IV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier7, plateTier7, plateTier7,
+ plateTier7, pipeTier7, plateTier7,
+ plateTier7, RECIPE_CONSTANTS.electricPump_LuV, plateTier7,
+ GregtechItemList.GT_FluidTank_LuV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier8, plateTier8, plateTier8,
+ plateTier8, pipeTier8, plateTier8,
+ plateTier8, RECIPE_CONSTANTS.electricPump_ZPM, plateTier8,
+ GregtechItemList.GT_FluidTank_ZPM.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier9, plateTier9, plateTier9,
+ plateTier9, pipeTier9, plateTier9,
+ plateTier9, RECIPE_CONSTANTS.electricPump_UV, plateTier9,
+ GregtechItemList.GT_FluidTank_UV.get(1));
+ RecipeUtils.addShapedGregtechRecipe(
+ plateTier10, plateTier10, plateTier10,
+ plateTier10, pipeTier10, plateTier10,
+ plateTier10, RECIPE_CONSTANTS.electricPump_MAX, plateTier10,
+ GregtechItemList.GT_FluidTank_MAX.get(1));
+
+
+
+
+
+ //Blast Smelter
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateZirconiumCarbide", circuitTier4, "plateZirconiumCarbide",
+ cableTier4, machineCasing_EV, cableTier4,
+ "plateZirconiumCarbide", circuitTier3, "plateZirconiumCarbide",
+ RECIPE_IndustrialBlastSmelterController);
+ //Blast Smelter Frame Casing
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateZirconiumCarbide", rodTier5, "plateZirconiumCarbide",
+ rodTier5, "frameGtTumbaga", rodTier5,
+ "plateZirconiumCarbide", rodTier5, "plateZirconiumCarbide",
+ RECIPE_IndustrialBlastSmelterFrame);
+ //Blast Smelter Coil
+ RecipeUtils.addShapedGregtechRecipe(
+ "plateStaballoy", "plateStaballoy", "plateStaballoy",
+ "frameGtStaballoy", gearboxCasing_Tier_3, "frameGtStaballoy",
+ "plateStaballoy", "plateStaballoy", "plateStaballoy",
+ RECIPE_IndustrialBlastSmelterCoil);
+
}
+
Utils.LOG_INFO("Done loading recipes for the Various machine blocks.");
}
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java
index b3c7d4e82c..fa11783f70 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java
@@ -7,39 +7,40 @@ import gtPlusPlus.core.util.recipe.RecipeUtils;
import net.minecraft.item.ItemStack;
public class RECIPES_Shapeless {
-
- static ItemStack dustStaballoy;
-
- // Circuits
- static String circuitPrimitive = "circuitPrimitive";
- static String circuitBasic = "circuitBasic";
- static String circuitGood = "circuitGood";
- static String circuitAdvanced = "circuitAdvanced";
- static String circuitData = "circuitData";
- static String circuitElite = "circuitElite";
- static String circuitMaster = "circuitMaster";
- static String circuitUltimate = "circuitUltimate";
- static ItemStack gearboxCasing_Tier_1;
-
- public static final void RECIPES_LOAD() {
- // run();
+
+ static ItemStack dustStaballoy;
+
+ //Circuits
+ static String circuitPrimitive = "circuitPrimitive";
+ static String circuitBasic = "circuitBasic";
+ static String circuitGood = "circuitGood";
+ static String circuitAdvanced = "circuitAdvanced";
+ static String circuitData = "circuitData";
+ static String circuitElite = "circuitElite";
+ static String circuitMaster = "circuitMaster";
+ static String circuitUltimate = "circuitUltimate";
+ static ItemStack gearboxCasing_Tier_1;
+
+ public static final void RECIPES_LOAD(){
+ //run();
Utils.LOG_INFO("Loading Shapeless Recipes.");
}
- private static void run() {
- // Gregtech items
- if (LoadedMods.Gregtech) {
- RECIPES_Shapeless.gearboxCasing_Tier_1 = ItemList.Casing_Gearbox_Bronze.get(1);
-
- RecipeUtils.shapelessBuilder(RECIPES_Shapeless.dustStaballoy, "dustTitanium", "dustUranium", "dustUranium",
- "dustUranium", "dustUranium", "dustUranium", "dustUranium", "dustUranium", "dustUranium");
-
- RecipeUtils.shapelessBuilder(RECIPES_Shapeless.gearboxCasing_Tier_1, RECIPES_Shapeless.circuitPrimitive,
- RECIPES_Shapeless.circuitPrimitive, RECIPES_Shapeless.circuitPrimitive,
- RECIPES_Shapeless.circuitPrimitive, RECIPES_Shapeless.circuitPrimitive,
- RECIPES_Shapeless.circuitPrimitive, RECIPES_Shapeless.circuitPrimitive,
- RECIPES_Shapeless.circuitPrimitive, RECIPES_Shapeless.circuitPrimitive);
+ private static void run(){
+ //Gregtech items
+ if (LoadedMods.Gregtech){
+ gearboxCasing_Tier_1 = ItemList.Casing_Gearbox_Bronze.get(1);
+
+ RecipeUtils.shapelessBuilder(dustStaballoy,
+ "dustTitanium", "dustUranium", "dustUranium",
+ "dustUranium", "dustUranium", "dustUranium",
+ "dustUranium", "dustUranium", "dustUranium");
+
+ RecipeUtils.shapelessBuilder(gearboxCasing_Tier_1,
+ circuitPrimitive, circuitPrimitive, circuitPrimitive,
+ circuitPrimitive, circuitPrimitive, circuitPrimitive,
+ circuitPrimitive, circuitPrimitive, circuitPrimitive);
}
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java
index 1c2625c8e8..17fa4ef93d 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java
@@ -12,162 +12,169 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class RECIPES_Tools {
-
- // Outputs
- public static ItemStack RECIPE_StaballoyPickaxe = new ItemStack(ModItems.itemStaballoyPickaxe);
- public static ItemStack RECIPE_StaballoyAxe = new ItemStack(ModItems.itemStaballoyAxe);
- public static ItemStack RECIPE_SandstoneHammer = new ItemStack(ModItems.itemSandstoneHammer);
- // public static ItemStack RECIPE_StaballoyIngot = new
- // ItemStack(ModItems.itemIngotStaballoy);
- public static ItemStack RECIPE_SandStone = new ItemStack(Blocks.sandstone, 2);
- public static ItemStack RECIPE_Sand = new ItemStack(Blocks.sand, 4);
-
- public static ItemStack RECIPE_DivisionSigil;
-
- // MC Items
- public static Item Apple = Items.apple;
-
- // MC Blocks
- public static Block CobbleStone = Blocks.cobblestone;
- public static Block Dirt = Blocks.dirt;
- public static Block Sand = Blocks.sand;
- public static Block Gravel = Blocks.gravel;
- public static Block Sandstone = Blocks.sandstone;
-
- // null
- public static String empty = " ";
-
- // Batteries
- public static String batteryBasic = "batteryBasic";
- public static String batteryAdvanced = "batteryAdvanced";
- public static String batteryElite = "batteryElite";
- public static String batteryMaster = "batteryMaster";
- public static String batteryUltimate = "batteryUltimate";
-
- // Circuits
- public static String circuitPrimitive = "circuitPrimitive";
- public static String circuitBasic = "circuitBasic";
- public static String circuitGood = "circuitGood";
- public static String circuitAdvanced = "circuitAdvanced";
- public static String circuitElite = "circuitElite";
- public static String circuitMaster = "circuitMaster";
- public static String circuitUltimate = "circuitUltimate";
-
- // Cables
- public static String cableGt01Electrum = "cableGt01Electrum";
- public static String cableGt02Electrum = "cableGt02Electrum";
- public static String cableGt01RedstoneAlloy = "cableGt01RedstoneAlloy";
- public static String cableGt02RedstoneAlloy = "cableGt02RedstoneAlloy";
- public static String cableGt01Copper = "cableGt01Copper";
- public static String cableGt02Copper = "cableGt02Copper";
- public static String cableGt01AnnealedCopper = "cableGt01AnnealedCopper";
- public static String cableGt02AnnealedCopper = "cableGt02AnnealedCopper";
-
- // Rods
- public static String stickStaballoy = "stickStaballoy";
- public static String stickTitanium = "stickTitanium";
- public static String stickIron = "stickIron";
- public static String stickGold = "stickGold";
- public static String stickSilver = "stickSilver";
- public static String stickSteel = "stickSteel";
- public static String stickBronze = "stickBronze";
- public static String stickTungsten = "stickTungsten";
- public static String stickRedAlloy = "stickRedAlloy";
- public static String stickInvar = "stickInvar";
- public static String stickElectrum = "stickElectrum";
- public static String stickElectricalSteel = "stickElectricalSteel";
-
- // Plates
- public static String plateStaballoy = "plateStaballoy";
- public static String plateTitanium = "plateTitanium";
- public static String plateIron = "plateIron";
- public static String plateGold = "plateGold";
- public static String plateSilver = "plateSilver";
- public static String plateSteel = "plateSteel";
- public static String plateBronze = "plateBronze";
- public static String plateTungsten = "plateTungsten";
- public static String plateRedAlloy = "plateRedAlloy";
- public static String plateInvar = "plateInvar";
- public static String plateElectrum = "plateElectrum";
- public static String plateElectricalSteel = "plateElectricalSteel";
-
- // Ingots
- public static String ingotStaballoy = "ingotStaballoy";
- public static String ingotTitanium = "ingotTitanium";
- public static String ingotIron = "ingotIron";
- public static String ingotGold = "ingotGold";
- public static String ingotSilver = "ingotSilver";
- public static String ingotSteel = "ingotSteel";
- public static String ingotBronze = "ingotBronze";
- public static String ingotTungsten = "ingotTungsten";
- public static String ingotRedAlloy = "ingotRedAlloy";
- public static String ingotInvar = "ingotInvar";
- public static String ingotElectrum = "ingotElectrum";
- public static String ingotUranium = "ingotUranium";
- public static String ingotElectricalSteel = "ingotElectricalSteel";
-
- // Crafting Tools
- public static String craftingToolHardHammer = "craftingToolHardHammer";
- public static String craftingToolSoftHammer = "craftingToolSoftHammer";
- public static String craftingToolFile = "craftingToolFile";
- public static String craftingToolSaw = "craftingToolSaw";
- public static String craftingToolPickaxe = "craftingToolPickaxe";
- public static String craftingToolWrench = "craftingToolWrench";
- public static String craftingToolCrowbar = "craftingToolCrowbar";
- public static String craftingToolKnife = "craftingToolKnife";
- public static String craftingToolScrewdriver = "craftingToolScrewdriver";
-
- public static ItemStack sandHammer = new ItemStack(ModItems.itemSandstoneHammer, 1,
- OreDictionary.WILDCARD_VALUE);
- public static String craftingToolSandHammer = "craftingToolSandHammer";
-
- public static ItemStack personalCloakingDevice = ItemUtils.getSimpleStack(ModItems.itemPersonalCloakingDevice);
- public static String plateDoubleNiChrome = "plateDoubleNichrome";
- public static String plateIridiumAlloy = "plateAlloyIridium";
-
- public static final void RECIPES_LOAD() {
-
- RECIPES_Tools.run();
-
+
+ //Outputs
+ public static ItemStack RECIPE_StaballoyPickaxe = new ItemStack(ModItems.itemStaballoyPickaxe);
+ public static ItemStack RECIPE_StaballoyAxe = new ItemStack(ModItems.itemStaballoyAxe);
+ public static ItemStack RECIPE_SandstoneHammer = new ItemStack(ModItems.itemSandstoneHammer);
+ //public static ItemStack RECIPE_StaballoyIngot = new ItemStack(ModItems.itemIngotStaballoy);
+ public static ItemStack RECIPE_SandStone = new ItemStack(Blocks.sandstone, 2);
+ public static ItemStack RECIPE_Sand = new ItemStack(Blocks.sand, 4);
+
+ public static ItemStack RECIPE_DivisionSigil;
+
+ //MC Items
+ public static Item Apple = Items.apple;
+
+ //MC Blocks
+ public static Block CobbleStone = Blocks.cobblestone;
+ public static Block Dirt = Blocks.dirt;
+ public static Block Sand = Blocks.sand;
+ public static Block Gravel = Blocks.gravel;
+ public static Block Sandstone = Blocks.sandstone;
+
+ //null
+ public static String empty = " ";
+
+ //Batteries
+ public static String batteryBasic = "batteryBasic";
+ public static String batteryAdvanced = "batteryAdvanced";
+ public static String batteryElite = "batteryElite";
+ public static String batteryMaster = "batteryMaster";
+ public static String batteryUltimate = "batteryUltimate";
+
+ //Circuits
+ public static String circuitPrimitive = "circuitPrimitive";
+ public static String circuitBasic = "circuitBasic";
+ public static String circuitGood = "circuitGood";
+ public static String circuitAdvanced = "circuitAdvanced";
+ public static String circuitElite = "circuitElite";
+ public static String circuitMaster = "circuitMaster";
+ public static String circuitUltimate = "circuitUltimate";
+
+ //Cables
+ public static String cableGt01Electrum = "cableGt01Electrum";
+ public static String cableGt02Electrum = "cableGt02Electrum";
+ public static String cableGt01RedstoneAlloy = "cableGt01RedstoneAlloy";
+ public static String cableGt02RedstoneAlloy = "cableGt02RedstoneAlloy";
+ public static String cableGt01Copper = "cableGt01Copper";
+ public static String cableGt02Copper = "cableGt02Copper";
+ public static String cableGt01AnnealedCopper = "cableGt01AnnealedCopper";
+ public static String cableGt02AnnealedCopper = "cableGt02AnnealedCopper";
+
+ //Rods
+ public static String stickStaballoy= "stickStaballoy";
+ public static String stickTitanium= "stickTitanium";
+ public static String stickIron= "stickIron";
+ public static String stickGold= "stickGold";
+ public static String stickSilver= "stickSilver";
+ public static String stickSteel= "stickSteel";
+ public static String stickBronze= "stickBronze";
+ public static String stickTungsten= "stickTungsten";
+ public static String stickRedAlloy= "stickRedAlloy";
+ public static String stickInvar= "stickInvar";
+ public static String stickElectrum= "stickElectrum";
+ public static String stickElectricalSteel= "stickElectricalSteel";
+
+ //Plates
+ public static String plateStaballoy= "plateStaballoy";
+ public static String plateTitanium= "plateTitanium";
+ public static String plateIron= "plateIron";
+ public static String plateGold= "plateGold";
+ public static String plateSilver= "plateSilver";
+ public static String plateSteel= "plateSteel";
+ public static String plateBronze= "plateBronze";
+ public static String plateTungsten= "plateTungsten";
+ public static String plateRedAlloy= "plateRedAlloy";
+ public static String plateInvar= "plateInvar";
+ public static String plateElectrum= "plateElectrum";
+ public static String plateElectricalSteel= "plateElectricalSteel";
+
+ //Ingots
+ public static String ingotStaballoy= "ingotStaballoy";
+ public static String ingotTitanium= "ingotTitanium";
+ public static String ingotIron= "ingotIron";
+ public static String ingotGold= "ingotGold";
+ public static String ingotSilver= "ingotSilver";
+ public static String ingotSteel= "ingotSteel";
+ public static String ingotBronze= "ingotBronze";
+ public static String ingotTungsten= "ingotTungsten";
+ public static String ingotRedAlloy= "ingotRedAlloy";
+ public static String ingotInvar= "ingotInvar";
+ public static String ingotElectrum= "ingotElectrum";
+ public static String ingotUranium= "ingotUranium";
+ public static String ingotElectricalSteel= "ingotElectricalSteel";
+
+ //Crafting Tools
+ public static String craftingToolHardHammer = "craftingToolHardHammer";
+ public static String craftingToolSoftHammer = "craftingToolSoftHammer";
+ public static String craftingToolFile = "craftingToolFile";
+ public static String craftingToolSaw = "craftingToolSaw";
+ public static String craftingToolPickaxe = "craftingToolPickaxe";
+ public static String craftingToolWrench = "craftingToolWrench";
+ public static String craftingToolCrowbar = "craftingToolCrowbar";
+ public static String craftingToolKnife = "craftingToolKnife";
+ public static String craftingToolScrewdriver = "craftingToolScrewdriver";
+
+ public static ItemStack sandHammer = new ItemStack (ModItems.itemSandstoneHammer, 1, OreDictionary.WILDCARD_VALUE);
+ public static String craftingToolSandHammer = "craftingToolSandHammer";
+
+ public static ItemStack personalCloakingDevice = ItemUtils.getSimpleStack(ModItems.itemPersonalCloakingDevice);
+ public static String plateDoubleNiChrome = "plateDoubleNichrome";
+ public static String plateIridiumAlloy = "plateAlloyIridium";
+
+ public static final void RECIPES_LOAD(){
+
+
+ run();
+
}
-
- private static void run() {
- // Staballoy Pickaxe
- RecipeUtils.recipeBuilder(RECIPES_Tools.plateStaballoy, RECIPES_Tools.plateStaballoy,
- RECIPES_Tools.ingotStaballoy, RECIPES_Tools.craftingToolFile, RECIPES_Tools.stickTungsten,
- RECIPES_Tools.craftingToolHardHammer, RECIPES_Tools.craftingToolWrench, RECIPES_Tools.stickTungsten,
- RECIPES_Tools.craftingToolHardHammer, RECIPES_Tools.RECIPE_StaballoyPickaxe);
-
- // Staballoy Axe
- RecipeUtils.recipeBuilder(RECIPES_Tools.plateStaballoy, RECIPES_Tools.ingotStaballoy,
- RECIPES_Tools.craftingToolHardHammer, RECIPES_Tools.plateStaballoy, RECIPES_Tools.stickTungsten,
- RECIPES_Tools.craftingToolHardHammer, RECIPES_Tools.craftingToolFile, RECIPES_Tools.stickTungsten,
- RECIPES_Tools.craftingToolWrench, RECIPES_Tools.RECIPE_StaballoyAxe);
-
- // Cobble to Sand
- RecipeUtils.recipeBuilder(RECIPES_Tools.CobbleStone, RECIPES_Tools.CobbleStone, RECIPES_Tools.CobbleStone,
- RECIPES_Tools.CobbleStone, RECIPES_Tools.sandHammer, RECIPES_Tools.CobbleStone,
- RECIPES_Tools.CobbleStone, RECIPES_Tools.CobbleStone, RECIPES_Tools.CobbleStone,
- RECIPES_Tools.RECIPE_Sand);
-
- if (LoadedMods.Baubles) {
- // Cloaking Device
- RecipeUtils.recipeBuilder(RECIPES_Tools.plateDoubleNiChrome, RECIPES_Tools.plateIridiumAlloy,
- RECIPES_Tools.plateDoubleNiChrome, RECIPES_Tools.plateIridiumAlloy, RECIPES_Tools.batteryUltimate,
- RECIPES_Tools.plateIridiumAlloy, RECIPES_Tools.plateDoubleNiChrome, RECIPES_Tools.plateIridiumAlloy,
- RECIPES_Tools.plateDoubleNiChrome, RECIPES_Tools.personalCloakingDevice);
-
+
+ private static void run(){
+ //Staballoy Pickaxe
+ RecipeUtils.recipeBuilder(
+ plateStaballoy, plateStaballoy, ingotStaballoy,
+ craftingToolFile, stickTungsten, craftingToolHardHammer,
+ craftingToolWrench, stickTungsten, craftingToolHardHammer,
+ RECIPE_StaballoyPickaxe);
+
+ //Staballoy Axe
+ RecipeUtils.recipeBuilder(
+ plateStaballoy, ingotStaballoy, craftingToolHardHammer,
+ plateStaballoy, stickTungsten, craftingToolHardHammer,
+ craftingToolFile, stickTungsten, craftingToolWrench,
+ RECIPE_StaballoyAxe);
+
+ //Cobble to Sand
+ RecipeUtils.recipeBuilder(
+ CobbleStone, CobbleStone, CobbleStone,
+ CobbleStone, sandHammer, CobbleStone,
+ CobbleStone, CobbleStone, CobbleStone,
+ RECIPE_Sand);
+
+ if (LoadedMods.Baubles){
+ //Cloaking Device
+ RecipeUtils.recipeBuilder(
+ plateDoubleNiChrome, plateIridiumAlloy, plateDoubleNiChrome,
+ plateIridiumAlloy, batteryUltimate, plateIridiumAlloy,
+ plateDoubleNiChrome, plateIridiumAlloy, plateDoubleNiChrome,
+ personalCloakingDevice);
+
}
- // Sand to Sandstone
- RecipeUtils.recipeBuilder(RECIPES_Tools.Sand, RECIPES_Tools.Sand, RECIPES_Tools.Sand, RECIPES_Tools.Sand,
- RECIPES_Tools.sandHammer, RECIPES_Tools.Sand, RECIPES_Tools.Sand, RECIPES_Tools.Sand,
- RECIPES_Tools.Sand, RECIPES_Tools.RECIPE_SandStone);
-
- // Sandstone Hammer
- RecipeUtils.recipeBuilder(RECIPES_Tools.plateElectrum, RECIPES_Tools.ingotElectrum, RECIPES_Tools.plateElectrum,
- RECIPES_Tools.craftingToolScrewdriver, RECIPES_Tools.stickBronze, RECIPES_Tools.craftingToolHardHammer,
- null, RECIPES_Tools.stickSteel, null, RECIPES_Tools.RECIPE_SandstoneHammer);
-
+ //Sand to Sandstone
+ RecipeUtils.recipeBuilder(
+ Sand, Sand, Sand,
+ Sand, sandHammer, Sand,
+ Sand, Sand, Sand,
+ RECIPE_SandStone);
+
+ //Sandstone Hammer
+ RecipeUtils.recipeBuilder(
+ plateElectrum, ingotElectrum, plateElectrum,
+ craftingToolScrewdriver, stickBronze, craftingToolHardHammer,
+ null, stickSteel, null,
+ RECIPE_SandstoneHammer);
+
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java b/src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java
index 7be85973f9..440f8815bc 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java
@@ -8,41 +8,42 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import net.minecraft.item.ItemStack;
public class RECIPE_Batteries {
-
- static ItemStack RECIPE_Battery_Sodium = GregtechItemList.Battery_RE_EV_Sodium.get(1);
- static ItemStack RECIPE_Battery_Cadmium = GregtechItemList.Battery_RE_EV_Cadmium.get(1);
- static ItemStack RECIPE_Battery_Lithium = GregtechItemList.Battery_RE_EV_Lithium.get(1);
- static ItemStack GT_Battery_Sodium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32539, 1);
- static ItemStack GT_Battery_Cadmium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32537, 1);
- static ItemStack GT_Battery_Lithium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32538, 1);
- static ItemStack machineTransformer_EV;
-
- public static void RECIPES_LOAD() {
-
- if (LoadedMods.Gregtech) {
- RECIPE_Batteries.machineTransformer_EV = ItemList.Transformer_EV_HV.get(1);
- RECIPE_Batteries.run();
+
+ static ItemStack RECIPE_Battery_Sodium = GregtechItemList.Battery_RE_EV_Sodium.get(1);
+ static ItemStack RECIPE_Battery_Cadmium = GregtechItemList.Battery_RE_EV_Cadmium.get(1);
+ static ItemStack RECIPE_Battery_Lithium = GregtechItemList.Battery_RE_EV_Lithium.get(1);
+ static ItemStack GT_Battery_Sodium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32539, 1);
+ static ItemStack GT_Battery_Cadmium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32537, 1);
+ static ItemStack GT_Battery_Lithium = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32538, 1);
+ static ItemStack machineTransformer_EV;
+
+ public static void RECIPES_LOAD(){
+
+ if (LoadedMods.Gregtech){
+ machineTransformer_EV = ItemList.Transformer_EV_HV.get(1);
+ run();
}
}
-
- private static void run() {
-
- RecipeUtils.addShapedGregtechRecipe(RECIPE_Batteries.GT_Battery_Sodium, RECIPES_Machines.cableTier4,
- RECIPE_Batteries.GT_Battery_Sodium, RECIPES_Machines.circuitTier3,
- RECIPE_Batteries.machineTransformer_EV, RECIPES_Machines.circuitTier3,
- RECIPE_Batteries.GT_Battery_Sodium, RECIPES_Machines.cableTier4, RECIPE_Batteries.GT_Battery_Sodium,
- RECIPE_Batteries.RECIPE_Battery_Sodium);
- RecipeUtils.addShapedGregtechRecipe(RECIPE_Batteries.GT_Battery_Cadmium, RECIPES_Machines.cableTier4,
- RECIPE_Batteries.GT_Battery_Cadmium, RECIPES_Machines.circuitTier3,
- RECIPE_Batteries.machineTransformer_EV, RECIPES_Machines.circuitTier3,
- RECIPE_Batteries.GT_Battery_Cadmium, RECIPES_Machines.cableTier4, RECIPE_Batteries.GT_Battery_Cadmium,
- RECIPE_Batteries.RECIPE_Battery_Cadmium);
- RecipeUtils.addShapedGregtechRecipe(RECIPE_Batteries.GT_Battery_Lithium, RECIPES_Machines.cableTier4,
- RECIPE_Batteries.GT_Battery_Lithium, RECIPES_Machines.circuitTier3,
- RECIPE_Batteries.machineTransformer_EV, RECIPES_Machines.circuitTier3,
- RECIPE_Batteries.GT_Battery_Lithium, RECIPES_Machines.cableTier4, RECIPE_Batteries.GT_Battery_Lithium,
- RECIPE_Batteries.RECIPE_Battery_Lithium);
-
+
+ private static void run(){
+
+
+ RecipeUtils.addShapedGregtechRecipe(
+ GT_Battery_Sodium, RECIPES_Machines.cableTier4, GT_Battery_Sodium,
+ RECIPES_Machines.circuitTier3, machineTransformer_EV, RECIPES_Machines.circuitTier3,
+ GT_Battery_Sodium, RECIPES_Machines.cableTier4, GT_Battery_Sodium,
+ RECIPE_Battery_Sodium);
+ RecipeUtils.addShapedGregtechRecipe(
+ GT_Battery_Cadmium, RECIPES_Machines.cableTier4, GT_Battery_Cadmium,
+ RECIPES_Machines.circuitTier3, machineTransformer_EV, RECIPES_Machines.circuitTier3,
+ GT_Battery_Cadmium, RECIPES_Machines.cableTier4, GT_Battery_Cadmium,
+ RECIPE_Battery_Cadmium);
+ RecipeUtils.addShapedGregtechRecipe(
+ GT_Battery_Lithium, RECIPES_Machines.cableTier4, GT_Battery_Lithium,
+ RECIPES_Machines.circuitTier3, machineTransformer_EV, RECIPES_Machines.circuitTier3,
+ GT_Battery_Lithium, RECIPES_Machines.cableTier4, GT_Battery_Lithium,
+ RECIPE_Battery_Lithium);
+
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java b/src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java
index 2cdf006307..c0548e9e74 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java
@@ -7,120 +7,120 @@ import net.minecraft.item.ItemStack;
public class RECIPE_CONSTANTS {
- // Machine Components
- public static ItemStack electricMotor_LuV;
- public static ItemStack electricMotor_ZPM;
- public static ItemStack electricMotor_UV;
- public static ItemStack electricMotor_MAX;
- public static ItemStack electricPump_LuV;
- public static ItemStack electricPump_ZPM;
- public static ItemStack electricPump_UV;
- public static ItemStack electricPump_MAX;
- public static ItemStack electricPiston_LuV;
- public static ItemStack electricPiston_ZPM;
- public static ItemStack electricPiston_UV;
- public static ItemStack electricPiston_MAX;
- public static ItemStack robotArm_LuV;
- public static ItemStack robotArm_ZPM;
- public static ItemStack robotArm_UV;
- public static ItemStack robotArm_MAX;
- public static ItemStack conveyorModule_LuV;
- public static ItemStack conveyorModule_ZPM;
- public static ItemStack conveyorModule_UV;
- public static ItemStack conveyorModule_MAX;
- public static ItemStack emitter_LuV;
- public static ItemStack emitter_ZPM;
- public static ItemStack emitter_UV;
- public static ItemStack emitter_MAX;
- public static ItemStack fieldGenerator_LuV;
- public static ItemStack fieldGenerator_ZPM;
- public static ItemStack fieldGenerator_UV;
- public static ItemStack fieldGenerator_MAX;
- public static ItemStack sensor_LuV;
- public static ItemStack sensor_ZPM;
- public static ItemStack sensor_UV;
- public static ItemStack sensor_MAX;
-
- public static void initialise() {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- RECIPE_CONSTANTS.registerGTExperimentalComponents();
+ //Machine Components
+ public static ItemStack electricMotor_LuV;
+ public static ItemStack electricMotor_ZPM;
+ public static ItemStack electricMotor_UV;
+ public static ItemStack electricMotor_MAX;
+ public static ItemStack electricPump_LuV;
+ public static ItemStack electricPump_ZPM;
+ public static ItemStack electricPump_UV;
+ public static ItemStack electricPump_MAX;
+ public static ItemStack electricPiston_LuV;
+ public static ItemStack electricPiston_ZPM;
+ public static ItemStack electricPiston_UV ;
+ public static ItemStack electricPiston_MAX;
+ public static ItemStack robotArm_LuV;
+ public static ItemStack robotArm_ZPM;
+ public static ItemStack robotArm_UV;
+ public static ItemStack robotArm_MAX;
+ public static ItemStack conveyorModule_LuV;
+ public static ItemStack conveyorModule_ZPM;
+ public static ItemStack conveyorModule_UV;
+ public static ItemStack conveyorModule_MAX;
+ public static ItemStack emitter_LuV;
+ public static ItemStack emitter_ZPM;
+ public static ItemStack emitter_UV;
+ public static ItemStack emitter_MAX;
+ public static ItemStack fieldGenerator_LuV;
+ public static ItemStack fieldGenerator_ZPM;
+ public static ItemStack fieldGenerator_UV;
+ public static ItemStack fieldGenerator_MAX;
+ public static ItemStack sensor_LuV;
+ public static ItemStack sensor_ZPM;
+ public static ItemStack sensor_UV;
+ public static ItemStack sensor_MAX;
+
+ public static void initialise(){
+ if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ registerGTExperimentalComponents();
}
else {
- RECIPE_CONSTANTS.registerGTStandardComponents();
+ registerGTStandardComponents();
}
}
-
- private static void registerGTExperimentalComponents() {
- // Machine Components
- RECIPE_CONSTANTS.electricMotor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32606, 1);
- RECIPE_CONSTANTS.electricMotor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32607, 1);
- RECIPE_CONSTANTS.electricMotor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32608, 1);
- RECIPE_CONSTANTS.electricPump_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32620, 1);
- RECIPE_CONSTANTS.electricPump_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32621, 1);
- RECIPE_CONSTANTS.electricPump_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32622, 1);
- RECIPE_CONSTANTS.electricPiston_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32645, 1);
- RECIPE_CONSTANTS.electricPiston_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32646, 1);
- RECIPE_CONSTANTS.electricPiston_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32647, 1);
- RECIPE_CONSTANTS.robotArm_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32655, 1);
- RECIPE_CONSTANTS.robotArm_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32656, 1);
- RECIPE_CONSTANTS.robotArm_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32657, 1);
- RECIPE_CONSTANTS.conveyorModule_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32636, 1);
- RECIPE_CONSTANTS.conveyorModule_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32637, 1);
- RECIPE_CONSTANTS.conveyorModule_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32638, 1);
- RECIPE_CONSTANTS.emitter_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32685, 1);
- RECIPE_CONSTANTS.emitter_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32686, 1);
- RECIPE_CONSTANTS.emitter_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32687, 1);
- RECIPE_CONSTANTS.fieldGenerator_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32675, 1);
- RECIPE_CONSTANTS.fieldGenerator_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32676, 1);
- RECIPE_CONSTANTS.fieldGenerator_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32677, 1);
- RECIPE_CONSTANTS.sensor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32695, 1);
- RECIPE_CONSTANTS.sensor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1);
- RECIPE_CONSTANTS.sensor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1);
-
- // Max Tier Components Blood Never added... Useless, lol.
- RECIPE_CONSTANTS.electricMotor_MAX = GregtechItemList.Electric_Motor_MAX.get(1);
- RECIPE_CONSTANTS.electricPump_MAX = GregtechItemList.Electric_Pump_MAX.get(1);
- RECIPE_CONSTANTS.electricPiston_MAX = GregtechItemList.Electric_Piston_MAX.get(1);
- RECIPE_CONSTANTS.robotArm_MAX = GregtechItemList.Robot_Arm_MAX.get(1);
- RECIPE_CONSTANTS.conveyorModule_MAX = GregtechItemList.Conveyor_Module_MAX.get(1);
- RECIPE_CONSTANTS.emitter_MAX = GregtechItemList.Emitter_MAX.get(1);
- RECIPE_CONSTANTS.fieldGenerator_MAX = GregtechItemList.Field_Generator_MAX.get(1);
- RECIPE_CONSTANTS.sensor_MAX = GregtechItemList.Sensor_MAX.get(1);
+
+ private static void registerGTExperimentalComponents(){
+ //Machine Components
+ electricMotor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32606, 1);
+ electricMotor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32607, 1);
+ electricMotor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32608, 1);
+ electricPump_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32620, 1);
+ electricPump_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32621, 1);
+ electricPump_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32622, 1);
+ electricPiston_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32645, 1);
+ electricPiston_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32646, 1);
+ electricPiston_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32647, 1);
+ robotArm_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32655, 1);
+ robotArm_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32656, 1);
+ robotArm_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32657, 1);
+ conveyorModule_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32636, 1);
+ conveyorModule_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32637, 1);
+ conveyorModule_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32638, 1);
+ emitter_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32685, 1);
+ emitter_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32686, 1);
+ emitter_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32687, 1);
+ fieldGenerator_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32675, 1);
+ fieldGenerator_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32676, 1);
+ fieldGenerator_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32677, 1);
+ sensor_LuV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32695, 1);
+ sensor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1);
+ sensor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1);
+
+ //Max Tier Components Blood Never added... Useless, lol.
+ electricMotor_MAX = GregtechItemList.Electric_Motor_MAX.get(1);
+ electricPump_MAX = GregtechItemList.Electric_Pump_MAX.get(1);
+ electricPiston_MAX = GregtechItemList.Electric_Piston_MAX.get(1);
+ robotArm_MAX = GregtechItemList.Robot_Arm_MAX.get(1);
+ conveyorModule_MAX = GregtechItemList.Conveyor_Module_MAX.get(1);
+ emitter_MAX = GregtechItemList.Emitter_MAX.get(1);
+ fieldGenerator_MAX = GregtechItemList.Field_Generator_MAX.get(1);
+ sensor_MAX = GregtechItemList.Sensor_MAX.get(1);
}
-
- private static void registerGTStandardComponents() {
- RECIPE_CONSTANTS.electricMotor_LuV = GregtechItemList.Electric_Motor_LuV.get(1);
- RECIPE_CONSTANTS.electricMotor_ZPM = GregtechItemList.Electric_Motor_ZPM.get(1);
- RECIPE_CONSTANTS.electricMotor_UV = GregtechItemList.Electric_Motor_UV.get(1);
- RECIPE_CONSTANTS.electricMotor_MAX = GregtechItemList.Electric_Motor_MAX.get(1);
- RECIPE_CONSTANTS.electricPump_LuV = GregtechItemList.Electric_Pump_LuV.get(1);
- RECIPE_CONSTANTS.electricPump_ZPM = GregtechItemList.Electric_Pump_ZPM.get(1);
- RECIPE_CONSTANTS.electricPump_UV = GregtechItemList.Electric_Pump_UV.get(1);
- RECIPE_CONSTANTS.electricPump_MAX = GregtechItemList.Electric_Pump_MAX.get(1);
- RECIPE_CONSTANTS.electricPiston_LuV = GregtechItemList.Electric_Piston_LuV.get(1);
- RECIPE_CONSTANTS.electricPiston_ZPM = GregtechItemList.Electric_Piston_ZPM.get(1);
- RECIPE_CONSTANTS.electricPiston_UV = GregtechItemList.Electric_Piston_UV.get(1);
- RECIPE_CONSTANTS.electricPiston_MAX = GregtechItemList.Electric_Piston_MAX.get(1);
- RECIPE_CONSTANTS.robotArm_LuV = GregtechItemList.Robot_Arm_LuV.get(1);
- RECIPE_CONSTANTS.robotArm_ZPM = GregtechItemList.Robot_Arm_ZPM.get(1);
- RECIPE_CONSTANTS.robotArm_UV = GregtechItemList.Robot_Arm_UV.get(1);
- RECIPE_CONSTANTS.robotArm_MAX = GregtechItemList.Robot_Arm_MAX.get(1);
- RECIPE_CONSTANTS.conveyorModule_LuV = GregtechItemList.Conveyor_Module_LuV.get(1);
- RECIPE_CONSTANTS.conveyorModule_ZPM = GregtechItemList.Conveyor_Module_ZPM.get(1);
- RECIPE_CONSTANTS.conveyorModule_UV = GregtechItemList.Conveyor_Module_UV.get(1);
- RECIPE_CONSTANTS.conveyorModule_MAX = GregtechItemList.Conveyor_Module_MAX.get(1);
- RECIPE_CONSTANTS.emitter_LuV = GregtechItemList.Emitter_LuV.get(1);
- RECIPE_CONSTANTS.emitter_ZPM = GregtechItemList.Emitter_ZPM.get(1);
- RECIPE_CONSTANTS.emitter_UV = GregtechItemList.Emitter_UV.get(1);
- RECIPE_CONSTANTS.emitter_MAX = GregtechItemList.Emitter_MAX.get(1);
- RECIPE_CONSTANTS.fieldGenerator_LuV = GregtechItemList.Field_Generator_LuV.get(1);
- RECIPE_CONSTANTS.fieldGenerator_ZPM = GregtechItemList.Field_Generator_ZPM.get(1);
- RECIPE_CONSTANTS.fieldGenerator_UV = GregtechItemList.Field_Generator_UV.get(1);
- RECIPE_CONSTANTS.fieldGenerator_MAX = GregtechItemList.Field_Generator_MAX.get(1);
- RECIPE_CONSTANTS.sensor_LuV = GregtechItemList.Sensor_LuV.get(1);
- RECIPE_CONSTANTS.sensor_ZPM = GregtechItemList.Sensor_ZPM.get(1);
- RECIPE_CONSTANTS.sensor_UV = GregtechItemList.Sensor_UV.get(1);
- RECIPE_CONSTANTS.sensor_MAX = GregtechItemList.Sensor_MAX.get(1);
+
+ private static void registerGTStandardComponents(){
+ electricMotor_LuV = GregtechItemList.Electric_Motor_LuV.get(1);
+ electricMotor_ZPM = GregtechItemList.Electric_Motor_ZPM.get(1);
+ electricMotor_UV = GregtechItemList.Electric_Motor_UV.get(1);
+ electricMotor_MAX = GregtechItemList.Electric_Motor_MAX.get(1);
+ electricPump_LuV = GregtechItemList.Electric_Pump_LuV.get(1);
+ electricPump_ZPM = GregtechItemList.Electric_Pump_ZPM.get(1);
+ electricPump_UV = GregtechItemList.Electric_Pump_UV.get(1);
+ electricPump_MAX = GregtechItemList.Electric_Pump_MAX.get(1);
+ electricPiston_LuV = GregtechItemList.Electric_Piston_LuV.get(1);
+ electricPiston_ZPM = GregtechItemList.Electric_Piston_ZPM.get(1);
+ electricPiston_UV = GregtechItemList.Electric_Piston_UV.get(1);
+ electricPiston_MAX = GregtechItemList.Electric_Piston_MAX.get(1);
+ robotArm_LuV = GregtechItemList.Robot_Arm_LuV.get(1);
+ robotArm_ZPM = GregtechItemList.Robot_Arm_ZPM.get(1);
+ robotArm_UV = GregtechItemList.Robot_Arm_UV.get(1);
+ robotArm_MAX = GregtechItemList.Robot_Arm_MAX.get(1);
+ conveyorModule_LuV = GregtechItemList.Conveyor_Module_LuV.get(1);
+ conveyorModule_ZPM = GregtechItemList.Conveyor_Module_ZPM.get(1);
+ conveyorModule_UV = GregtechItemList.Conveyor_Module_UV.get(1);
+ conveyorModule_MAX = GregtechItemList.Conveyor_Module_MAX.get(1);
+ emitter_LuV = GregtechItemList.Emitter_LuV.get(1);
+ emitter_ZPM = GregtechItemList.Emitter_ZPM.get(1);
+ emitter_UV = GregtechItemList.Emitter_UV.get(1);
+ emitter_MAX = GregtechItemList.Emitter_MAX.get(1);
+ fieldGenerator_LuV = GregtechItemList.Field_Generator_LuV.get(1);
+ fieldGenerator_ZPM = GregtechItemList.Field_Generator_ZPM.get(1);
+ fieldGenerator_UV = GregtechItemList.Field_Generator_UV.get(1);
+ fieldGenerator_MAX = GregtechItemList.Field_Generator_MAX.get(1);
+ sensor_LuV = GregtechItemList.Sensor_LuV.get(1);
+ sensor_ZPM = GregtechItemList.Sensor_ZPM.get(1);
+ sensor_UV = GregtechItemList.Sensor_UV.get(1);
+ sensor_MAX = GregtechItemList.Sensor_MAX.get(1);
}
}
diff --git a/src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java b/src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java
index 1d89d1bfa6..348f9907c0 100644
--- a/src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java
+++ b/src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java
@@ -6,20 +6,22 @@ import net.minecraft.item.ItemStack;
public class ShapedRecipeObject {
- public Object object_A;
- public Object object_B;
- public Object object_C;
- public Object object_D;
- public Object object_E;
- public Object object_F;
- public Object object_G;
- public Object object_H;
- public Object object_I;
- public ItemStack object_OUTPUT;
-
- public ShapedRecipeObject(final Object input_A, final Object input_B, final Object input_C, final Object input_D,
- final Object input_E, final Object input_F, final Object input_G, final Object input_H,
- final Object input_I, final ItemStack input_Output) {
+ public Object object_A;
+ public Object object_B;
+ public Object object_C;
+ public Object object_D;
+ public Object object_E;
+ public Object object_F;
+ public Object object_G;
+ public Object object_H;
+ public Object object_I;
+ public ItemStack object_OUTPUT;
+
+ public ShapedRecipeObject(
+ Object input_A,Object input_B,Object input_C,
+ Object input_D,Object input_E,Object input_F,
+ Object input_G,Object input_H,Object input_I,
+ ItemStack input_Output){
this.object_A = input_A;
this.object_B = input_B;
this.object_C = input_C;
@@ -32,10 +34,9 @@ public class ShapedRecipeObject {
this.object_OUTPUT = input_Output;
Utils.LOG_SPECIFIC_WARNING("ShapedRecipeObject", "New object created.", 36);
}
-
- public void buildRecipe() {
- RecipeUtils.recipeBuilder(this.object_A, this.object_B, this.object_C, this.object_D, this.object_E,
- this.object_F, this.object_G, this.object_H, this.object_I, this.object_OUTPUT);
+
+ public void buildRecipe(){
+ RecipeUtils.recipeBuilder(object_A, object_B, object_C, object_D, object_E, object_F, object_G, object_H, object_I, object_OUTPUT);
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java b/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java
index 2a97b82d4a..3c5c30966e 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java
@@ -6,25 +6,25 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class SlotBlueprint extends Slot {
+public class SlotBlueprint extends Slot{
- public SlotBlueprint(final IInventory inventory, final int x, final int y, final int z) {
+ public SlotBlueprint(IInventory inventory, int x, int y, int z) {
super(inventory, x, y, z);
}
@Override
- public int getSlotStackLimit() {
- return 1;
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (itemstack.getItem() instanceof IItemBlueprint) {
- Utils.LOG_WARNING(itemstack.getDisplayName() + " is a valid Blueprint.");
+ public boolean isItemValid(ItemStack itemstack) {
+ if (itemstack.getItem() instanceof IItemBlueprint){
+ Utils.LOG_WARNING(itemstack.getDisplayName()+" is a valid Blueprint.");
return true;
}
- Utils.LOG_WARNING(itemstack.getDisplayName() + " is not a valid Blueprint.");
+ Utils.LOG_WARNING(itemstack.getDisplayName()+" is not a valid Blueprint.");
return false;
}
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotCrafting.java b/src/Java/gtPlusPlus/core/slots/SlotCrafting.java
index 498748cf94..0c9989158d 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotCrafting.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotCrafting.java
@@ -1,150 +1,164 @@
package gtPlusPlus.core.slots;
-import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
-import net.minecraft.item.*;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemHoe;
+import net.minecraft.item.ItemPickaxe;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.ItemSword;
import net.minecraft.stats.AchievementList;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
+import cpw.mods.fml.common.FMLCommonHandler;
-public class SlotCrafting extends Slot {
- private static final String __OBFID = "CL_00001761";
- /** The craft matrix inventory linked to this result slot. */
- private final IInventory craftMatrix;
- /** The player that is using the GUI where this slot resides. */
- private final EntityPlayer thePlayer;
- /**
- * The number of items that have been crafted so far. Gets passed to
- * ItemStack.onCrafting before being reset.
- */
- private int amountCrafted;
-
- public SlotCrafting(final EntityPlayer p_i1823_1_, final IInventory p_i1823_2_, final IInventory p_i1823_3_,
- final int p_i1823_4_, final int p_i1823_5_, final int p_i1823_6_) {
- super(p_i1823_3_, p_i1823_4_, p_i1823_5_, p_i1823_6_);
- this.thePlayer = p_i1823_1_;
- this.craftMatrix = p_i1823_2_;
- }
-
- /**
- * Decrease the size of the stack in slot (first int arg) by the amount of
- * the second int arg. Returns the new stack.
- */
- @Override
- public ItemStack decrStackSize(final int p_75209_1_) {
- if (this.getHasStack()) {
- this.amountCrafted += Math.min(p_75209_1_, this.getStack().stackSize);
- }
-
- return super.decrStackSize(p_75209_1_);
- }
-
- /**
- * Check if the stack is a valid item for this slot. Always true beside for
- * the armor slots.
- */
- @Override
- public boolean isItemValid(final ItemStack p_75214_1_) {
- return false;
- }
-
- /**
- * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
- * not ore and wood.
- */
- @Override
- protected void onCrafting(final ItemStack p_75208_1_) {
- p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
- this.amountCrafted = 0;
-
- if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) {
- this.thePlayer.addStat(AchievementList.buildWorkBench, 1);
- }
-
- if (p_75208_1_.getItem() instanceof ItemPickaxe) {
- this.thePlayer.addStat(AchievementList.buildPickaxe, 1);
- }
-
- if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.furnace)) {
- this.thePlayer.addStat(AchievementList.buildFurnace, 1);
- }
-
- if (p_75208_1_.getItem() instanceof ItemHoe) {
- this.thePlayer.addStat(AchievementList.buildHoe, 1);
- }
-
- if (p_75208_1_.getItem() == Items.bread) {
- this.thePlayer.addStat(AchievementList.makeBread, 1);
- }
-
- if (p_75208_1_.getItem() == Items.cake) {
- this.thePlayer.addStat(AchievementList.bakeCake, 1);
- }
-
- if (p_75208_1_.getItem() instanceof ItemPickaxe
- && ((ItemPickaxe) p_75208_1_.getItem()).func_150913_i() != Item.ToolMaterial.WOOD) {
- this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1);
- }
-
- if (p_75208_1_.getItem() instanceof ItemSword) {
- this.thePlayer.addStat(AchievementList.buildSword, 1);
- }
-
- if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) {
- this.thePlayer.addStat(AchievementList.enchantments, 1);
- }
-
- if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) {
- this.thePlayer.addStat(AchievementList.bookcase, 1);
- }
- }
-
- /**
- * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
- * not ore and wood. Typically increases an internal count then calls
- * onCrafting(item).
- */
- @Override
- protected void onCrafting(final ItemStack p_75210_1_, final int p_75210_2_) {
- this.amountCrafted += p_75210_2_;
- this.onCrafting(p_75210_1_);
- }
-
- @Override
- public void onPickupFromSlot(final EntityPlayer p_82870_1_, final ItemStack p_82870_2_) {
- FMLCommonHandler.instance().firePlayerCraftingEvent(p_82870_1_, p_82870_2_, this.craftMatrix);
- this.onCrafting(p_82870_2_);
-
- for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) {
- final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
-
- if (itemstack1 != null) {
- this.craftMatrix.decrStackSize(i, 1);
-
- if (itemstack1.getItem().hasContainerItem(itemstack1)) {
- final ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1);
-
- if (itemstack2 != null && itemstack2.isItemStackDamageable()
- && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) {
- MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2));
- continue;
- }
-
- if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1)
- || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) {
- if (this.craftMatrix.getStackInSlot(i) == null) {
- this.craftMatrix.setInventorySlotContents(i, itemstack2);
- }
- else {
- this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false);
- }
- }
- }
- }
- }
- }
+public class SlotCrafting extends Slot
+{
+ /** The craft matrix inventory linked to this result slot. */
+ private final IInventory craftMatrix;
+ /** The player that is using the GUI where this slot resides. */
+ private EntityPlayer thePlayer;
+ /** The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset. */
+ private int amountCrafted;
+ private static final String __OBFID = "CL_00001761";
+
+ public SlotCrafting(EntityPlayer p_i1823_1_, IInventory p_i1823_2_, IInventory p_i1823_3_, int p_i1823_4_, int p_i1823_5_, int p_i1823_6_)
+ {
+ super(p_i1823_3_, p_i1823_4_, p_i1823_5_, p_i1823_6_);
+ this.thePlayer = p_i1823_1_;
+ this.craftMatrix = p_i1823_2_;
+ }
+
+ /**
+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots.
+ */
+ public boolean isItemValid(ItemStack p_75214_1_)
+ {
+ return false;
+ }
+
+ /**
+ * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new
+ * stack.
+ */
+ public ItemStack decrStackSize(int p_75209_1_)
+ {
+ if (this.getHasStack())
+ {
+ this.amountCrafted += Math.min(p_75209_1_, this.getStack().stackSize);
+ }
+
+ return super.decrStackSize(p_75209_1_);
+ }
+
+ /**
+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an
+ * internal count then calls onCrafting(item).
+ */
+ protected void onCrafting(ItemStack p_75210_1_, int p_75210_2_)
+ {
+ this.amountCrafted += p_75210_2_;
+ this.onCrafting(p_75210_1_);
+ }
+
+ /**
+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
+ */
+ protected void onCrafting(ItemStack p_75208_1_)
+ {
+ p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
+ this.amountCrafted = 0;
+
+ if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.crafting_table))
+ {
+ this.thePlayer.addStat(AchievementList.buildWorkBench, 1);
+ }
+
+ if (p_75208_1_.getItem() instanceof ItemPickaxe)
+ {
+ this.thePlayer.addStat(AchievementList.buildPickaxe, 1);
+ }
+
+ if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.furnace))
+ {
+ this.thePlayer.addStat(AchievementList.buildFurnace, 1);
+ }
+
+ if (p_75208_1_.getItem() instanceof ItemHoe)
+ {
+ this.thePlayer.addStat(AchievementList.buildHoe, 1);
+ }
+
+ if (p_75208_1_.getItem() == Items.bread)
+ {
+ this.thePlayer.addStat(AchievementList.makeBread, 1);
+ }
+
+ if (p_75208_1_.getItem() == Items.cake)
+ {
+ this.thePlayer.addStat(AchievementList.bakeCake, 1);
+ }
+
+ if (p_75208_1_.getItem() instanceof ItemPickaxe && ((ItemPickaxe)p_75208_1_.getItem()).func_150913_i() != Item.ToolMaterial.WOOD)
+ {
+ this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1);
+ }
+
+ if (p_75208_1_.getItem() instanceof ItemSword)
+ {
+ this.thePlayer.addStat(AchievementList.buildSword, 1);
+ }
+
+ if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.enchanting_table))
+ {
+ this.thePlayer.addStat(AchievementList.enchantments, 1);
+ }
+
+ if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.bookshelf))
+ {
+ this.thePlayer.addStat(AchievementList.bookcase, 1);
+ }
+ }
+
+ public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_)
+ {
+ FMLCommonHandler.instance().firePlayerCraftingEvent(p_82870_1_, p_82870_2_, craftMatrix);
+ this.onCrafting(p_82870_2_);
+
+ for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i)
+ {
+ ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
+
+ if (itemstack1 != null)
+ {
+ this.craftMatrix.decrStackSize(i, 1);
+
+ if (itemstack1.getItem().hasContainerItem(itemstack1))
+ {
+ ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1);
+
+ if (itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage())
+ {
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, itemstack2));
+ continue;
+ }
+
+ if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2))
+ {
+ if (this.craftMatrix.getStackInSlot(i) == null)
+ {
+ this.craftMatrix.setInventorySlotContents(i, itemstack2);
+ }
+ else
+ {
+ this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false);
+ }
+ }
+ }
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/slots/SlotFrame.java b/src/Java/gtPlusPlus/core/slots/SlotFrame.java
index cd38611847..13bc8fa717 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotFrame.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotFrame.java
@@ -1,25 +1,25 @@
package gtPlusPlus.core.slots;
-import forestry.api.apiculture.IHiveFrame;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
+import forestry.api.apiculture.IHiveFrame;
-public class SlotFrame extends Slot {
+public class SlotFrame extends Slot{
- public SlotFrame(final IInventory inventory, final int x, final int y, final int z) {
+ public SlotFrame(IInventory inventory, int x, int y, int z) {
super(inventory, x, y, z);
}
@Override
- public int getSlotStackLimit() {
- return 1;
+ public boolean isItemValid(ItemStack itemstack) {
+ return itemstack.getItem() instanceof IHiveFrame;
}
@Override
- public boolean isItemValid(final ItemStack itemstack) {
- return itemstack.getItem() instanceof IHiveFrame;
+ public int getSlotStackLimit() {
+ return 1;
}
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotGeneric.java b/src/Java/gtPlusPlus/core/slots/SlotGeneric.java
index 4cfd6ced49..bf7dc1fff5 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotGeneric.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotGeneric.java
@@ -4,21 +4,21 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class SlotGeneric extends Slot {
+public class SlotGeneric extends Slot{
- public SlotGeneric(final IInventory inventory, final int x, final int y, final int z) {
+ public SlotGeneric(IInventory inventory, int x, int y, int z) {
super(inventory, x, y, z);
}
@Override
- public int getSlotStackLimit() {
- return 64;
+ public boolean isItemValid(ItemStack itemstack) {
+ return true;
}
@Override
- public boolean isItemValid(final ItemStack itemstack) {
- return true;
+ public int getSlotStackLimit() {
+ return 64;
}
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotGtTool.java b/src/Java/gtPlusPlus/core/slots/SlotGtTool.java
index 011fcee9a4..cdea2fa43f 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotGtTool.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotGtTool.java
@@ -6,26 +6,26 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class SlotGtTool extends Slot {
+public class SlotGtTool extends Slot{
- public SlotGtTool(final IInventory inventory, final int x, final int y, final int z) {
+ public SlotGtTool(IInventory inventory, int x, int y, int z) {
super(inventory, x, y, z);
}
@Override
- public int getSlotStackLimit() {
- return 1;
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) {
- Utils.LOG_WARNING(itemstack.getDisplayName() + " is a valid Tool.");
+ public boolean isItemValid(ItemStack itemstack) {
+ if (itemstack.getItem() instanceof GT_MetaGenerated_Tool){
+ Utils.LOG_WARNING(itemstack.getDisplayName()+" is a valid Tool.");
return true;
}
- Utils.LOG_WARNING(itemstack.getDisplayName() + " is not a valid Tool.");
+ Utils.LOG_WARNING(itemstack.getDisplayName()+" is not a valid Tool.");
return false;
}
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java b/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java
index c4efbb4995..461fa6ff04 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java
@@ -10,83 +10,89 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
public class SlotGtToolElectric extends SlotGtTool {
- public int tier;
- private ItemStack content;
+ public int tier;
+ private ItemStack content;
- public boolean allowRedstoneDust = true;
-
- public SlotGtToolElectric(final IInventory base, final int x, final int y, final int z, final int tier,
- final boolean allowRedstoneDust) {
+ public SlotGtToolElectric(IInventory base, int x, int y, int z, int tier, boolean allowRedstoneDust)
+ {
super(base, x, y, z);
this.tier = tier;
this.allowRedstoneDust = allowRedstoneDust;
}
- public boolean accepts(final ItemStack stack) {
+ public boolean accepts(ItemStack stack)
+ {
if (stack == null) {
return false;
}
- if (stack.getItem() == Items.redstone && !this.allowRedstoneDust) {
+ if ((stack.getItem() == Items.redstone) && (!this.allowRedstoneDust)) {
return false;
}
- return Info.itemEnergy.getEnergyValue(stack) > 0.0D
- || ElectricItem.manager.discharge(stack, 1.0D / 0.0D, this.tier, true, true, true) > 0.0D;
+ return (Info.itemEnergy.getEnergyValue(stack) > 0.0D) || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), this.tier, true, true, true) > 0.0D);
}
- public double discharge(final double amount, final boolean ignoreLimit) {
+ public double discharge(double amount, boolean ignoreLimit)
+ {
if (amount <= 0.0D) {
throw new IllegalArgumentException("Amount must be > 0.");
}
- final ItemStack stack = this.get(0);
+ ItemStack stack = get(0);
if (stack == null) {
return 0.0D;
}
double realAmount = ElectricItem.manager.discharge(stack, amount, this.tier, ignoreLimit, true, false);
- if (realAmount <= 0.0D) {
+ if (realAmount <= 0.0D)
+ {
realAmount = Info.itemEnergy.getEnergyValue(stack);
if (realAmount <= 0.0D) {
return 0.0D;
}
stack.stackSize -= 1;
if (stack.stackSize <= 0) {
- this.put(0, null);
+ put(0, null);
}
}
return realAmount;
}
- public ItemStack get() {
- return this.get(0);
+ public void setTier(int tier1)
+ {
+ this.tier = tier1;
}
- public ItemStack get(final int index) {
- return this.content;
+ public boolean allowRedstoneDust = true;
+
+ public ItemStack get()
+ {
+ return get(0);
}
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (itemstack.getItem() instanceof GT_MetaGenerated_Tool || itemstack.getItem() instanceof IElectricItem) {
- Utils.LOG_WARNING(itemstack.getDisplayName() + " is a valid Tool.");
- return true;
- }
- Utils.LOG_WARNING(itemstack.getDisplayName() + " is not a valid Tool.");
- return false;
+ public ItemStack get(int index)
+ {
+ return this.content;
}
- public void onChanged() {
+ public void put(ItemStack content)
+ {
+ put(0, content);
}
- public void put(final int index, final ItemStack content) {
+ public void put(int index, ItemStack content)
+ {
this.content = content;
- this.onChanged();
+ onChanged();
}
- public void put(final ItemStack content) {
- this.put(0, content);
- }
+ public void onChanged() {}
- public void setTier(final int tier1) {
- this.tier = tier1;
+ @Override
+ public boolean isItemValid(ItemStack itemstack) {
+ if (itemstack.getItem() instanceof GT_MetaGenerated_Tool || itemstack.getItem() instanceof IElectricItem){
+ Utils.LOG_WARNING(itemstack.getDisplayName()+" is a valid Tool.");
+ return true;
+ }
+ Utils.LOG_WARNING(itemstack.getDisplayName()+" is not a valid Tool.");
+ return false;
}
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java b/src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java
index bc74e65844..7a22086949 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java
@@ -5,8 +5,10 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class SlotItemBackpackInv extends Slot {
- public SlotItemBackpackInv(final IInventory inv, final int index, final int xPos, final int yPos) {
+public class SlotItemBackpackInv extends Slot
+{
+ public SlotItemBackpackInv(IInventory inv, int index, int xPos, int yPos)
+ {
super(inv, index, xPos, yPos);
}
@@ -18,7 +20,8 @@ public class SlotItemBackpackInv extends Slot {
* Check if the stack is a valid item for this slot.
*/
@Override
- public boolean isItemValid(final ItemStack itemstack) {
+ public boolean isItemValid(ItemStack itemstack)
+ {
// Everything returns true except an instance of our Item
return !(itemstack.getItem() instanceof BaseItemBackpack);
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotNoInput.java b/src/Java/gtPlusPlus/core/slots/SlotNoInput.java
index 7af4570eff..fe51631a5d 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotNoInput.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotNoInput.java
@@ -4,20 +4,20 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class SlotNoInput extends Slot {
+public class SlotNoInput extends Slot{
- public SlotNoInput(final IInventory inventory, final int x, final int y, final int z) {
+ public SlotNoInput(IInventory inventory, int x, int y, int z) {
super(inventory, x, y, z);
}
@Override
- public int getSlotStackLimit() {
- return 0;
+ public boolean isItemValid(ItemStack itemstack) {
+ return false;
}
@Override
- public boolean isItemValid(final ItemStack itemstack) {
- return false;
+ public int getSlotStackLimit() {
+ return 0;
}
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotOutput.java b/src/Java/gtPlusPlus/core/slots/SlotOutput.java
index e5eb310068..a0f895d554 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotOutput.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotOutput.java
@@ -1,89 +1,95 @@
package gtPlusPlus.core.slots;
-import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
+import cpw.mods.fml.common.FMLCommonHandler;
+
+public class SlotOutput extends SlotCrafting{
-public class SlotOutput extends SlotCrafting {
+ private final IInventory craftMatrix;
+ private final EntityPlayer thePlayer;
+ private int amountCrafted;
- private final IInventory craftMatrix;
- private final EntityPlayer thePlayer;
- private int amountCrafted;
- public SlotOutput(final EntityPlayer player, final InventoryCrafting craftingInventory,
- final IInventory p_i45790_3_, final int slotIndex, final int xPosition, final int yPosition) {
+ public SlotOutput(EntityPlayer player, InventoryCrafting craftingInventory, IInventory p_i45790_3_, int slotIndex, int xPosition, int yPosition)
+ {
super(player, craftingInventory, p_i45790_3_, slotIndex, xPosition, yPosition);
this.thePlayer = player;
this.craftMatrix = craftingInventory;
}
-
/**
- * Decrease the size of the stack in slot (first int arg) by the amount of
- * the second int arg. Returns the new stack.
+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots.
*/
@Override
- public ItemStack decrStackSize(final int par1) {
- if (this.getHasStack()) {
+ public boolean isItemValid(ItemStack par1ItemStack)
+ {
+ return false;
+ }
+ /**
+ * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new
+ * stack.
+ */
+ @Override
+ public ItemStack decrStackSize(int par1)
+ {
+ if (this.getHasStack())
+ {
this.amountCrafted += Math.min(par1, this.getStack().stackSize);
}
return super.decrStackSize(par1);
}
-
/**
- * Check if the stack is a valid item for this slot. Always true beside for
- * the armor slots.
+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an
+ * internal count then calls onCrafting(item).
*/
@Override
- public boolean isItemValid(final ItemStack par1ItemStack) {
- return false;
+ protected void onCrafting(ItemStack par1ItemStack, int par2)
+ {
+ this.amountCrafted += par2;
+ this.onCrafting(par1ItemStack);
}
-
/**
- * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
- * not ore and wood.
+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
*/
@Override
- protected void onCrafting(final ItemStack stack) {
+ protected void onCrafting(ItemStack stack)
+ {
stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
this.amountCrafted = 0;
}
- /**
- * the itemStack passed in is the output - ie, iron ingots, and pickaxes,
- * not ore and wood. Typically increases an internal count then calls
- * onCrafting(item).
- */
- @Override
- protected void onCrafting(final ItemStack par1ItemStack, final int par2) {
- this.amountCrafted += par2;
- this.onCrafting(par1ItemStack);
- }
-
@Override
- public void onPickupFromSlot(final EntityPlayer playerIn, final ItemStack stack) {
+ public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack)
+ {
{
- FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, this.craftMatrix);
+ FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, craftMatrix);
this.onCrafting(stack);
- for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) {
- final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
- if (itemstack1 != null) {
+ for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i)
+ {
+ ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
+ if (itemstack1 != null)
+ {
this.craftMatrix.decrStackSize(i, 1);
- if (itemstack1.getItem().hasContainerItem(itemstack1)) {
+ if (itemstack1.getItem().hasContainerItem(itemstack1))
+ {
ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1);
- if (itemstack2.isItemStackDamageable()
- && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) {
- MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2));
+ if (itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage())
+ {
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, itemstack2));
itemstack2 = null;
}
- if (!this.thePlayer.inventory.addItemStackToInventory(itemstack2)) {
- if (this.craftMatrix.getStackInSlot(i) == null) {
+ if (!this.thePlayer.inventory.addItemStackToInventory(itemstack2))
+ {
+ if (this.craftMatrix.getStackInSlot(i) == null)
+ {
this.craftMatrix.setInventorySlotContents(i, itemstack2);
}
- else {
+ else
+ {
this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false);
}
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotRTG.java b/src/Java/gtPlusPlus/core/slots/SlotRTG.java
index 31c176d4f9..1f16463de2 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotRTG.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotRTG.java
@@ -5,21 +5,21 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class SlotRTG extends Slot {
+public class SlotRTG extends Slot{
- public SlotRTG(final IInventory inventory, final int x, final int y, final int z) {
+ public SlotRTG(IInventory inventory, int x, int y, int z) {
super(inventory, x, y, z);
}
@Override
- public int getSlotStackLimit() {
- return 1;
+ public boolean isItemValid(ItemStack itemstack) {
+ return itemstack.getItem().getClass() == Ic2Items.RTGPellets.getItem().getClass();
}
@Override
- public boolean isItemValid(final ItemStack itemstack) {
- return itemstack.getItem().getClass() == Ic2Items.RTGPellets.getItem().getClass();
+ public int getSlotStackLimit() {
+ return 1;
}
}
diff --git a/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java
index eebe106e58..a228021c82 100644
--- a/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java
+++ b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java
@@ -1,26 +1,22 @@
package gtPlusPlus.core.tileentities;
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench;
import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced;
import gtPlusPlus.core.util.Utils;
+import cpw.mods.fml.common.registry.GameRegistry;
public class ModTileEntities {
- public static void init() {
+
+ public static void init(){
Utils.LOG_INFO("Registering Tile Entities.");
- // GameRegistry.registerTileEntity(TileEntityReverter.class,
- // "TE_blockGriefSaver");
- // GameRegistry.registerTileEntity(TileEntityReverter.class, "Tower
- // Reverter");
- // GameRegistry.registerTileEntity(TileEntityNHG.class,
- // "NuclearFueledHeliumGenerator");
- // GameRegistry.registerTileEntity(TileEntityCharger.class,
- // "TE_Charger");
- // GameRegistry.registerTileEntity(TileEntityHeliumGenerator.class,
- // "Helium");
+ //GameRegistry.registerTileEntity(TileEntityReverter.class, "TE_blockGriefSaver");
+ //GameRegistry.registerTileEntity(TileEntityReverter.class, "Tower Reverter");
+ //GameRegistry.registerTileEntity(TileEntityNHG.class, "NuclearFueledHeliumGenerator");
+ //GameRegistry.registerTileEntity(TileEntityCharger.class, "TE_Charger");
+ // GameRegistry.registerTileEntity(TileEntityHeliumGenerator.class, "Helium");
GameRegistry.registerTileEntity(TileEntityWorkbench.class, "TileWorkbench");
GameRegistry.registerTileEntity(TileEntityWorkbenchAdvanced.class, "TileWorkbenchAdvanced");
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java b/src/Java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java
index 196c01a018..67c592c79c 100644
--- a/src/Java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java
+++ b/src/Java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java
@@ -9,34 +9,31 @@ import net.minecraft.tileentity.TileEntity;
public class TILE_ENTITY_BASE extends TileEntity {
@Override
- public Packet getDescriptionPacket() {
- final NBTTagCompound tag = new NBTTagCompound();
- this.writeCustomNBT(tag);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, -999, tag);
+ public void writeToNBT(NBTTagCompound tag) {
+ super.writeToNBT(tag);
+ writeCustomNBT(tag);
}
@Override
- public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity packet) {
- super.onDataPacket(net, packet);
- this.readCustomNBT(packet.func_148857_g());
+ public void readFromNBT(NBTTagCompound tag) {
+ super.readFromNBT(tag);
+ readCustomNBT(tag);
}
- public void readCustomNBT(final NBTTagCompound tag) {
- }
+ public void writeCustomNBT(NBTTagCompound tag) {}
+ public void readCustomNBT(NBTTagCompound tag) {}
@Override
- public void readFromNBT(final NBTTagCompound tag) {
- super.readFromNBT(tag);
- this.readCustomNBT(tag);
- }
-
- public void writeCustomNBT(final NBTTagCompound tag) {
+ public Packet getDescriptionPacket() {
+ NBTTagCompound tag = new NBTTagCompound();
+ writeCustomNBT(tag);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, tag);
}
@Override
- public void writeToNBT(final NBTTagCompound tag) {
- super.writeToNBT(tag);
- this.writeCustomNBT(tag);
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
+ super.onDataPacket(net, packet);
+ readCustomNBT(packet.func_148857_g());
}
}
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java
index 535af68200..8767b6607c 100644
--- a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java
+++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java
@@ -1,96 +1,90 @@
package gtPlusPlus.core.tileentities.general;
+import gtPlusPlus.core.block.ModBlocks;
+
import java.util.Random;
-import gtPlusPlus.core.block.ModBlocks;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
-public class TileEntityReverter extends TileEntity {
- private static final int REVERT_CHANCE = 10;
- public int radius = 16;
- public int diameter = 8 * this.radius + 4;
- public double requiredPlayerRange = 64.0D;
- public Random rand = new Random();
- private int tickCount;
- private boolean slowScan;
- private int ticksSinceChange;
- private Block[] blockData;
- private byte[] metaData;
- public boolean anyPlayerInRange() {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D,
- this.requiredPlayerRange) != null;
- }
- @Override
- public boolean canUpdate() {
+public class TileEntityReverter extends TileEntity
+{
+ private static final int REVERT_CHANCE = 10;
+ public int radius = 16;
+ public int diameter = 8 * this.radius + 4;
+ public double requiredPlayerRange = 64.0D;
+ public Random rand = new Random();
+ private int tickCount;
+ private boolean slowScan;
+ private int ticksSinceChange;
+ private Block[] blockData;
+ private byte[] metaData;
+
+ public boolean canUpdate(){
return true;
}
- private void captureBlockData() {
- this.blockData = new Block[this.diameter * this.diameter * this.diameter];
- this.metaData = new byte[this.diameter * this.diameter * this.diameter];
-
- int index = 0;
- for (int x = -this.radius; x <= this.radius; x++) {
- for (int y = -this.radius; y <= this.radius; y++) {
- for (int z = -this.radius; z <= this.radius; z++) {
- final Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
- final int meta = this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
-
- this.blockData[index] = blockID;
- this.metaData[index] = (byte) meta;
+ public void updateEntity()
+ {
+ if (anyPlayerInRange())
+ {
+ this.tickCount += 1;
+ if (this.worldObj.isRemote)
+ {
+ double var1 = this.xCoord + this.worldObj.rand.nextFloat();
+ double var3 = this.yCoord + this.worldObj.rand.nextFloat();
+ double var5 = this.zCoord + this.worldObj.rand.nextFloat();
- index++;
+ this.worldObj.spawnParticle("enchantmenttable", var1, var3, var5, 0.0D, 0.0D, 0.0D);
+ if (this.rand.nextInt(5) == 0)
+ {
+ makeRandomOutline();
+ makeRandomOutline();
+ makeRandomOutline();
+ }
+ }
+ else
+ {
+ if ((this.blockData == null) || (this.metaData == null))
+ {
+ captureBlockData();
+ this.slowScan = true;
+ }
+ if ((!this.slowScan) || (this.tickCount % 20 == 0)) {
+ if (scanAndRevertChanges())
+ {
+ this.slowScan = false;
+ this.ticksSinceChange = 0;
+ }
+ else
+ {
+ this.ticksSinceChange += 1;
+ if (this.ticksSinceChange > 20) {
+ this.slowScan = true;
+ }
+ }
}
}
}
- }
-
- protected void drawParticleLine(final double srcX, final double srcY, final double srcZ, final double destX,
- final double destY, final double destZ) {
- final int particles = 16;
- for (int i = 0; i < particles; i++) {
- final double trailFactor = i / (particles - 1.0D);
+ else
+ {
+ this.blockData = null;
+ this.metaData = null;
- final double tx = srcX + (destX - srcX) * trailFactor + this.rand.nextFloat() * 0.005D;
- final double ty = srcY + (destY - srcY) * trailFactor + this.rand.nextFloat() * 0.005D;
- final double tz = srcZ + (destZ - srcZ) * trailFactor + this.rand.nextFloat() * 0.005D;
- this.worldObj.spawnParticle("portal", tx, ty, tz, 0.0D, 0.0D, 0.0D);
+ this.tickCount = 0;
}
}
- private boolean isUnrevertable(final Block thereBlockID, final byte thereMeta, final Block replaceBlockID,
- final byte replaceMeta) {
- if (thereBlockID == ModBlocks.blockGriefSaver || replaceBlockID == ModBlocks.blockGriefSaver) {
- return true;
- }
- /*
- * if (((thereBlockID == towerTranslucent) && (thereMeta != 4)) ||
- * ((replaceBlockID == towerTranslucent) && (replaceMeta != 4))) {
- * return true; }
- */
- if (thereBlockID == Blocks.redstone_lamp && replaceBlockID == Blocks.lit_redstone_lamp) {
- return true;
- }
- if (thereBlockID == Blocks.lit_redstone_lamp && replaceBlockID == Blocks.redstone_lamp) {
- return true;
- }
- /*
- * if ((thereBlockID == Blocks.water) || (replaceBlockID ==
- * Blocks.flowing_water)) { return true; } if ((thereBlockID ==
- * Blocks.flowing_water) || (replaceBlockID == Blocks.water)) { return
- * true; }
- */
- if (replaceBlockID == Blocks.tnt) {
- return true;
- }
- return false;
+ private void makeRandomOutline()
+ {
+ makeOutline(this.rand.nextInt(12));
}
- private void makeOutline(final int outline) {
+ private void makeOutline(int outline)
+ {
double sx = this.xCoord;
double sy = this.yCoord;
double sz = this.zCoord;
@@ -98,143 +92,126 @@ public class TileEntityReverter extends TileEntity {
double dx = this.xCoord;
double dy = this.yCoord;
double dz = this.zCoord;
- switch (outline) {
- case 0:
- sx -= this.radius;
- dx -= this.radius;
- sz -= this.radius;
- dz += this.radius + 1;
- case 8:
- sx -= this.radius;
- dx += this.radius + 1;
- sz -= this.radius;
- dz -= this.radius;
- break;
- case 1:
- case 9:
- sx -= this.radius;
- dx -= this.radius;
- sz -= this.radius;
- dz += this.radius + 1;
- break;
- case 2:
- case 10:
- sx -= this.radius;
- dx += this.radius + 1;
- sz += this.radius + 1;
- dz += this.radius + 1;
- break;
- case 3:
- case 11:
- sx += this.radius + 1;
- dx += this.radius + 1;
- sz -= this.radius;
- dz += this.radius + 1;
- break;
- case 4:
- sx -= this.radius;
- dx -= this.radius;
- sz -= this.radius;
- dz -= this.radius;
- break;
- case 5:
- sx += this.radius + 1;
- dx += this.radius + 1;
- sz -= this.radius;
- dz -= this.radius;
- break;
- case 6:
- sx += this.radius + 1;
- dx += this.radius + 1;
- sz += this.radius + 1;
- dz += this.radius + 1;
- break;
- case 7:
- sx -= this.radius;
- dx -= this.radius;
- sz += this.radius + 1;
- dz += this.radius + 1;
+ switch (outline)
+ {
+ case 0:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz -= this.radius;
+ dz += this.radius + 1;
+ case 8:
+ sx -= this.radius;
+ dx += this.radius + 1;
+ sz -= this.radius;
+ dz -= this.radius;
+ break;
+ case 1:
+ case 9:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz -= this.radius;
+ dz += this.radius + 1;
+ break;
+ case 2:
+ case 10:
+ sx -= this.radius;
+ dx += this.radius + 1;
+ sz += this.radius + 1;
+ dz += this.radius + 1;
+ break;
+ case 3:
+ case 11:
+ sx += this.radius + 1;
+ dx += this.radius + 1;
+ sz -= this.radius;
+ dz += this.radius + 1;
+ break;
+ case 4:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz -= this.radius;
+ dz -= this.radius;
+ break;
+ case 5:
+ sx += this.radius + 1;
+ dx += this.radius + 1;
+ sz -= this.radius;
+ dz -= this.radius;
+ break;
+ case 6:
+ sx += this.radius + 1;
+ dx += this.radius + 1;
+ sz += this.radius + 1;
+ dz += this.radius + 1;
+ break;
+ case 7:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz += this.radius + 1;
+ dz += this.radius + 1;
}
- switch (outline) {
- case 0:
- case 1:
- case 2:
- case 3:
- sy += this.radius + 1;
- dy += this.radius + 1;
- break;
- case 4:
- case 5:
- case 6:
- case 7:
- sy -= this.radius;
- dy += this.radius + 1;
- break;
- case 8:
- case 9:
- case 10:
- case 11:
- sy -= this.radius;
- dy -= this.radius;
+ switch (outline)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ sy += this.radius + 1;
+ dy += this.radius + 1;
+ break;
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ sy -= this.radius;
+ dy += this.radius + 1;
+ break;
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ sy -= this.radius;
+ dy -= this.radius;
}
if (this.rand.nextBoolean()) {
- this.drawParticleLine(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, dx, dy, dz);
+ drawParticleLine(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, dx, dy, dz);
+ } else {
+ drawParticleLine(sx, sy, sz, this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D);
}
- else {
- this.drawParticleLine(sx, sy, sz, this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D);
- }
- this.drawParticleLine(sx, sy, sz, dx, dy, dz);
+ drawParticleLine(sx, sy, sz, dx, dy, dz);
}
- private void makeRandomOutline() {
- this.makeOutline(this.rand.nextInt(12));
- }
+ protected void drawParticleLine(double srcX, double srcY, double srcZ, double destX, double destY, double destZ)
+ {
+ int particles = 16;
+ for (int i = 0; i < particles; i++)
+ {
+ double trailFactor = i / (particles - 1.0D);
- private boolean revertBlock(final int x, final int y, final int z, final Block thereBlockID, final byte thereMeta,
- final Block replaceBlockID, byte replaceMeta) {
- /*
- * if ((thereBlockID == Blocks.air) &&
- * (!replaceBlockID.getMaterial().blocksMovement())) {
- * System.out.println("Not replacing block " + replaceBlockID +
- * " because it doesn't block movement");
- *
- * return false; }
- */
- if (this.isUnrevertable(thereBlockID, thereMeta, replaceBlockID, replaceMeta)) {
- return false;
- }
- if (this.rand.nextInt(5) == 0) {
- if (replaceBlockID != Blocks.air) {
- // replaceBlockID = null;
- replaceMeta = 4;
- }
- this.worldObj.setBlock(x, y, z, replaceBlockID, replaceMeta, 2);
- if (thereBlockID == Blocks.air) {
- this.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(replaceBlockID) + (replaceMeta << 12));
- }
- else if (replaceBlockID == Blocks.air) {
- this.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(thereBlockID) + (thereMeta << 12));
- thereBlockID.dropBlockAsItem(this.worldObj, x, y, z, thereMeta, 0);
- }
+ double tx = srcX + (destX - srcX) * trailFactor + this.rand.nextFloat() * 0.005D;
+ double ty = srcY + (destY - srcY) * trailFactor + this.rand.nextFloat() * 0.005D;
+ double tz = srcZ + (destZ - srcZ) * trailFactor + this.rand.nextFloat() * 0.005D;
+ this.worldObj.spawnParticle("portal", tx, ty, tz, 0.0D, 0.0D, 0.0D);
}
- return true;
}
- private boolean scanAndRevertChanges() {
+ private boolean scanAndRevertChanges()
+ {
int index = 0;
boolean reverted = false;
for (int x = -this.radius; x <= this.radius; x++) {
for (int y = -this.radius; y <= this.radius; y++) {
- for (int z = -this.radius; z <= this.radius; z++) {
- final Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
- final byte meta = (byte) this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y,
- this.zCoord + z);
+ for (int z = -this.radius; z <= this.radius; z++)
+ {
+ Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ byte meta = (byte)this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
if (this.blockData[index] != blockID) {
- if (this.revertBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z, blockID, meta,
- this.blockData[index], this.metaData[index])) {
+ if (revertBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z, blockID, meta, this.blockData[index], this.metaData[index]))
+ {
reverted = true;
}
- else {
+ else
+ {
this.blockData[index] = blockID;
this.metaData[index] = meta;
}
@@ -246,46 +223,88 @@ public class TileEntityReverter extends TileEntity {
return reverted;
}
- @Override
- public void updateEntity() {
- if (this.anyPlayerInRange()) {
- this.tickCount += 1;
- if (this.worldObj.isRemote) {
- final double var1 = this.xCoord + this.worldObj.rand.nextFloat();
- final double var3 = this.yCoord + this.worldObj.rand.nextFloat();
- final double var5 = this.zCoord + this.worldObj.rand.nextFloat();
+ private boolean revertBlock(int x, int y, int z, Block thereBlockID, byte thereMeta, Block replaceBlockID, byte replaceMeta)
+ {
+ /*if ((thereBlockID == Blocks.air) && (!replaceBlockID.getMaterial().blocksMovement()))
+ {
+ System.out.println("Not replacing block " + replaceBlockID + " because it doesn't block movement");
- this.worldObj.spawnParticle("enchantmenttable", var1, var3, var5, 0.0D, 0.0D, 0.0D);
- if (this.rand.nextInt(5) == 0) {
- this.makeRandomOutline();
- this.makeRandomOutline();
- this.makeRandomOutline();
- }
+ return false;
+ }*/
+ if (isUnrevertable(thereBlockID, thereMeta, replaceBlockID, replaceMeta)) {
+ return false;
+ }
+ if (this.rand.nextInt(5) == 0)
+ {
+ if (replaceBlockID != Blocks.air)
+ {
+ //replaceBlockID = null;
+ replaceMeta = 4;
}
- else {
- if (this.blockData == null || this.metaData == null) {
- this.captureBlockData();
- this.slowScan = true;
- }
- if (!this.slowScan || this.tickCount % 20 == 0) {
- if (this.scanAndRevertChanges()) {
- this.slowScan = false;
- this.ticksSinceChange = 0;
- }
- else {
- this.ticksSinceChange += 1;
- if (this.ticksSinceChange > 20) {
- this.slowScan = true;
- }
- }
- }
+ this.worldObj.setBlock(x, y, z, replaceBlockID, replaceMeta, 2);
+ if (thereBlockID == Blocks.air)
+ {
+ this.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(replaceBlockID) + (replaceMeta << 12));
+ }
+ else if (replaceBlockID == Blocks.air)
+ {
+ this.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(thereBlockID) + (thereMeta << 12));
+ thereBlockID.dropBlockAsItem(this.worldObj, x, y, z, thereMeta, 0);
}
}
- else {
- this.blockData = null;
- this.metaData = null;
+ return true;
+ }
- this.tickCount = 0;
+ private boolean isUnrevertable(Block thereBlockID, byte thereMeta, Block replaceBlockID, byte replaceMeta)
+ {
+ if ((thereBlockID == ModBlocks.blockGriefSaver) || (replaceBlockID == ModBlocks.blockGriefSaver)) {
+ return true;
}
+ /*if (((thereBlockID == towerTranslucent) && (thereMeta != 4)) || ((replaceBlockID == towerTranslucent) && (replaceMeta != 4))) {
+ return true;
+ }*/
+ if ((thereBlockID == Blocks.redstone_lamp) && (replaceBlockID == Blocks.lit_redstone_lamp)) {
+ return true;
+ }
+ if ((thereBlockID == Blocks.lit_redstone_lamp) && (replaceBlockID == Blocks.redstone_lamp)) {
+ return true;
+ }
+ /*if ((thereBlockID == Blocks.water) || (replaceBlockID == Blocks.flowing_water)) {
+ return true;
+ }
+ if ((thereBlockID == Blocks.flowing_water) || (replaceBlockID == Blocks.water)) {
+ return true;
+ }*/
+ if (replaceBlockID == Blocks.tnt) {
+ return true;
+ }
+ return false;
+ }
+
+ private void captureBlockData()
+ {
+ this.blockData = new Block[this.diameter * this.diameter * this.diameter];
+ this.metaData = new byte[this.diameter * this.diameter * this.diameter];
+
+ int index = 0;
+ for (int x = -this.radius; x <= this.radius; x++) {
+ for (int y = -this.radius; y <= this.radius; y++) {
+ for (int z = -this.radius; z <= this.radius; z++)
+ {
+ Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ int meta = this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+
+ this.blockData[index] = blockID;
+ this.metaData[index] = ((byte)meta);
+
+ index++;
+ }
+ }
+ }
+ }
+
+ public boolean anyPlayerInRange()
+ {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, this.requiredPlayerRange) != null;
}
}
diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java
index cc260527c4..9ec6aa3b24 100644
--- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java
+++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java
@@ -9,165 +9,178 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.Constants;
-public class TileEntityCharger extends TileEntity implements IInventory {
- private ItemStack[] items = new ItemStack[1]; // 18
- private int progress_Current = 1;
- private final int progress_Max = 1000;
- public float charge_Current;
- public float charge_Max = 10000;
- private float tempItemChargeValue;
+public class TileEntityCharger extends TileEntity implements IInventory
+{
+ private ItemStack[] items = new ItemStack[1]; //18
+ private int progress_Current = 1;
+ private int progress_Max = 1000;
+ public float charge_Current;
+ public float charge_Max = 10000;
+ private float tempItemChargeValue;
+
+ public float getCharge(){
+ return charge_Current;
+ }
+
+ public int getProgress(){
+ return progress_Current;
+ }
@Override
- public void closeInventory() {
+ public int getSizeInventory()
+ {
+ return items.length;
}
@Override
- public ItemStack decrStackSize(final int slot, final int amount) {
- if (this.items[slot] != null) {
+ public ItemStack getStackInSlot(int slot)
+ {
+ return items[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ if (items[slot] != null)
+ {
ItemStack itemstack;
- if (this.items[slot].stackSize == amount) {
- itemstack = this.items[slot];
- this.items[slot] = null;
- this.markDirty();
+ if (items[slot].stackSize == amount)
+ {
+ itemstack = items[slot];
+ items[slot] = null;
+ markDirty();
return itemstack;
}
- itemstack = this.items[slot].splitStack(amount);
- if (this.items[slot].stackSize == 0) {
- this.items[slot] = null;
- }
- this.markDirty();
+ itemstack = items[slot].splitStack(amount);
+ if (items[slot].stackSize == 0) items[slot] = null;
+ markDirty();
return itemstack;
}
return null;
}
- public float getCharge() {
- return this.charge_Current;
- }
-
@Override
- public String getInventoryName() {
- return "container.Charger";
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ if (items[slot] != null)
+ {
+ ItemStack itemstack = items[slot];
+ items[slot] = null;
+ return itemstack;
+ }
+ return null;
}
@Override
- public int getInventoryStackLimit() {
- return 64;
- }
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ if (stack != null){
+ items[slot] = stack;
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
- public int getProgress() {
- return this.progress_Current;
+
+ markDirty();
+ }
}
@Override
- public int getSizeInventory() {
- return this.items.length;
+ public String getInventoryName()
+ {
+ return "container.Charger";
}
@Override
- public ItemStack getStackInSlot(final int slot) {
- return this.items[slot];
+ public boolean hasCustomInventoryName()
+ {
+ return false;
}
@Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- if (this.items[slot] != null) {
- final ItemStack itemstack = this.items[slot];
- this.items[slot] = null;
- return itemstack;
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ NBTTagList list = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
+ items = new ItemStack[getSizeInventory()];
+
+ for (int i = 0; i < list.tagCount(); ++i) { NBTTagCompound comp = list.getCompoundTagAt(i); int j = comp.getByte("Slot") & 255; if (j >= 0 && j < items.length)
+ {
+ items[j] = ItemStack.loadItemStackFromNBT(comp);
+ }
}
- return null;
}
@Override
- public boolean hasCustomInventoryName() {
- return false;
- }
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ NBTTagList list = new NBTTagList();
+
+ for (int i = 0; i < items.length; ++i)
+ {
+ if (items[i] != null)
+ {
+ NBTTagCompound comp = new NBTTagCompound();
+ comp.setByte("Slot", (byte)i);
+ items[i].writeToNBT(comp);
+ list.appendTag(comp);
+ }
+ }
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack stack) {
- return true;
+ nbt.setTag("Items", list);
}
@Override
- public boolean isUseableByPlayer(final EntityPlayer player) {
- return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false
- : player.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D;
+ public int getInventoryStackLimit()
+ {
+ return 64;
}
@Override
- public void openInventory() {
+ public boolean isUseableByPlayer(EntityPlayer player)
+ {
+ return worldObj.getTileEntity(xCoord, yCoord, zCoord) != this ? false : player.getDistanceSq((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64.0D;
}
@Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- final NBTTagList list = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
- this.items = new ItemStack[this.getSizeInventory()];
-
- for (int i = 0; i < list.tagCount(); ++i) {
- final NBTTagCompound comp = list.getCompoundTagAt(i);
- final int j = comp.getByte("Slot") & 255;
- if (j >= 0 && j < this.items.length) {
- this.items[j] = ItemStack.loadItemStackFromNBT(comp);
- }
- }
- }
+ public void openInventory() {}
@Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- if (stack != null) {
- this.items[slot] = stack;
- if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
- stack.stackSize = this.getInventoryStackLimit();
- }
+ public void closeInventory() {}
- this.markDirty();
- }
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack stack)
+ {
+ return true;
}
@Override
public void updateEntity() {
- if (!this.worldObj.isRemote) {
- if (this.progress_Current < this.progress_Max) {
- this.progress_Current++;
+ if(!this.worldObj.isRemote){
+ if (progress_Current < progress_Max){
+ progress_Current++;
}
- else if (this.progress_Current >= this.progress_Max) {
- if (this.charge_Current < this.charge_Max) {
- this.charge_Current = this.charge_Current + 500;
- }
- if (this.getStackInSlot(0).getItem() instanceof BaseItemWithCharge) {
+ else if (progress_Current >= progress_Max){
+ if (charge_Current < charge_Max){
+ charge_Current = charge_Current+500;
+ }
+ if (getStackInSlot(0).getItem() instanceof BaseItemWithCharge){
float tempCharge;
- final ItemStack output = this.getStackInSlot(0).copy();
- if (output.stackTagCompound != null) {
+ ItemStack output = getStackInSlot(0).copy();
+ if (output.stackTagCompound != null){
tempCharge = output.stackTagCompound.getFloat("charge_Current");
output.stackTagCompound = new NBTTagCompound();
- output.stackTagCompound.setFloat("charge_Current", tempCharge + 40);
- this.charge_Current = this.charge_Current - 40;
+ output.stackTagCompound.setFloat("charge_Current", tempCharge+40);
+ this.charge_Current = charge_Current-40;
tempCharge = 0;
}
}
- this.progress_Current = 0;
+ progress_Current = 0;
}
}
}
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- final NBTTagList list = new NBTTagList();
-
- for (int i = 0; i < this.items.length; ++i) {
- if (this.items[i] != null) {
- final NBTTagCompound comp = new NBTTagCompound();
- comp.setByte("Slot", (byte) i);
- this.items[i].writeToNBT(comp);
- list.appendTag(comp);
- }
- }
-
- nbt.setTag("Items", list);
- }
-
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java
index 1183b906dc..3a9dbbd4c7 100644
--- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java
+++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java
@@ -12,486 +12,491 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.Constants;
-public class TileEntityNHG extends TileEntity implements IInventory {
- private ItemStack[] items = new ItemStack[19]; // 18
- private int progress = 1;
- private final int maxProgress = 180;
- private int heatCycleProgress = 12;
- public float coreTemp;
- public float maxTemp = 10000;
- private boolean fuelrod_1 = false;
- private boolean fuelrod_2 = false;
- private boolean fuelrod_3 = false;
- private boolean fuelrod_4 = false;
- private boolean fuelrod_5 = false;
- private boolean fuelrod_6 = false;
- private boolean fuelrod_7 = false;
- private boolean fuelrod_8 = false;
- private boolean fuelrod_9 = false;
- private boolean fuelrod_10 = false;
- private boolean fuelrod_11 = false;
- private boolean fuelrod_12 = false;
- private boolean fuelrod_13 = false;
- private boolean fuelrod_14 = false;
- private boolean fuelrod_15 = false;
- private boolean fuelrod_16 = false;
- private boolean fuelrod_17 = false;
- private boolean fuelrod_18 = false;
-
- // Machine Code - TODO
- private ItemStack neutrons;
+public class TileEntityNHG extends TileEntity implements IInventory
+{
+ private ItemStack[] items = new ItemStack[19]; //18
+ private int progress = 1;
+ private int maxProgress = 180;
+ private int heatCycleProgress = 12;
+ public float coreTemp;
+ public float maxTemp = 10000;
+ private boolean fuelrod_1 = false;
+ private boolean fuelrod_2 = false;
+ private boolean fuelrod_3 = false;
+ private boolean fuelrod_4 = false;
+ private boolean fuelrod_5 = false;
+ private boolean fuelrod_6 = false;
+ private boolean fuelrod_7 = false;
+ private boolean fuelrod_8 = false;
+ private boolean fuelrod_9 = false;
+ private boolean fuelrod_10 = false;
+ private boolean fuelrod_11 = false;
+ private boolean fuelrod_12 = false;
+ private boolean fuelrod_13 = false;
+ private boolean fuelrod_14 = false;
+ private boolean fuelrod_15 = false;
+ private boolean fuelrod_16 = false;
+ private boolean fuelrod_17 = false;
+ private boolean fuelrod_18 = false;
+
+ public float getCoreTemp(){
+ return coreTemp;
+ }
- public boolean calculateHeat() {
- /*
- * if (!fuelrod_1 || !fuelrod_2 || !fuelrod_3 || !fuelrod_4 ||
- * !fuelrod_5 || !fuelrod_6 || !fuelrod_7 || !fuelrod_8 || !fuelrod_9 ||
- * !fuelrod_10 || !fuelrod_11 || !fuelrod_12 || !fuelrod_13 ||
- * !fuelrod_14 || !fuelrod_15 || !fuelrod_16 || !fuelrod_17 ||
- * !fuelrod_18){ coreTemp = 0; } else {
- */
- if (!this.worldObj.isRemote) {
- for (int i = 0; i < this.getSizeInventory(); i++) {
- if (this.items[i] != null) {
- if (this.items[i].getItem() instanceof FuelRod_Base) {
- final ItemStack fuelRodStack = this.getStackInSlot(i).copy();
- // if (fuelRodStack.stackTagCompound.getFloat("heat") !=
- // 0){
- this.doFuelRodHeatDamage(fuelRodStack);
- this.coreTemp = this.coreTemp + fuelRodStack.stackTagCompound.getFloat("heat");
- return true;
- // }
+ public int getProgress(){
+ return progress;
+ }
+
+ public boolean isValidFuelRod(ItemStack input){
+ if(!this.worldObj.isRemote){
+ if (input != null){
+ if (input.getItem() instanceof FuelRod_Base){
+ int fuelRodFuelLevel = getRodFuelValue(input);
+ float fuelRodHeatLevel = getRodHeatValue(input);
+ Utils.LOG_WARNING("Fuel Left: "+fuelRodFuelLevel+" Current Temp: "+fuelRodHeatLevel);
+ return true;
+ //return input.stackTagCompound.getInteger("code");
+ }
+ }
+
+ }
+ return false;
+ }
+
+ public ItemStack doFuelRodHeatDamage(ItemStack input){
+ if(!this.worldObj.isRemote){
+ if (input != null){
+ if (isValidFuelRod(input)){
+ int fuelRodFuelLevel = getRodFuelValue(input);
+ float fuelRodHeatLevel = getRodHeatValue(input);
+ if(fuelRodFuelLevel <= 0 || fuelRodFuelLevel == 0){
+ return null;
+ }
+ if(fuelRodHeatLevel == 0 && fuelRodFuelLevel > 0){
+ if(fuelRodFuelLevel >= 5){
+ int tempInt=fuelRodFuelLevel;
+ float tempFloat=fuelRodHeatLevel;
+ ItemStack output = input.copy();
+ if (input.stackTagCompound != null){
+ output.stackTagCompound = new NBTTagCompound();
+ output.stackTagCompound.setInteger("fuelRemaining", tempInt-40);
+ output.stackTagCompound.setFloat("heat", tempFloat+20);
+ }
+ return output;
+ }
+ return null;
+ }
+ else if(fuelRodHeatLevel >= 5 && fuelRodFuelLevel > 0){
+ int tempInt=fuelRodFuelLevel;
+ float tempFloat=fuelRodHeatLevel;
+ ItemStack output = input.copy();
+ if (input.stackTagCompound != null){
+ output.stackTagCompound = new NBTTagCompound();
+ output.stackTagCompound.setInteger("fuelRemaining", tempInt-5);
+ output.stackTagCompound.setFloat("heat", tempFloat+5);
+ }
+ return output;
+ }
+
+ else if(fuelRodHeatLevel >= 5 && fuelRodFuelLevel == 0){
+ ItemStack output = input.copy();
+ if (input.stackTagCompound != null){
+ output.stackTagCompound = new NBTTagCompound();
+ output.stackTagCompound.setInteger("heat", -5);
+ }
+ return output;
+ }
+ else {
+ return null;
}
}
}
}
- // }
+ return null;
+ }
- return false;
+ public float getRodHeatValue(ItemStack value){
+ if (value != null){
+ if (value.stackTagCompound != null){
+ return value.stackTagCompound.getFloat("heat");
+ }
+ }
+ return 0f;
+ }
+
+ public int getRodFuelValue(ItemStack value){
+ if (value != null){
+ if (value.stackTagCompound != null){
+ int tempInt = value.stackTagCompound.getInteger("fuelRemaining");
+ return tempInt;
+ }
+ }
+ return 0;
}
- public void checkFuelRods() {
-
- if (!this.worldObj.isRemote) {
- for (int i = 0; i < this.getSizeInventory(); i++) {
- if (this.items[i] != null) {
- if (this.items[i].getItem() instanceof FuelRod_Base) {
- final ItemStack fuelRodStack = this.getStackInSlot(i).copy();
- // setInventorySlotContents(i,
- // doFuelRodHeatDamage(fuelRodStack));
- if (i == 0) {
- this.fuelrod_1 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ public void checkFuelRods(){
+
+ if(!this.worldObj.isRemote){
+ for (int i = 0; i < getSizeInventory(); i++){
+ if (items[i] != null){
+ if (items[i].getItem() instanceof FuelRod_Base){
+ ItemStack fuelRodStack = getStackInSlot(i).copy();
+ //setInventorySlotContents(i, doFuelRodHeatDamage(fuelRodStack));
+ if (i == 0){
+ fuelrod_1 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 1) {
- this.fuelrod_2 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 1){
+ fuelrod_2 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 2) {
- this.fuelrod_3 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 2){
+ fuelrod_3 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 3) {
- this.fuelrod_4 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 3){
+ fuelrod_4 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 4) {
- this.fuelrod_5 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 4){
+ fuelrod_5 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 5) {
- this.fuelrod_6 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 5){
+ fuelrod_6 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 6) {
- this.fuelrod_7 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 6){
+ fuelrod_7 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 7) {
- this.fuelrod_8 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 7){
+ fuelrod_8 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 8) {
- this.fuelrod_9 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 8){
+ fuelrod_9 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 9) {
- this.fuelrod_10 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 9){
+ fuelrod_10 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 10) {
- this.fuelrod_11 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 10){
+ fuelrod_11 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 11) {
- this.fuelrod_12 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 11){
+ fuelrod_12 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 12) {
- this.fuelrod_13 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 12){
+ fuelrod_13 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 13) {
- this.fuelrod_14 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 13){
+ fuelrod_14 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 14) {
- this.fuelrod_15 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 14){
+ fuelrod_15 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 15) {
- this.fuelrod_16 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 15){
+ fuelrod_16 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 16) {
- this.fuelrod_17 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 16){
+ fuelrod_17 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
- else if (i == 17) {
- this.fuelrod_18 = true;
- final ItemStack r = this.doFuelRodHeatDamage(fuelRodStack);
- this.setInventorySlotContents(i, r);
+ else if (i == 17){
+ fuelrod_18 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
}
+
}
}
}
- Utils.LOG_WARNING(
- "|" + this.fuelrod_1 + "|" + this.fuelrod_2 + "|" + this.fuelrod_3 + "| " + "|"
- + this.fuelrod_10 + "|" + this.fuelrod_11 + "|" + this.fuelrod_12 + "|");
- Utils.LOG_WARNING(
- "|" + this.fuelrod_4 + "|" + this.fuelrod_5 + "|" + this.fuelrod_6 + "| " + "|"
- + this.fuelrod_13 + "|" + this.fuelrod_14 + "|" + this.fuelrod_15 + "|");
- Utils.LOG_WARNING(
- "|" + this.fuelrod_7 + "|" + this.fuelrod_8 + "|" + this.fuelrod_9 + "| " + "|"
- + this.fuelrod_16 + "|" + this.fuelrod_17 + "|" + this.fuelrod_18 + "|");
+ Utils.LOG_WARNING("|"+fuelrod_1+"|"+fuelrod_2+"|"+fuelrod_3+"| "+"|"+fuelrod_10+"|"+fuelrod_11+"|"+fuelrod_12+"|");
+ Utils.LOG_WARNING("|"+fuelrod_4+"|"+fuelrod_5+"|"+fuelrod_6+"| "+"|"+fuelrod_13+"|"+fuelrod_14+"|"+fuelrod_15+"|");
+ Utils.LOG_WARNING("|"+fuelrod_7+"|"+fuelrod_8+"|"+fuelrod_9+"| "+"|"+fuelrod_16+"|"+fuelrod_17+"|"+fuelrod_18+"|");
}
}
- @Override
- public void closeInventory() {
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int amount) {
- if (this.items[slot] != null) {
- ItemStack itemstack;
-
- if (this.items[slot].stackSize == amount) {
- itemstack = this.items[slot];
- this.items[slot] = null;
- this.markDirty();
- return itemstack;
- }
- itemstack = this.items[slot].splitStack(amount);
- if (this.items[slot].stackSize == 0) {
- this.items[slot] = null;
- }
- this.markDirty();
- return itemstack;
+ public boolean calculateHeat(){
+ /*if (!fuelrod_1 || !fuelrod_2 || !fuelrod_3 || !fuelrod_4 || !fuelrod_5 || !fuelrod_6 || !fuelrod_7 || !fuelrod_8 || !fuelrod_9 || !fuelrod_10 || !fuelrod_11 || !fuelrod_12 || !fuelrod_13 || !fuelrod_14 || !fuelrod_15 || !fuelrod_16 || !fuelrod_17 || !fuelrod_18){
+ coreTemp = 0;
}
- return null;
- }
-
- public ItemStack doFuelRodHeatDamage(final ItemStack input) {
- if (!this.worldObj.isRemote) {
- if (input != null) {
- if (this.isValidFuelRod(input)) {
- final int fuelRodFuelLevel = this.getRodFuelValue(input);
- final float fuelRodHeatLevel = this.getRodHeatValue(input);
- if (fuelRodFuelLevel <= 0 || fuelRodFuelLevel == 0) {
- return null;
- }
- if (fuelRodHeatLevel == 0 && fuelRodFuelLevel > 0) {
- if (fuelRodFuelLevel >= 5) {
- final int tempInt = fuelRodFuelLevel;
- final float tempFloat = fuelRodHeatLevel;
- final ItemStack output = input.copy();
- if (input.stackTagCompound != null) {
- output.stackTagCompound = new NBTTagCompound();
- output.stackTagCompound.setInteger("fuelRemaining", tempInt - 40);
- output.stackTagCompound.setFloat("heat", tempFloat + 20);
- }
- return output;
- }
- return null;
- }
- else if (fuelRodHeatLevel >= 5 && fuelRodFuelLevel > 0) {
- final int tempInt = fuelRodFuelLevel;
- final float tempFloat = fuelRodHeatLevel;
- final ItemStack output = input.copy();
- if (input.stackTagCompound != null) {
- output.stackTagCompound = new NBTTagCompound();
- output.stackTagCompound.setInteger("fuelRemaining", tempInt - 5);
- output.stackTagCompound.setFloat("heat", tempFloat + 5);
- }
- return output;
- }
-
- else if (fuelRodHeatLevel >= 5 && fuelRodFuelLevel == 0) {
- final ItemStack output = input.copy();
- if (input.stackTagCompound != null) {
- output.stackTagCompound = new NBTTagCompound();
- output.stackTagCompound.setInteger("heat", -5);
- }
- return output;
- }
- else {
- return null;
+ else {*/
+ if(!this.worldObj.isRemote){
+ for (int i = 0; i < getSizeInventory(); i++){
+ if (items[i] != null){
+ if (items[i].getItem() instanceof FuelRod_Base){
+ ItemStack fuelRodStack = getStackInSlot(i).copy();
+ //if (fuelRodStack.stackTagCompound.getFloat("heat") != 0){
+ doFuelRodHeatDamage(fuelRodStack);
+ coreTemp = coreTemp+fuelRodStack.stackTagCompound.getFloat("heat");
+ return true;
+ //}
}
}
}
}
- return null;
- }
+ //}
+
+
- public float getCoreTemp() {
- return this.coreTemp;
+ return false;
}
@Override
- public String getInventoryName() {
- return "container.NHG";
+ public int getSizeInventory()
+ {
+ return items.length;
}
@Override
- public int getInventoryStackLimit() {
- return 64;
- }
+ public ItemStack getStackInSlot(int slot)
+ {
- public int getProgress() {
- return this.progress;
- }
+ return items[slot];
- public int getRodFuelValue(final ItemStack value) {
- if (value != null) {
- if (value.stackTagCompound != null) {
- final int tempInt = value.stackTagCompound.getInteger("fuelRemaining");
- return tempInt;
- }
- }
- return 0;
}
- public float getRodHeatValue(final ItemStack value) {
- if (value != null) {
- if (value.stackTagCompound != null) {
- return value.stackTagCompound.getFloat("heat");
+ @Override
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ if (items[slot] != null)
+ {
+ ItemStack itemstack;
+
+ if (items[slot].stackSize == amount)
+ {
+ itemstack = items[slot];
+ items[slot] = null;
+ markDirty();
+ return itemstack;
}
+ itemstack = items[slot].splitStack(amount);
+ if (items[slot].stackSize == 0) items[slot] = null;
+ markDirty();
+ return itemstack;
}
- return 0f;
+ return null;
}
@Override
- public int getSizeInventory() {
- return this.items.length;
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ if (items[slot] != null)
+ {
+ ItemStack itemstack = items[slot];
+ items[slot] = null;
+ return itemstack;
+ }
+ return null;
}
@Override
- public ItemStack getStackInSlot(final int slot) {
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ if (stack != null){
+ items[slot] = stack;
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
- return this.items[slot];
+ markDirty();
+ }
}
@Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- if (this.items[slot] != null) {
- final ItemStack itemstack = this.items[slot];
- this.items[slot] = null;
- return itemstack;
- }
- return null;
+ public String getInventoryName()
+ {
+ return "container.NHG";
}
@Override
- public boolean hasCustomInventoryName() {
+ public boolean hasCustomInventoryName()
+ {
return false;
}
@Override
- public boolean isItemValidForSlot(final int slot, final ItemStack stack) {
- return true;
- }
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ NBTTagList list = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
+ items = new ItemStack[getSizeInventory()];
- @Override
- public boolean isUseableByPlayer(final EntityPlayer player) {
- return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false
- : player.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D;
+ for (int i = 0; i < list.tagCount(); ++i) { NBTTagCompound comp = list.getCompoundTagAt(i); int j = comp.getByte("Slot") & 255; if (j >= 0 && j < items.length)
+ {
+ items[j] = ItemStack.loadItemStackFromNBT(comp);
+ }
+ }
}
- public boolean isValidFuelRod(final ItemStack input) {
- if (!this.worldObj.isRemote) {
- if (input != null) {
- if (input.getItem() instanceof FuelRod_Base) {
- final int fuelRodFuelLevel = this.getRodFuelValue(input);
- final float fuelRodHeatLevel = this.getRodHeatValue(input);
- Utils.LOG_WARNING("Fuel Left: " + fuelRodFuelLevel + " Current Temp: " + fuelRodHeatLevel);
- return true;
- // return input.stackTagCompound.getInteger("code");
- }
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ NBTTagList list = new NBTTagList();
+
+ for (int i = 0; i < items.length; ++i)
+ {
+ if (items[i] != null)
+ {
+ NBTTagCompound comp = new NBTTagCompound();
+ comp.setByte("Slot", (byte)i);
+ items[i].writeToNBT(comp);
+ list.appendTag(comp);
}
-
}
- return false;
+
+ nbt.setTag("Items", list);
}
@Override
- public void openInventory() {
+ public int getInventoryStackLimit()
+ {
+ return 64;
}
- public void readCustomNBT(final NBTTagCompound tag) {
- this.neutrons = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("Neutrons"));
- this.progress = tag.getInteger("Progress");
- this.coreTemp = tag.getFloat("coreTemp");
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer player)
+ {
+ return worldObj.getTileEntity(xCoord, yCoord, zCoord) != this ? false : player.getDistanceSq((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64.0D;
}
@Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- final NBTTagList list = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
- this.items = new ItemStack[this.getSizeInventory()];
-
- for (int i = 0; i < list.tagCount(); ++i) {
- final NBTTagCompound comp = list.getCompoundTagAt(i);
- final int j = comp.getByte("Slot") & 255;
- if (j >= 0 && j < this.items.length) {
- this.items[j] = ItemStack.loadItemStackFromNBT(comp);
- }
- }
- }
+ public void openInventory() {}
@Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- if (stack != null) {
- this.items[slot] = stack;
- if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
- stack.stackSize = this.getInventoryStackLimit();
- }
+ public void closeInventory() {}
- this.markDirty();
- }
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack stack)
+ {
+ return true;
}
+ //Machine Code - TODO
+ private ItemStack neutrons;
+
@Override
public void updateEntity() {
- if (!this.worldObj.isRemote) {
+ if(!this.worldObj.isRemote){
- if (this.progress >= this.heatCycleProgress) {
- // Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity
- // "+this.getBlockType().getUnlocalizedName(), 376);
- if (MathUtils.divideXintoY(this.heatCycleProgress, this.maxProgress)) {
- Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity " + this.getBlockType().getUnlocalizedName(),
- 378);
- this.calculateHeat();
- this.heatCycleProgress = 0;
+ if(progress >= heatCycleProgress){
+ //Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity "+this.getBlockType().getUnlocalizedName(), 376);
+ if (MathUtils.divideXintoY(heatCycleProgress, maxProgress)){
+ Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity "+this.getBlockType().getUnlocalizedName(), 378);
+ calculateHeat();
+ heatCycleProgress=0;
}
- }
+ }
- if (++this.progress >= this.maxProgress) {
+ if(++progress >= maxProgress){
- Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity " + this.getBlockType().getUnlocalizedName(), 338);
- if (this.items[18] != null) {
- final ItemStack checkOutput = this.getStackInSlot(18);
- if (this.neutrons == null) {
- this.neutrons = new ItemStack(ModItems.itemHeliumBlob, 1);
- if (checkOutput == null) {
+
+ Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity "+this.getBlockType().getUnlocalizedName(), 338);
+ if (items[18] != null){
+ ItemStack checkOutput = getStackInSlot(18);
+ if(neutrons == null){
+ neutrons = new ItemStack(ModItems.itemHeliumBlob, 1);
+ if (checkOutput == null){
Utils.LOG_WARNING("ItemStack in Output slot is definitely null, making a new ItemStack.");
- this.setInventorySlotContents(18, this.neutrons);
- this.progress = 0;
- this.markDirty();
+ setInventorySlotContents(18, neutrons);
+ progress = 0;
+ markDirty();
}
else {
checkOutput.stackSize++;
- Utils.LOG_WARNING("Found an ItemStack to increase the size of. Current size is "
- + this.neutrons.stackSize);
+ Utils.LOG_WARNING("Found an ItemStack to increase the size of. Current size is "+neutrons.stackSize);
- this.progress = 0;
- this.markDirty();
+ progress = 0;
+ markDirty();
}
}
- else if (checkOutput.getItem() == ModItems.itemHeliumBlob && checkOutput.stackSize < 64) {
+ else if(checkOutput.getItem() == ModItems.itemHeliumBlob && checkOutput.stackSize < 64){
checkOutput.stackSize++;
- Utils.LOG_WARNING(
- "Found an ItemStack to increase size of. Current size is " + checkOutput.stackSize);
- this.progress = 0;
- this.markDirty();
+ Utils.LOG_WARNING("Found an ItemStack to increase size of. Current size is "+checkOutput.stackSize);
+ progress = 0;
+ markDirty();
}
- else if (checkOutput.getItem() == ModItems.itemHeliumBlob && checkOutput.stackSize == 64) {
+ else if(checkOutput.getItem() == ModItems.itemHeliumBlob && checkOutput.stackSize == 64){
Utils.LOG_WARNING("Output stack is full.");
- this.progress = 0;
- this.markDirty();
+ progress = 0;
+ markDirty();
}
}
- else if (this.items[18] == null) {
+ else if (items[18] == null){
Utils.LOG_WARNING("ItemStack in Output slot is null");
- this.neutrons = new ItemStack(ModItems.itemHeliumBlob, 1);
- final ItemStack checkOutput = this.getStackInSlot(18);
- if (checkOutput == null) {
+ neutrons = new ItemStack(ModItems.itemHeliumBlob, 1);
+ ItemStack checkOutput = getStackInSlot(18);
+ if (checkOutput == null){
Utils.LOG_WARNING("ItemStack in Output slot is definitely null, making a new ItemStack.");
- this.setInventorySlotContents(18, this.neutrons);
- this.progress = 0;
- this.markDirty();
+ setInventorySlotContents(18, neutrons);
+ progress = 0;
+ markDirty();
}
else {
Utils.LOG_WARNING("Found an ItemStack to increase the size of.");
- checkOutput.stackSize++;
- this.progress = 0;
- this.markDirty();
+ checkOutput.stackSize++;
+ progress = 0;
+ markDirty();
}
}
- this.checkFuelRods();
+ checkFuelRods();
}
- this.progress++;
+ progress++;
}
}
- public void writeCustomNBT(final NBTTagCompound tag) {
+ public void readCustomNBT(NBTTagCompound tag)
+ {
+ this.neutrons = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("Neutrons"));
+ this.progress = tag.getInteger("Progress");
+ this.coreTemp = tag.getFloat("coreTemp");
+ }
+
+ public void writeCustomNBT(NBTTagCompound tag)
+ {
tag.setInteger("Progress", this.progress);
tag.setFloat("coreTemp", this.coreTemp);
- if (this.neutrons != null) {
- final NBTTagCompound produce = new NBTTagCompound();
- this.neutrons.writeToNBT(produce);
+ if(neutrons != null) {
+ NBTTagCompound produce = new NBTTagCompound();
+ neutrons.writeToNBT(produce);
tag.setTag("Neutrons", produce);
}
- else {
+ else
tag.removeTag("Neutrons");
- }
}
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < this.items.length; ++i) {
- if (this.items[i] != null) {
- final NBTTagCompound comp = new NBTTagCompound();
- comp.setByte("Slot", (byte) i);
- this.items[i].writeToNBT(comp);
- list.appendTag(comp);
- }
- }
-
- nbt.setTag("Items", list);
- }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java
index 2a87d4a7ab..9cbd963572 100644
--- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java
+++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java
@@ -1,13 +1,18 @@
package gtPlusPlus.core.tileentities.machines;
-import java.util.List;
-import java.util.Vector;
-
-import gtPlusPlus.core.inventories.*;
+import gtPlusPlus.core.inventories.InventoryWorkbenchChest;
+import gtPlusPlus.core.inventories.InventoryWorkbenchHoloCrafting;
+import gtPlusPlus.core.inventories.InventoryWorkbenchHoloSlots;
+import gtPlusPlus.core.inventories.InventoryWorkbenchTools;
import ic2.api.network.INetworkDataProvider;
import ic2.api.network.INetworkUpdateListener;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
+import ic2.core.network.NetworkManager;
+
+import java.util.List;
+import java.util.Vector;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCraftResult;
@@ -16,150 +21,154 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
-public class TileEntityWorkbench extends TileEntity
- implements INetworkDataProvider, INetworkUpdateListener, IWrenchable {
-
- // Credit to NovaViper in
- // http://www.minecraftforge.net/forum/index.php?topic=26439.0 - Helped me
- // restructure my Inventory system and now the crafting matrix works better.
-
- public InventoryWorkbenchChest inventoryChest;
- public InventoryWorkbenchTools inventoryTool;
- public InventoryWorkbenchHoloSlots inventoryHolo;
- public InventoryWorkbenchHoloCrafting inventoryCrafting;
+public class TileEntityWorkbench extends TileEntity implements INetworkDataProvider, INetworkUpdateListener, IWrenchable{
- public IInventory inventoryCraftResult = new InventoryCraftResult();
+ //Credit to NovaViper in http://www.minecraftforge.net/forum/index.php?topic=26439.0 - Helped me restructure my Inventory system and now the crafting matrix works better.
- private short facing = 0;
+ public InventoryWorkbenchChest inventoryChest;
+ public InventoryWorkbenchTools inventoryTool;
+ public InventoryWorkbenchHoloSlots inventoryHolo;
+ public InventoryWorkbenchHoloCrafting inventoryCrafting;
- public short prevFacing = 0;
+ public IInventory inventoryCraftResult = new InventoryCraftResult();
- public TileEntityWorkbench() {
- this.inventoryTool = new InventoryWorkbenchTools();// number of slots -
- // without product
- // slot
- this.inventoryChest = new InventoryWorkbenchChest();// number of slots -
- // without product
- // slot
+ public TileEntityWorkbench(){
+ this.inventoryTool = new InventoryWorkbenchTools();//number of slots - without product slot
+ this.inventoryChest = new InventoryWorkbenchChest();//number of slots - without product slot
this.inventoryHolo = new InventoryWorkbenchHoloSlots();
this.inventoryCrafting = new InventoryWorkbenchHoloCrafting();
this.canUpdate();
}
- @Override
- public short getFacing() {
- return this.facing;
- }
-
- @Override
- public List<String> getNetworkedFields() {
- final List<String> ret = new Vector(2);
- ret.add("facing");
- return ret;
- }
-
@SuppressWarnings("static-method")
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
+ public NBTTagCompound getTag(NBTTagCompound nbt, String tag)
+ {
+ if(!nbt.hasKey(tag))
+ {
nbt.setTag(tag, new NBTTagCompound());
}
return nbt.getCompoundTag(tag);
}
@Override
- public ItemStack getWrenchDrop(final EntityPlayer entityPlayer) {
- return new ItemStack(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord), 1,
- this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord));
- }
- @Override
- public float getWrenchDropRate() {
- return 1.0F;
- }
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+
+ nbt.setShort("facing", this.facing);
+
+ inventoryChest.writeToNBT(getTag(nbt, "ContentsChest"));
+ inventoryTool.writeToNBT(getTag(nbt, "ContentsTools"));
+ //inventoryCrafting.writeToNBT(getTag(nbt, "ContentsCrafting"));
+ inventoryHolo.writeToNBT(getTag(nbt, "ContentsHolo"));
- @Override
- public void onNetworkUpdate(final String field) {
+ // Write Crafting Matrix to NBT
+ NBTTagList craftingTag = new NBTTagList();
+ for (int currentIndex = 0; currentIndex < inventoryCrafting.getSizeInventory(); ++currentIndex) {
+ if (inventoryCrafting.getStackInSlot(currentIndex) != null) {
+ NBTTagCompound tagCompound = new NBTTagCompound();
+ tagCompound.setByte("Slot", (byte) currentIndex);
+ inventoryCrafting.getStackInSlot(currentIndex).writeToNBT(tagCompound);
+ craftingTag.appendTag(tagCompound);
+ }
+ }
- this.prevFacing = this.facing;
+ nbt.setTag("CraftingMatrix", craftingTag);
+ // Write craftingResult to NBT
+ if (inventoryCraftResult.getStackInSlot(0) != null)
+ nbt.setTag("CraftingResult", inventoryCraftResult.getStackInSlot(0).writeToNBT(new NBTTagCompound()));
}
@Override
- public void readFromNBT(final NBTTagCompound nbt) {
+ public void readFromNBT(NBTTagCompound nbt)
+ {
super.readFromNBT(nbt);
- this.prevFacing = this.facing = nbt.getShort("facing");
-
- this.inventoryChest.readFromNBT(nbt.getCompoundTag("ContentsChest"));
- this.inventoryTool.readFromNBT(nbt.getCompoundTag("ContentsTools"));
- // inventoryCrafting.readFromNBT(nbt.getCompoundTag("ContentsCrafting"));
- this.inventoryHolo.readFromNBT(nbt.getCompoundTag("ContentsHolo"));
+ this.prevFacing = (this.facing = nbt.getShort("facing"));
+
+ inventoryChest.readFromNBT(nbt.getCompoundTag("ContentsChest"));
+ inventoryTool.readFromNBT(nbt.getCompoundTag("ContentsTools"));
+ //inventoryCrafting.readFromNBT(nbt.getCompoundTag("ContentsCrafting"));
+ inventoryHolo.readFromNBT(nbt.getCompoundTag("ContentsHolo"));
// Read in the Crafting Matrix from NBT
- final NBTTagList craftingTag = nbt.getTagList("CraftingMatrix", 10);
- this.inventoryCrafting = new InventoryWorkbenchHoloCrafting(); // TODO:
- // magic
- // number
+ NBTTagList craftingTag = nbt.getTagList("CraftingMatrix", 10);
+ inventoryCrafting = new InventoryWorkbenchHoloCrafting(); //TODO: magic number
for (int i = 0; i < craftingTag.tagCount(); ++i) {
- final NBTTagCompound tagCompound = craftingTag.getCompoundTagAt(i);
- final byte slot = tagCompound.getByte("Slot");
- if (slot >= 0 && slot < this.inventoryCrafting.getSizeInventory()) {
- this.inventoryCrafting.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(tagCompound));
+ NBTTagCompound tagCompound = (NBTTagCompound) craftingTag.getCompoundTagAt(i);
+ byte slot = tagCompound.getByte("Slot");
+ if (slot >= 0 && slot < inventoryCrafting.getSizeInventory()) {
+ inventoryCrafting.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(tagCompound));
}
}
+
// Read craftingResult from NBT
- final NBTTagCompound tagCraftResult = nbt.getCompoundTag("CraftingResult");
- this.inventoryCraftResult.setInventorySlotContents(0, ItemStack.loadItemStackFromNBT(tagCraftResult));
+ NBTTagCompound tagCraftResult = nbt.getCompoundTag("CraftingResult");
+ inventoryCraftResult.setInventorySlotContents(0, ItemStack.loadItemStackFromNBT(tagCraftResult));
}
@Override
- public void setFacing(final short facing1) {
+ public List<String> getNetworkedFields(){
+ List<String> ret = new Vector(2);
+ ret.add("facing");
+ return ret;
+ }
+
+
+ @Override
+ public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
+ {
+ return false;
+ }
+
+ private short facing = 0;
+ public short prevFacing = 0;
+
+ @Override
+ public void setFacing(short facing1)
+ {
this.facing = facing1;
if (this.prevFacing != facing1) {
- IC2.network.get().updateTileEntityField(this, "facing");
+ ((NetworkManager)IC2.network.get()).updateTileEntityField(this, "facing");
}
this.prevFacing = facing1;
}
@Override
- public boolean wrenchCanRemove(final EntityPlayer entityPlayer) {
- return true;
+ public short getFacing()
+ {
+ return this.facing;
}
+
@Override
- public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final int side) {
- return false;
+ public boolean wrenchCanRemove(EntityPlayer entityPlayer)
+ {
+ return true;
}
@Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
+ public float getWrenchDropRate()
+ {
+ return 1.0F;
+ }
- nbt.setShort("facing", this.facing);
+ @Override
+ public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
+ {
+ return new ItemStack(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord), 1, this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord));
+ }
- this.inventoryChest.writeToNBT(this.getTag(nbt, "ContentsChest"));
- this.inventoryTool.writeToNBT(this.getTag(nbt, "ContentsTools"));
- // inventoryCrafting.writeToNBT(getTag(nbt, "ContentsCrafting"));
- this.inventoryHolo.writeToNBT(this.getTag(nbt, "ContentsHolo"));
+ @Override
+ public void onNetworkUpdate(String field) {
- // Write Crafting Matrix to NBT
- final NBTTagList craftingTag = new NBTTagList();
- for (int currentIndex = 0; currentIndex < this.inventoryCrafting.getSizeInventory(); ++currentIndex) {
- if (this.inventoryCrafting.getStackInSlot(currentIndex) != null) {
- final NBTTagCompound tagCompound = new NBTTagCompound();
- tagCompound.setByte("Slot", (byte) currentIndex);
- this.inventoryCrafting.getStackInSlot(currentIndex).writeToNBT(tagCompound);
- craftingTag.appendTag(tagCompound);
- }
- }
+ this.prevFacing = this.facing;
+
+ }
- nbt.setTag("CraftingMatrix", craftingTag);
- // Write craftingResult to NBT
- if (this.inventoryCraftResult.getStackInSlot(0) != null) {
- nbt.setTag("CraftingResult", this.inventoryCraftResult.getStackInSlot(0).writeToNBT(new NBTTagCompound()));
- }
- }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java
index 0cd730d4c8..63770a6efd 100644
--- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java
+++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java
@@ -1,9 +1,9 @@
package gtPlusPlus.core.tileentities.machines;
-import java.util.List;
-import java.util.Vector;
-
-import gtPlusPlus.core.inventories.*;
+import gtPlusPlus.core.inventories.InventoryWorkbenchChest;
+import gtPlusPlus.core.inventories.InventoryWorkbenchHoloCrafting;
+import gtPlusPlus.core.inventories.InventoryWorkbenchHoloSlots;
+import gtPlusPlus.core.inventories.InventoryWorkbenchToolsElectric;
import ic2.api.energy.event.EnergyTileLoadEvent;
import ic2.api.energy.event.EnergyTileUnloadEvent;
import ic2.api.energy.tile.IEnergySink;
@@ -11,6 +11,11 @@ import ic2.api.network.INetworkDataProvider;
import ic2.api.network.INetworkUpdateListener;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
+import ic2.core.network.NetworkManager;
+
+import java.util.List;
+import java.util.Vector;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCraftResult;
@@ -21,214 +26,223 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ForgeDirection;
-public class TileEntityWorkbenchAdvanced extends TileEntity
- implements IEnergySink, INetworkDataProvider, INetworkUpdateListener, IWrenchable {
-
- // Credit to NovaViper in
- // http://www.minecraftforge.net/forum/index.php?topic=26439.0 - Helped me
- // restructure my Inventory system and now the crafting matrix works better.
-
- public InventoryWorkbenchChest inventoryChest;
- public InventoryWorkbenchToolsElectric inventoryTool;
- public InventoryWorkbenchHoloSlots inventoryHolo;
- public InventoryWorkbenchHoloCrafting inventoryCrafting;
-
- public IInventory inventoryCraftResult = new InventoryCraftResult();
-
- // Wrench Code
- private short facing = 0;
- public short prevFacing = 0;
-
- // E-Net Code
- public double energy = 0.0D;
- public int maxEnergy;
- private boolean addedToEnergyNet = false;
- private int tier;
- private float guiChargeLevel;
-
- public TileEntityWorkbenchAdvanced(final int maxenergy, final int tier1) {
- this.inventoryTool = new InventoryWorkbenchToolsElectric();// number of
- // slots -
- // without
- // product
- // slot
- this.inventoryChest = new InventoryWorkbenchChest();// number of slots -
- // without product
- // slot
- this.inventoryHolo = new InventoryWorkbenchHoloSlots();
- this.inventoryCrafting = new InventoryWorkbenchHoloCrafting();
- this.canUpdate();
+public class TileEntityWorkbenchAdvanced extends TileEntity implements IEnergySink, INetworkDataProvider, INetworkUpdateListener, IWrenchable{
- // Electric Stats
- this.maxEnergy = maxenergy;
- this.tier = tier1;
+ //Credit to NovaViper in http://www.minecraftforge.net/forum/index.php?topic=26439.0 - Helped me restructure my Inventory system and now the crafting matrix works better.
- }
+ public InventoryWorkbenchChest inventoryChest;
+ public InventoryWorkbenchToolsElectric inventoryTool;
+ public InventoryWorkbenchHoloSlots inventoryHolo;
+ public InventoryWorkbenchHoloCrafting inventoryCrafting;
- @Override
- public boolean acceptsEnergyFrom(final TileEntity emitter, final ForgeDirection direction) {
- return true;
- }
+ public IInventory inventoryCraftResult = new InventoryCraftResult();
- public final float getChargeLevel() {
- return this.guiChargeLevel;
- }
+ //Wrench Code
+ private short facing = 0;
+ public short prevFacing = 0;
- @Override
- public double getDemandedEnergy() {
- return this.maxEnergy - this.energy;
- }
+ //E-Net Code
+ public double energy = 0.0D;
+ public int maxEnergy;
+ private boolean addedToEnergyNet = false;
+ private int tier;
+ private float guiChargeLevel;
- @Override
- public short getFacing() {
- return this.facing;
- }
- @Override
- public List<String> getNetworkedFields() {
- final List<String> ret = new Vector(2);
- ret.add("facing");
- return ret;
- }
+ public TileEntityWorkbenchAdvanced(int maxenergy, int tier1){
+ this.inventoryTool = new InventoryWorkbenchToolsElectric();//number of slots - without product slot
+ this.inventoryChest = new InventoryWorkbenchChest();//number of slots - without product slot
+ this.inventoryHolo = new InventoryWorkbenchHoloSlots();
+ this.inventoryCrafting = new InventoryWorkbenchHoloCrafting();
+ this.canUpdate();
+
+ //Electric Stats
+ this.maxEnergy = maxenergy;
+ this.tier = tier1;
- @Override
- public int getSinkTier() {
- return this.tier;
}
@SuppressWarnings("static-method")
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
+ public NBTTagCompound getTag(NBTTagCompound nbt, String tag)
+ {
+ if(!nbt.hasKey(tag))
+ {
nbt.setTag(tag, new NBTTagCompound());
}
return nbt.getCompoundTag(tag);
}
@Override
- public ItemStack getWrenchDrop(final EntityPlayer entityPlayer) {
- return new ItemStack(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord), 1,
- this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord));
- }
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ nbt.setDouble("energy", this.energy);
+ nbt.setShort("facing", this.facing);
- @Override
- public float getWrenchDropRate() {
- return 1.0F;
- }
+ inventoryChest.writeToNBT(getTag(nbt, "ContentsChest"));
+ inventoryTool.writeToNBT(getTag(nbt, "ContentsTools"));
+ //inventoryCrafting.writeToNBT(getTag(nbt, "ContentsCrafting"));
+ inventoryHolo.writeToNBT(getTag(nbt, "ContentsHolo"));
- @Override
- public double injectEnergy(final ForgeDirection directionFrom, final double amount, final double voltage) {
- if (this.energy >= this.maxEnergy) {
- return amount;
+ // Write Crafting Matrix to NBT
+ NBTTagList craftingTag = new NBTTagList();
+ for (int currentIndex = 0; currentIndex < inventoryCrafting.getSizeInventory(); ++currentIndex) {
+ if (inventoryCrafting.getStackInSlot(currentIndex) != null) {
+ NBTTagCompound tagCompound = new NBTTagCompound();
+ tagCompound.setByte("Slot", (byte) currentIndex);
+ inventoryCrafting.getStackInSlot(currentIndex).writeToNBT(tagCompound);
+ craftingTag.appendTag(tagCompound);
+ }
}
- this.energy += amount;
- return 0.0D;
- }
-
- @Override
- public void onNetworkUpdate(final String field) {
- this.prevFacing = this.facing;
+ nbt.setTag("CraftingMatrix", craftingTag);
+ // Write craftingResult to NBT
+ if (inventoryCraftResult.getStackInSlot(0) != null)
+ nbt.setTag("CraftingResult", inventoryCraftResult.getStackInSlot(0).writeToNBT(new NBTTagCompound()));
}
@Override
- public void readFromNBT(final NBTTagCompound nbt) {
+ public void readFromNBT(NBTTagCompound nbt)
+ {
super.readFromNBT(nbt);
this.energy = nbt.getDouble("energy");
- this.prevFacing = this.facing = nbt.getShort("facing");
+ this.prevFacing = (this.facing = nbt.getShort("facing"));
- this.inventoryChest.readFromNBT(nbt.getCompoundTag("ContentsChest"));
- this.inventoryTool.readFromNBT(nbt.getCompoundTag("ContentsTools"));
- // inventoryCrafting.readFromNBT(nbt.getCompoundTag("ContentsCrafting"));
- this.inventoryHolo.readFromNBT(nbt.getCompoundTag("ContentsHolo"));
+ inventoryChest.readFromNBT(nbt.getCompoundTag("ContentsChest"));
+ inventoryTool.readFromNBT(nbt.getCompoundTag("ContentsTools"));
+ //inventoryCrafting.readFromNBT(nbt.getCompoundTag("ContentsCrafting"));
+ inventoryHolo.readFromNBT(nbt.getCompoundTag("ContentsHolo"));
// Read in the Crafting Matrix from NBT
- final NBTTagList craftingTag = nbt.getTagList("CraftingMatrix", 10);
- this.inventoryCrafting = new InventoryWorkbenchHoloCrafting(); // TODO:
- // magic
- // number
+ NBTTagList craftingTag = nbt.getTagList("CraftingMatrix", 10);
+ inventoryCrafting = new InventoryWorkbenchHoloCrafting(); //TODO: magic number
for (int i = 0; i < craftingTag.tagCount(); ++i) {
- final NBTTagCompound tagCompound = craftingTag.getCompoundTagAt(i);
- final byte slot = tagCompound.getByte("Slot");
- if (slot >= 0 && slot < this.inventoryCrafting.getSizeInventory()) {
- this.inventoryCrafting.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(tagCompound));
+ NBTTagCompound tagCompound = (NBTTagCompound) craftingTag.getCompoundTagAt(i);
+ byte slot = tagCompound.getByte("Slot");
+ if (slot >= 0 && slot < inventoryCrafting.getSizeInventory()) {
+ inventoryCrafting.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(tagCompound));
}
}
+
// Read craftingResult from NBT
- final NBTTagCompound tagCraftResult = nbt.getCompoundTag("CraftingResult");
- this.inventoryCraftResult.setInventorySlotContents(0, ItemStack.loadItemStackFromNBT(tagCraftResult));
+ NBTTagCompound tagCraftResult = nbt.getCompoundTag("CraftingResult");
+ inventoryCraftResult.setInventorySlotContents(0, ItemStack.loadItemStackFromNBT(tagCraftResult));
}
@Override
- public void setFacing(final short facing1) {
- this.facing = facing1;
- if (this.prevFacing != facing1) {
- IC2.network.get().updateTileEntityField(this, "facing");
+ public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction)
+ {
+ return true;
+ }
+
+ @Override
+ public double getDemandedEnergy()
+ {
+ return this.maxEnergy - this.energy;
+ }
+
+ @Override
+ public int getSinkTier()
+ {
+ return this.tier;
+ }
+
+ @Override
+ public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage)
+ {
+ if (this.energy >= this.maxEnergy) {
+ return amount;
}
- this.prevFacing = facing1;
+ this.energy += amount;
+ return 0.0D;
+ }
+
+ public final float getChargeLevel()
+ {
+ return this.guiChargeLevel;
}
- public void setTier(final int tier1) {
+ public void setTier(int tier1)
+ {
if (this.tier == tier1) {
return;
}
- final boolean addedToENet = this.addedToEnergyNet;
- if (addedToENet) {
+ boolean addedToENet = this.addedToEnergyNet;
+ if (addedToENet)
+ {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
this.addedToEnergyNet = false;
}
this.tier = tier1;
- for (int i = 0; i < this.inventoryTool.getSizeInventory(); i++) {
- // this.inventoryTool..setTier(tier1); TODO
+ for (int i=0; i<inventoryTool.getSizeInventory(); i++){
+ //this.inventoryTool..setTier(tier1); TODO
}
- if (addedToENet) {
+ if (addedToENet)
+ {
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
this.addedToEnergyNet = true;
}
}
@Override
- public boolean wrenchCanRemove(final EntityPlayer entityPlayer) {
- return true;
+ public List<String> getNetworkedFields(){
+ List<String> ret = new Vector(2);
+ ret.add("facing");
+ return ret;
}
+
@Override
- public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final int side) {
+ public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
+ {
return false;
}
@Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- nbt.setDouble("energy", this.energy);
- nbt.setShort("facing", this.facing);
+ public void setFacing(short facing1)
+ {
+ this.facing = facing1;
+ if (this.prevFacing != facing1) {
+ ((NetworkManager)IC2.network.get()).updateTileEntityField(this, "facing");
+ }
+ this.prevFacing = facing1;
+ }
- this.inventoryChest.writeToNBT(this.getTag(nbt, "ContentsChest"));
- this.inventoryTool.writeToNBT(this.getTag(nbt, "ContentsTools"));
- // inventoryCrafting.writeToNBT(getTag(nbt, "ContentsCrafting"));
- this.inventoryHolo.writeToNBT(this.getTag(nbt, "ContentsHolo"));
+ @Override
+ public short getFacing()
+ {
+ return this.facing;
+ }
- // Write Crafting Matrix to NBT
- final NBTTagList craftingTag = new NBTTagList();
- for (int currentIndex = 0; currentIndex < this.inventoryCrafting.getSizeInventory(); ++currentIndex) {
- if (this.inventoryCrafting.getStackInSlot(currentIndex) != null) {
- final NBTTagCompound tagCompound = new NBTTagCompound();
- tagCompound.setByte("Slot", (byte) currentIndex);
- this.inventoryCrafting.getStackInSlot(currentIndex).writeToNBT(tagCompound);
- craftingTag.appendTag(tagCompound);
- }
- }
- nbt.setTag("CraftingMatrix", craftingTag);
- // Write craftingResult to NBT
- if (this.inventoryCraftResult.getStackInSlot(0) != null) {
- nbt.setTag("CraftingResult", this.inventoryCraftResult.getStackInSlot(0).writeToNBT(new NBTTagCompound()));
- }
+ @Override
+ public boolean wrenchCanRemove(EntityPlayer entityPlayer)
+ {
+ return true;
+ }
+
+ @Override
+ public float getWrenchDropRate()
+ {
+ return 1.0F;
+ }
+
+ @Override
+ public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
+ {
+ return new ItemStack(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord), 1, this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord));
+ }
+
+ @Override
+ public void onNetworkUpdate(String field) {
+
+ this.prevFacing = this.facing;
}
diff --git a/src/Java/gtPlusPlus/core/util/BaseHandler.java b/src/Java/gtPlusPlus/core/util/BaseHandler.java
index e8fb919ab0..63f22f3763 100644
--- a/src/Java/gtPlusPlus/core/util/BaseHandler.java
+++ b/src/Java/gtPlusPlus/core/util/BaseHandler.java
@@ -2,10 +2,10 @@ package gtPlusPlus.core.util;
public abstract class BaseHandler {
+ public abstract void preInit();
+
public abstract void init();
-
+
public abstract void postInit();
-
- public abstract void preInit();
-
+
}
diff --git a/src/Java/gtPlusPlus/core/util/ClassUtils.java b/src/Java/gtPlusPlus/core/util/ClassUtils.java
index e58c2f2785..ba3db748f9 100644
--- a/src/Java/gtPlusPlus/core/util/ClassUtils.java
+++ b/src/Java/gtPlusPlus/core/util/ClassUtils.java
@@ -1,56 +1,70 @@
package gtPlusPlus.core.util;
-import java.lang.reflect.*;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
public class ClassUtils {
- public static Method getMethodViaReflection(final Class<?> lookupClass, final String methodName,
- final boolean invoke) throws Exception {
- final Class<? extends Class> lookup = lookupClass.getClass();
- final Method m = lookup.getDeclaredMethod(methodName);
- m.setAccessible(true);// Abracadabra
- if (invoke) {
+
+ /*@ if (isPresent("com.optionaldependency.DependencyClass")) {
+ // This block will never execute when the dependency is not present
+ // There is therefore no more risk of code throwing NoClassDefFoundException.
+ executeCodeLinkingToDependency();
+ }*/
+ public static boolean isPresent(String className) {
+ try {
+ Class.forName(className);
+ return true;
+ } catch (Throwable ex) {
+ // Class or one of its dependencies is not present...
+ return false;
+ }
+ }
+
+ public static Method getMethodViaReflection(Class<?> lookupClass, String methodName, boolean invoke) throws Exception{
+ Class<? extends Class> lookup = lookupClass.getClass();
+ Method m = lookup.getDeclaredMethod(methodName);
+ m.setAccessible(true);// Abracadabra
+ if (invoke){
m.invoke(lookup);// now its OK
}
return m;
}
- public static Class getNonPublicClass(final String className) {
+ public static Class getNonPublicClass(String className){
Class<?> c = null;
try {
c = Class.forName(className);
- }
- catch (final ClassNotFoundException e) {
+ } catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
- // full package name --------^^^^^^^^^^
- // or simpler without Class.forName:
- // Class<package1.A> c = package1.A.class;
+ //full package name --------^^^^^^^^^^
+ //or simpler without Class.forName:
+ //Class<package1.A> c = package1.A.class;
- if (null != c) {
- // In our case we need to use
+ if (null != c){
+ //In our case we need to use
Constructor<?> constructor = null;
try {
constructor = c.getDeclaredConstructor();
- }
- catch (NoSuchMethodException | SecurityException e) {
+ } catch (NoSuchMethodException | SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
- // note: getConstructor() can return only public constructors
- // so we needed to search for any Declared constructor
+ //note: getConstructor() can return only public constructors
+ //so we needed to search for any Declared constructor
- // now we need to make this constructor accessible
- if (null != constructor) {
- constructor.setAccessible(true);// ABRACADABRA!
+ //now we need to make this constructor accessible
+ if (null != constructor){
+ constructor.setAccessible(true);//ABRACADABRA!
try {
- final Object o = constructor.newInstance();
+ Object o = constructor.newInstance();
return (Class) o;
- }
- catch (InstantiationException | IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
+ } catch (InstantiationException | IllegalAccessException
+ | IllegalArgumentException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
@@ -59,21 +73,6 @@ public class ClassUtils {
return null;
}
- /*
- * @ if (isPresent("com.optionaldependency.DependencyClass")) { // This
- * block will never execute when the dependency is not present // There is
- * therefore no more risk of code throwing NoClassDefFoundException.
- * executeCodeLinkingToDependency(); }
- */
- public static boolean isPresent(final String className) {
- try {
- Class.forName(className);
- return true;
- }
- catch (final Throwable ex) {
- // Class or one of its dependencies is not present...
- return false;
- }
- }
+
}
diff --git a/src/Java/gtPlusPlus/core/util/Log.java b/src/Java/gtPlusPlus/core/util/Log.java
index 460f8598dc..ea7076e453 100644
--- a/src/Java/gtPlusPlus/core/util/Log.java
+++ b/src/Java/gtPlusPlus/core/util/Log.java
@@ -3,22 +3,27 @@ package gtPlusPlus.core.util;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-public final class Log {
- public static final Logger LOGGER = LogManager.getLogger("MiscUtils");
-
- public static void debug(final String msg) {
- Log.LOGGER.debug(msg);
- }
-
- public static void error(final String msg) {
- Log.LOGGER.error(msg);
- }
-
- public static void info(final String msg) {
- Log.LOGGER.info(msg);
- }
-
- public static void warn(final String msg) {
- Log.LOGGER.warn(msg);
- }
+public final class Log
+{
+ public static final Logger LOGGER = LogManager.getLogger("MiscUtils");
+
+ public static void warn(String msg)
+ {
+ LOGGER.warn(msg);
+ }
+
+ public static void error(String msg)
+ {
+ LOGGER.error(msg);
+ }
+
+ public static void info(String msg)
+ {
+ LOGGER.info(msg);
+ }
+
+ public static void debug(String msg)
+ {
+ LOGGER.debug(msg);
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/LoggingUtils.java b/src/Java/gtPlusPlus/core/util/LoggingUtils.java
index ffae71c40d..7783577ee2 100644
--- a/src/Java/gtPlusPlus/core/util/LoggingUtils.java
+++ b/src/Java/gtPlusPlus/core/util/LoggingUtils.java
@@ -1,52 +1,54 @@
package gtPlusPlus.core.util;
-import java.io.*;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
import java.util.Date;
public class LoggingUtils {
- public static boolean logCurrentSystemTime(final String message) {
- final Date date = new Date(System.currentTimeMillis());
- try {
- LoggingUtils.profileLog(message + " | " + date.toString());
- return true;
- }
- catch (final Throwable r) {
- return false;
- }
-
- }
-
- public static void profileLog(final Object o) {
- try {
+ public static void profileLog(Object o){
+ try {
String content;
- final File file = new File("GregtechTimingsTC.txt");
+ File file = new File("GregtechTimingsTC.txt");
// if file doesnt exists, then create it
if (!file.exists()) {
file.createNewFile();
- final FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
- final BufferedWriter bw = new BufferedWriter(fw);
+ FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
+ BufferedWriter bw = new BufferedWriter(fw);
bw.write("============================================================");
bw.write(System.lineSeparator());
bw.close();
- }
- if (o instanceof String) {
+ }
+ if (o instanceof String){
content = (String) o;
- }
- else {
- content = o.toString();
- }
- final FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
- final BufferedWriter bw = new BufferedWriter(fw);
+ }
+ else {
+ content = o.toString();
+ }
+ FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
+ BufferedWriter bw = new BufferedWriter(fw);
bw.write(content);
bw.write(System.lineSeparator());
bw.close();
System.out.println("Data Logged.");
- }
- catch (final IOException e) {
+ } catch (IOException e) {
System.out.println("Data logging failed.");
}
+ }
+
+ public static boolean logCurrentSystemTime(String message){
+ Date date = new Date(System.currentTimeMillis());
+ try {
+ profileLog(message+" | "+date.toString());
+ return true;
+ }
+ catch (Throwable r) {
+ return false;
+ }
+
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/util/Quality.java b/src/Java/gtPlusPlus/core/util/Quality.java
index 50d1b9fc90..1ce29c7a58 100644
--- a/src/Java/gtPlusPlus/core/util/Quality.java
+++ b/src/Java/gtPlusPlus/core/util/Quality.java
@@ -4,65 +4,56 @@ import gtPlusPlus.core.util.math.MathUtils;
import net.minecraft.util.EnumChatFormatting;
public enum Quality {
-
+
// Magic Blue
// Rare Yellow
// Set Green
// Unique Gold/Purple
// Trade-off Brown
-
- POOR("Poor", EnumChatFormatting.GRAY), COMMON("Common", EnumChatFormatting.WHITE), UNCOMMON("Uncommon",
- EnumChatFormatting.DARK_GREEN), MAGIC("Magic", EnumChatFormatting.BLUE), RARE("Rare",
- EnumChatFormatting.YELLOW), UNIQUE("Unique", EnumChatFormatting.GOLD), ARTIFACT("Artifact",
- EnumChatFormatting.AQUA), SET("Set Piece", EnumChatFormatting.GREEN), TRADEOFF("Trade-off",
- EnumChatFormatting.DARK_RED), EPIC("Epic", EnumChatFormatting.LIGHT_PURPLE);
-
- public static Quality getRandomQuality() {
- final int lootChance = MathUtils.randInt(0, 100);
- if (lootChance <= 10) {
- return Quality.POOR;
- }
- else if (lootChance <= 45) {
- return Quality.COMMON;
- }
- else if (lootChance <= 65) {
- return Quality.UNCOMMON;
- }
- else if (lootChance <= 82) {
- return Quality.MAGIC;
- }
- else if (lootChance <= 92) {
- return Quality.EPIC;
- }
- else if (lootChance <= 97) {
- return Quality.RARE;
- }
- else if (lootChance <= 99) {
- return Quality.ARTIFACT;
- }
- else {
- return null;
- }
- }
- private String LOOT;
-
- private EnumChatFormatting COLOUR;
-
- private Quality(final String lootTier, final EnumChatFormatting tooltipColour) {
+
+ POOR("Poor", EnumChatFormatting.GRAY),
+ COMMON("Common", EnumChatFormatting.WHITE),
+ UNCOMMON("Uncommon", EnumChatFormatting.DARK_GREEN),
+ MAGIC("Magic", EnumChatFormatting.BLUE),
+ RARE("Rare", EnumChatFormatting.YELLOW),
+ UNIQUE("Unique", EnumChatFormatting.GOLD),
+ ARTIFACT("Artifact", EnumChatFormatting.AQUA),
+ SET("Set Piece", EnumChatFormatting.GREEN),
+ TRADEOFF("Trade-off", EnumChatFormatting.DARK_RED),
+ EPIC("Epic", EnumChatFormatting.LIGHT_PURPLE);
+
+ private String LOOT;
+ private EnumChatFormatting COLOUR;
+ private Quality (final String lootTier, final EnumChatFormatting tooltipColour)
+ {
this.LOOT = lootTier;
this.COLOUR = tooltipColour;
}
- public String formatted() {
- return this.COLOUR + this.LOOT;
+ public String getQuality() {
+ return LOOT;
}
-
- protected EnumChatFormatting getColour() {
- return this.COLOUR;
+
+ protected EnumChatFormatting getColour(){
+ return COLOUR;
}
-
- public String getQuality() {
- return this.LOOT;
+
+ public String formatted(){
+ return this.COLOUR+this.LOOT;
+ }
+
+ public static Quality getRandomQuality(){
+ int lootChance = MathUtils.randInt(0, 100);
+ if (lootChance <= 10){return Quality.POOR;}
+ else if (lootChance <= 45){return Quality.COMMON;}
+ else if (lootChance <= 65){return Quality.UNCOMMON;}
+ else if (lootChance <= 82){return Quality.MAGIC;}
+ else if (lootChance <= 92){return Quality.EPIC;}
+ else if (lootChance <= 97){return Quality.RARE;}
+ else if (lootChance <= 99){return Quality.ARTIFACT;}
+ else return null;
}
}
+
+
diff --git a/src/Java/gtPlusPlus/core/util/Utils.java b/src/Java/gtPlusPlus/core/util/Utils.java
index e65e0f2ea9..2e25b8b0e9 100644
--- a/src/Java/gtPlusPlus/core/util/Utils.java
+++ b/src/Java/gtPlusPlus/core/util/Utils.java
@@ -1,14 +1,5 @@
package gtPlusPlus.core.util;
-import java.awt.Color;
-import java.awt.Graphics;
-import java.lang.reflect.Method;
-import java.util.*;
-
-import org.apache.commons.lang3.EnumUtils;
-
-import cpw.mods.fml.common.FMLCommonHandler;
-import cpw.mods.fml.common.FMLLog;
import gregtech.api.enums.Materials;
import gregtech.api.enums.TC_Aspects;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
@@ -20,285 +11,237 @@ import gtPlusPlus.core.util.math.MathUtils;
import ic2.core.Ic2Items;
import ic2.core.init.InternalName;
import ic2.core.item.resources.ItemCell;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.EnumHelper;
-import net.minecraftforge.fluids.*;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
+import org.apache.commons.lang3.EnumUtils;
+
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.common.FMLLog;
+
public class Utils {
+ public static final int WILDCARD_VALUE = Short.MAX_VALUE;
+
+ public static final boolean isServer(){
+ return FMLCommonHandler.instance().getEffectiveSide().isServer();
+ }
+
static class ShortTimerTask extends TimerTask {
@Override
public void run() {
Utils.LOG_WARNING("Timer expired.");
}
}
-
- public static final int WILDCARD_VALUE = Short.MAX_VALUE;
-
- private static short cellID = 15;
-
- public static Integer appenedHexNotationToInteger(final int hexAsStringOrInt) {
- final String hexChar = "0x";
- String result;
- Utils.LOG_INFO(String.valueOf(hexAsStringOrInt));
- result = hexChar + String.valueOf(hexAsStringOrInt);
- return Integer.getInteger(result);
- }
-
- public static String appenedHexNotationToString(final Object hexAsStringOrInt) {
- final String hexChar = "0x";
- String result;
- if (hexAsStringOrInt.getClass() == String.class) {
-
- if (((String) hexAsStringOrInt).length() != 6) {
- final String temp = Utils.leftPadWithZeroes((String) hexAsStringOrInt, 6);
- result = temp;
- }
- result = hexChar + hexAsStringOrInt;
- return result;
- }
- else if (hexAsStringOrInt.getClass() == Integer.class) {
- ;
- if (((String) hexAsStringOrInt).length() != 6) {
- final String temp = Utils.leftPadWithZeroes((String) hexAsStringOrInt, 6);
- result = temp;
- }
- result = hexChar + String.valueOf(hexAsStringOrInt);
- return result;
- }
- else {
- return null;
- }
- }
-
- public static String byteToHex(final byte b) {
- final int i = b & 0xFF;
- return Integer.toHexString(i);
- }
-
- public static String checkCorrectMiningToolForBlock(final Block currentBlock, final World currentWorld) {
- String correctTool = "";
- if (!currentWorld.isRemote) {
- try {
- correctTool = currentBlock.getHarvestTool(0);
- Utils.LOG_WARNING(correctTool);
-
- }
- catch (final NullPointerException e) {
-
- }
- }
-
- return correctTool;
- }
-
- public static boolean containsMatch(final boolean strict, final ItemStack[] inputs, final ItemStack... targets) {
- for (final ItemStack input : inputs) {
- for (final ItemStack target : targets) {
- if (Utils.itemMatches(target, input, strict)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static List<Object> convertArrayListToList(final ArrayList sourceArray) {
- final List<Object> targetList = new ArrayList<Object>(Arrays.asList(sourceArray));
- return targetList;
- }
-
- public static List<Object> convertArrayToFixedSizeList(final Object[] sourceArray) {
- final List<Object> targetList = Arrays.asList(sourceArray);
- return targetList;
- }
-
- public static List<Object> convertArrayToList(final Object[] sourceArray) {
- final List<Object> targetList = new ArrayList<Object>(Arrays.asList(sourceArray));
- return targetList;
- }
-
- public static Object[] convertListToArray(final List<Object> sourceList) {
- final Object[] targetArray = sourceList.toArray(new Object[sourceList.size()]);
- return targetArray;
- }
-
- public static ItemStack createInternalNameAndFluidCell(final String s) {
- Utils.LOG_WARNING("1");
- final InternalName yourName = EnumHelper.addEnum(InternalName.class, s, new Class[0], new Object[0]);
- Utils.LOG_WARNING("2 " + yourName.name());
- final ItemCell item = (ItemCell) Ic2Items.cell.getItem();
- Utils.LOG_WARNING("3 " + item.getUnlocalizedName());
- try {
- Utils.LOG_WARNING("4");
- final Class<? extends ItemCell> clz = item.getClass();
- Utils.LOG_WARNING("5 " + clz.getSimpleName());
- final Method methode = clz.getDeclaredMethod("addCell", int.class, InternalName.class, Block[].class);
- Utils.LOG_WARNING("6 " + methode.getName());
- methode.setAccessible(true);
- Utils.LOG_WARNING("7 " + methode.isAccessible());
- final ItemStack temp = (ItemStack) methode.invoke(item, Utils.cellID++, yourName, new Block[0]);
- Utils.LOG_INFO("Successfully created " + temp.getDisplayName() + "s.");
- FluidContainerRegistry.registerFluidContainer(FluidUtils.getFluidStack(s.toLowerCase(), 0), temp.copy(),
- Ic2Items.cell.copy());
- ItemUtils.addItemToOreDictionary(temp.copy(), "cell" + s);
- return temp;
- }
- catch (final Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static boolean doesEntryExistAlreadyInOreDictionary(final String OreDictName) {
- if (OreDictionary.getOres(OreDictName).size() != 0) {
+
+ public static boolean isModUpToDate(){
+
+ if (CORE.MASTER_VERSION.equals(CORE.VERSION.toLowerCase())){
return true;
- }
+ }
return false;
}
-
- public static ToolMaterial generateMaterialFromGT(final Materials gtMaterial) {
- final String name = gtMaterial.name();
- final int harvestLevel = gtMaterial.mToolQuality;
- final int durability = gtMaterial.mDurability;
- final float damage = gtMaterial.mToolQuality;
- final int efficiency = (int) gtMaterial.mToolSpeed;
- final int enchantability = gtMaterial.mEnchantmentToolsLevel;
- final ToolMaterial temp = EnumHelper.addToolMaterial(name, harvestLevel, durability, efficiency, damage,
- enchantability);
- return temp;
-
+
+ public static TC_AspectStack getTcAspectStack (TC_Aspects aspect, long size){
+ return getTcAspectStack(aspect.name(), (int) size);
}
-
- /**
- * Returns a Liquid Stack with given amount of IC2Steam.
- */
- public static FluidStack getIC2Steam(final long aAmount) {
- return FluidRegistry.getFluidStack("ic2steam", (int) aAmount);
+
+ public static TC_AspectStack getTcAspectStack (String aspect, long size){
+ return getTcAspectStack(aspect, (int) size);
}
- public static TC_AspectStack getTcAspectStack(final String aspect, final int size) {
+ public static TC_AspectStack getTcAspectStack (TC_Aspects aspect, int size){
+ return getTcAspectStack(aspect.name(), size);
+ }
+
+ public static TC_AspectStack getTcAspectStack (String aspect, int size){
TC_AspectStack returnValue = null;
- if (aspect.toUpperCase() == "COGNITIO") {
- // Adds in Compat for older GT Versions which Misspell aspects.
+ if (aspect.toUpperCase() == "COGNITIO"){
+ //Adds in Compat for older GT Versions which Misspell aspects.
try {
- if (EnumUtils.isValidEnum(TC_Aspects.class, "COGNITIO")) {
- Utils.LOG_WARNING("TC Aspect found - " + aspect);
+ if (EnumUtils.isValidEnum(TC_Aspects.class, "COGNITIO")){
+ Utils.LOG_WARNING("TC Aspect found - "+aspect);
returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITIO"), size);
}
else {
- Utils.LOG_INFO("Fallback TC Aspect found - " + aspect
- + " - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
+ Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITO"), size);
- }
- }
- catch (final NoSuchFieldError r) {
+ }
+ } catch (NoSuchFieldError r){
Utils.LOG_INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus");
}
}
- else if (aspect.toUpperCase() == "EXANIMUS") {
- // Adds in Compat for older GT Versions which Misspell aspects.
+ else if (aspect.toUpperCase() == "EXANIMUS"){
+ //Adds in Compat for older GT Versions which Misspell aspects.
try {
- if (EnumUtils.isValidEnum(TC_Aspects.class, "EXANIMUS")) {
- Utils.LOG_WARNING("TC Aspect found - " + aspect);
+ if (EnumUtils.isValidEnum(TC_Aspects.class, "EXANIMUS")){
+ Utils.LOG_WARNING("TC Aspect found - "+aspect);
returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXANIMUS"), size);
}
else {
- Utils.LOG_INFO("Fallback TC Aspect found - " + aspect
- + " - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
+ Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXAMINIS"), size);
- }
- }
- catch (final NoSuchFieldError r) {
+ }
+ } catch (NoSuchFieldError r){
Utils.LOG_INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus");
}
-
+
+
}
- else if (aspect.toUpperCase() == "PRAECANTATIO") {
- // Adds in Compat for older GT Versions which Misspell aspects.
+ else if (aspect.toUpperCase() == "PRAECANTATIO"){
+ //Adds in Compat for older GT Versions which Misspell aspects.
try {
- if (EnumUtils.isValidEnum(TC_Aspects.class, "PRAECANTATIO")) {
- Utils.LOG_WARNING("TC Aspect found - " + aspect);
+ if (EnumUtils.isValidEnum(TC_Aspects.class, "PRAECANTATIO")){
+ Utils.LOG_WARNING("TC Aspect found - "+aspect);
returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTATIO"), size);
}
else {
- Utils.LOG_INFO("Fallback TC Aspect found - " + aspect
- + " - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
+ Utils.LOG_INFO("Fallback TC Aspect found - "+aspect+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTIO"), size);
- }
- }
- catch (final NoSuchFieldError r) {
+ }
+ } catch (NoSuchFieldError r){
Utils.LOG_INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus");
- }
+ }
}
else {
- Utils.LOG_WARNING("TC Aspect found - " + aspect);
+ Utils.LOG_WARNING("TC Aspect found - "+aspect);
returnValue = new TC_AspectStack(TC_Aspects.valueOf(aspect), size);
}
return returnValue;
}
- /*
- * public static void recipeBuilderBlock(ItemStack slot_1, ItemStack slot_2,
- * ItemStack slot_3, ItemStack slot_4, ItemStack slot_5, ItemStack slot_6,
- * ItemStack slot_7, ItemStack slot_8, ItemStack slot_9, Block resultBlock){
- * GameRegistry.addRecipe(new ItemStack(resultBlock), new Object[] {"ABC",
- * "DEF", "GHI", 'A',slot_1,'B',slot_2,'C',slot_3,
- * 'D',slot_4,'E',slot_5,'F',slot_6, 'G',slot_7,'H',slot_8,'I',slot_9 }); }
- */
+ public static boolean containsMatch(boolean strict, ItemStack[] inputs, ItemStack... targets)
+ {
+ for (ItemStack input : inputs)
+ {
+ for (ItemStack target : targets)
+ {
+ if (itemMatches(target, input, strict))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public static boolean itemMatches(ItemStack target, ItemStack input, boolean strict)
+ {
+ if (input == null || target == null)
+ {
+ return false;
+ }
+ return (target.getItem() == input.getItem() && ((target.getItemDamage() == WILDCARD_VALUE && !strict) || target.getItemDamage() == input.getItemDamage()));
+ }
+
+ //Non-Dev Comments
+ public static void LOG_INFO(String s){
+ //if (CORE.DEBUG){
+ FMLLog.info("GT++: "+s);
+ //}
+ }
+
+ //Developer Comments
+ public static void LOG_WARNING(String s){
+ if (CORE.DEBUG){
+ FMLLog.warning("GT++: "+s);
+ }
+ }
- public static TC_AspectStack getTcAspectStack(final String aspect, final long size) {
- return Utils.getTcAspectStack(aspect, (int) size);
+ //Errors
+ public static void LOG_ERROR(String s){
+ if (CORE.DEBUG){
+ FMLLog.severe("GT++: "+s);
+ }
}
- public static TC_AspectStack getTcAspectStack(final TC_Aspects aspect, final int size) {
- return Utils.getTcAspectStack(aspect.name(), size);
+ //Developer Logger
+ public static void LOG_SPECIFIC_WARNING(String whatToLog, String msg, int line){
+ if (CORE.DEBUG){
+ FMLLog.warning("GT++ |"+line+"| "+whatToLog+" | "+msg);
+ }
}
- public static TC_AspectStack getTcAspectStack(final TC_Aspects aspect, final long size) {
- return Utils.getTcAspectStack(aspect.name(), (int) size);
+ public static void paintBox(Graphics g, int MinA, int MinB, int MaxA, int MaxB){
+ g.drawRect (MinA, MinB, MaxA, MaxB);
}
/**
- *
- * @param colourInt
- * e.g. 0XFFFFFF
- * @return Colour
+ * Returns if that Liquid is IC2Steam.
*/
- public static Color hex2Rgb(final int colourInt) {
- return Color.decode(String.valueOf(colourInt));
+ public static boolean isIC2Steam(FluidStack aFluid) {
+ if (aFluid == null) return false;
+ return aFluid.isFluidEqual(getIC2Steam(1));
}
/**
- *
- * @param colourStr
- * e.g. "#FFFFFF"
- * @return
+ * Returns a Liquid Stack with given amount of IC2Steam.
*/
- public static Color hex2Rgb(final String colorStr) {
- return new Color(Integer.valueOf(colorStr.substring(1, 3), 16), Integer.valueOf(colorStr.substring(3, 5), 16),
- Integer.valueOf(colorStr.substring(5, 7), 16));
+ public static FluidStack getIC2Steam(long aAmount) {
+ return FluidRegistry.getFluidStack("ic2steam", (int)aAmount);
+ }
+
+
+
+ /*public static void recipeBuilderBlock(ItemStack slot_1, ItemStack slot_2, ItemStack slot_3, ItemStack slot_4, ItemStack slot_5, ItemStack slot_6, ItemStack slot_7, ItemStack slot_8, ItemStack slot_9, Block resultBlock){
+ GameRegistry.addRecipe(new ItemStack(resultBlock),
+ new Object[] {"ABC", "DEF", "GHI",
+ 'A',slot_1,'B',slot_2,'C',slot_3,
+ 'D',slot_4,'E',slot_5,'F',slot_6,
+ 'G',slot_7,'H',slot_8,'I',slot_9
+ });
+ }*/
+
+ public static String checkCorrectMiningToolForBlock(Block currentBlock, World currentWorld){
+ String correctTool = "";
+ if (!currentWorld.isRemote){
+ try {
+ correctTool = currentBlock.getHarvestTool(0);
+ Utils.LOG_WARNING(correctTool);
+
+ } catch (NullPointerException e){
+
+ }
+ }
+
+ return correctTool;
}
/**
- *
- * @param colourStr
- * e.g. "#FFFFFF"
+ *
+ * @param colourStr e.g. "#FFFFFF"
* @return String - formatted "rgb(0,0,0)"
*/
- public static String hex2RgbFormatted(final String hexString) {
- final Color c = new Color(Integer.valueOf(hexString.substring(1, 3), 16),
- Integer.valueOf(hexString.substring(3, 5), 16), Integer.valueOf(hexString.substring(5, 7), 16));
+ public static String hex2RgbFormatted(String hexString) {
+ Color c = new Color(
+ Integer.valueOf(hexString.substring(1, 3), 16),
+ Integer.valueOf(hexString.substring(3, 5), 16),
+ Integer.valueOf(hexString.substring(5, 7), 16));
- final StringBuffer sb = new StringBuffer();
+ StringBuffer sb = new StringBuffer();
sb.append("rgb(");
sb.append(c.getRed());
sb.append(",");
@@ -308,162 +251,256 @@ public class Utils {
sb.append(")");
return sb.toString();
}
-
+
+ /**
+ *
+ * @param colourStr e.g. "#FFFFFF"
+ * @return
+ */
+ public static Color hex2Rgb(String colorStr) {
+ return new Color(
+ Integer.valueOf( colorStr.substring( 1, 3 ), 16 ),
+ Integer.valueOf( colorStr.substring( 3, 5 ), 16 ),
+ Integer.valueOf( colorStr.substring( 5, 7 ), 16 ) );
+ }
+
+ /**
+ *
+ * @param colourInt e.g. 0XFFFFFF
+ * @return Colour
+ */
+ public static Color hex2Rgb(int colourInt) {
+ return Color.decode(String.valueOf(colourInt));
+ }
+
/**
- *
- * @param colourInt
- * e.g. 0XFFFFFF
+ *
+ * @param colourInt e.g. 0XFFFFFF
* @return short[]
*/
- public static short[] hex2RgbShort(final int colourInt) {
- final Color rgb = Color.decode(String.valueOf(colourInt));
- final short[] rgba = {
- (short) rgb.getRed(), (short) rgb.getGreen(), (short) rgb.getBlue(), (short) rgb.getAlpha()
- };
+ public static short[] hex2RgbShort(int colourInt) {
+ Color rgb = Color.decode(String.valueOf(colourInt));
+ short[] rgba = {(short) rgb.getRed(), (short) rgb.getGreen(), (short) rgb.getBlue(), (short) rgb.getAlpha()};
return rgba;
}
- /*
- * Original Code by Chandana Napagoda -
- * https://cnapagoda.blogspot.com.au/2011/03/java-hex-color-code-generator.
- * html
- */
- public static Map<Integer, String> hexColourGenerator(final int colorCount) {
- final int maxColorValue = 16777215;
- // this is decimal value of the "FFFFFF"
- final int devidedvalue = maxColorValue / colorCount;
- int countValue = 0;
- final HashMap<Integer, String> hexColorMap = new HashMap<Integer, String>();
- for (int a = 0; a < colorCount && maxColorValue >= countValue; a++) {
- if (a != 0) {
- countValue += devidedvalue;
- hexColorMap.put(a, Integer.toHexString(0x10000 | countValue).substring(1).toUpperCase());
- }
- else {
- hexColorMap.put(a, Integer.toHexString(0x10000 | countValue).substring(1).toUpperCase());
- }
- }
- return hexColorMap;
+ public static Timer ShortTimer(int seconds) {
+ Timer timer;
+ timer = new Timer();
+ timer.schedule(new ShortTimerTask(), seconds * 1000);
+ return timer;
}
- /*
- * Original Code by Chandana Napagoda -
- * https://cnapagoda.blogspot.com.au/2011/03/java-hex-color-code-generator.
- * html
- */
- public static Map<Integer, String> hexColourGeneratorRandom(final int colorCount) {
- final HashMap<Integer, String> hexColorMap = new HashMap<Integer, String>();
- for (int a = 0; a < colorCount; a++) {
- String code = "" + (int) (Math.random() * 256);
- code = code + code + code;
- final int i = Integer.parseInt(code);
- hexColorMap.put(a, Integer.toHexString(0x1000000 | i).substring(1).toUpperCase());
- Utils.LOG_INFO("" + Integer.toHexString(0x1000000 | i).substring(1).toUpperCase());
- }
- return hexColorMap;
+ public static String byteToHex(byte b) {
+ int i = b & 0xFF;
+ return Integer.toHexString(i);
}
- public static boolean invertBoolean(final boolean booleans) {
- if (booleans == true) {
- return false;
- }
- return true;
+ public static Object[] convertListToArray(List<Object> sourceList) {
+ Object[] targetArray = sourceList.toArray(new Object[sourceList.size()]);
+ return targetArray;
}
- /**
- * Returns if that Liquid is IC2Steam.
- */
- public static boolean isIC2Steam(final FluidStack aFluid) {
- if (aFluid == null) {
- return false;
- }
- return aFluid.isFluidEqual(Utils.getIC2Steam(1));
+ public static List<Object> convertArrayToFixedSizeList(Object[] sourceArray) {
+ List<Object> targetList = Arrays.asList(sourceArray);
+ return targetList;
}
- public static boolean isModUpToDate() {
-
- if (CORE.MASTER_VERSION.equals(CORE.VERSION.toLowerCase())) {
- return true;
- }
- return false;
+ public static List<Object> convertArrayToList(Object[] sourceArray) {
+ List<Object> targetList = new ArrayList<Object>(Arrays.asList(sourceArray));
+ return targetList;
+ }
+
+ public static List<Object> convertArrayListToList(ArrayList sourceArray) {
+ List<Object> targetList = new ArrayList<Object>(Arrays.asList(sourceArray));
+ return targetList;
}
- public static final boolean isServer() {
- return FMLCommonHandler.instance().getEffectiveSide().isServer();
+ public static void spawnCustomParticle(Entity entity){
+ GTplusplus.proxy.generateMysteriousParticles(entity);
+ }
+
+ public static void spawnFX(World world, int x, int y, int z, String particleName, Object particleName2){
+ if (!world.isRemote){
+ if (particleName2 == null || particleName2.equals("")){
+ particleName2 = particleName;
+ }
+ int l = MathUtils.randInt(0, 4);
+ double d0 = (double)((float)x + 0.5F);
+ double d1 = (double)((float)y + 0.7F);
+ double d2 = (double)((float)z + 0.5F);
+ double d3 = 0.2199999988079071D;
+ double d4 = 0.27000001072883606D;
+
+ if (l == 1)
+ {
+ world.spawnParticle(particleName, d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
+ }
+ else if (l == 2)
+ {
+ world.spawnParticle((String) particleName2, d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
+ }
+ else if (l == 3)
+ {
+ world.spawnParticle(particleName, d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
+ }
+ else if (l == 4)
+ {
+ world.spawnParticle((String) particleName2, d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
+ }
+ else
+ {
+ world.spawnParticle(particleName, d0, d1, d2, 0.0D, 0.0D, 0.0D);
+ if (particleName2 != null){
+ world.spawnParticle((String) particleName2, d0, d1, d2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
}
- public static boolean itemMatches(final ItemStack target, final ItemStack input, final boolean strict) {
- if (input == null || target == null) {
- return false;
+ public static int rgbtoHexValue(int r, int g, int b){
+ if (r > 255 || g > 255 || b > 255 || r < 0 || g < 0 || b < 0){
+ return 0;
}
- return target.getItem() == input.getItem() && (target.getItemDamage() == Utils.WILDCARD_VALUE && !strict
- || target.getItemDamage() == input.getItemDamage());
+ Color c = new Color(r,g,b);
+ String temp = Integer.toHexString( c.getRGB() & 0xFFFFFF ).toUpperCase();
+
+ //System.out.println( "hex: " + Integer.toHexString( c.getRGB() & 0xFFFFFF ) + " hex value:"+temp);
+ temp = Utils.appenedHexNotationToString(String.valueOf(temp));
+ Utils.LOG_WARNING("Made "+temp+" - Hopefully it's not a mess.");
+ Utils.LOG_WARNING("It will decode into "+Integer.decode(temp)+".");
+ return Integer.decode(temp);
}
/*
* http://javadevnotes.com/java-left-pad-string-with-zeros-examples
*/
- public static String leftPadWithZeroes(final String originalString, final int length) {
- final StringBuilder sb = new StringBuilder();
+ public static String leftPadWithZeroes(String originalString, int length) {
+ StringBuilder sb = new StringBuilder();
while (sb.length() + originalString.length() < length) {
sb.append('0');
}
sb.append(originalString);
- final String paddedString = sb.toString();
+ String paddedString = sb.toString();
return paddedString;
}
- // Errors
- public static void LOG_ERROR(final String s) {
- if (CORE.DEBUG) {
- FMLLog.severe("GT++: " + s);
+ /*
+ * Original Code by Chandana Napagoda - https://cnapagoda.blogspot.com.au/2011/03/java-hex-color-code-generator.html
+ */
+ public static Map<Integer, String> hexColourGenerator(int colorCount){
+ int maxColorValue = 16777215;
+ // this is decimal value of the "FFFFFF"
+ int devidedvalue = maxColorValue/colorCount;
+ int countValue = 0;
+ HashMap<Integer, String> hexColorMap = new HashMap<Integer, String>();
+ for(int a=0; a < colorCount && maxColorValue >= countValue ; a++){
+ if(a != 0){
+ countValue+=devidedvalue;
+ hexColorMap.put(a,Integer.toHexString( 0x10000 | countValue).substring(1).toUpperCase());
+ }
+ else {
+ hexColorMap.put(a,Integer.toHexString( 0x10000 | countValue).substring(1).toUpperCase());
+ }
}
+ return hexColorMap;
}
- // Non-Dev Comments
- public static void LOG_INFO(final String s) {
- // if (CORE.DEBUG){
- FMLLog.info("GT++: " + s);
- // }
- }
-
- // Developer Logger
- public static void LOG_SPECIFIC_WARNING(final String whatToLog, final String msg, final int line) {
- if (CORE.DEBUG) {
- FMLLog.warning("GT++ |" + line + "| " + whatToLog + " | " + msg);
+ /*
+ * Original Code by Chandana Napagoda - https://cnapagoda.blogspot.com.au/2011/03/java-hex-color-code-generator.html
+ */
+ public static Map<Integer, String> hexColourGeneratorRandom(int colorCount){
+ HashMap<Integer, String> hexColorMap = new HashMap<Integer, String>();
+ for(int a=0;a < colorCount; a++){
+ String code = ""+(int)(Math.random()*256);
+ code = code+code+code;
+ int i = Integer.parseInt(code);
+ hexColorMap.put(a,Integer.toHexString( 0x1000000 | i).substring(1).toUpperCase());
+ Utils.LOG_INFO(""+Integer.toHexString( 0x1000000 | i).substring(1).toUpperCase());
}
+ return hexColorMap;
}
- // Developer Comments
- public static void LOG_WARNING(final String s) {
- if (CORE.DEBUG) {
- FMLLog.warning("GT++: " + s);
+ public static String appenedHexNotationToString(Object hexAsStringOrInt){
+ String hexChar = "0x";
+ String result;
+ if (hexAsStringOrInt.getClass() == String.class){
+
+ if (((String) hexAsStringOrInt).length() != 6){
+ String temp = leftPadWithZeroes((String) hexAsStringOrInt, 6);
+ result = temp;
+ }
+ result = hexChar+hexAsStringOrInt;
+ return result;
+ }
+ else if (hexAsStringOrInt.getClass() == Integer.class){
+ ;
+ if (((String) hexAsStringOrInt).length() != 6){
+ String temp = leftPadWithZeroes((String) hexAsStringOrInt, 6);
+ result = temp;
+ }
+ result = hexChar+String.valueOf(hexAsStringOrInt);
+ return result;
+ }
+ else {
+ return null;
}
}
- public static void paintBox(final Graphics g, final int MinA, final int MinB, final int MaxA, final int MaxB) {
- g.drawRect(MinA, MinB, MaxA, MaxB);
+ public static Integer appenedHexNotationToInteger(int hexAsStringOrInt){
+ String hexChar = "0x";
+ String result;
+ Utils.LOG_INFO(String.valueOf(hexAsStringOrInt));
+ result = hexChar+String.valueOf(hexAsStringOrInt);
+ return Integer.getInteger(result);
}
- public static int rgbtoHexValue(final int r, final int g, final int b) {
- if (r > 255 || g > 255 || b > 255 || r < 0 || g < 0 || b < 0) {
- return 0;
+ public static boolean doesEntryExistAlreadyInOreDictionary(String OreDictName){
+ if (OreDictionary.getOres(OreDictName).size() != 0) {
+ return true;
}
- final Color c = new Color(r, g, b);
- String temp = Integer.toHexString(c.getRGB() & 0xFFFFFF).toUpperCase();
+ return false;
+ }
- // System.out.println( "hex: " + Integer.toHexString( c.getRGB() &
- // 0xFFFFFF ) + " hex value:"+temp);
- temp = Utils.appenedHexNotationToString(String.valueOf(temp));
- Utils.LOG_WARNING("Made " + temp + " - Hopefully it's not a mess.");
- Utils.LOG_WARNING("It will decode into " + Integer.decode(temp) + ".");
- return Integer.decode(temp);
+ public static boolean invertBoolean(boolean booleans){
+ if (booleans == true){
+ return false;
+ }
+ return true;
}
- public static String sanitizeString(final String input) {
+ private static short cellID = 15;
+ public static ItemStack createInternalNameAndFluidCell(String s){
+ Utils.LOG_WARNING("1");
+ InternalName yourName = EnumHelper.addEnum(InternalName.class, s, new Class[0], new Object[0]);
+ Utils.LOG_WARNING("2 "+yourName.name());
+ ItemCell item = (ItemCell)Ic2Items.cell.getItem();
+ Utils.LOG_WARNING("3 "+item.getUnlocalizedName());
+ try
+ {
+ Utils.LOG_WARNING("4");
+ Class<? extends ItemCell> clz = item.getClass();
+ Utils.LOG_WARNING("5 "+clz.getSimpleName());
+ Method methode = clz.getDeclaredMethod("addCell", int.class, InternalName.class, Block[].class);
+ Utils.LOG_WARNING("6 "+methode.getName());
+ methode.setAccessible(true);
+ Utils.LOG_WARNING("7 "+methode.isAccessible());
+ ItemStack temp = (ItemStack) methode.invoke(item, cellID++, yourName, new Block[0]);
+ Utils.LOG_INFO("Successfully created "+temp.getDisplayName()+"s.");
+ FluidContainerRegistry.registerFluidContainer(FluidUtils.getFluidStack(s.toLowerCase(), 0), temp.copy(), Ic2Items.cell.copy());
+ ItemUtils.addItemToOreDictionary(temp.copy(), "cell"+s);
+ return temp;
+ }
+ catch(Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static String sanitizeString(String input){
String temp;
String output;
-
+
temp = input.replace(" ", "");
temp = temp.replace("-", "");
temp = temp.replace("_", "");
@@ -478,54 +515,24 @@ public class Utils {
temp = temp.replace("[", "");
temp = temp.replace("]", "");
temp = temp.replace(" ", "");
- output = temp;
+ output = temp;
return output;
-
+
+ }
+
+ public static ToolMaterial generateMaterialFromGT(Materials gtMaterial){
+ String name = gtMaterial.name();
+ int harvestLevel = gtMaterial.mToolQuality;
+ int durability = gtMaterial.mDurability;
+ float damage = gtMaterial.mToolQuality;
+ int efficiency = (int) gtMaterial.mToolSpeed;
+ int enchantability = gtMaterial.mEnchantmentToolsLevel;
+ ToolMaterial temp = EnumHelper.addToolMaterial(name, harvestLevel, durability, efficiency, damage, enchantability);
+ return temp;
+
}
- public static Timer ShortTimer(final int seconds) {
- Timer timer;
- timer = new Timer();
- timer.schedule(new ShortTimerTask(), seconds * 1000);
- return timer;
- }
- public static void spawnCustomParticle(final Entity entity) {
- GTplusplus.proxy.generateMysteriousParticles(entity);
- }
+}
- public static void spawnFX(final World world, final int x, final int y, final int z, final String particleName,
- Object particleName2) {
- if (!world.isRemote) {
- if (particleName2 == null || particleName2.equals("")) {
- particleName2 = particleName;
- }
- final int l = MathUtils.randInt(0, 4);
- final double d0 = x + 0.5F;
- final double d1 = y + 0.7F;
- final double d2 = z + 0.5F;
- final double d3 = 0.2199999988079071D;
- final double d4 = 0.27000001072883606D;
-
- if (l == 1) {
- world.spawnParticle(particleName, d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
- }
- else if (l == 2) {
- world.spawnParticle((String) particleName2, d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
- }
- else if (l == 3) {
- world.spawnParticle(particleName, d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
- }
- else if (l == 4) {
- world.spawnParticle((String) particleName2, d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
- }
- else {
- world.spawnParticle(particleName, d0, d1, d2, 0.0D, 0.0D, 0.0D);
- if (particleName2 != null) {
- world.spawnParticle((String) particleName2, d0, d1, d2, 0.0D, 0.0D, 0.0D);
- }
- }
- }
- }
-}
diff --git a/src/Java/gtPlusPlus/core/util/UtilsChatFormatting.java b/src/Java/gtPlusPlus/core/util/UtilsChatFormatting.java
index 38fa9eeca9..9e358b3074 100644
--- a/src/Java/gtPlusPlus/core/util/UtilsChatFormatting.java
+++ b/src/Java/gtPlusPlus/core/util/UtilsChatFormatting.java
@@ -1,131 +1,156 @@
package gtPlusPlus.core.util;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
import java.util.regex.Pattern;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-public enum UtilsChatFormatting {
- BLACK('0'), DARK_BLUE('1'), DARK_GREEN('2'), DARK_AQUA('3'), DARK_RED('4'), DARK_PURPLE('5'), GOLD('6'), GRAY(
- '7'), DARK_GRAY('8'), BLUE('9'), GREEN('a'), AQUA('b'), RED('c'), LIGHT_PURPLE('d'), YELLOW('e'), WHITE(
- 'f'), OBFUSCATED('k', true), BOLD('l',
- true), STRIKETHROUGH('m', true), UNDERLINE('n', true), ITALIC('o', true), RESET('r');
- /**
- * Maps a formatting code (e.g., 'f') to its corresponding enum value (e.g.,
- * WHITE).
- */
- private static final Map<Character, UtilsChatFormatting> formattingCodeMapping = new HashMap<Character, UtilsChatFormatting>();
- /**
- * Maps a name (e.g., 'underline') to its corresponding enum value (e.g.,
- * UNDERLINE).
- */
- private static final Map<String, UtilsChatFormatting> nameMapping = new HashMap<String, UtilsChatFormatting>();
- /**
- * Matches formatting codes that indicate that the client should treat the
- * following text as bold, recolored, obfuscated, etc.
- */
- private static final Pattern formattingCodePattern = Pattern
- .compile("(?i)" + String.valueOf('\u00a7') + "[0-9A-FK-OR]");
- static {
- final UtilsChatFormatting[] var0 = UtilsChatFormatting.values();
- final int var1 = var0.length;
-
- for (int var2 = 0; var2 < var1; ++var2) {
- final UtilsChatFormatting var3 = var0[var2];
- UtilsChatFormatting.formattingCodeMapping.put(Character.valueOf(var3.getFormattingCode()), var3);
- UtilsChatFormatting.nameMapping.put(var3.getFriendlyName(), var3);
- }
- }
- /**
- * Returns a copy of the given string, with formatting codes stripped away.
- */
- @SideOnly(Side.CLIENT)
- public static String getTextWithoutFormattingCodes(final String p_110646_0_) {
- return p_110646_0_ == null ? null
- : UtilsChatFormatting.formattingCodePattern.matcher(p_110646_0_).replaceAll("");
- }
- /**
- * Gets all the valid values. Args: @param par0: Whether or not to include
- * color values. @param par1: Whether or not to include fancy-styling values
- * (anything that isn't a color value or the "reset" value).
- */
- public static Collection<String> getValidValues(final boolean p_96296_0_, final boolean p_96296_1_) {
- final ArrayList<String> arraylist = new ArrayList<String>();
- final UtilsChatFormatting[] aenumchatformatting = UtilsChatFormatting.values();
- final int i = aenumchatformatting.length;
-
- for (int j = 0; j < i; ++j) {
- final UtilsChatFormatting enumchatformatting = aenumchatformatting[j];
-
- if ((!enumchatformatting.isColor() || p_96296_0_) && (!enumchatformatting.isFancyStyling() || p_96296_1_)) {
- arraylist.add(enumchatformatting.getFriendlyName());
- }
- }
-
- return arraylist;
- }
-
- /**
- * Gets a value by its friendly name; null if the given name does not map to
- * a defined value.
- */
- public static UtilsChatFormatting getValueByName(final String p_96300_0_) {
- return p_96300_0_ == null ? null
- : (UtilsChatFormatting) UtilsChatFormatting.nameMapping.get(p_96300_0_.toLowerCase());
- }
-
- /** The formatting code that produces this format. */
- private final char formattingCode;
-
- private final boolean fancyStyling;
-
- /**
- * The control string (section sign + formatting code) that can be inserted
- * into client-side text to display subsequent text in this format.
- */
- private final String controlString;
-
- private UtilsChatFormatting(final char p_i1336_3_) {
- this(p_i1336_3_, false);
- }
-
- private UtilsChatFormatting(final char p_i1337_3_, final boolean p_i1337_4_) {
- this.formattingCode = p_i1337_3_;
- this.fancyStyling = p_i1337_4_;
- this.controlString = "\u00a7" + p_i1337_3_;
- }
-
- /**
- * Gets the formatting code that produces this format.
- */
- public char getFormattingCode() {
- return this.formattingCode;
- }
-
- /**
- * Gets the friendly name of this value.
- */
- public String getFriendlyName() {
- return this.name().toLowerCase();
- }
-
- /**
- * Checks if typo is a color.
- */
- public boolean isColor() {
- return !this.fancyStyling && this != RESET;
- }
-
- /**
- * False if this is just changing the color or resetting; true otherwise.
- */
- public boolean isFancyStyling() {
- return this.fancyStyling;
- }
-
- @Override
- public String toString() {
- return this.controlString;
- }
+public enum UtilsChatFormatting
+{
+ BLACK('0'),
+ DARK_BLUE('1'),
+ DARK_GREEN('2'),
+ DARK_AQUA('3'),
+ DARK_RED('4'),
+ DARK_PURPLE('5'),
+ GOLD('6'),
+ GRAY('7'),
+ DARK_GRAY('8'),
+ BLUE('9'),
+ GREEN('a'),
+ AQUA('b'),
+ RED('c'),
+ LIGHT_PURPLE('d'),
+ YELLOW('e'),
+ WHITE('f'),
+ OBFUSCATED('k', true),
+ BOLD('l', true),
+ STRIKETHROUGH('m', true),
+ UNDERLINE('n', true),
+ ITALIC('o', true),
+ RESET('r');
+ /** Maps a formatting code (e.g., 'f') to its corresponding enum value (e.g., WHITE). */
+ private static final Map<Character, UtilsChatFormatting> formattingCodeMapping = new HashMap<Character, UtilsChatFormatting>();
+ /** Maps a name (e.g., 'underline') to its corresponding enum value (e.g., UNDERLINE). */
+ private static final Map<String, UtilsChatFormatting> nameMapping = new HashMap<String, UtilsChatFormatting>();
+ /**
+ * Matches formatting codes that indicate that the client should treat the following text as bold, recolored,
+ * obfuscated, etc.
+ */
+ private static final Pattern formattingCodePattern = Pattern.compile("(?i)" + String.valueOf('\u00a7') + "[0-9A-FK-OR]");
+ /** The formatting code that produces this format. */
+ private final char formattingCode;
+ private final boolean fancyStyling;
+ /**
+ * The control string (section sign + formatting code) that can be inserted into client-side text to display
+ * subsequent text in this format.
+ */
+ private final String controlString;
+
+ private UtilsChatFormatting(char p_i1336_3_)
+ {
+ this(p_i1336_3_, false);
+ }
+
+ private UtilsChatFormatting(char p_i1337_3_, boolean p_i1337_4_)
+ {
+ this.formattingCode = p_i1337_3_;
+ this.fancyStyling = p_i1337_4_;
+ this.controlString = "\u00a7" + p_i1337_3_;
+ }
+
+ /**
+ * Gets the formatting code that produces this format.
+ */
+ public char getFormattingCode()
+ {
+ return this.formattingCode;
+ }
+
+ /**
+ * False if this is just changing the color or resetting; true otherwise.
+ */
+ public boolean isFancyStyling()
+ {
+ return this.fancyStyling;
+ }
+
+ /**
+ * Checks if typo is a color.
+ */
+ public boolean isColor()
+ {
+ return !this.fancyStyling && this != RESET;
+ }
+
+ /**
+ * Gets the friendly name of this value.
+ */
+ public String getFriendlyName()
+ {
+ return this.name().toLowerCase();
+ }
+
+ @Override
+ public String toString()
+ {
+ return this.controlString;
+ }
+
+ /**
+ * Returns a copy of the given string, with formatting codes stripped away.
+ */
+ @SideOnly(Side.CLIENT)
+ public static String getTextWithoutFormattingCodes(String p_110646_0_)
+ {
+ return p_110646_0_ == null ? null : formattingCodePattern.matcher(p_110646_0_).replaceAll("");
+ }
+
+ /**
+ * Gets a value by its friendly name; null if the given name does not map to a defined value.
+ */
+ public static UtilsChatFormatting getValueByName(String p_96300_0_)
+ {
+ return p_96300_0_ == null ? null : (UtilsChatFormatting)nameMapping.get(p_96300_0_.toLowerCase());
+ }
+
+ /**
+ * Gets all the valid values. Args: @param par0: Whether or not to include color values. @param par1: Whether or not
+ * to include fancy-styling values (anything that isn't a color value or the "reset" value).
+ */
+ public static Collection<String> getValidValues(boolean p_96296_0_, boolean p_96296_1_)
+ {
+ ArrayList<String> arraylist = new ArrayList<String>();
+ UtilsChatFormatting[] aenumchatformatting = values();
+ int i = aenumchatformatting.length;
+
+ for (int j = 0; j < i; ++j)
+ {
+ UtilsChatFormatting enumchatformatting = aenumchatformatting[j];
+
+ if ((!enumchatformatting.isColor() || p_96296_0_) && (!enumchatformatting.isFancyStyling() || p_96296_1_))
+ {
+ arraylist.add(enumchatformatting.getFriendlyName());
+ }
+ }
+
+ return arraylist;
+ }
+
+ static
+ {
+ UtilsChatFormatting[] var0 = values();
+ int var1 = var0.length;
+
+ for (int var2 = 0; var2 < var1; ++var2)
+ {
+ UtilsChatFormatting var3 = var0[var2];
+ formattingCodeMapping.put(Character.valueOf(var3.getFormattingCode()), var3);
+ nameMapping.put(var3.getFriendlyName(), var3);
+ }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/UtilsRarity.java b/src/Java/gtPlusPlus/core/util/UtilsRarity.java
index 1eed211613..19339b7717 100644
--- a/src/Java/gtPlusPlus/core/util/UtilsRarity.java
+++ b/src/Java/gtPlusPlus/core/util/UtilsRarity.java
@@ -2,17 +2,22 @@ package gtPlusPlus.core.util;
import net.minecraft.util.EnumChatFormatting;
-public enum UtilsRarity {
- T1_poor(EnumChatFormatting.GRAY, "Poor"), T2_normal(EnumChatFormatting.WHITE, "Common"), T3_uncommon(
- EnumChatFormatting.GREEN,
- "Uncommon"), T4_magic(EnumChatFormatting.BLUE, "Magic"), T5_rare(EnumChatFormatting.LIGHT_PURPLE,
- "Rare"), T6_epic(EnumChatFormatting.YELLOW, "Epic"), T8_unique(EnumChatFormatting.GOLD, "Unique");
+public enum UtilsRarity
+{
+ T1_poor(EnumChatFormatting.GRAY, "Poor"),
+ T2_normal(EnumChatFormatting.WHITE, "Common"),
+ T3_uncommon(EnumChatFormatting.GREEN, "Uncommon"),
+ T4_magic(EnumChatFormatting.BLUE, "Magic"),
+ T5_rare(EnumChatFormatting.LIGHT_PURPLE, "Rare"),
+ T6_epic(EnumChatFormatting.YELLOW, "Epic"),
+ T8_unique(EnumChatFormatting.GOLD, "Unique");
+
+ public final EnumChatFormatting rarityColor;
+ public final String rarityName;
- public final EnumChatFormatting rarityColor;
- public final String rarityName;
-
- private UtilsRarity(final EnumChatFormatting rarity, final String name) {
- this.rarityColor = rarity;
- this.rarityName = name;
- }
+ private UtilsRarity(EnumChatFormatting rarity, String name)
+ {
+ this.rarityColor = rarity;
+ this.rarityName = name;
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/UtilsText.java b/src/Java/gtPlusPlus/core/util/UtilsText.java
index 0db7dd35a2..e91fa95e4c 100644
--- a/src/Java/gtPlusPlus/core/util/UtilsText.java
+++ b/src/Java/gtPlusPlus/core/util/UtilsText.java
@@ -2,17 +2,31 @@ package gtPlusPlus.core.util;
public enum UtilsText {
- blue('1'), green('2'), teal('3'), maroon('4'), purple('5'), orange('6'), lightGray('7'), darkGray('8'), lightBlue(
- '9'), black('0'), lime('a'), aqua('b'), red('c'), pink('d'), yellow('e'), white('f');
+ blue('1'),
+ green('2'),
+ teal('3'),
+ maroon('4'),
+ purple('5'),
+ orange('6'),
+ lightGray('7'),
+ darkGray('8'),
+ lightBlue('9'),
+ black('0'),
+ lime('a'),
+ aqua('b'),
+ red('c'),
+ pink('d'),
+ yellow('e'),
+ white('f');
private char colourValue;
-
- private UtilsText(final char value) {
+ private UtilsText (char value)
+ {
this.colourValue = value;
}
public String colour() {
- return "�" + this.colourValue;
+ return "§"+colourValue;
}
}
diff --git a/src/Java/gtPlusPlus/core/util/array/ArrayUtils.java b/src/Java/gtPlusPlus/core/util/array/ArrayUtils.java
index 0d78c76681..ea02aaf1da 100644
--- a/src/Java/gtPlusPlus/core/util/array/ArrayUtils.java
+++ b/src/Java/gtPlusPlus/core/util/array/ArrayUtils.java
@@ -4,15 +4,15 @@ import java.util.Arrays;
public class ArrayUtils {
- private static Object[] addElement(Object[] series, final Object newValueToAdd) {
- series = Arrays.copyOf(series, series.length + 1);
- series[series.length - 1] = newValueToAdd;
- return series;
- }
-
- public static void expandArray(final Object[] someArray, final Object newValueToAdd) {
+ public static void expandArray(Object[] someArray, Object newValueToAdd) {
Object[] series = someArray;
- series = ArrayUtils.addElement(series, newValueToAdd);
+ series = addElement(series, newValueToAdd);
}
+ private static Object[] addElement(Object[] series, Object newValueToAdd) {
+ series = Arrays.copyOf(series, series.length + 1);
+ series[series.length - 1] = newValueToAdd;
+ return series;
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/util/array/Pair.java b/src/Java/gtPlusPlus/core/util/array/Pair.java
index 45c6aacc23..94437e6779 100644
--- a/src/Java/gtPlusPlus/core/util/array/Pair.java
+++ b/src/Java/gtPlusPlus/core/util/array/Pair.java
@@ -1,21 +1,21 @@
package gtPlusPlus.core.util.array;
-public class Pair<K, V> {
-
- private final K key;
- private final V value;
-
- public Pair(final K key, final V value) {
+public class Pair<K,V> {
+
+ private final K key;
+ private final V value;
+
+ public Pair(final K key, final V value){
this.key = key;
this.value = value;
}
-
- final public K getKey() {
- return this.key;
- }
-
- final public V getValue() {
- return this.value;
- }
+
+ final public K getKey(){
+ return key;
+ }
+
+ final public V getValue(){
+ return value;
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/array/Triplet.java b/src/Java/gtPlusPlus/core/util/array/Triplet.java
index 7882c2f13a..07f29ae6c8 100644
--- a/src/Java/gtPlusPlus/core/util/array/Triplet.java
+++ b/src/Java/gtPlusPlus/core/util/array/Triplet.java
@@ -1,27 +1,27 @@
package gtPlusPlus.core.util.array;
-public class Triplet<K, V, C> {
-
- private final K key;
- private final V value;
- private final C count;
-
- public Triplet(final K key, final V value, final C value2) {
+public class Triplet<K,V,C> {
+
+ private final K key;
+ private final V value;
+ private final C count;
+
+ public Triplet(final K key, final V value, final C value2){
this.key = key;
this.value = value;
this.count = value2;
}
-
- final public K getKey() {
- return this.key;
- }
-
- final public C getSecondValue() {
- return this.count;
- }
-
- final public V getValue() {
- return this.value;
- }
+
+ final public K getKey(){
+ return key;
+ }
+
+ final public V getValue(){
+ return value;
+ }
+
+ final public C getSecondValue(){
+ return count;
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_BLOCK_ShapeSpawner.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_BLOCK_ShapeSpawner.java
index 1f90697e52..74df9f90ba 100644
--- a/src/Java/gtPlusPlus/core/util/debug/DEBUG_BLOCK_ShapeSpawner.java
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_BLOCK_ShapeSpawner.java
@@ -11,67 +11,95 @@ public class DEBUG_BLOCK_ShapeSpawner extends DEBUG_MULTIBLOCK_ShapeSpawner {
private static boolean controller;
- public DEBUG_BLOCK_ShapeSpawner(final int aID, final String aName, final String aNameRegional) {
+ public DEBUG_BLOCK_ShapeSpawner(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public DEBUG_BLOCK_ShapeSpawner(final String aName) {
+ public DEBUG_BLOCK_ShapeSpawner(String aName) {
super(aName);
}
@Override
- public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new DEBUG_BLOCK_ShapeSpawner(this.mName);
+ }
+
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Testing",
+ "Create the shapes for Multiblocks.",};
+ }
+
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity arg0, byte arg1,
+ byte arg2, byte arg3, boolean arg4, boolean arg5) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ // TODO Auto-generated method stub
+ return false;
+ }
- final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
return false;
}
-
+
int stepX = aBaseMetaTileEntity.getXCoord();
- final int stepY = aBaseMetaTileEntity.getYCoord();
+ int stepY = aBaseMetaTileEntity.getYCoord();
int stepZ = aBaseMetaTileEntity.getZCoord();
- final int temp = 0;
+ int temp = 0;
- Utils.LOG_INFO("Starting Block located @ " + "[X:" + stepX + "][Y:" + stepY + "][Z:" + stepZ + "]");
+ Utils.LOG_INFO("Starting Block located @ "+"[X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
- final int tAmount = 0;
+ int tAmount = 0;
switch (xDir) {
- case -1:
- stepX++;
- Utils.LOG_INFO("Modifying stepX + accomodate a " + xDir + " xDir - [X:" + stepX + "][Y:" + stepY
- + "][Z:" + stepZ + "]");
- break;
-
- case 1:
- stepX--;
- Utils.LOG_INFO("Modifying stepX - accomodate a " + xDir + " xDir - [X:" + stepX + "][Y:" + stepY
- + "][Z:" + stepZ + "]");
- break;
+ case -1:
+ stepX++;
+ Utils.LOG_INFO("Modifying stepX + accomodate a "+xDir+" xDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
+
+ case 1:
+ stepX--;
+ Utils.LOG_INFO("Modifying stepX - accomodate a "+xDir+" xDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
}
switch (zDir) {
- case -1:
- stepZ++;
- Utils.LOG_INFO("Modifying stepZ + accomodate a " + zDir + " zDir - [X:" + stepX + "][Y:" + stepY
- + "][Z:" + stepZ + "]");
- break;
-
- case 1:
- stepZ--;
- Utils.LOG_INFO("Modifying stepZ - accomodate a " + zDir + " zDir - [X:" + stepX + "][Y:" + stepY
- + "][Z:" + stepZ + "]");
- break;
+ case -1:
+ stepZ++;
+ Utils.LOG_INFO("Modifying stepZ + accomodate a "+zDir+" zDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
+
+ case 1:
+ stepZ--;
+ Utils.LOG_INFO("Modifying stepZ - accomodate a "+zDir+" zDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
}
- for (int i = stepX - 1; i <= stepX + 1; i++) {
- for (int j = stepZ - 1; j <= stepZ + 1; j++) {
- for (int h = stepY - 1; h <= stepY + 1; h++) {
+ for (int i = stepX-1; i <= stepX+1; i++){
+ for (int j = stepZ-1; j <= stepZ+1; j++){
+ for (int h = stepY-1; h <= stepY+1; h++){
+
- Utils.LOG_INFO("Block Facing - X:" + xDir + " Z:" + zDir);
+ Utils.LOG_INFO("Block Facing - X:"+xDir+" Z:"+zDir);
Utils.LOG_INFO("(h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))");
- Utils.LOG_INFO(" " + (h != 0) + " || " + (xDir + i != 0) + " || "
- + (zDir + j != 0) + " && " + (i != 0) + " || " + (j != 0));
+ Utils.LOG_INFO(" "+(h != 0)+" || "+(((xDir + i != 0)+" || "+(zDir + j != 0))+" && "+((i != 0)+" || "+(j != 0))));
}
}
}
@@ -79,64 +107,33 @@ public class DEBUG_BLOCK_ShapeSpawner extends DEBUG_MULTIBLOCK_ShapeSpawner {
}
@Override
- public boolean checkRecipe(final ItemStack aStack) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean explodesOnComponentBreak(final ItemStack aStack) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public int getAmountOfOutputs() {
+ public int getMaxEfficiency(ItemStack aStack) {
// TODO Auto-generated method stub
return 0;
}
@Override
- public int getDamageToComponent(final ItemStack aStack) {
+ public int getPollutionPerTick(ItemStack aStack) {
// TODO Auto-generated method stub
return 0;
}
@Override
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Testing", "Create the shapes for Multiblocks.",
- };
- }
-
- @Override
- public int getMaxEfficiency(final ItemStack aStack) {
+ public int getDamageToComponent(ItemStack aStack) {
// TODO Auto-generated method stub
return 0;
}
@Override
- public int getPollutionPerTick(final ItemStack aStack) {
+ public int getAmountOfOutputs() {
// TODO Auto-generated method stub
return 0;
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity arg0, final byte arg1, final byte arg2, final byte arg3,
- final boolean arg4, final boolean arg5) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean isCorrectMachinePart(final ItemStack aStack) {
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
// TODO Auto-generated method stub
return false;
}
- @Override
- public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new DEBUG_BLOCK_ShapeSpawner(this.mName);
- }
-
}
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_INIT.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_INIT.java
index 048b9cc8e8..440949471c 100644
--- a/src/Java/gtPlusPlus/core/util/debug/DEBUG_INIT.java
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_INIT.java
@@ -1,42 +1,43 @@
package gtPlusPlus.core.util.debug;
-import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.item.base.BaseItemWithCharge;
import gtPlusPlus.core.item.general.BedLocator_Base;
import gtPlusPlus.core.lib.CORE;
import net.minecraftforge.common.MinecraftForge;
+import cpw.mods.fml.common.registry.GameRegistry;
public class DEBUG_INIT {
- public static void registerBlocks() {
- // Debug Loading
- if (CORE.DEBUG) {
+ public static void registerBlocks(){
+ //Debug Loading
+ if (CORE.DEBUG){
}
}
- public static void registerHandlers() {
- MinecraftForge.EVENT_BUS.register(new DEBUG_ScreenOverlay());
- }
-
- public static void registerItems() {
- ModItems.itemDebugShapeSpawner = new DEBUG_ITEM_ShapeSpawner("itemDebugShapeSpawner", AddToCreativeTab.tabMisc,
- 1, 500);
+ public static void registerItems(){
+ ModItems.itemDebugShapeSpawner = new DEBUG_ITEM_ShapeSpawner("itemDebugShapeSpawner", AddToCreativeTab.tabMisc, 1, 500);
GameRegistry.registerItem(ModItems.itemDebugShapeSpawner, "itemDebugShapeSpawner");
ModItems.itemBedLocator_Base = new BedLocator_Base("itemBedLocator_Base");
- GameRegistry.registerItem(ModItems.itemBedLocator_Base, "itemBedLocator_Base");
+ GameRegistry.registerItem(ModItems.itemBedLocator_Base, "itemBedLocator_Base");
ModItems.itemBaseItemWithCharge = new BaseItemWithCharge("itemBaseItemWithCharge", 0, 1000);
GameRegistry.registerItem(ModItems.itemBaseItemWithCharge, "itemBaseItemWithCharge");
}
- public static void registerMisc() {
+ public static void registerTEs(){
}
- public static void registerTEs() {
+ public static void registerMisc(){
+
+
+
+ }
+ public static void registerHandlers(){
+ MinecraftForge.EVENT_BUS.register(new DEBUG_ScreenOverlay());
}
}
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java
index 7257986e99..bfaa7404e1 100644
--- a/src/Java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java
@@ -1,21 +1,21 @@
package gtPlusPlus.core.util.debug;
import static net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK;
-
-import java.util.List;
-
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.base.BaseItemGeneric;
import gtPlusPlus.core.util.Utils;
+
+import java.util.List;
+
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-public class DEBUG_ITEM_ShapeSpawner extends BaseItemGeneric {
+public class DEBUG_ITEM_ShapeSpawner extends BaseItemGeneric{
public DEBUG_ITEM_ShapeSpawner(String s, CreativeTabs c, int stackSize, int maxDmg) {
super(s, c, stackSize, maxDmg);
@@ -25,32 +25,31 @@ public class DEBUG_ITEM_ShapeSpawner extends BaseItemGeneric {
maxDmg = 500;
}
- @SuppressWarnings({
- "unchecked", "rawtypes"
- })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(EnumChatFormatting.GOLD + "For Testing Gregtech Shapes!");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
@Override
- public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer player) {
-
- if (!world.isRemote) {
- Utils.LOG_INFO("Constructing the shape for the " + "VACUUM FREEZER");
- final Thread thread = new Thread(new DEBUG_TimerThread(world, player));
- thread.start();
+ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
+
+ if (!world.isRemote){
+ Utils.LOG_INFO("Constructing the shape for the "+"VACUUM FREEZER");
+ Thread thread = new Thread(new DEBUG_TimerThread(world, player));
+ thread.start();
}
- return stack;
+ return stack;
}
-
+
+
+
@SuppressWarnings("static-method")
@SubscribeEvent
- public void playerInteractEventHandler(final PlayerInteractEvent event) {
- if (event.isCanceled() || event.world.isRemote || event.action != RIGHT_CLICK_BLOCK) {
- return;
- }
+ public void playerInteractEventHandler(PlayerInteractEvent event)
+ {
+ if (event.isCanceled() || event.world.isRemote || event.action != RIGHT_CLICK_BLOCK) return;
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.GOLD+"For Testing Gregtech Shapes!");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java
index fc61878ffe..78acb27cfb 100644
--- a/src/Java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java
@@ -1,21 +1,35 @@
package gtPlusPlus.core.util.debug;
-import java.util.ArrayList;
-
+import static gregtech.api.enums.GT_Values.V;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.gui.GT_Container_MultiMachine;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.*;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
+
+import java.util.ArrayList;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -24,938 +38,768 @@ import net.minecraftforge.fluids.FluidStack;
public abstract class DEBUG_MULTIBLOCK_ShapeSpawner extends MetaTileEntity {
- public static boolean disableMaintenance;
- public static boolean isValidMetaTileEntity(final MetaTileEntity aMetaTileEntity) {
- return aMetaTileEntity.getBaseMetaTileEntity() != null
- && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileEntity() == aMetaTileEntity
- && !aMetaTileEntity.getBaseMetaTileEntity().isDead();
- }
- public boolean mMachine = false, mWrench = false,
- mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = false, mCrowbar = false,
- mRunningOnLoad = false;
- public int mPollution = 0, mProgresstime = 0,
- mMaxProgresstime = 0, mEUt = 0, mEfficiencyIncrease = 0, mUpdate = 0, mStartUpCheck = 100, mRuntime = 0,
- mEfficiency = 0;
- public ItemStack[] mOutputItems = null;
- public FluidStack[] mOutputFluids = null;
- public ArrayList<GT_MetaTileEntity_Hatch_Input> mInputHatches = new ArrayList<GT_MetaTileEntity_Hatch_Input>();
- public ArrayList<GT_MetaTileEntity_Hatch_Output> mOutputHatches = new ArrayList<GT_MetaTileEntity_Hatch_Output>();
- public ArrayList<GT_MetaTileEntity_Hatch_InputBus> mInputBusses = new ArrayList<GT_MetaTileEntity_Hatch_InputBus>();
- public ArrayList<GT_MetaTileEntity_Hatch_OutputBus> mOutputBusses = new ArrayList<GT_MetaTileEntity_Hatch_OutputBus>();
- public ArrayList<GT_MetaTileEntity_Hatch_Dynamo> mDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch_Dynamo>();
- public ArrayList<GT_MetaTileEntity_Hatch_Muffler> mMufflerHatches = new ArrayList<GT_MetaTileEntity_Hatch_Muffler>();
- public ArrayList<GT_MetaTileEntity_Hatch_Energy> mEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch_Energy>();
-
- public ArrayList<GT_MetaTileEntity_Hatch_Maintenance> mMaintenanceHatches = new ArrayList<GT_MetaTileEntity_Hatch_Maintenance>();
-
- public DEBUG_MULTIBLOCK_ShapeSpawner(final int aID, final String aName, final String aNameRegional) {
- super(aID, aName, aNameRegional, 2);
- DEBUG_MULTIBLOCK_ShapeSpawner.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig,
- "MultiBlockMachines.disableMaintenance", false);
- }
-
- public DEBUG_MULTIBLOCK_ShapeSpawner(final String aName) {
- super(aName, 2);
- DEBUG_MULTIBLOCK_ShapeSpawner.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig,
- "MultiBlockMachines.disableMaintenance", false);
- }
-
- public boolean addDynamoToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addEnergyInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addEnergyOutput(final long aEU) {
- if (aEU <= 0) {
- return true;
- }
- for (final GT_MetaTileEntity_Hatch_Dynamo tHatch : this.mDynamoHatches) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(aEU, false)) {
- return true;
- }
- }
- }
- return false;
- }
-
- private void addFluidOutputs(final FluidStack[] mOutputFluids2) {
- for (int i = 0; i < mOutputFluids2.length; i++) {
- if (this.mOutputHatches.size() > i && this.mOutputHatches.get(i) != null && mOutputFluids2[i] != null
- && DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(this.mOutputHatches.get(i))) {
- this.mOutputHatches.get(i).fill(mOutputFluids2[i], true);
- }
- }
-
- }
-
- public boolean addInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
- return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = this.getRecipeMap();
- return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addMaintenanceToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addMufflerToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addOutput(final FluidStack aLiquid) {
- if (aLiquid == null) {
- return false;
- }
- final FluidStack tLiquid = aLiquid.copy();
- for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid)
- ? tHatch.outputsSteam() : tHatch.outputsLiquids()) {
- final int tAmount = tHatch.fill(tLiquid, false);
- if (tAmount >= tLiquid.amount) {
- return tHatch.fill(tLiquid, true) >= tLiquid.amount;
- }
- else if (tAmount > 0) {
- tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true);
- }
- }
- }
- return false;
- }
-
- public boolean addOutput(ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return false;
- }
- aStack = GT_Utility.copy(aStack);
- // FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
- // if (aLiquid == null) {
- for (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) {
- if (tHatch.getBaseMetaTileEntity().addStackToSlot(i, aStack)) {
- return true;
- }
- }
- }
- }
- for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) {
- if (tHatch.getBaseMetaTileEntity().addStackToSlot(1, aStack)) {
- return true;
- }
- }
- }
- // }else {
- // for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
- // if (isValidMetaTileEntity(tHatch) &&
- // GT_ModHandler.isSteam(aLiquid)?tHatch.outputsSteam():tHatch.outputsLiquids())
- // {
- // int tAmount = tHatch.fill(aLiquid, false);
- // if (tAmount >= aLiquid.amount) {
- // return tHatch.fill(aLiquid, true) >= aLiquid.amount;
- // }
- // }
- // }
- // }
- return false;
- }
-
- public boolean addOutputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
- }
- return false;
- }
-
- public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- }
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) {
- ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
- return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
- return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
- return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
- return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
- return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
- return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
- }
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
- return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
- }
- return false;
- }
-
- @Override
- public boolean allowCoverOnSide(final byte aSide, final GT_ItemStack aCoverID) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- @Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
- }
-
- /**
- * Checks the Machine. You have to assign the MetaTileEntities for the
- * Hatches here.
- */
- public abstract boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack);
-
- /**
- * Checks the Recipe
- */
- public abstract boolean checkRecipe(ItemStack aStack);
-
- public boolean depleteInput(final FluidStack aLiquid) {
- if (aLiquid == null) {
- return false;
- }
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- FluidStack tLiquid = tHatch.getFluid();
- if (tLiquid != null && tLiquid.isFluidEqual(aLiquid)) {
- tLiquid = tHatch.drain(aLiquid.amount, false);
- if (tLiquid != null && tLiquid.amount >= aLiquid.amount) {
- tLiquid = tHatch.drain(aLiquid.amount, true);
- return tLiquid != null && tLiquid.amount >= aLiquid.amount;
- }
- }
- }
- }
- return false;
- }
-
- public boolean depleteInput(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return false;
- }
- final FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
- if (aLiquid != null) {
- return this.depleteInput(aLiquid);
- }
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) {
- if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
- tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
- return true;
- }
- }
- }
- }
- for (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) {
- if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
- tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- public boolean doRandomMaintenanceDamage() {
- if (!this.isCorrectMachinePart(this.mInventory[1]) || this.getRepairStatus() == 0) {
- this.stopMachine();
- return false;
- }
- if (this.mRuntime++ > 1000) {
- this.mRuntime = 0;
- if (this.getBaseMetaTileEntity().getRandomNumber(6000) == 0) {
- switch (this.getBaseMetaTileEntity().getRandomNumber(6)) {
- case 0:
- this.mWrench = false;
- break;
- case 1:
- this.mScrewdriver = false;
- break;
- case 2:
- this.mSoftHammer = false;
- break;
- case 3:
- this.mHardHammer = false;
- break;
- case 4:
- this.mSolderingTool = false;
- break;
- case 5:
- this.mCrowbar = false;
- break;
- }
- }
- if (this.mInventory[1] != null && this.getBaseMetaTileEntity().getRandomNumber(2) == 0
- && !this.mInventory[1].getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) {
- if (this.mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) {
- final NBTTagCompound tNBT = this.mInventory[1].getTagCompound();
- if (tNBT != null) {
- NBTTagCompound tNBT2 = tNBT.getCompoundTag("GT.CraftingComponents");
- if (!tNBT.getBoolean("mDis")) {
- tNBT2 = new NBTTagCompound();
- final Materials tMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(this.mInventory[1]);
- final ItemStack tTurbine = GT_OreDictUnificator.get(OrePrefixes.turbineBlade, tMaterial, 1);
- final int i = this.mInventory[1].getItemDamage();
- if (i == 170) {
- ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Magnalium, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- }
- else if (i == 172) {
- ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Titanium, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- }
- else if (i == 174) {
- ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.TungstenSteel, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- }
- else if (i == 176) {
- ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
- tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
- tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
- tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Americium, 1);
- tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
- }
- tNBT.setTag("GT.CraftingComponents", tNBT2);
- tNBT.setBoolean("mDis", true);
- this.mInventory[1].setTagCompound(tNBT);
-
- }
- }
-
- ((GT_MetaGenerated_Tool) this.mInventory[1].getItem()).doDamage(this.mInventory[1],
- (long) Math.min(this.mEUt / 5, Math.pow(this.mEUt, 0.7)));
- if (this.mInventory[1].stackSize == 0) {
- this.mInventory[1] = null;
- }
- }
- }
- }
- return true;
- }
-
- public boolean drainEnergyInput(final long aEU) {
- if (aEU <= 0) {
- return true;
- }
- for (final GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public void explodeMultiblock() {
- this.mInventory[1] = null;
- for (final MetaTileEntity tTileEntity : this.mInputBusses) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mOutputBusses) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mInputHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mOutputHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mDynamoHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mMufflerHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mEnergyHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- for (final MetaTileEntity tTileEntity : this.mMaintenanceHatches) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
- this.getBaseMetaTileEntity().doExplosion(GT_Values.V[8]);
- }
-
- /**
- * If it explodes when the Component has to be replaced.
- */
- public abstract boolean explodesOnComponentBreak(ItemStack aStack);
-
- /**
- * Gets the Amount of possibly outputted Items for loading the Output Stack
- * Array from NBT. This should be the largest Amount that can ever happen
- * legitimately.
- */
- public abstract int getAmountOfOutputs();
-
- @Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
- "MultiblockDisplay.png");
- }
-
- /**
- * Gets the damage to the ItemStack, usually 0 or 1.
- */
- public abstract int getDamageToComponent(ItemStack aStack);
-
- public int getIdealStatus() {
- return 6;
- }
-
- @Override
- public String[] getInfoData() {
- return new String[] {
- "Progress:", this.mProgresstime / 20 + "secs", this.mMaxProgresstime / 20 + "secs", "Efficiency:",
- this.mEfficiency / 100.0F + "%", "Problems:", "" + (this.getIdealStatus() - this.getRepairStatus())
- };
- }
-
- /**
- * Gets the maximum Efficiency that spare Part can get (0 - 10000)
- */
- public abstract int getMaxEfficiency(ItemStack aStack);
-
- public long getMaxInputVoltage() {
- long rVoltage = 0;
- for (final GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
- }
- }
- return rVoltage;
- }
-
- /**
- * Gets the pollution this Device outputs to a Muffler per tick (10000 = one
- * Pullution Block)
- */
- public abstract int getPollutionPerTick(ItemStack aStack);
-
- @Override
- public int getProgresstime() {
- return this.mProgresstime;
- }
-
- public GT_Recipe_Map getRecipeMap() {
- return null;
- }
-
- public int getRepairStatus() {
- return (this.mWrench ? 1 : 0) + (this.mScrewdriver ? 1 : 0) + (this.mSoftHammer ? 1 : 0)
- + (this.mHardHammer ? 1 : 0) + (this.mSolderingTool ? 1 : 0) + (this.mCrowbar ? 1 : 0);
- }
-
- @Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public ArrayList<FluidStack> getStoredFluids() {
- final ArrayList<FluidStack> rList = new ArrayList<FluidStack>();
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) {
- rList.add(tHatch.getFillableStack());
- }
- }
- return rList;
- }
-
- public ArrayList<ItemStack> getStoredInputs() {
- final ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)
- && tHatch.getBaseMetaTileEntity().getStackInSlot(0) != null) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(0));
- }
- }
- for (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
- tHatch.mRecipeMap = this.getRecipeMap();
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- }
- }
- return rList;
- }
-
- public ArrayList<ItemStack> getStoredOutputs() {
- final ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
- for (final GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(1));
- }
- }
- for (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
- }
- }
- }
- return rList;
- }
-
- @Override
- public byte getTileEntityBaseType() {
- return 2;
- }
-
- @Override
- public int increaseProgress(final int aProgress) {
- return aProgress;
- }
-
- @Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
- }
-
- /**
- * Checks if this is a Correct Machine Part for this kind of Machine
- * (Turbine Rotor for example)
- */
- public abstract boolean isCorrectMachinePart(ItemStack aStack);
-
- @Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isValidSlot(final int aIndex) {
- return aIndex > 0;
- }
-
- @Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mEUt = aNBT.getInteger("mEUt");
- this.mProgresstime = aNBT.getInteger("mProgresstime");
- this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
- if (this.mMaxProgresstime > 0) {
- this.mRunningOnLoad = true;
- }
- this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
- this.mEfficiency = aNBT.getInteger("mEfficiency");
- this.mPollution = aNBT.getInteger("mPollution");
- this.mRuntime = aNBT.getInteger("mRuntime");
- this.mOutputItems = new ItemStack[this.getAmountOfOutputs()];
- for (int i = 0; i < this.mOutputItems.length; i++) {
- this.mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
- }
- this.mOutputFluids = new FluidStack[this.getAmountOfOutputs()];
- for (int i = 0; i < this.mOutputFluids.length; i++) {
- this.mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i);
- }
- this.mWrench = aNBT.getBoolean("mWrench");
- this.mScrewdriver = aNBT.getBoolean("mScrewdriver");
- this.mSoftHammer = aNBT.getBoolean("mSoftHammer");
- this.mHardHammer = aNBT.getBoolean("mHardHammer");
- this.mSolderingTool = aNBT.getBoolean("mSolderingTool");
- this.mCrowbar = aNBT.getBoolean("mCrowbar");
- }
-
- @Override
- public int maxProgresstime() {
- return this.mMaxProgresstime;
- }
-
- @Override
- public void onMachineBlockUpdate() {
- this.mUpdate = 50;
- }
-
- @Override
- public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (this.mEfficiency < 0) {
- this.mEfficiency = 0;
- }
- if (--this.mUpdate == 0 || --this.mStartUpCheck == 0) {
- this.mInputHatches.clear();
- this.mInputBusses.clear();
- this.mOutputHatches.clear();
- this.mOutputBusses.clear();
- this.mDynamoHatches.clear();
- this.mEnergyHatches.clear();
- this.mMufflerHatches.clear();
- this.mMaintenanceHatches.clear();
- this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]);
- }
- if (this.mStartUpCheck < 0) {
- if (this.mMachine) {
- for (final GT_MetaTileEntity_Hatch_Maintenance tHatch : this.mMaintenanceHatches) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- if (!DEBUG_MULTIBLOCK_ShapeSpawner.disableMaintenance) {
- if (tHatch.mWrench) {
- this.mWrench = true;
- }
- if (tHatch.mScrewdriver) {
- this.mScrewdriver = true;
- }
- if (tHatch.mSoftHammer) {
- this.mSoftHammer = true;
- }
- if (tHatch.mHardHammer) {
- this.mHardHammer = true;
- }
- if (tHatch.mSolderingTool) {
- this.mSolderingTool = true;
- }
- if (tHatch.mCrowbar) {
- this.mCrowbar = true;
- }
- }
- else {
- this.mWrench = true;
- this.mScrewdriver = true;
- this.mSoftHammer = true;
- this.mHardHammer = true;
- this.mSolderingTool = true;
- this.mCrowbar = true;
- }
-
- tHatch.mWrench = false;
- tHatch.mScrewdriver = false;
- tHatch.mSoftHammer = false;
- tHatch.mHardHammer = false;
- tHatch.mSolderingTool = false;
- tHatch.mCrowbar = false;
- }
- }
- if (this.getRepairStatus() > 0) {
- if (this.mMaxProgresstime > 0 && this.doRandomMaintenanceDamage()) {
- if (this.onRunningTick(this.mInventory[1])) {
- if (!this.polluteEnvironment(this.getPollutionPerTick(this.mInventory[1]))) {
- this.stopMachine();
- }
- if (this.mMaxProgresstime > 0 && ++this.mProgresstime >= this.mMaxProgresstime) {
- if (this.mOutputItems != null) {
- for (final ItemStack tStack : this.mOutputItems) {
- if (tStack != null) {
- try {
- GT_Mod.achievements.issueAchivementHatch(
- aBaseMetaTileEntity.getWorld().getPlayerEntityByName(
- aBaseMetaTileEntity.getOwnerName()),
- tStack);
- }
- catch (final Exception e) {
- }
- this.addOutput(tStack);
- }
- }
- }
- if (this.mOutputFluids != null && this.mOutputFluids.length == 1) {
- for (final FluidStack tStack : this.mOutputFluids) {
- if (tStack != null) {
- this.addOutput(tStack);
- }
- }
- }
- else if (this.mOutputFluids != null && this.mOutputFluids.length > 1) {
- this.addFluidOutputs(this.mOutputFluids);
- }
- this.mEfficiency = Math.max(0,
- Math.min(this.mEfficiency + this.mEfficiencyIncrease,
- this.getMaxEfficiency(this.mInventory[1])
- - (this.getIdealStatus() - this.getRepairStatus()) * 1000));
- this.mOutputItems = null;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- this.mEfficiencyIncrease = 0;
- if (aBaseMetaTileEntity.isAllowedToWork()) {
- this.checkRecipe(this.mInventory[1]);
- }
- if (this.mOutputFluids != null && this.mOutputFluids.length > 0) {
- if (this.mOutputFluids.length > 1) {
- GT_Mod.achievements.issueAchievement(aBaseMetaTileEntity.getWorld()
- .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
- "oilplant");
- }
- }
- }
- }
- }
- else {
- if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
- || aBaseMetaTileEntity.hasInventoryBeenModified()) {
-
- if (aBaseMetaTileEntity.isAllowedToWork()) {
- this.checkRecipe(this.mInventory[1]);
- }
- if (this.mMaxProgresstime <= 0) {
- this.mEfficiency = Math.max(0, this.mEfficiency - 1000);
- }
- }
- }
- }
- else {
- this.stopMachine();
- }
- }
- else {
- this.stopMachine();
- }
- }
- aBaseMetaTileEntity
- .setErrorDisplayID(aBaseMetaTileEntity.getErrorDisplayID() & ~127 | (this.mWrench ? 0 : 1)
- | (this.mScrewdriver ? 0 : 2) | (this.mSoftHammer ? 0 : 4) | (this.mHardHammer ? 0 : 8)
- | (this.mSolderingTool ? 0 : 16) | (this.mCrowbar ? 0 : 32) | (this.mMachine ? 0 : 64));
- aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0);
- }
- }
-
- @Override
- public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- /**
- * Called every tick the Machine runs
- */
- public boolean onRunningTick(final ItemStack aStack) {
- if (this.mEUt > 0) {
- this.addEnergyOutput((long) this.mEUt * this.mEfficiency / 10000);
- return true;
- }
- if (this.mEUt < 0) {
- if (!this.drainEnergyInput((long) -this.mEUt * 10000 / Math.max(1000, this.mEfficiency))) {
- this.stopMachine();
- return false;
- }
- }
- return true;
- }
-
- public boolean polluteEnvironment(final int aPollutionLevel) {
- this.mPollution += aPollutionLevel;
- for (final GT_MetaTileEntity_Hatch_Muffler tHatch : this.mMufflerHatches) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- if (this.mPollution >= 10000) {
- if (tHatch.polluteEnvironment()) {
- this.mPollution -= 10000;
- }
- }
- else {
- break;
- }
- }
- }
- return this.mPollution < 10000;
- }
-
- @Override
- public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("mEUt", this.mEUt);
- aNBT.setInteger("mProgresstime", this.mProgresstime);
- aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
- aNBT.setInteger("mEfficiencyIncrease", this.mEfficiencyIncrease);
- aNBT.setInteger("mEfficiency", this.mEfficiency);
- aNBT.setInteger("mPollution", this.mPollution);
- aNBT.setInteger("mRuntime", this.mRuntime);
-
- if (this.mOutputItems != null) {
- for (int i = 0; i < this.mOutputItems.length; i++) {
- if (this.mOutputItems[i] != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItems[i].writeToNBT(tNBT);
- aNBT.setTag("mOutputItem" + i, tNBT);
- }
- }
- }
- if (this.mOutputFluids != null) {
- for (int i = 0; i < this.mOutputFluids.length; i++) {
- if (this.mOutputFluids[i] != null) {
- final NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputFluids[i].writeToNBT(tNBT);
- aNBT.setTag("mOutputFluids" + i, tNBT);
- }
- }
- }
-
- aNBT.setBoolean("mWrench", this.mWrench);
- aNBT.setBoolean("mScrewdriver", this.mScrewdriver);
- aNBT.setBoolean("mSoftHammer", this.mSoftHammer);
- aNBT.setBoolean("mHardHammer", this.mHardHammer);
- aNBT.setBoolean("mSolderingTool", this.mSolderingTool);
- aNBT.setBoolean("mCrowbar", this.mCrowbar);
- }
-
- public void stopMachine() {
- this.mOutputItems = null;
- this.mEUt = 0;
- this.mEfficiency = 0;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- this.mEfficiencyIncrease = 0;
- this.getBaseMetaTileEntity().disableWorking();
- }
-
- public void updateSlots() {
- for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- tHatch.updateSlots();
- }
- }
- for (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) {
- if (DEBUG_MULTIBLOCK_ShapeSpawner.isValidMetaTileEntity(tHatch)) {
- tHatch.updateSlots();
- }
- }
- }
+ public static boolean disableMaintenance;
+ public boolean mMachine = false, mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = false, mCrowbar = false, mRunningOnLoad = false;
+ public int mPollution = 0, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mEfficiencyIncrease = 0, mUpdate = 0, mStartUpCheck = 100, mRuntime = 0, mEfficiency = 0;
+ public ItemStack[] mOutputItems = null;
+ public FluidStack[] mOutputFluids = null;
+ public ArrayList<GT_MetaTileEntity_Hatch_Input> mInputHatches = new ArrayList<GT_MetaTileEntity_Hatch_Input>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Output> mOutputHatches = new ArrayList<GT_MetaTileEntity_Hatch_Output>();
+ public ArrayList<GT_MetaTileEntity_Hatch_InputBus> mInputBusses = new ArrayList<GT_MetaTileEntity_Hatch_InputBus>();
+ public ArrayList<GT_MetaTileEntity_Hatch_OutputBus> mOutputBusses = new ArrayList<GT_MetaTileEntity_Hatch_OutputBus>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Dynamo> mDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch_Dynamo>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Muffler> mMufflerHatches = new ArrayList<GT_MetaTileEntity_Hatch_Muffler>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Energy> mEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch_Energy>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Maintenance> mMaintenanceHatches = new ArrayList<GT_MetaTileEntity_Hatch_Maintenance>();
+
+ public DEBUG_MULTIBLOCK_ShapeSpawner(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 2);
+ this.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
+ }
+
+ public DEBUG_MULTIBLOCK_ShapeSpawner(String aName) {
+ super(aName, 2);
+ this.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
+ }
+
+ public static boolean isValidMetaTileEntity(MetaTileEntity aMetaTileEntity) {
+ return aMetaTileEntity.getBaseMetaTileEntity() != null && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileEntity() == aMetaTileEntity && !aMetaTileEntity.getBaseMetaTileEntity().isDead();
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex > 0;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return mProgresstime;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return mMaxProgresstime;
+ }
+
+ @Override
+ public int increaseProgress(int aProgress) {
+ return aProgress;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mEUt", mEUt);
+ aNBT.setInteger("mProgresstime", mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", mMaxProgresstime);
+ aNBT.setInteger("mEfficiencyIncrease", mEfficiencyIncrease);
+ aNBT.setInteger("mEfficiency", mEfficiency);
+ aNBT.setInteger("mPollution", mPollution);
+ aNBT.setInteger("mRuntime", mRuntime);
+
+ if (mOutputItems != null) for (int i = 0; i < mOutputItems.length; i++)
+ if (mOutputItems[i] != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ mOutputItems[i].writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem" + i, tNBT);
+ }
+ if (mOutputFluids != null) for (int i = 0; i < mOutputFluids.length; i++)
+ if (mOutputFluids[i] != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ mOutputFluids[i].writeToNBT(tNBT);
+ aNBT.setTag("mOutputFluids" + i, tNBT);
+ }
+
+ aNBT.setBoolean("mWrench", mWrench);
+ aNBT.setBoolean("mScrewdriver", mScrewdriver);
+ aNBT.setBoolean("mSoftHammer", mSoftHammer);
+ aNBT.setBoolean("mHardHammer", mHardHammer);
+ aNBT.setBoolean("mSolderingTool", mSolderingTool);
+ aNBT.setBoolean("mCrowbar", mCrowbar);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mEUt = aNBT.getInteger("mEUt");
+ mProgresstime = aNBT.getInteger("mProgresstime");
+ mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ if (mMaxProgresstime > 0) mRunningOnLoad = true;
+ mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ mEfficiency = aNBT.getInteger("mEfficiency");
+ mPollution = aNBT.getInteger("mPollution");
+ mRuntime = aNBT.getInteger("mRuntime");
+ mOutputItems = new ItemStack[getAmountOfOutputs()];
+ for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
+ mOutputFluids = new FluidStack[getAmountOfOutputs()];
+ for (int i = 0; i < mOutputFluids.length; i++)
+ mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i);
+ mWrench = aNBT.getBoolean("mWrench");
+ mScrewdriver = aNBT.getBoolean("mScrewdriver");
+ mSoftHammer = aNBT.getBoolean("mSoftHammer");
+ mHardHammer = aNBT.getBoolean("mHardHammer");
+ mSolderingTool = aNBT.getBoolean("mSolderingTool");
+ mCrowbar = aNBT.getBoolean("mCrowbar");
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiblockDisplay.png");
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return 2;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ mUpdate = 50;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (mEfficiency < 0) mEfficiency = 0;
+ if (--mUpdate == 0 || --mStartUpCheck == 0) {
+ mInputHatches.clear();
+ mInputBusses.clear();
+ mOutputHatches.clear();
+ mOutputBusses.clear();
+ mDynamoHatches.clear();
+ mEnergyHatches.clear();
+ mMufflerHatches.clear();
+ mMaintenanceHatches.clear();
+ mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]);
+ }
+ if (mStartUpCheck < 0) {
+ if (mMachine) {
+ for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (!this.disableMaintenance) {
+ if (tHatch.mWrench) mWrench = true;
+ if (tHatch.mScrewdriver) mScrewdriver = true;
+ if (tHatch.mSoftHammer) mSoftHammer = true;
+ if (tHatch.mHardHammer) mHardHammer = true;
+ if (tHatch.mSolderingTool) mSolderingTool = true;
+ if (tHatch.mCrowbar) mCrowbar = true;
+ } else {
+ mWrench = true;
+ mScrewdriver = true;
+ mSoftHammer = true;
+ mHardHammer = true;
+ mSolderingTool = true;
+ mCrowbar = true;
+ }
+
+ tHatch.mWrench = false;
+ tHatch.mScrewdriver = false;
+ tHatch.mSoftHammer = false;
+ tHatch.mHardHammer = false;
+ tHatch.mSolderingTool = false;
+ tHatch.mCrowbar = false;
+ }
+ }
+ if (getRepairStatus() > 0) {
+ if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) {
+ if (onRunningTick(mInventory[1])) {
+ if (!polluteEnvironment(getPollutionPerTick(mInventory[1]))) {
+ stopMachine();
+ }
+ if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
+ if (mOutputItems != null) for (ItemStack tStack : mOutputItems)
+ if (tStack != null) {
+ try {
+ GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack);
+ } catch (Exception e) {
+ }
+ addOutput(tStack);
+ }
+ if (mOutputFluids != null && mOutputFluids.length == 1) {
+ for (FluidStack tStack : mOutputFluids)
+ if (tStack != null) {
+ addOutput(tStack);
+ }
+ } else if (mOutputFluids != null && mOutputFluids.length > 1) {
+ addFluidOutputs(mOutputFluids);
+ }
+ mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
+ mOutputItems = null;
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ if (aBaseMetaTileEntity.isAllowedToWork()) checkRecipe(mInventory[1]);
+ if (mOutputFluids != null && mOutputFluids.length > 0) {
+ if (mOutputFluids.length > 1) {
+ GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "oilplant");
+ }
+ }
+ }
+ }
+ } else {
+ if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+
+ if (aBaseMetaTileEntity.isAllowedToWork()) {
+ checkRecipe(mInventory[1]);
+ }
+ if (mMaxProgresstime <= 0) mEfficiency = Math.max(0, mEfficiency - 1000);
+ }
+ }
+ } else {
+ stopMachine();
+ }
+ } else {
+ stopMachine();
+ }
+ }
+ aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
+ aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
+ }
+ }
+
+ public boolean polluteEnvironment(int aPollutionLevel) {
+ mPollution += aPollutionLevel;
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (mPollution >= 10000) {
+ if (tHatch.polluteEnvironment()) {
+ mPollution -= 10000;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+ return mPollution < 10000;
+ }
+
+ /**
+ * Called every tick the Machine runs
+ */
+ public boolean onRunningTick(ItemStack aStack) {
+ if (mEUt > 0) {
+ addEnergyOutput(((long) mEUt * mEfficiency) / 10000);
+ return true;
+ }
+ if (mEUt < 0) {
+ if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) {
+ stopMachine();
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Checks if this is a Correct Machine Part for this kind of Machine (Turbine Rotor for example)
+ */
+ public abstract boolean isCorrectMachinePart(ItemStack aStack);
+
+ /**
+ * Checks the Recipe
+ */
+ public abstract boolean checkRecipe(ItemStack aStack);
+
+ /**
+ * Checks the Machine. You have to assign the MetaTileEntities for the Hatches here.
+ */
+ public abstract boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack);
+
+ /**
+ * Gets the maximum Efficiency that spare Part can get (0 - 10000)
+ */
+ public abstract int getMaxEfficiency(ItemStack aStack);
+
+ /**
+ * Gets the pollution this Device outputs to a Muffler per tick (10000 = one Pullution Block)
+ */
+ public abstract int getPollutionPerTick(ItemStack aStack);
+
+ /**
+ * Gets the damage to the ItemStack, usually 0 or 1.
+ */
+ public abstract int getDamageToComponent(ItemStack aStack);
+
+ /**
+ * Gets the Amount of possibly outputted Items for loading the Output Stack Array from NBT.
+ * This should be the largest Amount that can ever happen legitimately.
+ */
+ public abstract int getAmountOfOutputs();
+
+ /**
+ * If it explodes when the Component has to be replaced.
+ */
+ public abstract boolean explodesOnComponentBreak(ItemStack aStack);
+
+ public void stopMachine() {
+ mOutputItems = null;
+ mEUt = 0;
+ mEfficiency = 0;
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ getBaseMetaTileEntity().disableWorking();
+ }
+
+ public int getRepairStatus() {
+ return (mWrench ? 1 : 0) + (mScrewdriver ? 1 : 0) + (mSoftHammer ? 1 : 0) + (mHardHammer ? 1 : 0) + (mSolderingTool ? 1 : 0) + (mCrowbar ? 1 : 0);
+ }
+
+ public int getIdealStatus() {
+ return 6;
+ }
+
+ public boolean doRandomMaintenanceDamage() {
+ if (!isCorrectMachinePart(mInventory[1]) || getRepairStatus() == 0) {
+ stopMachine();
+ return false;
+ }
+ if (mRuntime++ > 1000) {
+ mRuntime = 0;
+ if (getBaseMetaTileEntity().getRandomNumber(6000) == 0) {
+ switch (getBaseMetaTileEntity().getRandomNumber(6)) {
+ case 0:
+ mWrench = false;
+ break;
+ case 1:
+ mScrewdriver = false;
+ break;
+ case 2:
+ mSoftHammer = false;
+ break;
+ case 3:
+ mHardHammer = false;
+ break;
+ case 4:
+ mSolderingTool = false;
+ break;
+ case 5:
+ mCrowbar = false;
+ break;
+ }
+ }
+ if (mInventory[1] != null && getBaseMetaTileEntity().getRandomNumber(2) == 0 && !mInventory[1].getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) {
+ if (mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) {
+ NBTTagCompound tNBT = mInventory[1].getTagCompound();
+ if (tNBT != null) {
+ NBTTagCompound tNBT2 = tNBT.getCompoundTag("GT.CraftingComponents");
+ if (!tNBT.getBoolean("mDis")) {
+ tNBT2 = new NBTTagCompound();
+ Materials tMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[1]);
+ ItemStack tTurbine = GT_OreDictUnificator.get(OrePrefixes.turbineBlade, tMaterial, 1);
+ int i = mInventory[1].getItemDamage();
+ if (i == 170) {
+ ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Magnalium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 172) {
+ ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Titanium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 174) {
+ ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.TungstenSteel, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 176) {
+ ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Americium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ }
+ tNBT.setTag("GT.CraftingComponents", tNBT2);
+ tNBT.setBoolean("mDis", true);
+ mInventory[1].setTagCompound(tNBT);
+
+ }
+ }
+
+ ((GT_MetaGenerated_Tool) mInventory[1].getItem()).doDamage(mInventory[1], (long) Math.min(mEUt / 5, Math.pow(mEUt, 0.7)));
+ if (mInventory[1].stackSize == 0) mInventory[1] = null;
+ }
+ }
+ }
+ return true;
+ }
+
+ public void explodeMultiblock() {
+ mInventory[1] = null;
+ for (MetaTileEntity tTileEntity : mInputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mOutputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mInputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mOutputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mDynamoHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mMufflerHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mEnergyHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mMaintenanceHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+
+ public boolean addEnergyOutput(long aEU) {
+ if (aEU <= 0) return true;
+ for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(aEU, false)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public long getMaxInputVoltage() {
+ long rVoltage = 0;
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
+ if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
+ return rVoltage;
+ }
+
+ public boolean drainEnergyInput(long aEU) {
+ if (aEU <= 0) return true;
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
+ if (isValidMetaTileEntity(tHatch)) {
+ if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) return true;
+ }
+ return false;
+ }
+
+ public boolean addOutput(FluidStack aLiquid) {
+ if (aLiquid == null) return false;
+ FluidStack tLiquid = aLiquid.copy();
+ for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) {
+ int tAmount = tHatch.fill(tLiquid, false);
+ if (tAmount >= tLiquid.amount) {
+ return tHatch.fill(tLiquid, true) >= tLiquid.amount;
+ } else if (tAmount > 0) {
+ tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true);
+ }
+ }
+ }
+ return false;
+ }
+
+ private void addFluidOutputs(FluidStack[] mOutputFluids2) {
+ for (int i = 0; i < mOutputFluids2.length; i++) {
+ if (mOutputHatches.size() > i && mOutputHatches.get(i) != null && mOutputFluids2[i] != null && isValidMetaTileEntity(mOutputHatches.get(i))) {
+ mOutputHatches.get(i).fill(mOutputFluids2[i], true);
+ }
+ }
+
+ }
+
+ public boolean depleteInput(FluidStack aLiquid) {
+ if (aLiquid == null) return false;
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ FluidStack tLiquid = tHatch.getFluid();
+ if (tLiquid != null && tLiquid.isFluidEqual(aLiquid)) {
+ tLiquid = tHatch.drain(aLiquid.amount, false);
+ if (tLiquid != null && tLiquid.amount >= aLiquid.amount) {
+ tLiquid = tHatch.drain(aLiquid.amount, true);
+ return tLiquid != null && tLiquid.amount >= aLiquid.amount;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean addOutput(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return false;
+ aStack = GT_Utility.copy(aStack);
+// FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
+// if (aLiquid == null) {
+ for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) {
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) {
+ if (tHatch.getBaseMetaTileEntity().addStackToSlot(i, aStack)) return true;
+ }
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) {
+ if (tHatch.getBaseMetaTileEntity().addStackToSlot(1, aStack)) return true;
+ }
+ }
+// }else {
+// for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+// if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid)?tHatch.outputsSteam():tHatch.outputsLiquids()) {
+// int tAmount = tHatch.fill(aLiquid, false);
+// if (tAmount >= aLiquid.amount) {
+// return tHatch.fill(aLiquid, true) >= aLiquid.amount;
+// }
+// }
+// }
+// }
+ return false;
+ }
+
+ public boolean depleteInput(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return false;
+ FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
+ if (aLiquid != null) return depleteInput(aLiquid);
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) {
+ if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
+ tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
+ return true;
+ }
+ }
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) {
+ if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
+ tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public ArrayList<ItemStack> getStoredOutputs() {
+ ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
+ for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(1));
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) {
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ }
+ return rList;
+ }
+
+ public ArrayList<FluidStack> getStoredFluids() {
+ ArrayList<FluidStack> rList = new ArrayList<FluidStack>();
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) {
+ rList.add(tHatch.getFillableStack());
+ }
+ }
+ return rList;
+ }
+
+ public ArrayList<ItemStack> getStoredInputs() {
+ ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().getStackInSlot(0) != null) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(0));
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null)
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ }
+ return rList;
+ }
+
+ public GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ public void updateSlots() {
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches)
+ if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
+ for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses)
+ if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
+ }
+
+ public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch)
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input)
+ return mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus)
+ return mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output)
+ return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus)
+ return mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy)
+ return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo)
+ return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance)
+ return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler)
+ return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
+ return false;
+ }
+
+ public boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = getRecipeMap();
+ return mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = getRecipeMap();
+ return mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[]{"Progress:", (mProgresstime / 20) + "secs", (mMaxProgresstime / 20) + "secs", "Efficiency:", (mEfficiency / 100.0F) + "%", "Problems:", "" + (getIdealStatus() - getRepairStatus())};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java
index 4040c07d1b..9153543eaf 100644
--- a/src/Java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java
@@ -1,55 +1,45 @@
package gtPlusPlus.core.util.debug;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.*;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.Gui;
+import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class DEBUG_ScreenOverlay extends Gui {
- int width, height;
- Minecraft mc = Minecraft.getMinecraft();
+ int width, height;
+ Minecraft mc = Minecraft.getMinecraft();
@SubscribeEvent
- public void eventHandler(final RenderGameOverlayEvent.Text event) {
+ public void eventHandler(RenderGameOverlayEvent.Text event)
+ {
- // if
- // (mc.thePlayer.getHeldItem().equals(ModItems.itemStaballoyPickaxe)){
- final ScaledResolution res = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
- final FontRenderer fontRender = this.mc.fontRenderer;
+ //if (mc.thePlayer.getHeldItem().equals(ModItems.itemStaballoyPickaxe)){
+ ScaledResolution res = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
+ FontRenderer fontRender = mc.fontRenderer;
this.width = res.getScaledWidth();
this.height = res.getScaledHeight();
Minecraft.getMinecraft().entityRenderer.setupOverlayRendering();
- final String str = "Words";
+ String str = "Words";
Item heldItem = null;
- try {
- heldItem = this.mc.thePlayer.getHeldItem().getItem();
-
- if (heldItem != null) {
- /*
- * if (heldItem instanceof StaballoyPickaxe){
- *
- * int dmg =((StaballoyPickaxe)
- * heldItem).getDamage(((StaballoyPickaxe)
- * heldItem).thisPickaxe);
- *
- * ((StaballoyPickaxe) heldItem).checkFacing(((StaballoyPickaxe)
- * heldItem).localWorld); str = "DAMAGE: "+ dmg +" | FACING: "
- * +((StaballoyPickaxe) heldItem).FACING+
- * " | FACING_HORIZONTAL: "+((StaballoyPickaxe)
- * heldItem).FACING_HORIZONTAL+" | LOOKING DIRECTION: "
- * +((StaballoyPickaxe) heldItem).lookingDirection;
- *
- * drawString(fontRender, str, (this.width -
- * fontRender.getStringWidth(str)) / 2, this.height / 10,
- * 0xFFAA00); }
- */
- }
- }
- catch (final NullPointerException e) {
+ try{heldItem = mc.thePlayer.getHeldItem().getItem();
+
+ if (heldItem != null){
+ /*if (heldItem instanceof StaballoyPickaxe){
+
+ int dmg =((StaballoyPickaxe) heldItem).getDamage(((StaballoyPickaxe) heldItem).thisPickaxe);
+
+ ((StaballoyPickaxe) heldItem).checkFacing(((StaballoyPickaxe) heldItem).localWorld);
+ str = "DAMAGE: "+ dmg +" | FACING: "+((StaballoyPickaxe) heldItem).FACING+" | FACING_HORIZONTAL: "+((StaballoyPickaxe) heldItem).FACING_HORIZONTAL+" | LOOKING DIRECTION: "+((StaballoyPickaxe) heldItem).lookingDirection;
+
+ drawString(fontRender, str, (this.width - fontRender.getStringWidth(str)) / 2, this.height / 10, 0xFFAA00);
+ }*/
}
+ }catch(NullPointerException e){}
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java
index 9c1e931bb2..1eb69eb11b 100644
--- a/src/Java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java
@@ -1,8 +1,9 @@
package gtPlusPlus.core.util.debug;
+import gtPlusPlus.core.util.Utils;
+
import java.util.concurrent.TimeUnit;
-import gtPlusPlus.core.util.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -11,53 +12,51 @@ import net.minecraftforge.common.util.ForgeDirection;
public class DEBUG_TimerThread implements Runnable {
- private final World world;
- private final EntityPlayer player;
+ private World world;
+ private EntityPlayer player;
+
- public DEBUG_TimerThread(final World WORLD, final EntityPlayer PLAYER) {
- this.world = WORLD;
- this.player = PLAYER;
+ public DEBUG_TimerThread(World WORLD, EntityPlayer PLAYER) {
+ world = WORLD;
+ player = PLAYER;
}
@Override
- public void run() {
- int xDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posX).offsetX;
- int zDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posZ).offsetZ;
-
- final int stepX = Minecraft.getMinecraft().objectMouseOver.blockX;
- final int stepY = Minecraft.getMinecraft().objectMouseOver.blockY;
- final int stepZ = Minecraft.getMinecraft().objectMouseOver.blockZ;
- Utils.LOG_INFO("Clicked on a Block @ " + "[X:" + stepX + "][Y:" + stepY + "][Z:" + stepZ + "]" + " with xDir:"
- + xDir + " zDir:" + zDir);
- this.world.setBlock(stepX, stepY, stepZ, Blocks.bedrock, 0, 3);
+ public void run(){
+ int xDir = ForgeDirection.getOrientation(player.getPlayerCoordinates().posX).offsetX;
+ int zDir = ForgeDirection.getOrientation(player.getPlayerCoordinates().posZ).offsetZ;
+
+ int stepX = Minecraft.getMinecraft().objectMouseOver.blockX;
+ int stepY = Minecraft.getMinecraft().objectMouseOver.blockY;
+ int stepZ = Minecraft.getMinecraft().objectMouseOver.blockZ;
+ Utils.LOG_INFO("Clicked on a Block @ "+"[X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]"+" with xDir:"+xDir+" zDir:"+zDir);
+ world.setBlock(stepX, stepY, stepZ, Blocks.bedrock,0,3);
Utils.LOG_INFO("Makng it Bedrock for future investment.");
- // for (int i = -1; i <= 1; i++) {
- // stepX = stepX+i;
- for (int i = stepX - 1; i <= stepX + 1; i++) {
- for (int j = stepZ - 1; j <= stepZ + 1; j++) {
- for (int h = stepY - 1; h <= stepY + 1; h++) {
-
- xDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posX).offsetX;
- zDir = ForgeDirection.getOrientation(this.player.getPlayerCoordinates().posZ).offsetZ;
-
- // for (int j = -1; j <= 1; j++) {
- // stepZ = stepZ+j;
- // for (int h = -1; h <= 1; h++) {
- // stepY = stepY+h;
- Utils.LOG_INFO("Placing Block @ " + "[X:" + i + "][Y:" + h + "][Z:" + j + "]" + " with xDir:" + xDir
- + " zDir:" + zDir);
- if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) {
- this.world.setBlock(i, h, j, Blocks.stone, 0, 3);
+ //for (int i = -1; i <= 1; i++) {
+ //stepX = stepX+i;
+ for (int i = stepX-1; i <= stepX+1; i++){
+ for (int j = stepZ-1; j <= stepZ+1; j++){
+ for (int h = stepY-1; h <= stepY+1; h++){
+
+ xDir = ForgeDirection.getOrientation(player.getPlayerCoordinates().posX).offsetX;
+ zDir = ForgeDirection.getOrientation(player.getPlayerCoordinates().posZ).offsetZ;
+
+ //for (int j = -1; j <= 1; j++) {
+ //stepZ = stepZ+j;
+ //for (int h = -1; h <= 1; h++) {
+ //stepY = stepY+h;
+ Utils.LOG_INFO("Placing Block @ "+"[X:"+i+"][Y:"+h+"][Z:"+j+"]"+" with xDir:"+xDir+" zDir:"+zDir);
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+ world.setBlock(i, h, j, Blocks.stone,0,3);
}
else {
Utils.LOG_INFO("Not even sure what this is for, but I got here.");
}
try {
TimeUnit.MILLISECONDS.sleep(500);
- }
- catch (final InterruptedException e1) {
+ } catch (InterruptedException e1) {
e1.printStackTrace();
- }
+ }
}
}
}
diff --git a/src/Java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java b/src/Java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java
index b289b9152a..59c652d73b 100644
--- a/src/Java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java
+++ b/src/Java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java
@@ -5,562 +5,339 @@ import java.nio.ByteBuffer;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
+
/**
- * User: The Grey Ghost Date: 9/02/14
+ * User: The Grey Ghost
+ * Date: 9/02/14
*/
-public class UtilityGL11Debug {
- public class GLproperty {
- public int gLconstant;
+public class UtilityGL11Debug
+{
+ public class GLproperty
+ {
+ public GLproperty(int init_gLconstant, String init_name, String init_description, String init_category, String init_fetchCommand) {
+ gLconstant = init_gLconstant;
+ name = init_name;
+ description = init_description;
+ category = init_category;
+ fetchCommand = init_fetchCommand;
+ }
- public String name;
- public String description;
- public String category;
- public String fetchCommand;
- public GLproperty(final int init_gLconstant, final String init_name, final String init_description,
- final String init_category, final String init_fetchCommand) {
- this.gLconstant = init_gLconstant;
- this.name = init_name;
- this.description = init_description;
- this.category = init_category;
- this.fetchCommand = init_fetchCommand;
- }
- }
+ public int gLconstant;
+ public String name;
+ public String description;
+ public String category;
+ public String fetchCommand;
+ }
- public static UtilityGL11Debug instance = new UtilityGL11Debug();
+ public static UtilityGL11Debug instance = new UtilityGL11Debug();
- public static void dumpAllIsEnabled() // Call This
- {
- for (int i = 0; i < UtilityGL11Debug.instance.propertyList.length; ++i)
+ public GLproperty[] propertyList =
- {
- if (UtilityGL11Debug.instance.propertyList[i].fetchCommand == "glIsEnabled()")
+ {
+ new GLproperty(GL11.GL_CURRENT_COLOR, "GL_CURRENT_COLOR", "Current color", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_INDEX, "GL_CURRENT_INDEX", "Current color index", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_TEXTURE_COORDS, "GL_CURRENT_TEXTURE_COORDS", "Current texture coordinates", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_NORMAL, "GL_CURRENT_NORMAL", "Current normal", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_POSITION, "GL_CURRENT_RASTER_POSITION", "Current raster position", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_DISTANCE, "GL_CURRENT_RASTER_DISTANCE", "Current raster distance", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_COLOR, "GL_CURRENT_RASTER_COLOR", "Color associated with raster position", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_INDEX, "GL_CURRENT_RASTER_INDEX", "Color index associated with raster position", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_TEXTURE_COORDS, "GL_CURRENT_RASTER_TEXTURE_COORDS", "Texture coordinates associated with raster position", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_POSITION_VALID, "GL_CURRENT_RASTER_POSITION_VALID", "Raster position valid bit", "current", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_EDGE_FLAG, "GL_EDGE_FLAG", "Edge flag", "current", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_VERTEX_ARRAY, "GL_VERTEX_ARRAY", "Vertex array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_VERTEX_ARRAY_SIZE, "GL_VERTEX_ARRAY_SIZE", "Coordinates per vertex", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_VERTEX_ARRAY_TYPE, "GL_VERTEX_ARRAY_TYPE", "Type of vertex coordinates", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_VERTEX_ARRAY_STRIDE, "GL_VERTEX_ARRAY_STRIDE", "Stride between vertices", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_VERTEX_ARRAY_POINTER, "GL_VERTEX_ARRAY_POINTER", "Pointer to the vertex array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_NORMAL_ARRAY, "GL_NORMAL_ARRAY", "Normal array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_NORMAL_ARRAY_TYPE, "GL_NORMAL_ARRAY_TYPE", "Type of normal coordinates", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_NORMAL_ARRAY_STRIDE, "GL_NORMAL_ARRAY_STRIDE", "Stride between normals", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_NORMAL_ARRAY_POINTER, "GL_NORMAL_ARRAY_POINTER", "Pointer to the normal array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_COLOR_ARRAY, "GL_COLOR_ARRAY", "RGBA color array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_COLOR_ARRAY_SIZE, "GL_COLOR_ARRAY_SIZE", "Colors per vertex", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_ARRAY_TYPE, "GL_COLOR_ARRAY_TYPE", "Type of color components", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_ARRAY_STRIDE, "GL_COLOR_ARRAY_STRIDE", "Stride between colors", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_ARRAY_POINTER, "GL_COLOR_ARRAY_POINTER", "Pointer to the color array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_INDEX_ARRAY, "GL_INDEX_ARRAY", "Color-index array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_INDEX_ARRAY_TYPE, "GL_INDEX_ARRAY_TYPE", "Type of color indices", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_INDEX_ARRAY_STRIDE, "GL_INDEX_ARRAY_STRIDE", "Stride between color indices", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_INDEX_ARRAY_POINTER, "GL_INDEX_ARRAY_POINTER", "Pointer to the index array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY, "GL_TEXTURE_COORD_ARRAY", "Texture coordinate array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_SIZE, "GL_TEXTURE_COORD_ARRAY_SIZE", "Texture coordinates per element", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_TYPE, "GL_TEXTURE_COORD_ARRAY_TYPE", "Type of texture coordinates", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_STRIDE, "GL_TEXTURE_COORD_ARRAY_STRIDE", "Stride between texture coordinates", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_POINTER, "GL_TEXTURE_COORD_ARRAY_POINTER", "Pointer to the texture coordinate array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_EDGE_FLAG_ARRAY, "GL_EDGE_FLAG_ARRAY", "Edge flag array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_EDGE_FLAG_ARRAY_STRIDE, "GL_EDGE_FLAG_ARRAY_STRIDE", "Stride between edge flags", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_EDGE_FLAG_ARRAY_POINTER, "GL_EDGE_FLAG_ARRAY_POINTER", "Pointer to the edge flag array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_MODELVIEW_MATRIX, "GL_MODELVIEW_MATRIX", "Modelview matrix stack", "matrix", "glGetFloatv()"),
+ new GLproperty(GL11.GL_PROJECTION_MATRIX, "GL_PROJECTION_MATRIX", "Projection matrix stack", "matrix", "glGetFloatv()"),
+ new GLproperty(GL11.GL_TEXTURE_MATRIX, "GL_TEXTURE_MATRIX", "Texture matrix stack", "matrix", "glGetFloatv()"),
+ new GLproperty(GL11.GL_VIEWPORT, "GL_VIEWPORT", "Viewport origin and extent", "viewport", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DEPTH_RANGE, "GL_DEPTH_RANGE", "Depth range near and far", "viewport", "glGetFloatv()"),
+ new GLproperty(GL11.GL_MODELVIEW_STACK_DEPTH, "GL_MODELVIEW_STACK_DEPTH", "Modelview matrix stack pointer", "matrix", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_PROJECTION_STACK_DEPTH, "GL_PROJECTION_STACK_DEPTH", "Projection matrix stack pointer", "matrix", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE_STACK_DEPTH, "GL_TEXTURE_STACK_DEPTH", "Texture matrix stack pointer", "matrix", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MATRIX_MODE, "GL_MATRIX_MODE", "Current matrix mode", "transform", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_NORMALIZE, "GL_NORMALIZE", "Current normal normalization on/off", "transform/ enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_FOG_COLOR, "GL_FOG_COLOR", "Fog color", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_INDEX, "GL_FOG_INDEX", "Fog index", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_DENSITY, "GL_FOG_DENSITY", "Exponential fog density", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_START, "GL_FOG_START", "Linear fog start", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_END, "GL_FOG_END", "Linear fog end", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_MODE, "GL_FOG_MODE", "Fog mode", "fog", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FOG, "GL_FOG", "True if fog enabled", "fog/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_SHADE_MODEL, "GL_SHADE_MODEL", "glShadeModel() setting", "lighting", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LIGHTING, "GL_LIGHTING", "True if lighting is enabled", "lighting/e nable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_COLOR_MATERIAL, "GL_COLOR_MATERIAL", "True if color tracking is enabled", "lighting", "glIsEnabled()"),
+ new GLproperty(GL11.GL_COLOR_MATERIAL_PARAMETER, "GL_COLOR_MATERIAL_PARAMETER", "Material properties tracking current color", "lighting", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_MATERIAL_FACE, "GL_COLOR_MATERIAL_FACE", "Face(s) affected by color tracking", "lighting", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_AMBIENT, "GL_AMBIENT", "Ambient material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_DIFFUSE, "GL_DIFFUSE", "Diffuse material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_SPECULAR, "GL_SPECULAR", "Specular material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_EMISSION, "GL_EMISSION", "Emissive material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_SHININESS, "GL_SHININESS", "Specular exponent of material", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_LIGHT_MODEL_AMBIENT, "GL_LIGHT_MODEL_AMBIENT", "Ambient scene color", "lighting", "glGetFloatv()"),
+ new GLproperty(GL11.GL_LIGHT_MODEL_LOCAL_VIEWER, "GL_LIGHT_MODEL_LOCAL_VIEWER", "Viewer is local", "lighting", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_LIGHT_MODEL_TWO_SIDE, "GL_LIGHT_MODEL_TWO_SIDE", "Use two-sided lighting", "lighting", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_AMBIENT, "GL_AMBIENT", "Ambient intensity of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_DIFFUSE, "GL_DIFFUSE", "Diffuse intensity of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_SPECULAR, "GL_SPECULAR", "Specular intensity of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_POSITION, "GL_POSITION", "Position of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_CONSTANT_ATTENUATION, "GL_CONSTANT_ATTENUATION", "Constant attenuation factor", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_LINEAR_ATTENUATION, "GL_LINEAR_ATTENUATION", "Linear attenuation factor", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_QUADRATIC_ATTENUATION, "GL_QUADRATIC_ATTENUATION", "Quadratic attenuation factor", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_SPOT_DIRECTION, "GL_SPOT_DIRECTION", "Spotlight direction of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_SPOT_EXPONENT, "GL_SPOT_EXPONENT", "Spotlight exponent of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_SPOT_CUTOFF, "GL_SPOT_CUTOFF", "Spotlight angle of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_LIGHT0, "GL_LIGHT0", "True if light 0 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT1, "GL_LIGHT1", "True if light 1 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT2, "GL_LIGHT2", "True if light 2 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT3, "GL_LIGHT3", "True if light 3 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT4, "GL_LIGHT4", "True if light 4 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT5, "GL_LIGHT5", "True if light 5 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT6, "GL_LIGHT6", "True if light 6 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT7, "GL_LIGHT7", "True if light 7 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_COLOR_INDEXES, "GL_COLOR_INDEXES", "ca, cd, and cs for color-index lighting", "lighting/e nable", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_POINT_SIZE, "GL_POINT_SIZE", "Point size", "point", "glGetFloatv()"),
+ new GLproperty(GL11.GL_POINT_SMOOTH, "GL_POINT_SMOOTH", "Point antialiasing on", "point/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LINE_WIDTH, "GL_LINE_WIDTH", "Line width", "line", "glGetFloatv()"),
+ new GLproperty(GL11.GL_LINE_SMOOTH, "GL_LINE_SMOOTH", "Line antialiasing on", "line/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LINE_STIPPLE_PATTERN, "GL_LINE_STIPPLE_PATTERN", "Line stipple", "line", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LINE_STIPPLE_REPEAT, "GL_LINE_STIPPLE_REPEAT", "Line stipple repeat", "line", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LINE_STIPPLE, "GL_LINE_STIPPLE", "Line stipple enable", "line/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_CULL_FACE, "GL_CULL_FACE", "Polygon culling enabled", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_CULL_FACE_MODE, "GL_CULL_FACE_MODE", "Cull front-/back-facing polygons", "polygon", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FRONT_FACE, "GL_FRONT_FACE", "Polygon front-face CW/CCW indicator", "polygon", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_POLYGON_SMOOTH, "GL_POLYGON_SMOOTH", "Polygon antialiasing on", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_POLYGON_MODE, "GL_POLYGON_MODE", "Polygon rasterization mode (front and back)", "polygon", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_POLYGON_OFFSET_FACTOR, "GL_POLYGON_OFFSET_FACTOR", "Polygon offset factor", "polygon", "glGetFloatv()"),
+ new GLproperty(GL11.GL_POLYGON_OFFSET_POINT, "GL_POLYGON_OFFSET_POINT", "Polygon offset enable for GL_POINT mode rasterization", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_POLYGON_OFFSET_LINE, "GL_POLYGON_OFFSET_LINE", "Polygon offset enable for GL_LINE mode rasterization", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_POLYGON_OFFSET_FILL, "GL_POLYGON_OFFSET_FILL", "Polygon offset enable for GL_FILL mode rasterization", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_POLYGON_STIPPLE, "GL_POLYGON_STIPPLE", "Polygon stipple enable", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_1D, "GL_TEXTURE_1D", "True if 1-D texturing enabled ", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_2D, "GL_TEXTURE_2D", "True if 2-D texturing enabled ", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_BINDING_1D, "GL_TEXTURE_BINDING_1D", "Texture object bound to GL_TEXTURE_1D", "texture", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE_BINDING_2D, "GL_TEXTURE_BINDING_2D", "Texture object bound to GL_TEXTURE_2D", "texture", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE, "GL_TEXTURE", "x-D texture image at level of detail i", "UNUSED", "glGetTexImage()"),
+ new GLproperty(GL11.GL_TEXTURE_WIDTH, "GL_TEXTURE_WIDTH", "x-D texture image i's width", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_HEIGHT, "GL_TEXTURE_HEIGHT", "x-D texture image i's height", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_BORDER, "GL_TEXTURE_BORDER", "x-D texture image i's border width", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_RED_SIZE, "GL_TEXTURE_RED_SIZE", "x-D texture image i's red resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_GREEN_SIZE, "GL_TEXTURE_GREEN_SIZE", "x-D texture image i's green resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_BLUE_SIZE, "GL_TEXTURE_BLUE_SIZE", "x-D texture image i's blue resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_ALPHA_SIZE, "GL_TEXTURE_ALPHA_SIZE", "x-D texture image i's alpha resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_LUMINANCE_SIZE, "GL_TEXTURE_LUMINANCE_SIZE", "x-D texture image i's luminance resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_INTENSITY_SIZE, "GL_TEXTURE_INTENSITY_SIZE", "x-D texture image i's intensity resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_BORDER_COLOR, "GL_TEXTURE_BORDER_COLOR", "Texture border color", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_MIN_FILTER, "GL_TEXTURE_MIN_FILTER", "Texture minification function", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_MAG_FILTER, "GL_TEXTURE_MAG_FILTER", "Texture magnification function", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_WRAP_S, "GL_TEXTURE_WRAP_S", "Texture wrap mode (x is S or T)", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_WRAP_T, "GL_TEXTURE_WRAP_T", "Texture wrap mode (x is S or T)", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_PRIORITY, "GL_TEXTURE_PRIORITY", "Texture object priority", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_ENV_MODE, "GL_TEXTURE_ENV_MODE", "Texture application function", "texture", "glGetTexEnviv()"),
+ new GLproperty(GL11.GL_TEXTURE_ENV_COLOR, "GL_TEXTURE_ENV_COLOR", "Texture environment color", "texture", "glGetTexEnvfv()"),
+ new GLproperty(GL11.GL_TEXTURE_GEN_S, "GL_TEXTURE_GEN_S", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_GEN_T, "GL_TEXTURE_GEN_T", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_GEN_R, "GL_TEXTURE_GEN_R", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_GEN_Q, "GL_TEXTURE_GEN_Q", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_EYE_PLANE, "GL_EYE_PLANE", "Texgen plane equation coefficients", "texture", "glGetTexGenfv()"),
+ new GLproperty(GL11.GL_OBJECT_PLANE, "GL_OBJECT_PLANE", "Texgen object linear coefficients", "texture", "glGetTexGenfv()"),
+ new GLproperty(GL11.GL_TEXTURE_GEN_MODE, "GL_TEXTURE_GEN_MODE", "Function used for texgen", "texture", "glGetTexGeniv()"),
+ new GLproperty(GL11.GL_SCISSOR_TEST, "GL_SCISSOR_TEST", "Scissoring enabled", "scissor/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_SCISSOR_BOX, "GL_SCISSOR_BOX", "Scissor box", "scissor", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ALPHA_TEST, "GL_ALPHA_TEST", "Alpha test enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_ALPHA_TEST_FUNC, "GL_ALPHA_TEST_FUNC", "Alpha test function", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ALPHA_TEST_REF, "GL_ALPHA_TEST_REF", "Alpha test reference value", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_TEST, "GL_STENCIL_TEST", "Stenciling enabled", "stencil-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_STENCIL_FUNC, "GL_STENCIL_FUNC", "Stencil function", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_VALUE_MASK, "GL_STENCIL_VALUE_MASK", "Stencil mask", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_REF, "GL_STENCIL_REF", "Stencil reference value", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_FAIL, "GL_STENCIL_FAIL", "Stencil fail action", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_PASS_DEPTH_FAIL, "GL_STENCIL_PASS_DEPTH_FAIL", "Stencil depth buffer fail action", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_PASS_DEPTH_PASS, "GL_STENCIL_PASS_DEPTH_PASS", "Stencil depth buffer pass action", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DEPTH_TEST, "GL_DEPTH_TEST", "Depth buffer enabled", "depth-buffer/ena ble", "glIsEnabled()"),
+ new GLproperty(GL11.GL_DEPTH_FUNC, "GL_DEPTH_FUNC", "Depth buffer test function", "depth-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_BLEND, "GL_BLEND", "Blending enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_BLEND_SRC, "GL_BLEND_SRC", "Blending source function", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_BLEND_DST, "GL_BLEND_DST", "Blending destination function", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DITHER, "GL_DITHER", "Dithering enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_INDEX_LOGIC_OP, "GL_INDEX_LOGIC_OP", "Color index logical operation enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_COLOR_LOGIC_OP, "GL_COLOR_LOGIC_OP", "RGBA color logical operation enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LOGIC_OP_MODE, "GL_LOGIC_OP_MODE", "Logical operation function", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DRAW_BUFFER, "GL_DRAW_BUFFER", "Buffers selected for drawing", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_INDEX_WRITEMASK, "GL_INDEX_WRITEMASK", "Color-index writemask", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_WRITEMASK, "GL_COLOR_WRITEMASK", "Color write enables; R, G, B, or A", "color-buffer", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_DEPTH_WRITEMASK, "GL_DEPTH_WRITEMASK", "Depth buffer enabled for writing", "depth-buffer", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_STENCIL_WRITEMASK, "GL_STENCIL_WRITEMASK", "Stencil-buffer writemask", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_CLEAR_VALUE, "GL_COLOR_CLEAR_VALUE", "Color-buffer clear value (RGBA mode)", "color-buffer", "glGetFloatv()"),
+ new GLproperty(GL11.GL_INDEX_CLEAR_VALUE, "GL_INDEX_CLEAR_VALUE", "Color-buffer clear value (color-index mode)", "color-buffer", "glGetFloatv()"),
+ new GLproperty(GL11.GL_DEPTH_CLEAR_VALUE, "GL_DEPTH_CLEAR_VALUE", "Depth-buffer clear value", "depth-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_CLEAR_VALUE, "GL_STENCIL_CLEAR_VALUE", "Stencil-buffer clear value", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ACCUM_CLEAR_VALUE, "GL_ACCUM_CLEAR_VALUE", "Accumulation-buffer clear value", "accum-buffer", "glGetFloatv()"),
+ new GLproperty(GL11.GL_UNPACK_SWAP_BYTES, "GL_UNPACK_SWAP_BYTES", "Value of GL_UNPACK_SWAP_BYTES", "pixel-store", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_UNPACK_LSB_FIRST, "GL_UNPACK_LSB_FIRST", "Value of GL_UNPACK_LSB_FIRST", "pixel-store", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_UNPACK_ROW_LENGTH, "GL_UNPACK_ROW_LENGTH", "Value of GL_UNPACK_ROW_LENGTH", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_UNPACK_SKIP_ROWS, "GL_UNPACK_SKIP_ROWS", "Value of GL_UNPACK_SKIP_ROWS", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_UNPACK_SKIP_PIXELS, "GL_UNPACK_SKIP_PIXELS", "Value of GL_UNPACK_SKIP_PIXELS", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_UNPACK_ALIGNMENT, "GL_UNPACK_ALIGNMENT", "Value of GL_UNPACK_ALIGNMENT", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_PACK_SWAP_BYTES, "GL_PACK_SWAP_BYTES", "Value of GL_PACK_SWAP_BYTES", "pixel-store", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_PACK_LSB_FIRST, "GL_PACK_LSB_FIRST", "Value of GL_PACK_LSB_FIRST", "pixel-store", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_PACK_ROW_LENGTH, "GL_PACK_ROW_LENGTH", "Value of GL_PACK_ROW_LENGTH", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_PACK_SKIP_ROWS, "GL_PACK_SKIP_ROWS", "Value of GL_PACK_SKIP_ROWS", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_PACK_SKIP_PIXELS, "GL_PACK_SKIP_PIXELS", "Value of GL_PACK_SKIP_PIXELS", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_PACK_ALIGNMENT, "GL_PACK_ALIGNMENT", "Value of GL_PACK_ALIGNMENT", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAP_COLOR, "GL_MAP_COLOR", "True if colors are mapped", "pixel", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_MAP_STENCIL, "GL_MAP_STENCIL", "True if stencil values are mapped", "pixel", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_INDEX_SHIFT, "GL_INDEX_SHIFT", "Value of GL_INDEX_SHIFT", "pixel", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_INDEX_OFFSET, "GL_INDEX_OFFSET", "Value of GL_INDEX_OFFSET", "pixel", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ZOOM_X, "GL_ZOOM_X", "x zoom factor", "pixel", "glGetFloatv()"),
+ new GLproperty(GL11.GL_ZOOM_Y, "GL_ZOOM_Y", "y zoom factor", "pixel", "glGetFloatv()"),
+ new GLproperty(GL11.GL_READ_BUFFER, "GL_READ_BUFFER", "Read source buffer", "pixel", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ORDER, "GL_ORDER", "1D map order", "capability", "glGetMapiv()"),
+ new GLproperty(GL11.GL_ORDER, "GL_ORDER", "2D map orders", "capability", "glGetMapiv()"),
+ new GLproperty(GL11.GL_COEFF, "GL_COEFF", "1D control points", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_COEFF, "GL_COEFF", "2D control points", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_DOMAIN, "GL_DOMAIN", "1D domain endpoints", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_DOMAIN, "GL_DOMAIN", "2D domain endpoints", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_MAP1_GRID_DOMAIN, "GL_MAP1_GRID_DOMAIN", "1D grid endpoints", "eval", "glGetFloatv()"),
+ new GLproperty(GL11.GL_MAP2_GRID_DOMAIN, "GL_MAP2_GRID_DOMAIN", "2D grid endpoints", "eval", "glGetFloatv()"),
+ new GLproperty(GL11.GL_MAP1_GRID_SEGMENTS, "GL_MAP1_GRID_SEGMENTS", "1D grid divisions", "eval", "glGetFloatv()"),
+ new GLproperty(GL11.GL_MAP2_GRID_SEGMENTS, "GL_MAP2_GRID_SEGMENTS", "2D grid divisions", "eval", "glGetFloatv()"),
+ new GLproperty(GL11.GL_AUTO_NORMAL, "GL_AUTO_NORMAL", "True if automatic normal generation enabled", "eval", "glIsEnabled()"),
+ new GLproperty(GL11.GL_PERSPECTIVE_CORRECTION_HINT, "GL_PERSPECTIVE_CORRECTION_HINT", "Perspective correction hint", "hint", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_POINT_SMOOTH_HINT, "GL_POINT_SMOOTH_HINT", "Point smooth hint", "hint", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LINE_SMOOTH_HINT, "GL_LINE_SMOOTH_HINT", "Line smooth hint", "hint", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_POLYGON_SMOOTH_HINT, "GL_POLYGON_SMOOTH_HINT", "Polygon smooth hint", "hint", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FOG_HINT, "GL_FOG_HINT", "Fog hint", "hint", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_LIGHTS, "GL_MAX_LIGHTS", "Maximum number of lights", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_CLIP_PLANES, "GL_MAX_CLIP_PLANES", "Maximum number of user clipping planes", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_MODELVIEW_STACK_DEPTH, "GL_MAX_MODELVIEW_STACK_DEPTH", "Maximum modelview-matrix stack depth", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_PROJECTION_STACK_DEPTH, "GL_MAX_PROJECTION_STACK_DEPTH", "Maximum projection-matrix stack depth", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_TEXTURE_STACK_DEPTH, "GL_MAX_TEXTURE_STACK_DEPTH", "Maximum depth of texture matrix stack", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_SUBPIXEL_BITS, "GL_SUBPIXEL_BITS", "Number of bits of subpixel precision in x and y", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_TEXTURE_SIZE, "GL_MAX_TEXTURE_SIZE", "See discussion in Texture Proxy in Chapter 9", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_PIXEL_MAP_TABLE, "GL_MAX_PIXEL_MAP_TABLE", "Maximum size of a glPixelMap() translation table", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_NAME_STACK_DEPTH, "GL_MAX_NAME_STACK_DEPTH", "Maximum selection-name stack depth", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_LIST_NESTING, "GL_MAX_LIST_NESTING", "Maximum display-list call nesting", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_EVAL_ORDER, "GL_MAX_EVAL_ORDER", "Maximum evaluator polynomial order", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_VIEWPORT_DIMS, "GL_MAX_VIEWPORT_DIMS", "Maximum viewport dimensions", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_ATTRIB_STACK_DEPTH, "GL_MAX_ATTRIB_STACK_DEPTH", "Maximum depth of the attribute stack", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH", "Maximum depth of the client attribute stack", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_AUX_BUFFERS, "GL_AUX_BUFFERS", "Number of auxiliary buffers", "capability", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_RGBA_MODE, "GL_RGBA_MODE", "True if color buffers store RGBA", "capability", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_INDEX_MODE, "GL_INDEX_MODE", "True if color buffers store indices", "capability", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_DOUBLEBUFFER, "GL_DOUBLEBUFFER", "True if front and back buffers exist", "capability", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_STEREO, "GL_STEREO", "True if left and right buffers exist", "capability", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_POINT_SIZE_RANGE, "GL_POINT_SIZE_RANGE", "Range (low to high) of antialiased point sizes", "capability", "glGetFloatv()"),
+ new GLproperty(GL11.GL_POINT_SIZE_GRANULARITY, "GL_POINT_SIZE_GRANULARITY", "Antialiased point-size granularity", "capability", "glGetFloatv()"),
+ new GLproperty(GL11.GL_LINE_WIDTH_RANGE, "GL_LINE_WIDTH_RANGE", "Range (low to high) of antialiased line widths", "capability", "glGetFloatv()"),
+ new GLproperty(GL11.GL_LINE_WIDTH_GRANULARITY, "GL_LINE_WIDTH_GRANULARITY", "Antialiased line-width granularity", "capability", "glGetFloatv()"),
+ new GLproperty(GL11.GL_RED_BITS, "GL_RED_BITS", "Number of bits per red component in color buffers", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_GREEN_BITS, "GL_GREEN_BITS", "Number of bits per green component in color buffers", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_BLUE_BITS, "GL_BLUE_BITS", "Number of bits per blue component in color buffers", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ALPHA_BITS, "GL_ALPHA_BITS", "Number of bits per alpha component in color buffers", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_INDEX_BITS, "GL_INDEX_BITS", "Number of bits per index in color buffers", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DEPTH_BITS, "GL_DEPTH_BITS", "Number of depth-buffer bitplanes", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_BITS, "GL_STENCIL_BITS", "Number of stencil bitplanes", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ACCUM_RED_BITS, "GL_ACCUM_RED_BITS", "Number of bits per red component in the accumulation buffer", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ACCUM_GREEN_BITS, "GL_ACCUM_GREEN_BITS", "Number of bits per green component in the accumulation buffer", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ACCUM_BLUE_BITS, "GL_ACCUM_BLUE_BITS", "Number of bits per blue component in the accumulation buffer", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ACCUM_ALPHA_BITS, "GL_ACCUM_ALPHA_BITS", "Number of bits per alpha component in the accumulation buffer", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LIST_BASE, "GL_LIST_BASE", "Setting of glListBase()", "list", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LIST_INDEX, "GL_LIST_INDEX", "Number of display list under construction; 0 if none", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LIST_MODE, "GL_LIST_MODE", "Mode of display list under construction; undefined if none", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ATTRIB_STACK_DEPTH, "GL_ATTRIB_STACK_DEPTH", "Attribute stack pointer", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_CLIENT_ATTRIB_STACK_DEPTH, "GL_CLIENT_ATTRIB_STACK_DEPTH", "Client attribute stack pointer", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_NAME_STACK_DEPTH, "GL_NAME_STACK_DEPTH", "Name stack depth", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_RENDER_MODE, "GL_RENDER_MODE", "glRenderMode() setting", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_SELECTION_BUFFER_POINTER, "GL_SELECTION_BUFFER_POINTER", "Pointer to selection buffer", "select", "glGetPointerv()"),
+ new GLproperty(GL11.GL_SELECTION_BUFFER_SIZE, "GL_SELECTION_BUFFER_SIZE", "Size of selection buffer", "select", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FEEDBACK_BUFFER_POINTER, "GL_FEEDBACK_BUFFER_POINTER", "Pointer to feedback buffer", "feedback", "glGetPointerv()"),
+ new GLproperty(GL11.GL_FEEDBACK_BUFFER_SIZE, "GL_FEEDBACK_BUFFER_SIZE", "Size of feedback buffer", "feedback", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FEEDBACK_BUFFER_TYPE, "GL_FEEDBACK_BUFFER_TYPE", "Type of feedback buffer", "feedback", "glGetIntegerv()"),
+ };
- {
- System.out.print(UtilityGL11Debug.instance.propertyList[i].name + ":");
- System.out.print(GL11.glIsEnabled(UtilityGL11Debug.instance.propertyList[i].gLconstant));
- System.out.println(" (" + UtilityGL11Debug.instance.propertyList[i].description + ")");
- }
- }
- }
+ public static void dumpOpenGLstate()
+ {
+ }
- public static void dumpAllType(final String type)
+ public static void dumpAllIsEnabled() //Call This
+ {
+ for (int i = 0; i < instance.propertyList.length; ++i)
- {
- for (int i = 0; i < UtilityGL11Debug.instance.propertyList.length; ++i)
+ {
+ if (instance.propertyList[i].fetchCommand == "glIsEnabled()")
- {
- if (UtilityGL11Debug.instance.propertyList[i].category.equals(type))
+ {
+ System.out.print(instance.propertyList[i].name + ":");
+ System.out.print(GL11.glIsEnabled(instance.propertyList[i].gLconstant));
+ System.out.println(" (" + instance.propertyList[i].description + ")");
+ }
+ }
+ }
- {
- System.out.print(UtilityGL11Debug.instance.propertyList[i].name + ":");
- System.out.println(UtilityGL11Debug.getPropertyAsString(i));
- System.out.println(" (" + UtilityGL11Debug.instance.propertyList[i].description + ")");
- }
- }
- }
+ public static void dumpAllType(String type)
- public static void dumpOpenGLstate() {
- }
+ {
+ for (int i = 0; i < instance.propertyList.length; ++i)
- private static String getPropertyAsString(final int propertyListIndex) {
- final int gLconstant = UtilityGL11Debug.instance.propertyList[propertyListIndex].gLconstant;
- if (UtilityGL11Debug.instance.propertyList[propertyListIndex].fetchCommand.equals("glIsEnabled()")) {
- return "" + GL11.glIsEnabled(gLconstant);
- }
+ {
+ if (instance.propertyList[i].category.equals(type))
- if (UtilityGL11Debug.instance.propertyList[propertyListIndex].fetchCommand == "glGetBooleanv()")
+ {
+ System.out.print(instance.propertyList[i].name + ":");
+ System.out.println(getPropertyAsString(i));
+ System.out.println(" (" + instance.propertyList[i].description + ")");
+ }
+ }
+ }
- {
- final ByteBuffer params = BufferUtils.createByteBuffer(16);
+ private static String getPropertyAsString(int propertyListIndex)
+ {
+ int gLconstant = instance.propertyList[propertyListIndex].gLconstant;
+ if (instance.propertyList[propertyListIndex].fetchCommand.equals("glIsEnabled()")) {
+ return "" + GL11.glIsEnabled(gLconstant);
+ }
- GL11.glGetBoolean(gLconstant, params);
- String out = "";
- for (int i = 0; i < params.capacity(); ++i)
+ if (instance.propertyList[propertyListIndex].fetchCommand == "glGetBooleanv()")
- {
- out += (i == 0 ? "" : ", ") + params.get(i);
- }
- return out;
- }
+ {
+ ByteBuffer params = BufferUtils.createByteBuffer(16);
- return "";
- }
+ GL11.glGetBoolean(gLconstant, params);
+ String out = "";
+ for (int i = 0; i < params.capacity(); ++i)
- public GLproperty[] propertyList =
+ {
+ out += (i == 0 ? "" : ", ") + params.get(i);
+ }
+ return out;
+ }
- {
- new GLproperty(GL11.GL_CURRENT_COLOR, "GL_CURRENT_COLOR", "Current color", "current",
- "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_INDEX, "GL_CURRENT_INDEX", "Current color index", "current",
- "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_TEXTURE_COORDS, "GL_CURRENT_TEXTURE_COORDS",
- "Current texture coordinates", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_NORMAL, "GL_CURRENT_NORMAL", "Current normal", "current",
- "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_POSITION, "GL_CURRENT_RASTER_POSITION",
- "Current raster position", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_DISTANCE, "GL_CURRENT_RASTER_DISTANCE",
- "Current raster distance", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_COLOR, "GL_CURRENT_RASTER_COLOR",
- "Color associated with raster position", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_INDEX, "GL_CURRENT_RASTER_INDEX",
- "Color index associated with raster position", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_TEXTURE_COORDS, "GL_CURRENT_RASTER_TEXTURE_COORDS",
- "Texture coordinates associated with raster position", "current", "glGetFloatv()"),
- new GLproperty(GL11.GL_CURRENT_RASTER_POSITION_VALID, "GL_CURRENT_RASTER_POSITION_VALID",
- "Raster position valid bit", "current", "glGetBooleanv()"),
- new GLproperty(GL11.GL_EDGE_FLAG, "GL_EDGE_FLAG", "Edge flag", "current", "glGetBooleanv()"),
- new GLproperty(GL11.GL_VERTEX_ARRAY, "GL_VERTEX_ARRAY", "Vertex array enable", "vertex-array",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_VERTEX_ARRAY_SIZE, "GL_VERTEX_ARRAY_SIZE", "Coordinates per vertex",
- "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_VERTEX_ARRAY_TYPE, "GL_VERTEX_ARRAY_TYPE", "Type of vertex coordinates",
- "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_VERTEX_ARRAY_STRIDE, "GL_VERTEX_ARRAY_STRIDE", "Stride between vertices",
- "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_VERTEX_ARRAY_POINTER, "GL_VERTEX_ARRAY_POINTER",
- "Pointer to the vertex array", "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_NORMAL_ARRAY, "GL_NORMAL_ARRAY", "Normal array enable", "vertex-array",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_NORMAL_ARRAY_TYPE, "GL_NORMAL_ARRAY_TYPE", "Type of normal coordinates",
- "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_NORMAL_ARRAY_STRIDE, "GL_NORMAL_ARRAY_STRIDE", "Stride between normals",
- "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_NORMAL_ARRAY_POINTER, "GL_NORMAL_ARRAY_POINTER",
- "Pointer to the normal array", "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_COLOR_ARRAY, "GL_COLOR_ARRAY", "RGBA color array enable", "vertex-array",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_COLOR_ARRAY_SIZE, "GL_COLOR_ARRAY_SIZE", "Colors per vertex", "vertex-array",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_ARRAY_TYPE, "GL_COLOR_ARRAY_TYPE", "Type of color components",
- "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_ARRAY_STRIDE, "GL_COLOR_ARRAY_STRIDE", "Stride between colors",
- "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_ARRAY_POINTER, "GL_COLOR_ARRAY_POINTER", "Pointer to the color array",
- "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_INDEX_ARRAY, "GL_INDEX_ARRAY", "Color-index array enable", "vertex-array",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_INDEX_ARRAY_TYPE, "GL_INDEX_ARRAY_TYPE", "Type of color indices",
- "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_INDEX_ARRAY_STRIDE, "GL_INDEX_ARRAY_STRIDE", "Stride between color indices",
- "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_INDEX_ARRAY_POINTER, "GL_INDEX_ARRAY_POINTER", "Pointer to the index array",
- "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY, "GL_TEXTURE_COORD_ARRAY",
- "Texture coordinate array enable", "vertex-array", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_SIZE, "GL_TEXTURE_COORD_ARRAY_SIZE",
- "Texture coordinates per element", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_TYPE, "GL_TEXTURE_COORD_ARRAY_TYPE",
- "Type of texture coordinates", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_STRIDE, "GL_TEXTURE_COORD_ARRAY_STRIDE",
- "Stride between texture coordinates", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_POINTER, "GL_TEXTURE_COORD_ARRAY_POINTER",
- "Pointer to the texture coordinate array", "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_EDGE_FLAG_ARRAY, "GL_EDGE_FLAG_ARRAY", "Edge flag array enable",
- "vertex-array", "glIsEnabled()"),
- new GLproperty(GL11.GL_EDGE_FLAG_ARRAY_STRIDE, "GL_EDGE_FLAG_ARRAY_STRIDE",
- "Stride between edge flags", "vertex-array", "glGetIntegerv()"),
- new GLproperty(GL11.GL_EDGE_FLAG_ARRAY_POINTER, "GL_EDGE_FLAG_ARRAY_POINTER",
- "Pointer to the edge flag array", "vertex-array", "glGetPointerv()"),
- new GLproperty(GL11.GL_MODELVIEW_MATRIX, "GL_MODELVIEW_MATRIX", "Modelview matrix stack", "matrix",
- "glGetFloatv()"),
- new GLproperty(GL11.GL_PROJECTION_MATRIX, "GL_PROJECTION_MATRIX", "Projection matrix stack",
- "matrix", "glGetFloatv()"),
- new GLproperty(GL11.GL_TEXTURE_MATRIX, "GL_TEXTURE_MATRIX", "Texture matrix stack", "matrix",
- "glGetFloatv()"),
- new GLproperty(GL11.GL_VIEWPORT, "GL_VIEWPORT", "Viewport origin and extent", "viewport",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_DEPTH_RANGE, "GL_DEPTH_RANGE", "Depth range near and far", "viewport",
- "glGetFloatv()"),
- new GLproperty(GL11.GL_MODELVIEW_STACK_DEPTH, "GL_MODELVIEW_STACK_DEPTH",
- "Modelview matrix stack pointer", "matrix", "glGetIntegerv()"),
- new GLproperty(GL11.GL_PROJECTION_STACK_DEPTH, "GL_PROJECTION_STACK_DEPTH",
- "Projection matrix stack pointer", "matrix", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE_STACK_DEPTH, "GL_TEXTURE_STACK_DEPTH",
- "Texture matrix stack pointer", "matrix", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MATRIX_MODE, "GL_MATRIX_MODE", "Current matrix mode", "transform",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_NORMALIZE, "GL_NORMALIZE", "Current normal normalization on/off",
- "transform/ enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_FOG_COLOR, "GL_FOG_COLOR", "Fog color", "fog", "glGetFloatv()"),
- new GLproperty(GL11.GL_FOG_INDEX, "GL_FOG_INDEX", "Fog index", "fog", "glGetFloatv()"),
- new GLproperty(GL11.GL_FOG_DENSITY, "GL_FOG_DENSITY", "Exponential fog density", "fog",
- "glGetFloatv()"),
- new GLproperty(GL11.GL_FOG_START, "GL_FOG_START", "Linear fog start", "fog", "glGetFloatv()"),
- new GLproperty(GL11.GL_FOG_END, "GL_FOG_END", "Linear fog end", "fog", "glGetFloatv()"),
- new GLproperty(GL11.GL_FOG_MODE, "GL_FOG_MODE", "Fog mode", "fog", "glGetIntegerv()"),
- new GLproperty(GL11.GL_FOG, "GL_FOG", "True if fog enabled", "fog/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_SHADE_MODEL, "GL_SHADE_MODEL", "glShadeModel() setting", "lighting",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_LIGHTING, "GL_LIGHTING", "True if lighting is enabled", "lighting/e nable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_COLOR_MATERIAL, "GL_COLOR_MATERIAL", "True if color tracking is enabled",
- "lighting", "glIsEnabled()"),
- new GLproperty(GL11.GL_COLOR_MATERIAL_PARAMETER, "GL_COLOR_MATERIAL_PARAMETER",
- "Material properties tracking current color", "lighting", "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_MATERIAL_FACE, "GL_COLOR_MATERIAL_FACE",
- "Face(s) affected by color tracking", "lighting", "glGetIntegerv()"),
- new GLproperty(GL11.GL_AMBIENT, "GL_AMBIENT", "Ambient material color", "lighting",
- "glGetMaterialfv()"),
- new GLproperty(GL11.GL_DIFFUSE, "GL_DIFFUSE", "Diffuse material color", "lighting",
- "glGetMaterialfv()"),
- new GLproperty(GL11.GL_SPECULAR, "GL_SPECULAR", "Specular material color", "lighting",
- "glGetMaterialfv()"),
- new GLproperty(GL11.GL_EMISSION, "GL_EMISSION", "Emissive material color", "lighting",
- "glGetMaterialfv()"),
- new GLproperty(GL11.GL_SHININESS, "GL_SHININESS", "Specular exponent of material", "lighting",
- "glGetMaterialfv()"),
- new GLproperty(GL11.GL_LIGHT_MODEL_AMBIENT, "GL_LIGHT_MODEL_AMBIENT", "Ambient scene color",
- "lighting", "glGetFloatv()"),
- new GLproperty(GL11.GL_LIGHT_MODEL_LOCAL_VIEWER, "GL_LIGHT_MODEL_LOCAL_VIEWER", "Viewer is local",
- "lighting", "glGetBooleanv()"),
- new GLproperty(GL11.GL_LIGHT_MODEL_TWO_SIDE, "GL_LIGHT_MODEL_TWO_SIDE", "Use two-sided lighting",
- "lighting", "glGetBooleanv()"),
- new GLproperty(GL11.GL_AMBIENT, "GL_AMBIENT", "Ambient intensity of light i", "lighting",
- "glGetLightfv()"),
- new GLproperty(GL11.GL_DIFFUSE, "GL_DIFFUSE", "Diffuse intensity of light i", "lighting",
- "glGetLightfv()"),
- new GLproperty(GL11.GL_SPECULAR, "GL_SPECULAR", "Specular intensity of light i", "lighting",
- "glGetLightfv()"),
- new GLproperty(GL11.GL_POSITION, "GL_POSITION", "Position of light i", "lighting",
- "glGetLightfv()"),
- new GLproperty(GL11.GL_CONSTANT_ATTENUATION, "GL_CONSTANT_ATTENUATION",
- "Constant attenuation factor", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_LINEAR_ATTENUATION, "GL_LINEAR_ATTENUATION", "Linear attenuation factor",
- "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_QUADRATIC_ATTENUATION, "GL_QUADRATIC_ATTENUATION",
- "Quadratic attenuation factor", "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_SPOT_DIRECTION, "GL_SPOT_DIRECTION", "Spotlight direction of light i",
- "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_SPOT_EXPONENT, "GL_SPOT_EXPONENT", "Spotlight exponent of light i",
- "lighting", "glGetLightfv()"),
- new GLproperty(GL11.GL_SPOT_CUTOFF, "GL_SPOT_CUTOFF", "Spotlight angle of light i", "lighting",
- "glGetLightfv()"),
- new GLproperty(GL11.GL_LIGHT0, "GL_LIGHT0", "True if light 0 enabled", "lighting/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT1, "GL_LIGHT1", "True if light 1 enabled", "lighting/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT2, "GL_LIGHT2", "True if light 2 enabled", "lighting/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT3, "GL_LIGHT3", "True if light 3 enabled", "lighting/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT4, "GL_LIGHT4", "True if light 4 enabled", "lighting/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT5, "GL_LIGHT5", "True if light 5 enabled", "lighting/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT6, "GL_LIGHT6", "True if light 6 enabled", "lighting/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_LIGHT7, "GL_LIGHT7", "True if light 7 enabled", "lighting/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_COLOR_INDEXES, "GL_COLOR_INDEXES", "ca, cd, and cs for color-index lighting",
- "lighting/e nable", "glGetMaterialfv()"),
- new GLproperty(GL11.GL_POINT_SIZE, "GL_POINT_SIZE", "Point size", "point", "glGetFloatv()"),
- new GLproperty(GL11.GL_POINT_SMOOTH, "GL_POINT_SMOOTH", "Point antialiasing on", "point/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_LINE_WIDTH, "GL_LINE_WIDTH", "Line width", "line", "glGetFloatv()"),
- new GLproperty(GL11.GL_LINE_SMOOTH, "GL_LINE_SMOOTH", "Line antialiasing on", "line/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_LINE_STIPPLE_PATTERN, "GL_LINE_STIPPLE_PATTERN", "Line stipple", "line",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_LINE_STIPPLE_REPEAT, "GL_LINE_STIPPLE_REPEAT", "Line stipple repeat", "line",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_LINE_STIPPLE, "GL_LINE_STIPPLE", "Line stipple enable", "line/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_CULL_FACE, "GL_CULL_FACE", "Polygon culling enabled", "polygon/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_CULL_FACE_MODE, "GL_CULL_FACE_MODE", "Cull front-/back-facing polygons",
- "polygon", "glGetIntegerv()"),
- new GLproperty(GL11.GL_FRONT_FACE, "GL_FRONT_FACE", "Polygon front-face CW/CCW indicator",
- "polygon", "glGetIntegerv()"),
- new GLproperty(GL11.GL_POLYGON_SMOOTH, "GL_POLYGON_SMOOTH", "Polygon antialiasing on",
- "polygon/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_POLYGON_MODE, "GL_POLYGON_MODE",
- "Polygon rasterization mode (front and back)", "polygon", "glGetIntegerv()"),
- new GLproperty(GL11.GL_POLYGON_OFFSET_FACTOR, "GL_POLYGON_OFFSET_FACTOR", "Polygon offset factor",
- "polygon", "glGetFloatv()"),
- new GLproperty(GL11.GL_POLYGON_OFFSET_POINT, "GL_POLYGON_OFFSET_POINT",
- "Polygon offset enable for GL_POINT mode rasterization", "polygon/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_POLYGON_OFFSET_LINE, "GL_POLYGON_OFFSET_LINE",
- "Polygon offset enable for GL_LINE mode rasterization", "polygon/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_POLYGON_OFFSET_FILL, "GL_POLYGON_OFFSET_FILL",
- "Polygon offset enable for GL_FILL mode rasterization", "polygon/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_POLYGON_STIPPLE, "GL_POLYGON_STIPPLE", "Polygon stipple enable",
- "polygon/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_1D, "GL_TEXTURE_1D", "True if 1-D texturing enabled ",
- "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_2D, "GL_TEXTURE_2D", "True if 2-D texturing enabled ",
- "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_BINDING_1D, "GL_TEXTURE_BINDING_1D",
- "Texture object bound to GL_TEXTURE_1D", "texture", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE_BINDING_2D, "GL_TEXTURE_BINDING_2D",
- "Texture object bound to GL_TEXTURE_2D", "texture", "glGetIntegerv()"),
- new GLproperty(GL11.GL_TEXTURE, "GL_TEXTURE", "x-D texture image at level of detail i", "UNUSED",
- "glGetTexImage()"),
- new GLproperty(GL11.GL_TEXTURE_WIDTH, "GL_TEXTURE_WIDTH", "x-D texture image i's width", "UNUSED",
- "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_HEIGHT, "GL_TEXTURE_HEIGHT", "x-D texture image i's height",
- "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_BORDER, "GL_TEXTURE_BORDER", "x-D texture image i's border width",
- "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_RED_SIZE, "GL_TEXTURE_RED_SIZE",
- "x-D texture image i's red resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_GREEN_SIZE, "GL_TEXTURE_GREEN_SIZE",
- "x-D texture image i's green resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_BLUE_SIZE, "GL_TEXTURE_BLUE_SIZE",
- "x-D texture image i's blue resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_ALPHA_SIZE, "GL_TEXTURE_ALPHA_SIZE",
- "x-D texture image i's alpha resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_LUMINANCE_SIZE, "GL_TEXTURE_LUMINANCE_SIZE",
- "x-D texture image i's luminance resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_INTENSITY_SIZE, "GL_TEXTURE_INTENSITY_SIZE",
- "x-D texture image i's intensity resolution", "UNUSED", "glGetTexLevelParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_BORDER_COLOR, "GL_TEXTURE_BORDER_COLOR", "Texture border color",
- "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_MIN_FILTER, "GL_TEXTURE_MIN_FILTER", "Texture minification function",
- "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_MAG_FILTER, "GL_TEXTURE_MAG_FILTER",
- "Texture magnification function", "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_WRAP_S, "GL_TEXTURE_WRAP_S", "Texture wrap mode (x is S or T)",
- "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_WRAP_T, "GL_TEXTURE_WRAP_T", "Texture wrap mode (x is S or T)",
- "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_PRIORITY, "GL_TEXTURE_PRIORITY", "Texture object priority",
- "texture", "glGetTexParameter*()"),
- new GLproperty(GL11.GL_TEXTURE_ENV_MODE, "GL_TEXTURE_ENV_MODE", "Texture application function",
- "texture", "glGetTexEnviv()"),
- new GLproperty(GL11.GL_TEXTURE_ENV_COLOR, "GL_TEXTURE_ENV_COLOR", "Texture environment color",
- "texture", "glGetTexEnvfv()"),
- new GLproperty(GL11.GL_TEXTURE_GEN_S, "GL_TEXTURE_GEN_S", "Texgen enabled (x is S, T, R, or Q)",
- "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_GEN_T, "GL_TEXTURE_GEN_T", "Texgen enabled (x is S, T, R, or Q)",
- "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_GEN_R, "GL_TEXTURE_GEN_R", "Texgen enabled (x is S, T, R, or Q)",
- "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_TEXTURE_GEN_Q, "GL_TEXTURE_GEN_Q", "Texgen enabled (x is S, T, R, or Q)",
- "texture/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_EYE_PLANE, "GL_EYE_PLANE", "Texgen plane equation coefficients", "texture",
- "glGetTexGenfv()"),
- new GLproperty(GL11.GL_OBJECT_PLANE, "GL_OBJECT_PLANE", "Texgen object linear coefficients",
- "texture", "glGetTexGenfv()"),
- new GLproperty(GL11.GL_TEXTURE_GEN_MODE, "GL_TEXTURE_GEN_MODE", "Function used for texgen",
- "texture", "glGetTexGeniv()"),
- new GLproperty(GL11.GL_SCISSOR_TEST, "GL_SCISSOR_TEST", "Scissoring enabled", "scissor/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_SCISSOR_BOX, "GL_SCISSOR_BOX", "Scissor box", "scissor", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ALPHA_TEST, "GL_ALPHA_TEST", "Alpha test enabled", "color-buffer/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_ALPHA_TEST_FUNC, "GL_ALPHA_TEST_FUNC", "Alpha test function", "color-buffer",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_ALPHA_TEST_REF, "GL_ALPHA_TEST_REF", "Alpha test reference value",
- "color-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_TEST, "GL_STENCIL_TEST", "Stenciling enabled",
- "stencil-buffer/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_STENCIL_FUNC, "GL_STENCIL_FUNC", "Stencil function", "stencil-buffer",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_VALUE_MASK, "GL_STENCIL_VALUE_MASK", "Stencil mask",
- "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_REF, "GL_STENCIL_REF", "Stencil reference value", "stencil-buffer",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_FAIL, "GL_STENCIL_FAIL", "Stencil fail action", "stencil-buffer",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_PASS_DEPTH_FAIL, "GL_STENCIL_PASS_DEPTH_FAIL",
- "Stencil depth buffer fail action", "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_PASS_DEPTH_PASS, "GL_STENCIL_PASS_DEPTH_PASS",
- "Stencil depth buffer pass action", "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_DEPTH_TEST, "GL_DEPTH_TEST", "Depth buffer enabled", "depth-buffer/ena ble",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_DEPTH_FUNC, "GL_DEPTH_FUNC", "Depth buffer test function", "depth-buffer",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_BLEND, "GL_BLEND", "Blending enabled", "color-buffer/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_BLEND_SRC, "GL_BLEND_SRC", "Blending source function", "color-buffer",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_BLEND_DST, "GL_BLEND_DST", "Blending destination function", "color-buffer",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_DITHER, "GL_DITHER", "Dithering enabled", "color-buffer/enable",
- "glIsEnabled()"),
- new GLproperty(GL11.GL_INDEX_LOGIC_OP, "GL_INDEX_LOGIC_OP", "Color index logical operation enabled",
- "color-buffer/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_COLOR_LOGIC_OP, "GL_COLOR_LOGIC_OP", "RGBA color logical operation enabled",
- "color-buffer/enable", "glIsEnabled()"),
- new GLproperty(GL11.GL_LOGIC_OP_MODE, "GL_LOGIC_OP_MODE", "Logical operation function",
- "color-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_DRAW_BUFFER, "GL_DRAW_BUFFER", "Buffers selected for drawing",
- "color-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_INDEX_WRITEMASK, "GL_INDEX_WRITEMASK", "Color-index writemask",
- "color-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_WRITEMASK, "GL_COLOR_WRITEMASK", "Color write enables; R, G, B, or A",
- "color-buffer", "glGetBooleanv()"),
- new GLproperty(GL11.GL_DEPTH_WRITEMASK, "GL_DEPTH_WRITEMASK", "Depth buffer enabled for writing",
- "depth-buffer", "glGetBooleanv()"),
- new GLproperty(GL11.GL_STENCIL_WRITEMASK, "GL_STENCIL_WRITEMASK", "Stencil-buffer writemask",
- "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_COLOR_CLEAR_VALUE, "GL_COLOR_CLEAR_VALUE",
- "Color-buffer clear value (RGBA mode)", "color-buffer", "glGetFloatv()"),
- new GLproperty(GL11.GL_INDEX_CLEAR_VALUE, "GL_INDEX_CLEAR_VALUE",
- "Color-buffer clear value (color-index mode)", "color-buffer", "glGetFloatv()"),
- new GLproperty(GL11.GL_DEPTH_CLEAR_VALUE, "GL_DEPTH_CLEAR_VALUE", "Depth-buffer clear value",
- "depth-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_CLEAR_VALUE, "GL_STENCIL_CLEAR_VALUE", "Stencil-buffer clear value",
- "stencil-buffer", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ACCUM_CLEAR_VALUE, "GL_ACCUM_CLEAR_VALUE", "Accumulation-buffer clear value",
- "accum-buffer", "glGetFloatv()"),
- new GLproperty(GL11.GL_UNPACK_SWAP_BYTES, "GL_UNPACK_SWAP_BYTES", "Value of GL_UNPACK_SWAP_BYTES",
- "pixel-store", "glGetBooleanv()"),
- new GLproperty(GL11.GL_UNPACK_LSB_FIRST, "GL_UNPACK_LSB_FIRST", "Value of GL_UNPACK_LSB_FIRST",
- "pixel-store", "glGetBooleanv()"),
- new GLproperty(GL11.GL_UNPACK_ROW_LENGTH, "GL_UNPACK_ROW_LENGTH", "Value of GL_UNPACK_ROW_LENGTH",
- "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_UNPACK_SKIP_ROWS, "GL_UNPACK_SKIP_ROWS", "Value of GL_UNPACK_SKIP_ROWS",
- "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_UNPACK_SKIP_PIXELS, "GL_UNPACK_SKIP_PIXELS",
- "Value of GL_UNPACK_SKIP_PIXELS", "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_UNPACK_ALIGNMENT, "GL_UNPACK_ALIGNMENT", "Value of GL_UNPACK_ALIGNMENT",
- "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_PACK_SWAP_BYTES, "GL_PACK_SWAP_BYTES", "Value of GL_PACK_SWAP_BYTES",
- "pixel-store", "glGetBooleanv()"),
- new GLproperty(GL11.GL_PACK_LSB_FIRST, "GL_PACK_LSB_FIRST", "Value of GL_PACK_LSB_FIRST",
- "pixel-store", "glGetBooleanv()"),
- new GLproperty(GL11.GL_PACK_ROW_LENGTH, "GL_PACK_ROW_LENGTH", "Value of GL_PACK_ROW_LENGTH",
- "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_PACK_SKIP_ROWS, "GL_PACK_SKIP_ROWS", "Value of GL_PACK_SKIP_ROWS",
- "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_PACK_SKIP_PIXELS, "GL_PACK_SKIP_PIXELS", "Value of GL_PACK_SKIP_PIXELS",
- "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_PACK_ALIGNMENT, "GL_PACK_ALIGNMENT", "Value of GL_PACK_ALIGNMENT",
- "pixel-store", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAP_COLOR, "GL_MAP_COLOR", "True if colors are mapped", "pixel",
- "glGetBooleanv()"),
- new GLproperty(GL11.GL_MAP_STENCIL, "GL_MAP_STENCIL", "True if stencil values are mapped", "pixel",
- "glGetBooleanv()"),
- new GLproperty(GL11.GL_INDEX_SHIFT, "GL_INDEX_SHIFT", "Value of GL_INDEX_SHIFT", "pixel",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_INDEX_OFFSET, "GL_INDEX_OFFSET", "Value of GL_INDEX_OFFSET", "pixel",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_ZOOM_X, "GL_ZOOM_X", "x zoom factor", "pixel", "glGetFloatv()"),
- new GLproperty(GL11.GL_ZOOM_Y, "GL_ZOOM_Y", "y zoom factor", "pixel", "glGetFloatv()"),
- new GLproperty(GL11.GL_READ_BUFFER, "GL_READ_BUFFER", "Read source buffer", "pixel",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_ORDER, "GL_ORDER", "1D map order", "capability", "glGetMapiv()"),
- new GLproperty(GL11.GL_ORDER, "GL_ORDER", "2D map orders", "capability", "glGetMapiv()"),
- new GLproperty(GL11.GL_COEFF, "GL_COEFF", "1D control points", "capability", "glGetMapfv()"),
- new GLproperty(GL11.GL_COEFF, "GL_COEFF", "2D control points", "capability", "glGetMapfv()"),
- new GLproperty(GL11.GL_DOMAIN, "GL_DOMAIN", "1D domain endpoints", "capability", "glGetMapfv()"),
- new GLproperty(GL11.GL_DOMAIN, "GL_DOMAIN", "2D domain endpoints", "capability", "glGetMapfv()"),
- new GLproperty(GL11.GL_MAP1_GRID_DOMAIN, "GL_MAP1_GRID_DOMAIN", "1D grid endpoints", "eval",
- "glGetFloatv()"),
- new GLproperty(GL11.GL_MAP2_GRID_DOMAIN, "GL_MAP2_GRID_DOMAIN", "2D grid endpoints", "eval",
- "glGetFloatv()"),
- new GLproperty(GL11.GL_MAP1_GRID_SEGMENTS, "GL_MAP1_GRID_SEGMENTS", "1D grid divisions", "eval",
- "glGetFloatv()"),
- new GLproperty(GL11.GL_MAP2_GRID_SEGMENTS, "GL_MAP2_GRID_SEGMENTS", "2D grid divisions", "eval",
- "glGetFloatv()"),
- new GLproperty(GL11.GL_AUTO_NORMAL, "GL_AUTO_NORMAL", "True if automatic normal generation enabled",
- "eval", "glIsEnabled()"),
- new GLproperty(GL11.GL_PERSPECTIVE_CORRECTION_HINT, "GL_PERSPECTIVE_CORRECTION_HINT",
- "Perspective correction hint", "hint", "glGetIntegerv()"),
- new GLproperty(GL11.GL_POINT_SMOOTH_HINT, "GL_POINT_SMOOTH_HINT", "Point smooth hint", "hint",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_LINE_SMOOTH_HINT, "GL_LINE_SMOOTH_HINT", "Line smooth hint", "hint",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_POLYGON_SMOOTH_HINT, "GL_POLYGON_SMOOTH_HINT", "Polygon smooth hint", "hint",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_FOG_HINT, "GL_FOG_HINT", "Fog hint", "hint", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_LIGHTS, "GL_MAX_LIGHTS", "Maximum number of lights", "capability",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_CLIP_PLANES, "GL_MAX_CLIP_PLANES",
- "Maximum number of user clipping planes", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_MODELVIEW_STACK_DEPTH, "GL_MAX_MODELVIEW_STACK_DEPTH",
- "Maximum modelview-matrix stack depth", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_PROJECTION_STACK_DEPTH, "GL_MAX_PROJECTION_STACK_DEPTH",
- "Maximum projection-matrix stack depth", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_TEXTURE_STACK_DEPTH, "GL_MAX_TEXTURE_STACK_DEPTH",
- "Maximum depth of texture matrix stack", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_SUBPIXEL_BITS, "GL_SUBPIXEL_BITS",
- "Number of bits of subpixel precision in x and y", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_TEXTURE_SIZE, "GL_MAX_TEXTURE_SIZE",
- "See discussion in Texture Proxy in Chapter 9", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_PIXEL_MAP_TABLE, "GL_MAX_PIXEL_MAP_TABLE",
- "Maximum size of a glPixelMap() translation table", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_NAME_STACK_DEPTH, "GL_MAX_NAME_STACK_DEPTH",
- "Maximum selection-name stack depth", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_LIST_NESTING, "GL_MAX_LIST_NESTING", "Maximum display-list call nesting",
- "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_EVAL_ORDER, "GL_MAX_EVAL_ORDER", "Maximum evaluator polynomial order",
- "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_VIEWPORT_DIMS, "GL_MAX_VIEWPORT_DIMS", "Maximum viewport dimensions",
- "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_ATTRIB_STACK_DEPTH, "GL_MAX_ATTRIB_STACK_DEPTH",
- "Maximum depth of the attribute stack", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH",
- "Maximum depth of the client attribute stack", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_AUX_BUFFERS, "GL_AUX_BUFFERS", "Number of auxiliary buffers", "capability",
- "glGetBooleanv()"),
- new GLproperty(GL11.GL_RGBA_MODE, "GL_RGBA_MODE", "True if color buffers store RGBA", "capability",
- "glGetBooleanv()"),
- new GLproperty(GL11.GL_INDEX_MODE, "GL_INDEX_MODE", "True if color buffers store indices",
- "capability", "glGetBooleanv()"),
- new GLproperty(GL11.GL_DOUBLEBUFFER, "GL_DOUBLEBUFFER", "True if front and back buffers exist",
- "capability", "glGetBooleanv()"),
- new GLproperty(GL11.GL_STEREO, "GL_STEREO", "True if left and right buffers exist", "capability",
- "glGetBooleanv()"),
- new GLproperty(GL11.GL_POINT_SIZE_RANGE, "GL_POINT_SIZE_RANGE",
- "Range (low to high) of antialiased point sizes", "capability", "glGetFloatv()"),
- new GLproperty(GL11.GL_POINT_SIZE_GRANULARITY, "GL_POINT_SIZE_GRANULARITY",
- "Antialiased point-size granularity", "capability", "glGetFloatv()"),
- new GLproperty(GL11.GL_LINE_WIDTH_RANGE, "GL_LINE_WIDTH_RANGE",
- "Range (low to high) of antialiased line widths", "capability", "glGetFloatv()"),
- new GLproperty(GL11.GL_LINE_WIDTH_GRANULARITY, "GL_LINE_WIDTH_GRANULARITY",
- "Antialiased line-width granularity", "capability", "glGetFloatv()"),
- new GLproperty(GL11.GL_RED_BITS, "GL_RED_BITS", "Number of bits per red component in color buffers",
- "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_GREEN_BITS, "GL_GREEN_BITS",
- "Number of bits per green component in color buffers", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_BLUE_BITS, "GL_BLUE_BITS",
- "Number of bits per blue component in color buffers", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ALPHA_BITS, "GL_ALPHA_BITS",
- "Number of bits per alpha component in color buffers", "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_INDEX_BITS, "GL_INDEX_BITS", "Number of bits per index in color buffers",
- "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_DEPTH_BITS, "GL_DEPTH_BITS", "Number of depth-buffer bitplanes",
- "capability", "glGetIntegerv()"),
- new GLproperty(GL11.GL_STENCIL_BITS, "GL_STENCIL_BITS", "Number of stencil bitplanes", "capability",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_ACCUM_RED_BITS, "GL_ACCUM_RED_BITS",
- "Number of bits per red component in the accumulation buffer", "capability",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_ACCUM_GREEN_BITS, "GL_ACCUM_GREEN_BITS",
- "Number of bits per green component in the accumulation buffer", "capability",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_ACCUM_BLUE_BITS, "GL_ACCUM_BLUE_BITS",
- "Number of bits per blue component in the accumulation buffer", "capability",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_ACCUM_ALPHA_BITS, "GL_ACCUM_ALPHA_BITS",
- "Number of bits per alpha component in the accumulation buffer", "capability",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_LIST_BASE, "GL_LIST_BASE", "Setting of glListBase()", "list",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_LIST_INDEX, "GL_LIST_INDEX",
- "Number of display list under construction; 0 if none", "current", "glGetIntegerv()"),
- new GLproperty(GL11.GL_LIST_MODE, "GL_LIST_MODE",
- "Mode of display list under construction; undefined if none", "current", "glGetIntegerv()"),
- new GLproperty(GL11.GL_ATTRIB_STACK_DEPTH, "GL_ATTRIB_STACK_DEPTH", "Attribute stack pointer",
- "current", "glGetIntegerv()"),
- new GLproperty(GL11.GL_CLIENT_ATTRIB_STACK_DEPTH, "GL_CLIENT_ATTRIB_STACK_DEPTH",
- "Client attribute stack pointer", "current", "glGetIntegerv()"),
- new GLproperty(GL11.GL_NAME_STACK_DEPTH, "GL_NAME_STACK_DEPTH", "Name stack depth", "current",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_RENDER_MODE, "GL_RENDER_MODE", "glRenderMode() setting", "current",
- "glGetIntegerv()"),
- new GLproperty(GL11.GL_SELECTION_BUFFER_POINTER, "GL_SELECTION_BUFFER_POINTER",
- "Pointer to selection buffer", "select", "glGetPointerv()"),
- new GLproperty(GL11.GL_SELECTION_BUFFER_SIZE, "GL_SELECTION_BUFFER_SIZE",
- "Size of selection buffer", "select", "glGetIntegerv()"),
- new GLproperty(GL11.GL_FEEDBACK_BUFFER_POINTER, "GL_FEEDBACK_BUFFER_POINTER",
- "Pointer to feedback buffer", "feedback", "glGetPointerv()"),
- new GLproperty(GL11.GL_FEEDBACK_BUFFER_SIZE, "GL_FEEDBACK_BUFFER_SIZE", "Size of feedback buffer",
- "feedback", "glGetIntegerv()"),
- new GLproperty(GL11.GL_FEEDBACK_BUFFER_TYPE, "GL_FEEDBACK_BUFFER_TYPE", "Type of feedback buffer",
- "feedback", "glGetIntegerv()"),
- };
+ return "";
+ }
}
+
diff --git a/src/Java/gtPlusPlus/core/util/entity/EntityUtils.java b/src/Java/gtPlusPlus/core/util/entity/EntityUtils.java
index a571f1d76d..21d31a42ee 100644
--- a/src/Java/gtPlusPlus/core/util/entity/EntityUtils.java
+++ b/src/Java/gtPlusPlus/core/util/entity/EntityUtils.java
@@ -1,76 +1,68 @@
package gtPlusPlus.core.util.entity;
-import cpw.mods.fml.common.registry.EntityRegistry;
import ic2.core.IC2Potion;
import ic2.core.item.armor.ItemArmorHazmat;
+import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraft.block.Block;
-import net.minecraft.entity.*;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.EnumCreatureType;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
public class EntityUtils {
- public static boolean applyRadiationDamageToEntity(final int damage, final World world,
- final Entity entityHolding) {
- if (!world.isRemote) {
- if (damage > 0 && entityHolding instanceof EntityLivingBase) {
- final EntityLivingBase entityLiving = (EntityLivingBase) entityHolding;
- if (!ItemArmorHazmat.hasCompleteHazmat(entityLiving)) {
- int duration;
- if (entityLiving.getActivePotionEffect(IC2Potion.radiation) != null) {
- // Utils.LOG_INFO("t");
- duration = damage * 5 + entityLiving.getActivePotionEffect(IC2Potion.radiation).getDuration();
- }
- else {
- // Utils.LOG_INFO("f");
- duration = damage * 30;
- }
- IC2Potion.radiation.applyTo(entityLiving, duration, damage * 15);
- }
- }
- return true;
- }
- return false;
+ public static void setEntityOnFire(Entity entity, int length){
+ entity.setFire(length);
}
- public static Block findBlockUnderEntity(final Entity parEntity) {
- final int blockX = MathHelper.floor_double(parEntity.posX);
- final int blockY = MathHelper.floor_double(parEntity.boundingBox.minY) - 1;
- final int blockZ = MathHelper.floor_double(parEntity.posZ);
- return parEntity.worldObj.getBlock(blockX, blockY, blockZ);
+ public static int getFacingDirection(Entity entity){
+ int d = MathHelper.floor_double((double) (entity.rotationYaw * 4.0F / 360) + 0.50) & 3;
+ return d;
}
@Deprecated
- public static Block findBlockUnderEntityNonBoundingBox(final Entity parEntity) {
- final int blockX = MathHelper.floor_double(parEntity.posX);
- final int blockY = MathHelper.floor_double(parEntity.posY - 0.2D - parEntity.yOffset);
- final int blockZ = MathHelper.floor_double(parEntity.posZ);
+ public static Block findBlockUnderEntityNonBoundingBox(Entity parEntity){
+ int blockX = MathHelper.floor_double(parEntity.posX);
+ int blockY = MathHelper.floor_double(parEntity.posY-0.2D - (double)parEntity.yOffset);
+ int blockZ = MathHelper.floor_double(parEntity.posZ);
return parEntity.worldObj.getBlock(blockX, blockY, blockZ);
}
- public static int getFacingDirection(final Entity entity) {
- final int d = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360 + 0.50) & 3;
- return d;
+ public static Block findBlockUnderEntity(Entity parEntity){
+ int blockX = MathHelper.floor_double(parEntity.posX);
+ int blockY = MathHelper.floor_double(parEntity.boundingBox.minY)-1;
+ int blockZ = MathHelper.floor_double(parEntity.posZ);
+ return parEntity.worldObj.getBlock(blockX, blockY, blockZ);
}
- // TODO
- public static void registerEntityToBiomeSpawns(final Class<EntityLiving> classy, final EnumCreatureType EntityType,
- final BiomeGenBase baseBiomeGen) {
- EntityRegistry.addSpawn(classy, 6, 1, 5, EntityType, baseBiomeGen); // change
- // the
- // values
- // to
- // vary
- // the
- // spawn
- // rarity,
- // biome,
- // etc.
+ //TODO
+ public static void registerEntityToBiomeSpawns(Class<EntityLiving> classy, EnumCreatureType EntityType, BiomeGenBase baseBiomeGen){
+ EntityRegistry.addSpawn(classy, 6, 1, 5, EntityType, baseBiomeGen); //change the values to vary the spawn rarity, biome, etc.
}
- public static void setEntityOnFire(final Entity entity, final int length) {
- entity.setFire(length);
+ public static boolean applyRadiationDamageToEntity(int damage, World world, Entity entityHolding){
+ if (!world.isRemote){
+ if (damage > 0 && (entityHolding instanceof EntityLivingBase)) {
+ EntityLivingBase entityLiving = (EntityLivingBase) entityHolding;
+ if (!ItemArmorHazmat.hasCompleteHazmat(entityLiving)) {
+ int duration;
+ if (entityLiving.getActivePotionEffect(IC2Potion.radiation) != null){
+ //Utils.LOG_INFO("t");
+ duration = (damage*5)+entityLiving.getActivePotionEffect(IC2Potion.radiation).getDuration();
+ }
+ else {
+ //Utils.LOG_INFO("f");
+ duration = damage*30;
+ }
+ IC2Potion.radiation.applyTo(entityLiving, duration, damage * 15);
+ }
+ }
+ return true;
+ }
+ return false;
}
}
diff --git a/src/Java/gtPlusPlus/core/util/fluid/FluidGT6.java b/src/Java/gtPlusPlus/core/util/fluid/FluidGT6.java
index dd1cdfe6ea..5674082c4a 100644
--- a/src/Java/gtPlusPlus/core/util/fluid/FluidGT6.java
+++ b/src/Java/gtPlusPlus/core/util/fluid/FluidGT6.java
@@ -4,27 +4,27 @@ import gregtech.api.GregTech_API;
import gtPlusPlus.core.lib.CORE;
import net.minecraftforge.fluids.Fluid;
-public class FluidGT6 extends Fluid implements Runnable {
- private final short[] mRGBa;
- public final String mTextureName;
-
- public FluidGT6(final String aName, final String aTextureName, final short[] aRGBa) {
- super(aName);
- this.mRGBa = aRGBa;
- this.mTextureName = aTextureName;
- if (GregTech_API.sGTBlockIconload != null) {
- GregTech_API.sGTBlockIconload.add(this);
- }
- }
-
- @Override
+public class FluidGT6 extends Fluid implements Runnable
+{
+ private final short[] mRGBa;
+ public final String mTextureName;
+
+ public FluidGT6(final String aName, final String aTextureName, final short[] aRGBa) {
+ super(aName);
+ this.mRGBa = aRGBa;
+ this.mTextureName = aTextureName;
+ if (GregTech_API.sGTBlockIconload != null) {
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+ }
+
+ @Override
public int getColor() {
- return Math.max(0, Math.min(255, this.mRGBa[0])) << 16 | Math.max(0, Math.min(255, this.mRGBa[1])) << 8
- | Math.max(0, Math.min(255, this.mRGBa[2]));
- }
-
- @Override
+ return Math.max(0, Math.min(255, this.mRGBa[0])) << 16 | Math.max(0, Math.min(255, this.mRGBa[1])) << 8 | Math.max(0, Math.min(255, this.mRGBa[2]));
+ }
+
+ @Override
public void run() {
- this.setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID + ":" + "fluids/fluid." + this.mTextureName));
- }
+ this.setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID+ ":" + "fluids/fluid." + mTextureName));
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java b/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java
index d104195082..83b0bfd65d 100644
--- a/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java
+++ b/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java
@@ -1,6 +1,8 @@
package gtPlusPlus.core.util.fluid;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
import gregtech.api.util.GT_LanguageManager;
import gtPlusPlus.core.fluids.GenericFluid;
import gtPlusPlus.core.material.Material;
@@ -8,375 +10,336 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.*;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidContainerItem;
public class FluidUtils {
- public static Fluid addAutogeneratedMoltenFluid(final GT_Materials aMaterial) {
- return FluidUtils.addFluid("molten." + aMaterial.name().toLowerCase(), "molten.autogenerated",
- "Molten " + aMaterial.name(), aMaterial, aMaterial.mMoltenRGBa, 1,
- aMaterial.mMeltingPoint <= 0L ? 1000L : aMaterial.mMeltingPoint, null, null, 0);
- }
+ public static FluidStack getFluidStack(String fluidName, int amount){
+ Utils.LOG_WARNING("Trying to get a fluid stack of "+fluidName);
+ try {
+ return FluidRegistry.getFluidStack(fluidName, amount).copy();
+ }
+ catch (Throwable e){
+ return null;
+ }
- public static Fluid addAutogeneratedMoltenFluid(final String materialNameFormatted, final short[] rgba,
- final int MeltingPoint) {
- return FluidUtils.addFluid("molten." + materialNameFormatted.toLowerCase(), "molten.autogenerated",
- "Molten " + materialNameFormatted, null, rgba, 1, MeltingPoint <= 0L ? 1000L : MeltingPoint, null, null,
- 0);
}
-
- public static Fluid addFluid(final String aName, final String aLocalized, final GT_Materials aMaterial,
- final int aState, final long aTemperatureK) {
- return FluidUtils.addFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, null, null, 0);
+
+ public static FluidStack getFluidStack(FluidStack vmoltenFluid, int fluidAmount) {
+ Utils.LOG_WARNING("Trying to get a fluid stack of "+vmoltenFluid.getFluid().getName());
+ try {
+ return FluidRegistry.getFluidStack(vmoltenFluid.getFluid().getName(), fluidAmount).copy();
+ }
+ catch (Throwable e){
+ return null;
+ }
}
- public static Fluid addFluid(final String aName, final String aLocalized, final GT_Materials aMaterial,
- final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer,
- final int aFluidAmount) {
- return FluidUtils.addFluid(aName, aName.toLowerCase(), aLocalized, aMaterial, null, aState, aTemperatureK,
- aFullContainer, aEmptyContainer, aFluidAmount);
+ public static FluidStack[] getFluidStackArray(String fluidName, int amount){
+ Utils.LOG_WARNING("Trying to get a fluid stack of "+fluidName);
+ try {
+ FluidStack[] singleFluid = {FluidRegistry.getFluidStack(fluidName, amount)};
+ return singleFluid;
+ }
+ catch (Throwable e){
+ return null;
+ }
+
}
- public static Fluid addFluid(String aName, final String aTexture, final String aLocalized,
- final GT_Materials aMaterial, final short[] aRGBa, final int aState, final long aTemperatureK,
- final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
- aName = Utils.sanitizeString(aName.toLowerCase());
- Fluid rFluid = new FluidGT6(aName, aTexture, aRGBa != null ? aRGBa : Dyes._NULL.getRGBA());
- GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), aLocalized == null ? aName : aLocalized);
- if (FluidRegistry.registerFluid(rFluid)) {
- switch (aState) {
- case 0: {
- rFluid.setGaseous(false);
- rFluid.setViscosity(10000);
- break;
- }
- case 1:
- case 4: {
- rFluid.setGaseous(false);
- rFluid.setViscosity(1000);
- break;
- }
- case 2: {
- rFluid.setGaseous(true);
- rFluid.setDensity(-100);
- rFluid.setViscosity(200);
- break;
- }
- case 3: {
- rFluid.setGaseous(true);
- rFluid.setDensity(-10000);
- rFluid.setViscosity(10);
- rFluid.setLuminosity(15);
- break;
- }
- }
- }
- else {
- rFluid = FluidRegistry.getFluid(aName);
- }
- if (rFluid.getTemperature() == new Fluid("test").getTemperature() || rFluid.getTemperature() <= 0) {
- rFluid.setTemperature((int) aTemperatureK);
- }
- if (aMaterial != null) {
- switch (aState) {
- case 1: {
- aMaterial.mFluid = rFluid;
- break;
- }
- case 2: {
- aMaterial.mGas = rFluid;
- break;
- }
- case 3: {
- aMaterial.mPlasma = rFluid;
- break;
- }
- }
- }
- if (aFullContainer != null && aEmptyContainer != null && !FluidContainerRegistry
- .registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer)) {
- GT_Values.RA.addFluidCannerRecipe(aFullContainer, FluidUtils.container(aFullContainer, false), null,
- new FluidStack(rFluid, aFluidAmount));
+ public static FluidStack[] getFluidStackArray(FluidStack fluidName, int amount){
+ Utils.LOG_WARNING("Trying to get a fluid stack of "+fluidName);
+ try {
+ FluidStack[] singleFluid = {FluidRegistry.getFluidStack(fluidName.getLocalizedName(), amount)};
+ return singleFluid;
+ }
+ catch (Throwable e){
+ return null;
}
- return rFluid;
- }
- public static Fluid addGTFluid(final String aName, final String aLocalized, final short[] aRGBa, final int aState,
- final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer,
- final int aFluidAmount) {
- return FluidUtils.addGTFluid("molten." + aName, "molten.autogenerated", aLocalized, aRGBa, aState,
- aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount);
}
-
- public static Fluid addGTFluid(String aName, final String aTexture, final String aLocalized, final short[] aRGBa,
- final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer,
- final int aFluidAmount) {
- aName = Utils.sanitizeString(aName.toLowerCase());
- Fluid rFluid = new FluidGT6(aName, aTexture, aRGBa != null ? aRGBa : Dyes._NULL.getRGBA());
- GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), aLocalized == null ? aName : aLocalized);
- if (FluidRegistry.registerFluid(rFluid)) {
- switch (aState) {
- case 0: {
- rFluid.setGaseous(false);
- rFluid.setViscosity(10000);
- break;
- }
- case 1:
- case 4: {
- rFluid.setGaseous(false);
- rFluid.setViscosity(1000);
- break;
- }
- case 2: {
- rFluid.setGaseous(true);
- rFluid.setDensity(-100);
- rFluid.setViscosity(200);
- break;
- }
- case 3: {
- rFluid.setGaseous(true);
- rFluid.setDensity(-10000);
- rFluid.setViscosity(10);
- rFluid.setLuminosity(15);
- break;
- }
- }
+
+
+ /**
+ * @param String displayName
+ * @param String fluidName
+ * @param int meltingPointC Temp
+ * @param short[] rgba
+ * @param byte state
+ * States: 0 (Solid), 1 (Fluid), 2(Gas), 3(Plasma) 4(Fuel I think? Don't use.)
+ *
+ * @return short[]
+ */
+ public static Fluid generateFluid(String displayName, String fluidName, int tempK, short[] rgba ,int aState){
+ Fluid generatedFluid = null;
+ switch (aState) {
+ case 0: {
+ generatedFluid = new GenericFluid(displayName, fluidName, 0, 100, tempK, 10000, false, rgba);
+ break;
}
- else {
- rFluid = FluidRegistry.getFluid(aName);
+ default:
+ case 1:
+ case 4: {
+ generatedFluid = new GenericFluid(displayName, fluidName, 0, 100, tempK, 1000, false, rgba);
+ break;
}
- if (rFluid.getTemperature() == new Fluid("test").getTemperature() || rFluid.getTemperature() <= 0) {
- rFluid.setTemperature((int) aTemperatureK);
+ case 2: {
+ generatedFluid = new GenericFluid(displayName, fluidName, 0, -100, tempK, 200, true, rgba);
+ break;
}
- if (aFullContainer != null && aEmptyContainer != null && !FluidContainerRegistry
- .registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer)) {
- GT_Values.RA.addFluidCannerRecipe(aFullContainer, FluidUtils.container(aFullContainer, false), null,
- new FluidStack(rFluid, aFluidAmount));
+ case 3: {
+ generatedFluid = new GenericFluid(displayName, fluidName, 15, -10000, tempK, 10, true, rgba);
+ break;
}
- return rFluid;
- }
-
- public static ItemStack amount(final long aAmount, final Object... aStacks) {
- final ItemStack rStack = FluidUtils.copy(aStacks);
- if (FluidUtils.invalid(rStack)) {
- return null;
}
- rStack.stackSize = (int) aAmount;
- return rStack;
+ return generatedFluid;
}
-
- public static ItemStack container(final ItemStack aStack, final boolean aCheckIFluidContainerItems) {
- if (FluidUtils.invalid(aStack)) {
- return null;
- }
- if (aStack.getItem().hasContainerItem(aStack)) {
- return aStack.getItem().getContainerItem(aStack);
- }
- if (FluidUtils.equal(aStack, ItemList.Cell_Empty.get(1), true)) {
- return null;
+ /**
+ *
+ * @param String fluidName
+ * @param int meltingPointC Temp
+ * @param short[] rgba
+ * @param byte state
+ * States: 0 (Solid), 1 (Fluid), 2(Gas), 3(Plasma) 4(Fuel I think? Don't use.)
+ *
+ * @return short[]
+ */
+ public static Fluid generateFluid(Material material ,int aState){
+ int tempK = material.getMeltingPointC();
+ Fluid generatedFluid = null;
+ switch (aState) {
+ case 0: {
+ generatedFluid = new GenericFluid(material, 0, 100, tempK, 10000, false);
+ break;
}
- if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem
- && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) {
- final ItemStack tStack = FluidUtils.amount(1L, aStack);
- ((IFluidContainerItem) aStack.getItem()).drain(tStack, Integer.MAX_VALUE, true);
- if (!FluidUtils.equal(aStack, tStack)) {
- return tStack;
- }
- return null;
+ default:
+ case 1:
+ case 4: {
+ generatedFluid = new GenericFluid(material, 0, 100, tempK, 1000, false);
+ break;
}
- if (FluidUtils.equal(aStack, ItemList.IC2_ForgeHammer.get(1))
- || FluidUtils.equal(aStack, ItemList.IC2_WireCutter.get(1))) {
- return FluidUtils.copyMeta(FluidUtils.meta(aStack) + 1, aStack);
+ case 2: {
+ generatedFluid = new GenericFluid(material, 0, -100, tempK, 200, true);
+ break;
}
- return null;
- }
-
- public static ItemStack container(final ItemStack aStack, final boolean aCheckIFluidContainerItems,
- final int aStacksize) {
- return FluidUtils.amount(aStacksize, FluidUtils.container(aStack, aCheckIFluidContainerItems));
- }
-
- public static ItemStack copy(final Object... aStacks) {
- for (final Object tStack : aStacks) {
- if (FluidUtils.valid(tStack)) {
- return ((ItemStack) tStack).copy();
- }
+ case 3: {
+ generatedFluid = new GenericFluid(material, 15, -10000, tempK, 10, true);
+ break;
}
- return null;
- }
-
- public static ItemStack copyMeta(final long aMetaData, final Object... aStacks) {
- final ItemStack rStack = FluidUtils.copy(aStacks);
- if (FluidUtils.invalid(rStack)) {
- return null;
}
- return FluidUtils.meta(rStack, aMetaData);
+ return generatedFluid;
}
+
- public static boolean equal(final ItemStack aStack1, final ItemStack aStack2) {
- return FluidUtils.equal(aStack1, aStack2, false);
+ public static Fluid addAutogeneratedMoltenFluid(String materialNameFormatted, short[] rgba, int MeltingPoint) {
+ return addFluid("molten." + materialNameFormatted.toLowerCase(), "molten.autogenerated", "Molten " + materialNameFormatted, null, rgba, 1, (MeltingPoint <= 0L) ? 1000L : MeltingPoint, null, null, 0);
+ }
+
+ public static Fluid addAutogeneratedMoltenFluid(final GT_Materials aMaterial) {
+ return addFluid("molten." + aMaterial.name().toLowerCase(), "molten.autogenerated", "Molten " + aMaterial.name(), aMaterial, aMaterial.mMoltenRGBa, 1, (aMaterial.mMeltingPoint <= 0L) ? 1000L : aMaterial.mMeltingPoint, null, null, 0);
}
- public static boolean equal(final ItemStack aStack1, final ItemStack aStack2, final boolean aIgnoreNBT) {
- return aStack1 != null && aStack2 != null && FluidUtils.equal_(aStack1, aStack2, aIgnoreNBT);
+ public static Fluid addFluid(final String aName, final String aLocalized, final GT_Materials aMaterial, final int aState, final long aTemperatureK) {
+ return addFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, null, null, 0);
}
- public static boolean equal_(final ItemStack aStack1, final ItemStack aStack2, final boolean aIgnoreNBT) {
- return aStack1.getItem() == aStack2.getItem()
- && (aIgnoreNBT || aStack1.getTagCompound() == null == (aStack2.getTagCompound() == null)
- && (aStack1.getTagCompound() == null
- || aStack1.getTagCompound().equals(aStack2.getTagCompound())))
- && (FluidUtils.meta(aStack1) == FluidUtils.meta(aStack2) || FluidUtils.meta(aStack1) == 32767
- || FluidUtils.meta(aStack2) == 32767);
+ public static Fluid addFluid(final String aName, final String aLocalized, final GT_Materials aMaterial, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
+ return addFluid(aName, aName.toLowerCase(), aLocalized, aMaterial, null, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount);
}
- /**
- *
- * @param String
- * fluidName
- * @param int
- * meltingPointC Temp
- * @param short[]
- * rgba
- * @param byte
- * state States: 0 (Solid), 1 (Fluid), 2(Gas), 3(Plasma) 4(Fuel I
- * think? Don't use.)
- *
- * @return short[]
- */
- public static Fluid generateFluid(final Material material, final int aState) {
- final int tempK = material.getMeltingPointC();
- Fluid generatedFluid = null;
- switch (aState) {
+ public static Fluid addFluid(String aName, final String aTexture, final String aLocalized, final GT_Materials aMaterial, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
+ aName = Utils.sanitizeString(aName.toLowerCase());
+ Fluid rFluid = new FluidGT6(aName, aTexture, (aRGBa != null) ? aRGBa : Dyes._NULL.getRGBA());
+ GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), (aLocalized == null) ? aName : aLocalized);
+ if (FluidRegistry.registerFluid(rFluid)) {
+ switch (aState) {
case 0: {
- generatedFluid = new GenericFluid(material, 0, 100, tempK, 10000, false);
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(10000);
break;
}
- default:
case 1:
case 4: {
- generatedFluid = new GenericFluid(material, 0, 100, tempK, 1000, false);
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(1000);
break;
}
case 2: {
- generatedFluid = new GenericFluid(material, 0, -100, tempK, 200, true);
+ rFluid.setGaseous(true);
+ rFluid.setDensity(-100);
+ rFluid.setViscosity(200);
break;
}
case 3: {
- generatedFluid = new GenericFluid(material, 15, -10000, tempK, 10, true);
+ rFluid.setGaseous(true);
+ rFluid.setDensity(-10000);
+ rFluid.setViscosity(10);
+ rFluid.setLuminosity(15);
break;
}
+ }
}
- return generatedFluid;
+ else {
+ rFluid = FluidRegistry.getFluid(aName);
+ }
+ if (rFluid.getTemperature() == new Fluid("test").getTemperature() || rFluid.getTemperature() <= 0) {
+ rFluid.setTemperature((int) (aTemperatureK));
+ }
+ if (aMaterial != null) {
+ switch (aState) {
+ case 1: {
+ aMaterial.mFluid = (rFluid);
+ break;
+ }
+ case 2: {
+ aMaterial.mGas = (rFluid);
+ break;
+ }
+ case 3: {
+ aMaterial.mPlasma = (rFluid);
+ break;
+ }
+ }
+ }
+ if (aFullContainer != null && aEmptyContainer != null && !FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer)) {
+ GT_Values.RA.addFluidCannerRecipe(aFullContainer, container(aFullContainer, false), null, new FluidStack(rFluid, aFluidAmount));
+ }
+ return rFluid;
}
-
- /**
- * @param String
- * displayName
- * @param String
- * fluidName
- * @param int
- * meltingPointC Temp
- * @param short[]
- * rgba
- * @param byte
- * state States: 0 (Solid), 1 (Fluid), 2(Gas), 3(Plasma) 4(Fuel I
- * think? Don't use.)
- *
- * @return short[]
- */
- public static Fluid generateFluid(final String displayName, final String fluidName, final int tempK,
- final short[] rgba, final int aState) {
- Fluid generatedFluid = null;
- switch (aState) {
+
+ public static Fluid addGTFluid(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
+ return addGTFluid("molten."+aName, "molten.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount);
+ }
+
+ public static Fluid addGTFluid(String aName, final String aTexture, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount) {
+ aName = Utils.sanitizeString(aName.toLowerCase());
+ Fluid rFluid = new FluidGT6(aName, aTexture, (aRGBa != null) ? aRGBa : Dyes._NULL.getRGBA());
+ GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), (aLocalized == null) ? aName : aLocalized);
+ if (FluidRegistry.registerFluid(rFluid)) {
+ switch (aState) {
case 0: {
- generatedFluid = new GenericFluid(displayName, fluidName, 0, 100, tempK, 10000, false, rgba);
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(10000);
break;
}
- default:
case 1:
case 4: {
- generatedFluid = new GenericFluid(displayName, fluidName, 0, 100, tempK, 1000, false, rgba);
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(1000);
break;
}
case 2: {
- generatedFluid = new GenericFluid(displayName, fluidName, 0, -100, tempK, 200, true, rgba);
+ rFluid.setGaseous(true);
+ rFluid.setDensity(-100);
+ rFluid.setViscosity(200);
break;
}
case 3: {
- generatedFluid = new GenericFluid(displayName, fluidName, 15, -10000, tempK, 10, true, rgba);
+ rFluid.setGaseous(true);
+ rFluid.setDensity(-10000);
+ rFluid.setViscosity(10);
+ rFluid.setLuminosity(15);
break;
}
+ }
}
- return generatedFluid;
- }
-
- public static FluidStack getFluidStack(final FluidStack vmoltenFluid, final int fluidAmount) {
- Utils.LOG_WARNING("Trying to get a fluid stack of " + vmoltenFluid.getFluid().getName());
- try {
- return FluidRegistry.getFluidStack(vmoltenFluid.getFluid().getName(), fluidAmount).copy();
+ else {
+ rFluid = FluidRegistry.getFluid(aName);
}
- catch (final Throwable e) {
- return null;
+ if (rFluid.getTemperature() == new Fluid("test").getTemperature() || rFluid.getTemperature() <= 0) {
+ rFluid.setTemperature((int) (aTemperatureK));
+ }
+ if (aFullContainer != null && aEmptyContainer != null && !FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer)) {
+ GT_Values.RA.addFluidCannerRecipe(aFullContainer, container(aFullContainer, false), null, new FluidStack(rFluid, aFluidAmount));
}
+ return rFluid;
}
- public static FluidStack getFluidStack(final String fluidName, final int amount) {
- Utils.LOG_WARNING("Trying to get a fluid stack of " + fluidName);
- try {
- return FluidRegistry.getFluidStack(fluidName, amount).copy();
- }
- catch (final Throwable e) {
- return null;
- }
+ public static boolean valid(final Object aStack) {
+ return aStack != null && aStack instanceof ItemStack && ((ItemStack)aStack).getItem() != null && ((ItemStack)aStack).stackSize >= 0;
+ }
+ public static boolean invalid(final Object aStack) {
+ return aStack == null || !(aStack instanceof ItemStack) || ((ItemStack)aStack).getItem() == null || ((ItemStack)aStack).stackSize < 0;
}
- public static FluidStack[] getFluidStackArray(final FluidStack fluidName, final int amount) {
- Utils.LOG_WARNING("Trying to get a fluid stack of " + fluidName);
- try {
- final FluidStack[] singleFluid = {
- FluidRegistry.getFluidStack(fluidName.getLocalizedName(), amount)
- };
- return singleFluid;
- }
- catch (final Throwable e) {
- return null;
- }
+ public static boolean equal(final ItemStack aStack1, final ItemStack aStack2) {
+ return equal(aStack1, aStack2, false);
+ }
+ public static boolean equal(final ItemStack aStack1, final ItemStack aStack2, final boolean aIgnoreNBT) {
+ return aStack1 != null && aStack2 != null && equal_(aStack1, aStack2, aIgnoreNBT);
}
- public static FluidStack[] getFluidStackArray(final String fluidName, final int amount) {
- Utils.LOG_WARNING("Trying to get a fluid stack of " + fluidName);
- try {
- final FluidStack[] singleFluid = {
- FluidRegistry.getFluidStack(fluidName, amount)
- };
- return singleFluid;
- }
- catch (final Throwable e) {
- return null;
- }
+ public static boolean equal_(final ItemStack aStack1, final ItemStack aStack2, final boolean aIgnoreNBT) {
+ return aStack1.getItem() == aStack2.getItem() && (aIgnoreNBT || (aStack1.getTagCompound() == null == (aStack2.getTagCompound() == null) && (aStack1.getTagCompound() == null || aStack1.getTagCompound().equals((Object)aStack2.getTagCompound())))) && (meta(aStack1) == meta(aStack2) || meta(aStack1) == 32767 || meta(aStack2) == 32767);
+ }
+ public static ItemStack copy(final Object... aStacks) {
+ for (final Object tStack : aStacks) {
+ if (valid(tStack)) {
+ return ((ItemStack)tStack).copy();
+ }
+ }
+ return null;
}
- public static boolean invalid(final Object aStack) {
- return aStack == null || !(aStack instanceof ItemStack) || ((ItemStack) aStack).getItem() == null
- || ((ItemStack) aStack).stackSize < 0;
+ public static ItemStack copyMeta(final long aMetaData, final Object... aStacks) {
+ final ItemStack rStack = copy(aStacks);
+ if (invalid(rStack)) {
+ return null;
+ }
+ return meta(rStack, aMetaData);
}
public static short meta(final ItemStack aStack) {
- return (short) Items.feather.getDamage(aStack);
+ return (short)Items.feather.getDamage(aStack);
}
public static ItemStack meta(final ItemStack aStack, final long aMeta) {
- Items.feather.setDamage(aStack, (short) aMeta);
+ Items.feather.setDamage(aStack, (int)(short)aMeta);
return aStack;
}
- public static boolean valid(final Object aStack) {
- return aStack != null && aStack instanceof ItemStack && ((ItemStack) aStack).getItem() != null
- && ((ItemStack) aStack).stackSize >= 0;
+ public static ItemStack amount(final long aAmount, final Object... aStacks) {
+ final ItemStack rStack = copy(aStacks);
+ if (invalid(rStack)) {
+ return null;
+ }
+ rStack.stackSize = (int)aAmount;
+ return rStack;
+ }
+
+ public static ItemStack container(final ItemStack aStack, final boolean aCheckIFluidContainerItems) {
+ if (invalid(aStack)) {
+ return null;
+ }
+ if (aStack.getItem().hasContainerItem(aStack)) {
+ return aStack.getItem().getContainerItem(aStack);
+ }
+ if (equal(aStack, ItemList.Cell_Empty.get(1), true)) {
+ return null;
+ }
+ if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem)aStack.getItem()).getCapacity(aStack) > 0) {
+ final ItemStack tStack = amount(1L, aStack);
+ ((IFluidContainerItem)aStack.getItem()).drain(tStack, Integer.MAX_VALUE, true);
+ if (!equal(aStack, tStack)) {
+ return tStack;
+ }
+ return null;
+ }
+ if (equal(aStack, ItemList.IC2_ForgeHammer.get(1)) || equal(aStack, ItemList.IC2_WireCutter.get(1))) {
+ return copyMeta(meta(aStack) + 1, aStack);
+ }
+ return null;
}
+ public static ItemStack container(final ItemStack aStack, final boolean aCheckIFluidContainerItems, final int aStacksize) {
+ return amount(aStacksize, container(aStack, aCheckIFluidContainerItems));
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java b/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java
index 025b535e14..b10e643831 100644
--- a/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java
+++ b/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java
@@ -1,56 +1,56 @@
package gtPlusPlus.core.util.gregtech.recipehandlers;
-import java.lang.reflect.Method;
-
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
+
+import java.lang.reflect.Method;
+
import net.minecraft.item.ItemStack;
public final class GregtechRecipe {
public LibraryProxy ourProxy;
-
- public GregtechRecipe() {
+ public GregtechRecipe(){
Utils.LOG_INFO("Initializing a recipe handler for different versions of Gregtech 5.");
try {
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- this.ourProxy = new LibProxy1();
- Utils.LOG_INFO("Selecting GT 5.7/5.8 Recipe Set");
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ this.ourProxy = new LibProxy1();
+ Utils.LOG_INFO("Selecting GT 5.7/5.8 Recipe Set");
}
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- this.ourProxy = new LibProxy2();
- Utils.LOG_INFO("Selecting GT 5.9 Recipe Set");
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ this.ourProxy = new LibProxy2();
+ Utils.LOG_INFO("Selecting GT 5.9 Recipe Set");
}
- }
- catch (final NoSuchMethodException e) {
+ } catch (NoSuchMethodException e) {
this.ourProxy = null;
}
}
- public boolean addSmeltingAndAlloySmeltingRecipe(final ItemStack aInput, final ItemStack aOutput) {
- Utils.LOG_WARNING("Adding a GT Furnace/Alloy Smelter Recipe" + "| Input:" + aInput.getDisplayName()
- + " | Output:" + aOutput.getDisplayName() + " |");
- return this.ourProxy.addSmeltingAndAlloySmeltingRecipe(aInput, aOutput);
+ public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
+ Utils.LOG_WARNING("Adding a GT Furnace/Alloy Smelter Recipe"+"| Input:"+aInput.getDisplayName()+" | Output:"+aOutput.getDisplayName()+" |");
+ return ourProxy.addSmeltingAndAlloySmeltingRecipe(aInput, aOutput);
}
}
+abstract class LibraryProxy { // can also be interface unless you want to have common code here
+ abstract public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput);
+}
+
class LibProxy1 extends LibraryProxy {
final Method m1;
public LibProxy1() throws NoSuchMethodException {
- this.m1 = GT_ModHandler.class.getDeclaredMethod("addSmeltingAndAlloySmeltingRecipe", ItemStack.class,
- ItemStack.class);
+ m1 = GT_ModHandler.class.getDeclaredMethod("addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class);
}
@Override
- public boolean addSmeltingAndAlloySmeltingRecipe(final ItemStack aInput, final ItemStack aOutput) {
+ public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
try {
Utils.LOG_INFO("Trying with Gt 5.7/5.8 Method.");
- return (boolean) this.m1.invoke(null, aInput, aOutput);
- }
- catch (final Exception e) {
+ return (boolean) m1.invoke(null, aInput, aOutput);
+ } catch (Exception e) {
throw new RuntimeException(e);
}
}
@@ -60,32 +60,28 @@ class LibProxy2 extends LibraryProxy {
final Method m2;
public LibProxy2() throws NoSuchMethodException {
- this.m2 = GT_ModHandler.class.getDeclaredMethod("addSmeltingAndAlloySmeltingRecipe", ItemStack.class,
- ItemStack.class, boolean.class);
+ m2 = GT_ModHandler.class.getDeclaredMethod("addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class, boolean.class);
}
@Override
- public boolean addSmeltingAndAlloySmeltingRecipe(final ItemStack aInput, final ItemStack aOutput) {
+ public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
try {
Utils.LOG_INFO("Trying with Gt 5.9 Method.");
- return (boolean) this.m2.invoke(null, aInput, aOutput, true);
- }
- catch (final Exception e) {
+ return (boolean) m2.invoke(null, aInput, aOutput, true);
+ } catch (Exception e) {
throw new RuntimeException(e);
}
}
}
-abstract class LibraryProxy { // can also be interface unless you want to have
- // common code here
- abstract public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput);
+/*class Lib { // v1
+ public static void addRecipe(ItemStack aInput, ItemStack aOutput) {
+ System.out.println("shit totally happened v1");
+ }
}
-/*
- * class Lib { // v1 public static void addRecipe(ItemStack aInput, ItemStack
- * aOutput) { System.out.println("shit totally happened v1"); } }
- *
- * class Lib2 { // v2 public static void addRecipe(ItemStack aInput, ItemStack
- * aOutput, boolean hidden) { System.out.println("shit totally happened v2"); }
- * }
- */ \ No newline at end of file
+class Lib2 { // v2
+ public static void addRecipe(ItemStack aInput, ItemStack aOutput, boolean hidden) {
+ System.out.println("shit totally happened v2");
+ }
+}*/ \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
index c8b9848c9f..69d909f294 100644
--- a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.util.item;
-import java.util.ArrayList;
-import java.util.List;
-
-import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
@@ -22,337 +18,256 @@ import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.materials.MaterialUtils;
import gtPlusPlus.core.util.wrapper.var;
+
+import java.util.ArrayList;
+import java.util.List;
+
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
+import cpw.mods.fml.common.registry.GameRegistry;
public class ItemUtils {
- public static void addItemToOreDictionary(final ItemStack stack, final String oreDictName) {
+ public static ItemStack getSimpleStack(Item x){
+ return getSimpleStack(x, 1);
+ }
+ public static ItemStack getSimpleStack(Item x, int i){
try {
- GT_OreDictUnificator.registerOre(oreDictName, stack);
- }
- catch (final NullPointerException e) {
- Utils.LOG_ERROR(stack.getDisplayName() + " not registered. [NULL]");
+ ItemStack r = new ItemStack(x, i);
+ return r;
+ } catch(Throwable e){
+ return null;
}
}
-
- public static BaseItemCentidust generateCentidust(final Material material) {
- if (material.getDust(1) != null && MaterialUtils.hasValidRGBA(material.getRGBA())) {
- final BaseItemCentidust Centidust = new BaseItemCentidust(material);
- return Centidust;
+ public static ItemStack getSimpleStack(ItemStack x, int i){
+ try {
+ ItemStack r = x.copy();
+ r.stackSize = i;
+ return r;
+ } catch(Throwable e){
+ return null;
}
- return null;
}
- public static BaseItemCentidust generateCentidust(final Materials material) {
- if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null) {
- final Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material);
- if (placeholder != null) {
- ItemUtils.generateCentidust(placeholder);
- }
- }
- return null;
- }
+ public static ItemStack getIC2Cell(String S){
+ ItemStack moreTemp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+S, 1);
- public static BaseItemDecidust generateDecidust(final Material material) {
- if (material.getDust(1) != null && MaterialUtils.hasValidRGBA(material.getRGBA())) {
- final BaseItemDecidust Decidust = new BaseItemDecidust(material);
- return Decidust;
+ if (moreTemp == null){
+ int cellID = 0;
+ ItemStack temp =GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, cellID);
+ return temp != null ? temp : null;
}
- return null;
- }
- public static BaseItemDecidust generateDecidust(final Materials material) {
- if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null) {
- final Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material);
- if (placeholder != null) {
- ItemUtils.generateDecidust(placeholder);
- }
- }
- return null;
+ return moreTemp;
}
- public static Item[] generateDusts(final String unlocalizedName, final String materialName, final int materialTier,
- final Material matInfo, final int Colour) {
- final int radioactive = ItemUtils.getRadioactivityLevel(materialName);
- final Item[] output = {
- new BaseItemDust("itemDust" + unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier,
- radioactive),
- new BaseItemDust("itemDustSmall" + unlocalizedName, materialName, matInfo, Colour, "Small",
- materialTier, radioactive),
- new BaseItemDust("itemDustTiny" + unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier,
- radioactive)
- };
- return output;
+ public static ItemStack getIC2Cell(int meta){
+ ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, meta);
+ return temp != null ? temp : null;
}
- public static MultiPickaxeBase generateMultiPick(final boolean GT_Durability, final Materials material) {
- final ToolMaterial customMaterial = Utils.generateMaterialFromGT(material);
- Utils.LOG_WARNING("Generating a Multi-Pick out of " + material.name());
- short[] rgb;
- rgb = material.getRGBA();
- int dur = customMaterial.getMaxUses();
- Utils.LOG_WARNING("Determined durability for " + material.name() + " is " + dur);
- if (GT_Durability) {
- dur = material.mDurability * 100;
- Utils.LOG_WARNING("Using gregtech durability value, " + material.name() + " is now " + dur + ".");
- }
- else if (dur <= 0) {
- dur = material.mDurability;
- Utils.LOG_WARNING("Determined durability too low, " + material.name() + " is now " + dur
- + " based on the GT material durability.");
- }
- if (dur <= 0) {
- Utils.LOG_WARNING("Still too low, " + material.name() + " will now go unused.");
- return null;
- }
+ public static void getItemForOreDict(String FQRN, String oreDictName, String itemName, int meta){
+ try {
+ Item em = null;
+ Item em1 = getItem(FQRN);
+ Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null){
+ em = em1;
+ }
+ if (em != null){
- final MultiPickaxeBase MP_Redstone = new MultiPickaxeBase(material.name() + " Multipick", customMaterial, dur,
- Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]));
+ ItemStack metaStack = new ItemStack(em,1,meta);
+ GT_OreDictUnificator.registerOre(oreDictName, metaStack);
- if (MP_Redstone.isValid) {
- return MP_Redstone;
+ /*ItemStack itemStackWithMeta = new ItemStack(em,1,meta);
+ GT_OreDictUnificator.registerOre(oreDictName, new ItemStack(itemStackWithMeta.getItem()));*/
+ }
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(itemName+" not found. [NULL]");
}
- return null;
-
}
- public static MultiSpadeBase generateMultiShovel(final boolean GT_Durability, final Materials material) {
- final ToolMaterial customMaterial = Utils.generateMaterialFromGT(material);
- Utils.LOG_WARNING("Generating a Multi-Shovel out of " + material.name());
- short[] rgb;
- rgb = material.getRGBA();
- int dur = customMaterial.getMaxUses();
- Utils.LOG_WARNING("Determined durability for " + material.name() + " is " + dur);
- if (GT_Durability) {
- dur = material.mDurability * 100;
- Utils.LOG_WARNING("Using gregtech durability value, " + material.name() + " is now " + dur + ".");
- }
- else if (dur <= 0) {
- dur = material.mDurability;
- Utils.LOG_WARNING("Determined durability too low, " + material.name() + " is now " + dur
- + " based on the GT material durability.");
- }
-
- if (dur <= 0) {
- Utils.LOG_WARNING("Still too low, " + material.name() + " will now go unused.");
- return null;
+ public static void addItemToOreDictionary(ItemStack stack, String oreDictName){
+ try {
+ GT_OreDictUnificator.registerOre(oreDictName, stack);
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(stack.getDisplayName()+" not registered. [NULL]");
}
+ }
- final MultiSpadeBase MP_Redstone = new MultiSpadeBase(material.name() + " Multishovel", customMaterial, dur,
- Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]));
-
- if (MP_Redstone.isValid) {
- return MP_Redstone;
+ @SuppressWarnings("unused")
+ public static ItemStack getItemStackWithMeta(boolean MOD, String FQRN, String itemName, int meta, int itemstackSize){
+ if (MOD){
+ try {
+ Item em = null;
+ Item em1 = getItem(FQRN);
+ Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null){
+ if (null == em){
+ em = em1;
+ }
+ if (em != null){
+ ItemStack metaStack = new ItemStack(em,itemstackSize,meta);
+ return metaStack;
+ }
+ }
+ return null;
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(itemName+" not found. [NULL]");
+ return null;
+ }
}
return null;
-
- }
-
- public static void generateSpawnEgg(final String entityModID, final String parSpawnName, final int colourEgg,
- final int colourOverlay) {
- final Item itemSpawnEgg = new BasicSpawnEgg(entityModID, parSpawnName, colourEgg, colourOverlay)
- .setUnlocalizedName("spawn_egg_" + parSpawnName.toLowerCase())
- .setTextureName(CORE.MODID + ":spawn_egg");
- GameRegistry.registerItem(itemSpawnEgg, "spawnEgg" + parSpawnName);
}
- public static Item[] generateSpecialUseDusts(final String unlocalizedName, final String materialName,
- final int Colour) {
- final Item[] output = {
- new BaseItemDustUnique("itemDust" + unlocalizedName, materialName, Colour, "Dust"),
- new BaseItemDustUnique("itemDustSmall" + unlocalizedName, materialName, Colour, "Small"),
- new BaseItemDustUnique("itemDustTiny" + unlocalizedName, materialName, Colour, "Tiny")
- };
- return output;
+ @SuppressWarnings("unused")
+ public static ItemStack simpleMetaStack(String FQRN, int meta, int itemstackSize){
+ try {
+ Item em = null;
+ Item em1 = getItem(FQRN);
+ Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null){
+ if (null == em){
+ em = em1;
+ }
+ if (em != null){
+ ItemStack metaStack = new ItemStack(em,itemstackSize,meta);
+ return metaStack;
+ }
+ }
+ return null;
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(FQRN+" not found. [NULL]");
+ return null;
+ }
}
- public static String getArrayStackNames(final ItemStack[] aStack) {
- String itemNames = "Item Array: ";
- for (final ItemStack alph : aStack) {
-
- if (alph != null) {
- final String temp = itemNames;
- itemNames = temp + ", " + alph.getDisplayName() + " x" + alph.stackSize;
- }
- else {
- final String temp = itemNames;
- itemNames = temp + ", " + "null" + " x" + "0";
+ @SuppressWarnings("unused")
+ public static ItemStack simpleMetaStack(Item item, int meta, int itemstackSize){
+ try {
+ Item em = item;
+ Item em1 = item;
+ Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null){
+ if (null == em){
+ em = em1;
+ }
+ if (em != null){
+ ItemStack metaStack = new ItemStack(em,itemstackSize,meta);
+ return metaStack;
+ }
}
- }
- return itemNames;
-
+ return null;
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(item.getUnlocalizedName()+" not found. [NULL]");
+ return null;
+ }
}
- public static String[] getArrayStackNamesAsArray(final ItemStack[] aStack) {
- final String[] itemNames = {};
- int arpos = 0;
- for (final ItemStack alph : aStack) {
- itemNames[arpos] = alph.getDisplayName();
- arpos++;
+ public static ItemStack getCorrectStacktype(String fqrn, int stackSize){
+ String oreDict = "ore:";
+ ItemStack temp;
+ if (fqrn.toLowerCase().contains(oreDict.toLowerCase())){
+ String sanitizedName = fqrn.replace(oreDict, "");
+ temp = ItemUtils.getItemStack(sanitizedName, stackSize);
+ return temp;
}
- return itemNames;
+ String[] fqrnSplit = fqrn.split(":");
+ if(fqrnSplit[2] == null){fqrnSplit[2] = "0";}
+ temp = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(fqrnSplit[2]), stackSize);
+ return temp;
+ }
- }
-
- public static ItemStack getCorrectStacktype(final Object item_Input, final int stackSize) {
- if (item_Input instanceof String) {
- return ItemUtils.getCorrectStacktype(item_Input, stackSize);
+ public static ItemStack getCorrectStacktype(Object item_Input, int stackSize) {
+ if (item_Input instanceof String){
+ return getCorrectStacktype(item_Input, stackSize);
}
- else if (item_Input instanceof ItemStack) {
+ else if (item_Input instanceof ItemStack){
return (ItemStack) item_Input;
}
- if (item_Input instanceof var) {
+ if (item_Input instanceof var){
return ((var) item_Input).getStack(stackSize);
}
return null;
}
- public static ItemStack getCorrectStacktype(final String fqrn, final int stackSize) {
- final String oreDict = "ore:";
- ItemStack temp;
- if (fqrn.toLowerCase().contains(oreDict.toLowerCase())) {
- final String sanitizedName = fqrn.replace(oreDict, "");
- temp = ItemUtils.getItemStack(sanitizedName, stackSize);
- return temp;
- }
- final String[] fqrnSplit = fqrn.split(":");
- if (fqrnSplit[2] == null) {
- fqrnSplit[2] = "0";
- }
- temp = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(fqrnSplit[2]),
- stackSize);
- return temp;
- }
-
- // TODO
- /*
- * public static FluidStack getFluidStack(Materials m, int Size) // fqrn =
- * fully qualified resource name { String[] fqrnSplit = fqrn.split(":");
- *
- * FluidStack x = (FluidStack) "Materials."+m+".getFluid"(Size);
- *
- * return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size); }
- */
-
- public static String getFluidArrayStackNames(final FluidStack[] aStack) {
- String itemNames = "Fluid Array: ";
- for (final FluidStack alph : aStack) {
- final String temp = itemNames;
- itemNames = temp + ", " + alph.getFluid().getName() + " x" + alph.amount;
- }
- return itemNames;
-
+ public static Item getItem(String fqrn) // fqrn = fully qualified resource name
+ {
+ String[] fqrnSplit = fqrn.split(":");
+ return GameRegistry.findItem(fqrnSplit[0], fqrnSplit[1]);
}
- public static ItemStack getGregtechCircuit(final int Meta) {
- return ItemUtils.getItemStackWithMeta(LoadedMods.Gregtech, "gregtech:gt.integrated_circuit", "Gregtech Circuit",
- Meta, 0);
+ public static ItemStack getItemStack(String fqrn, int Size) // fqrn = fully qualified resource name
+ {
+ String[] fqrnSplit = fqrn.split(":");
+ return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
}
- public static ItemStack getIC2Cell(final int meta) {
- final ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, meta);
- return temp != null ? temp : null;
- }
+ // TODO
+ /*public static FluidStack getFluidStack(Materials m, int Size) // fqrn = fully qualified resource name
+ {
+ String[] fqrnSplit = fqrn.split(":");
- public static ItemStack getIC2Cell(final String S) {
- final ItemStack moreTemp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + S, 1);
+ FluidStack x = (FluidStack) "Materials."+m+".getFluid"(Size);
- if (moreTemp == null) {
- final int cellID = 0;
- final ItemStack temp = GT_ModHandler.getModItem("IC2", "itemCellEmpty", 1L, cellID);
- return temp != null ? temp : null;
- }
+ return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
+ }*/
- return moreTemp;
- }
- public static Item getItem(final String fqrn) // fqrn = fully qualified
- // resource name
- {
- final String[] fqrnSplit = fqrn.split(":");
- return GameRegistry.findItem(fqrnSplit[0], fqrnSplit[1]);
+ public static void generateSpawnEgg(String entityModID, String parSpawnName, int colourEgg, int colourOverlay){
+ Item itemSpawnEgg = new BasicSpawnEgg(entityModID, parSpawnName, colourEgg, colourOverlay).setUnlocalizedName("spawn_egg_"+parSpawnName.toLowerCase()).setTextureName(CORE.MODID+":spawn_egg");
+ GameRegistry.registerItem(itemSpawnEgg, "spawnEgg"+parSpawnName);
}
- public static void getItemForOreDict(final String FQRN, final String oreDictName, final String itemName,
- final int meta) {
- try {
- Item em = null;
- final Item em1 = ItemUtils.getItem(FQRN);
- Utils.LOG_WARNING("Found: " + em1.getUnlocalizedName() + ":" + meta);
- if (em1 != null) {
- em = em1;
- }
- if (em != null) {
-
- final ItemStack metaStack = new ItemStack(em, 1, meta);
- GT_OreDictUnificator.registerOre(oreDictName, metaStack);
- /*
- * ItemStack itemStackWithMeta = new ItemStack(em,1,meta);
- * GT_OreDictUnificator.registerOre(oreDictName, new
- * ItemStack(itemStackWithMeta.getItem()));
- */
- }
- }
- catch (final NullPointerException e) {
- Utils.LOG_ERROR(itemName + " not found. [NULL]");
+ public static ItemStack[] validItemsForOreDict(String oredictName){
+ List<?> validNames = MaterialUtils.oreDictValuesForEntry(oredictName);
+ ItemStack[] inputs = null;
+ for (int i=0; i<validNames.size();i++){
+ inputs[i] = (ItemStack) validNames.get(i);
}
+ return inputs;
}
- public static ItemStack getItemStack(final String fqrn, final int Size) // fqrn
- // =
- // fully
- // qualified
- // resource
- // name
- {
- final String[] fqrnSplit = fqrn.split(":");
- return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
- }
-
- public static ItemStack getItemStackOfAmountFromOreDict(final String oredictName, final int amount) {
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
- if (!oreDictList.isEmpty()) {
- final ItemStack returnValue = oreDictList.get(0).copy();
+ public static ItemStack getItemStackOfAmountFromOreDict(String oredictName, int amount){
+ ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
+ if (!oreDictList.isEmpty()){
+ ItemStack returnValue = oreDictList.get(0).copy();
returnValue.stackSize = amount;
return returnValue;
}
- return ItemUtils.getSimpleStack(ModItems.AAA_Broken, amount);
+ return getSimpleStack(ModItems.AAA_Broken, amount);
}
- public static ItemStack getItemStackOfAmountFromOreDictNoBroken(final String oredictName, final int amount) {
- final ItemStack returnValue = ItemUtils.getItemStackOfAmountFromOreDict(oredictName, amount);
+ public static ItemStack getItemStackOfAmountFromOreDictNoBroken(String oredictName, int amount){
+ ItemStack returnValue = getItemStackOfAmountFromOreDict(oredictName, amount);
- if (returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass()
- || returnValue.getItem() != ModItems.AAA_Broken) {
+ if (returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass() || returnValue.getItem() != ModItems.AAA_Broken){
return returnValue;
}
- Utils.LOG_INFO(oredictName + " was not valid.");
+ Utils.LOG_INFO(oredictName+" was not valid.");
return null;
}
- public static ItemStack getItemStackOfAmountFromOreDictNoBrokenExcluding(final String excludeModName,
- final String oredictName, final int amount) {
- ItemStack returnValue = ItemUtils.getItemStackOfAmountFromOreDict(oredictName, amount);
+ public static ItemStack getItemStackOfAmountFromOreDictNoBrokenExcluding(String excludeModName, String oredictName, int amount){
+ ItemStack returnValue = getItemStackOfAmountFromOreDict(oredictName, amount);
- if (returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass()
- || returnValue.getItem() != ModItems.AAA_Broken) {
- if (returnValue.getClass().toString().toLowerCase().contains(excludeModName.toLowerCase())) {
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
- if (!oreDictList.isEmpty()) {
+ if (returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass() || returnValue.getItem() != ModItems.AAA_Broken){
+ if (returnValue.getClass().toString().toLowerCase().contains(excludeModName.toLowerCase())){
+ ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
+ if (!oreDictList.isEmpty()){
returnValue = oreDictList.get(1).copy();
returnValue.stackSize = amount;
return returnValue;
}
- }
+ }
else {
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
- if (!oreDictList.isEmpty()) {
+ ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
+ if (!oreDictList.isEmpty()){
returnValue = oreDictList.get(1).copy();
returnValue.stackSize = amount;
return returnValue;
@@ -360,146 +275,202 @@ public class ItemUtils {
}
return returnValue;
}
- Utils.LOG_INFO(oredictName + " was not valid.");
+ Utils.LOG_INFO(oredictName+" was not valid.");
return null;
}
- @SuppressWarnings("unused")
- public static ItemStack getItemStackWithMeta(final boolean MOD, final String FQRN, final String itemName,
- final int meta, final int itemstackSize) {
- if (MOD) {
- try {
- Item em = null;
- final Item em1 = ItemUtils.getItem(FQRN);
- Utils.LOG_WARNING("Found: " + em1.getUnlocalizedName() + ":" + meta);
- if (em1 != null) {
- if (null == em) {
- em = em1;
- }
- if (em != null) {
- final ItemStack metaStack = new ItemStack(em, itemstackSize, meta);
- return metaStack;
- }
- }
- return null;
- }
- catch (final NullPointerException e) {
- Utils.LOG_ERROR(itemName + " not found. [NULL]");
- return null;
- }
- }
- return null;
+ public static Item[] generateDusts(String unlocalizedName, String materialName, int materialTier, Material matInfo, int Colour){
+ int radioactive = getRadioactivityLevel(materialName);
+ Item[] output = {
+ new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, radioactive),
+ new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, radioactive),
+ new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, radioactive)};
+ return output;
}
- public static int getRadioactivityLevel(final String materialName) {
- int sRadiation = 0;
- if (materialName.toLowerCase().contains("uranium")) {
- sRadiation = 2;
+ public static Item[] generateSpecialUseDusts(String unlocalizedName, String materialName, int Colour){
+ Item[] output = {
+ new BaseItemDustUnique("itemDust"+unlocalizedName, materialName, Colour, "Dust"),
+ new BaseItemDustUnique("itemDustSmall"+unlocalizedName, materialName, Colour, "Small"),
+ new BaseItemDustUnique("itemDustTiny"+unlocalizedName, materialName, Colour, "Tiny")};
+ return output;
+ }
+
+ public static MultiPickaxeBase generateMultiPick(boolean GT_Durability, Materials material){
+ ToolMaterial customMaterial = Utils.generateMaterialFromGT(material);
+ Utils.LOG_WARNING("Generating a Multi-Pick out of "+material.name());
+ short[] rgb;
+ rgb = material.getRGBA();
+ int dur = customMaterial.getMaxUses();
+ Utils.LOG_WARNING("Determined durability for "+material.name()+" is "+dur);
+ if (GT_Durability){
+ dur = material.mDurability*100;
+ Utils.LOG_WARNING("Using gregtech durability value, "+material.name()+" is now "+dur+".");
}
- else if (materialName.toLowerCase().contains("plutonium")) {
- sRadiation = 4;
+ else if (dur <= 0){
+ dur = material.mDurability;
+ Utils.LOG_WARNING("Determined durability too low, "+material.name()+" is now "+dur+" based on the GT material durability.");
}
- else if (materialName.toLowerCase().contains("thorium")) {
- sRadiation = 1;
+
+ if (dur <= 0){
+ Utils.LOG_WARNING("Still too low, "+material.name()+" will now go unused.");
+ return null;
}
- return sRadiation;
- }
- public static ItemStack getSimpleStack(final Item x) {
- return ItemUtils.getSimpleStack(x, 1);
+ MultiPickaxeBase MP_Redstone = new MultiPickaxeBase(
+ material.name()+" Multipick",
+ (customMaterial),
+ dur,
+ Utils.rgbtoHexValue(rgb[0],rgb[1],rgb[2])
+ );
+
+ if (MP_Redstone.isValid){
+ return MP_Redstone;
+ }
+ return null;
+
}
- public static ItemStack getSimpleStack(final Item x, final int i) {
- try {
- final ItemStack r = new ItemStack(x, i);
- return r;
+ public static MultiSpadeBase generateMultiShovel(boolean GT_Durability, Materials material){
+ ToolMaterial customMaterial = Utils.generateMaterialFromGT(material);
+ Utils.LOG_WARNING("Generating a Multi-Shovel out of "+material.name());
+ short[] rgb;
+ rgb = material.getRGBA();
+ int dur = customMaterial.getMaxUses();
+ Utils.LOG_WARNING("Determined durability for "+material.name()+" is "+dur);
+ if (GT_Durability){
+ dur = material.mDurability*100;
+ Utils.LOG_WARNING("Using gregtech durability value, "+material.name()+" is now "+dur+".");
+ }
+ else if (dur <= 0){
+ dur = material.mDurability;
+ Utils.LOG_WARNING("Determined durability too low, "+material.name()+" is now "+dur+" based on the GT material durability.");
}
- catch (final Throwable e) {
+
+ if (dur <= 0){
+ Utils.LOG_WARNING("Still too low, "+material.name()+" will now go unused.");
return null;
}
+
+ MultiSpadeBase MP_Redstone = new MultiSpadeBase(
+ material.name()+" Multishovel",
+ (customMaterial),
+ dur,
+ Utils.rgbtoHexValue(rgb[0],rgb[1],rgb[2])
+ );
+
+ if (MP_Redstone.isValid){
+ return MP_Redstone;
+ }
+ return null;
+
}
- public static ItemStack getSimpleStack(final ItemStack x, final int i) {
- try {
- final ItemStack r = x.copy();
- r.stackSize = i;
- return r;
+ public static BaseItemDecidust generateDecidust(Materials material){
+ if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null){
+ Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material);
+ if (placeholder != null)
+ generateDecidust(placeholder);
+ }
+ return null;
+ }
+
+ public static BaseItemDecidust generateDecidust(Material material){
+ if (material.getDust(1) != null && MaterialUtils.hasValidRGBA(material.getRGBA())){
+ BaseItemDecidust Decidust = new BaseItemDecidust(material);
+ return Decidust;
}
- catch (final Throwable e) {
- return null;
+ return null;
+ }
+
+ public static BaseItemCentidust generateCentidust(Materials material){
+ if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null){
+ Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material);
+ if (placeholder != null)
+ generateCentidust(placeholder);
+ }
+ return null;
+ }
+
+ public static BaseItemCentidust generateCentidust(Material material){
+ if (material.getDust(1) != null && MaterialUtils.hasValidRGBA(material.getRGBA())){
+ BaseItemCentidust Centidust = new BaseItemCentidust(material);
+ return Centidust;
}
+ return null;
}
- public static boolean isRadioactive(final String materialName) {
- int sRadiation = 0;
- if (materialName.toLowerCase().contains("uranium")) {
+ public static boolean isRadioactive(String materialName){
+ int sRadiation = 0;
+ if (materialName.toLowerCase().contains("uranium")){
sRadiation = 2;
}
- else if (materialName.toLowerCase().contains("plutonium")) {
+ else if (materialName.toLowerCase().contains("plutonium")){
sRadiation = 4;
}
- else if (materialName.toLowerCase().contains("thorium")) {
+ else if (materialName.toLowerCase().contains("thorium")){
sRadiation = 1;
}
- if (sRadiation >= 1) {
+ if (sRadiation >= 1){
return true;
}
return false;
}
- @SuppressWarnings("unused")
- public static ItemStack simpleMetaStack(final Item item, final int meta, final int itemstackSize) {
- try {
- Item em = item;
- final Item em1 = item;
- Utils.LOG_WARNING("Found: " + em1.getUnlocalizedName() + ":" + meta);
- if (em1 != null) {
- if (null == em) {
- em = em1;
- }
- if (em != null) {
- final ItemStack metaStack = new ItemStack(em, itemstackSize, meta);
- return metaStack;
- }
- }
- return null;
+ public static int getRadioactivityLevel(String materialName){
+ int sRadiation = 0;
+ if (materialName.toLowerCase().contains("uranium")){
+ sRadiation = 2;
}
- catch (final NullPointerException e) {
- Utils.LOG_ERROR(item.getUnlocalizedName() + " not found. [NULL]");
- return null;
+ else if (materialName.toLowerCase().contains("plutonium")){
+ sRadiation = 4;
}
+ else if (materialName.toLowerCase().contains("thorium")){
+ sRadiation = 1;
+ }
+ return sRadiation;
}
- @SuppressWarnings("unused")
- public static ItemStack simpleMetaStack(final String FQRN, final int meta, final int itemstackSize) {
- try {
- Item em = null;
- final Item em1 = ItemUtils.getItem(FQRN);
- Utils.LOG_WARNING("Found: " + em1.getUnlocalizedName() + ":" + meta);
- if (em1 != null) {
- if (null == em) {
- em = em1;
- }
- if (em != null) {
- final ItemStack metaStack = new ItemStack(em, itemstackSize, meta);
- return metaStack;
- }
+ public static String getArrayStackNames(ItemStack[] aStack){
+ String itemNames = "Item Array: ";
+ for (ItemStack alph : aStack){
+
+ if (alph != null){
+ String temp = itemNames;
+ itemNames = temp + ", " + alph.getDisplayName() + " x" + alph.stackSize;
+ }
+ else {
+ String temp = itemNames;
+ itemNames = temp + ", " + "null" + " x" + "0";
}
- return null;
}
- catch (final NullPointerException e) {
- Utils.LOG_ERROR(FQRN + " not found. [NULL]");
- return null;
+ return itemNames;
+
+ }
+
+ public static String[] getArrayStackNamesAsArray(ItemStack[] aStack){
+ String[] itemNames = {};
+ int arpos = 0;
+ for (ItemStack alph : aStack){
+ itemNames[arpos] = alph.getDisplayName();
+ arpos++;
}
+ return itemNames;
+
}
- public static ItemStack[] validItemsForOreDict(final String oredictName) {
- final List<?> validNames = MaterialUtils.oreDictValuesForEntry(oredictName);
- final ItemStack[] inputs = null;
- for (int i = 0; i < validNames.size(); i++) {
- inputs[i] = (ItemStack) validNames.get(i);
+ public static String getFluidArrayStackNames(FluidStack[] aStack){
+ String itemNames = "Fluid Array: ";
+ for (FluidStack alph : aStack){
+ String temp = itemNames;
+ itemNames = temp + ", " + alph.getFluid().getName() + " x" + alph.amount;
}
- return inputs;
+ return itemNames;
+
+ }
+
+ public static ItemStack getGregtechCircuit(int Meta){
+ return ItemUtils.getItemStackWithMeta(LoadedMods.Gregtech, "gregtech:gt.integrated_circuit", "Gregtech Circuit", Meta, 0);
}
}
diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java
index 9c93594963..b94b35921f 100644
--- a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java
+++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java
@@ -1,224 +1,225 @@
package gtPlusPlus.core.util.materials;
-import java.util.ArrayList;
-import java.util.List;
-
-import gregtech.api.enums.*;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Element;
+import gregtech.api.enums.Materials;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.enums.TextureSet;
import gregtech.api.objects.MaterialStack;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
+
+import java.util.ArrayList;
+import java.util.List;
+
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.oredict.OreDictionary;
public class MaterialUtils {
-
- public static short firstID = 791;
-
- private static Class[][] commonTypes = {
- {
- Materials.class, int.class, TextureSet.class, float.class, int.class, int.class, int.class,
- int.class, int.class, int.class, int.class, String.class, int.class, int.class, int.class,
- int.class, boolean.class, boolean.class, int.class, int.class, int.class, Dyes.class, int.class,
- List.class, List.class
- }
- };
-
- public static Materials addGtMaterial(final String enumNameForMaterial, final TextureSet aIconSet,
- final float aToolSpeed, final int aToolDurability, final int aToolQuality, final int aTypes, final int aR,
- final int aG, final int aB, final int aA, final String aLocalName, final int aFuelType,
- final int aFuelPower, final int aMeltingPoint, final int aBlastFurnaceTemp,
- final boolean aBlastFurnaceRequired, final boolean aTransparent, final int aOreValue,
- final int aDensityMultiplier, final int aDensityDivider, final Dyes aColor, final int aExtraData,
- final List<MaterialStack> aMaterialList, final List<TC_AspectStack> aAspects) {
- Utils.LOG_INFO("Attempting to add GT material: " + enumNameForMaterial);
- return EnumHelper.addEnum(Materials.class, enumNameForMaterial, MaterialUtils.commonTypes,
- MaterialUtils.firstID++, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA,
- aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired,
- aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor, aExtraData, aMaterialList,
- aAspects);
+
+ public static short firstID = 791;
+
+ private static Class[][] commonTypes =
+ {{Materials.class, int.class, TextureSet.class, float.class, int.class,
+ int.class, int.class, int.class, int.class, int.class, int.class,
+ String.class, int.class, int.class, int.class, int.class, boolean.class,
+ boolean.class, int.class, int.class, int.class, Dyes.class, int.class,
+ List.class , List.class}};
+
+ public static Materials addGtMaterial(String enumNameForMaterial, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List<MaterialStack> aMaterialList, List<TC_AspectStack> aAspects)
+ {
+ Utils.LOG_INFO("Attempting to add GT material: "+enumNameForMaterial);
+ return EnumHelper.addEnum(Materials.class, enumNameForMaterial, commonTypes, firstID++, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName,
+ aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider,
+ aColor, aExtraData, aMaterialList, aAspects);
+ }
+
+ public static List<?> oreDictValuesForEntry(String oredictName){
+ List<?> oredictItemNames;
+ if(OreDictionary.doesOreNameExist(oredictName)){
+ ArrayList<ItemStack> oredictItems = OreDictionary.getOres(oredictName);
+ oredictItemNames = Utils.convertArrayListToList(oredictItems);
+ return oredictItemNames;
+ }
+ return null;
}
-
- public static Material generateMaterialFromGtENUM(final Materials material) {
- final String name = material.name();
- final short[] rgba = material.mRGBa;
- final int melting = material.mMeltingPoint;
- final int boiling = material.mBlastFurnaceTemp;
- final long protons = material.getProtons();
- final long neutrons = material.getNeutrons();
- final boolean blastFurnace = material.mBlastFurnaceRequired;
- final String chemicalFormula = material.mChemicalFormula;
- final Element element = material.mElement;
+
+ public static Material generateMaterialFromGtENUM(Materials material){
+ String name = material.name();
+ short[] rgba = material.mRGBa;
+ int melting = material.mMeltingPoint;
+ int boiling = material.mBlastFurnaceTemp;
+ long protons = material.getProtons();
+ long neutrons = material.getNeutrons();
+ boolean blastFurnace = material.mBlastFurnaceRequired;
+ String chemicalFormula = material.mChemicalFormula;
+ Element element = material.mElement;
int radioactivity = 0;
- if (material.isRadioactive()) {
+ if (material.isRadioactive()){
radioactivity = 1;
}
- if (MaterialUtils.hasValidRGBA(rgba) || element == Element.H) {
- // ModItems.itemBaseDecidust =
- // UtilsItems.generateDecidust(material);
- // ModItems.itemBaseCentidust =
- // UtilsItems.generateCentidust(material);
- return new Material(name, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula,
- radioactivity);
+ if (hasValidRGBA(rgba) || element == Element.H){
+ //ModItems.itemBaseDecidust = UtilsItems.generateDecidust(material);
+ //ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material);
+ return new Material(name, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity);
}
return null;
-
+
}
-
- public static Material generateQuickMaterial(final String materialName, final short[] colour,
- final int sRadioactivity) {
- final Material temp = new Material(materialName, colour, 1000, // melting
- 3000, // boiling
- 50, // Protons
- 50, // Neutrons
- false, "", sRadioactivity);
+
+ public static Material generateQuickMaterial(String materialName, short[] colour, int sRadioactivity) {
+ Material temp = new Material(
+ materialName,
+ colour,
+ 1000, //melting
+ 3000, //boiling
+ 50, //Protons
+ 50, //Neutrons
+ false,
+ "",
+ sRadioactivity);
return temp;
}
+
+ public static boolean hasValidRGBA(short[] rgba){
+ boolean test1 = false;
+ boolean test2 = false;
+ boolean test3 = false;
+ for (int r=0;r<rgba.length;r++){
+ if (rgba[r] == 0){
+ if (r == 0){
+ test1 = true;
+ }
+ else if (r == 1){
+ test2 = true;
+ }
+ else if (r == 2){
+ test3 = true;
+ }
+ }
+ }
+ if ((test1 && test2) || (test1 && test3) || (test3 && test2)){
+ return false;
+ }
+ return true;
+ }
+
+ public static String superscript(String str) {
+ str = str.replaceAll("0", "\u2070");
+ str = str.replaceAll("1", "\u00B9");
+ str = str.replaceAll("2", "\u00B2");
+ str = str.replaceAll("3", "\u00B3");
+ str = str.replaceAll("4", "\u2074");
+ str = str.replaceAll("5", "\u2075");
+ str = str.replaceAll("6", "\u2076");
+ str = str.replaceAll("7", "\u2077");
+ str = str.replaceAll("8", "\u2078");
+ str = str.replaceAll("9", "\u2079");
+ return str;
+ }
- public static int getTierOfMaterial(final int M) {
- if (M >= 0 && M <= 750) {
+ public static String subscript(String str) {
+ str = str.replaceAll("0", "\u2080");
+ str = str.replaceAll("1", "\u2081");
+ str = str.replaceAll("2", "\u2082");
+ str = str.replaceAll("3", "\u2083");
+ str = str.replaceAll("4", "\u2084");
+ str = str.replaceAll("5", "\u2085");
+ str = str.replaceAll("6", "\u2086");
+ str = str.replaceAll("7", "\u2087");
+ str = str.replaceAll("8", "\u2088");
+ str = str.replaceAll("9", "\u2089");
+ return str;
+ }
+
+ public static int getTierOfMaterial(int M){
+ if (M >= 0 && M <= 750){
return 1;
}
- else if (M >= 751 && M <= 1250) {
+ else if(M >= 751 && M <= 1250){
return 2;
}
- else if (M >= 1251 && M <= 1750) {
+ else if(M >= 1251 && M <= 1750){
return 3;
}
- else if (M >= 1751 && M <= 2250) {
+ else if(M >= 1751 && M <= 2250){
return 4;
}
- else if (M >= 2251 && M <= 2750) {
+ else if(M >= 2251 && M <= 2750){
return 5;
}
- else if (M >= 2751 && M <= 3250) {
+ else if(M >= 2751 && M <= 3250){
return 6;
}
- else if (M >= 3251 && M <= 3750) {
+ else if(M >= 3251 && M <= 3750){
return 7;
}
- else if (M >= 3751 && M <= 4250) {
+ else if(M >= 3751 && M <= 4250){
return 8;
}
- else if (M >= 4251 && M <= 4750) {
+ else if(M >= 4251 && M <= 4750){
return 9;
}
- else if (M >= 4751 && M <= 9999) {
+ else if(M >= 4751 && M <= 9999){
return 10;
}
else {
return 0;
}
}
+
- public static boolean hasValidRGBA(final short[] rgba) {
- boolean test1 = false;
- boolean test2 = false;
- boolean test3 = false;
- for (int r = 0; r < rgba.length; r++) {
- if (rgba[r] == 0) {
- if (r == 0) {
- test1 = true;
- }
- else if (r == 1) {
- test2 = true;
- }
- else if (r == 2) {
- test3 = true;
- }
- }
- }
- if (test1 && test2 || test1 && test3 || test3 && test2) {
- return false;
- }
- return true;
- }
-
- public static List<?> oreDictValuesForEntry(final String oredictName) {
- List<?> oredictItemNames;
- if (OreDictionary.doesOreNameExist(oredictName)) {
- final ArrayList<ItemStack> oredictItems = OreDictionary.getOres(oredictName);
- oredictItemNames = Utils.convertArrayListToList(oredictItems);
- return oredictItemNames;
- }
- return null;
- }
-
- public static String subscript(String str) {
- str = str.replaceAll("0", "\u2080");
- str = str.replaceAll("1", "\u2081");
- str = str.replaceAll("2", "\u2082");
- str = str.replaceAll("3", "\u2083");
- str = str.replaceAll("4", "\u2084");
- str = str.replaceAll("5", "\u2085");
- str = str.replaceAll("6", "\u2086");
- str = str.replaceAll("7", "\u2087");
- str = str.replaceAll("8", "\u2088");
- str = str.replaceAll("9", "\u2089");
- return str;
- }
+ /*
+ * That's shown, many times, in the EnumHelper code, all the add functions just wrap the addEnum function.
+ You need the target enum class, and 2 arrays, 1 holding the types for the constructor arguments,
+ and the other holding the constructor argument values (the things being passed to the constructor)
- public static String superscript(String str) {
- str = str.replaceAll("0", "\u2070");
- str = str.replaceAll("1", "\u00B9");
- str = str.replaceAll("2", "\u00B2");
- str = str.replaceAll("3", "\u00B3");
- str = str.replaceAll("4", "\u2074");
- str = str.replaceAll("5", "\u2075");
- str = str.replaceAll("6", "\u2076");
- str = str.replaceAll("7", "\u2077");
- str = str.replaceAll("8", "\u2078");
- str = str.replaceAll("9", "\u2079");
- return str;
- }
+ The 'decompiled' Boolean should be set to true if the class you're adding to has been decompiled/recompiled again.
+ (it adds a 2nd enum arguments that need to be accounted for, but isn't actually useful to you)
- /*
- * That's shown, many times, in the EnumHelper code, all the add functions
- * just wrap the addEnum function. You need the target enum class, and 2
- * arrays, 1 holding the types for the constructor arguments, and the other
- * holding the constructor argument values (the things being passed to the
- * constructor)
- *
- * The 'decompiled' Boolean should be set to true if the class you're adding
- * to has been decompiled/recompiled again. (it adds a 2nd enum arguments
- * that need to be accounted for, but isn't actually useful to you)
*
- *
- * new Class[{int.class, TextureSet.class, float.class, int.class,
- * int.class, int.class, int.class, int.class, int.class, int.class,
- * String.class, int.class, int.class, int.class, int.class, boolean.class,
- * boolean.class, int.class, int.class, int.class, Dyes.class, int.class,
- * List.class , List.class}],
+ *new Class[{int.class, TextureSet.class, float.class, int.class,
+ int.class, int.class, int.class, int.class, int.class, int.class,
+ String.class, int.class, int.class, int.class, int.class, boolean.class,
+ boolean.class, int.class, int.class, int.class, Dyes.class, int.class,
+ List.class , List.class}],
*/
- /*
- * public static Materials GenerateGtMaterialForSingleUse(MaterialInfo s){
- *
- * Materials yourName = EnumHelper.addEnum(
- *
- * Materials.class, s.name(),
- *
- *
- *
- * new Object[0]
- *
- * ); try {
- *
- *
- *
- * Class<? extends ItemCell> clz = item.getClass(); Method methode =
- * clz.getDeclaredMethod("addCell", int.class, InternalName.class,
- * Block[].class); methode.setAccessible(true); ItemStack temp = (ItemStack)
- * methode.invoke(item, cellID++, yourName, new Block[0]);
- *
- *
- *
- *
- *
- *
- * return Materials.Abyssal; } catch(Exception e){ e.printStackTrace(); }
- * return null; }
- */
+
+
+ /*public static Materials GenerateGtMaterialForSingleUse(MaterialInfo s){
+
+ Materials yourName = EnumHelper.addEnum(
+
+ Materials.class, s.name(),
+
+
+
+ new Object[0]
+
+ );
+ try
+ {
+
+
+
+ Class<? extends ItemCell> clz = item.getClass();
+ Method methode = clz.getDeclaredMethod("addCell", int.class, InternalName.class, Block[].class);
+ methode.setAccessible(true);
+ ItemStack temp = (ItemStack) methode.invoke(item, cellID++, yourName, new Block[0]);
+
+
+
+
+
+
+ return Materials.Abyssal;
+ }
+ catch(Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }*/
}
diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
index 69e4a1a446..75d8452975 100644
--- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java
+++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
@@ -1,259 +1,263 @@
package gtPlusPlus.core.util.math;
+import gtPlusPlus.core.util.Utils;
+
import java.util.Map;
import java.util.Random;
-import gtPlusPlus.core.util.Utils;
-
public class MathUtils {
/**
- * Returns an int. The returned number is the value on i + 273.15F. Supports
- * ints.
+ * Returns a psuedo-random number between min and max, inclusive.
+ * The difference between min and max can be at most
+ * Integer.MAX_VALUE - 1.
*
- * @param i
- * Temp in Celcius.
- * @return int The celcius temp returned as Kelvin, rounded to the readest
- * whole.
+ * @param min Minimim value
+ * @param max Maximim value. Must be greater than min.
+ * @return Integer between min and max, inclusive.
+ * @see java.util.Random#nextInt(int)
*/
- public static float celsiusToKelvin(final int i) {
- final double f = i + 273.15F;
- return (int) MathUtils.decimalRoundingToWholes(f);
- }
+ public static int randInt(int min, int max) {
- // Smooth Rounding Function
+ // Usually this can be a field rather than a method variable
+ Random rand = new Random();
+
+ // nextInt is normally exclusive of the top value,
+ // so add 1 to make it inclusive
+ int randomNum = rand.nextInt((max - min) + 1) + min;
+
+ return randomNum;
+ }
+
+ public static double getChanceOfXOverYRuns(double x, double y){
+ double z = (1-Math.pow((1-x), y));
+ return z;
+ }
+
+
/**
- * Returns a double. The returned number is d rounded to the nearest d.01.
- * Supports Doubles.
+ * Returns a psuedo-random number between min and max, inclusive.
+ * The difference between min and max can be at most
+ * Long.MAX_VALUE - 1.
*
- * @param current
- * Current value.
- * @return double Rounded value.
+ * @param min Minimim value
+ * @param max Maximim value. Must be greater than min.
+ * @return Long between min and max, inclusive.
+ * @see java.util.Random#nextLong(long)
*/
- public static double decimalRounding(final double d) {
- return Math.round(d * 2) / 2.0;
+ public static long randLong(long min, long max) {
+ // Usually this can be a field rather than a method variable
+ Random rand = new Random();
+
+ // nextInt is normally exclusive of the top value,
+ // so add 1 to make it inclusive
+ long randomNum = MathUtils.nextLong(rand,(max - min) + 1) + min;
+
+ return randomNum;
+ }
+ private static long nextLong(Random rng, long n) {
+ // error checking and 2^x checking removed for simplicity.
+ long bits, val;
+ do {
+ bits = (rng.nextLong() << 1) >>> 1;
+ val = bits % n;
+ } while (bits-val+(n-1) < 0L);
+ return val;
}
+
- // Smooth Rounding Function (Nearest 5)
/**
- * Returns a double. The returned number is d rounded to the nearest d.5.
+ * Returns a percentage.
+ * The returned number is the % of X in Y.
* Supports Doubles.
*
- * @param current
- * Current value.
- * @return double Rounded value.
+ * @param current Current value.
+ * @param max Maximim value. Must be greater than min.
+ * @return double between min and max, inclusive.
*/
- public static double decimalRoundingToWholes(final double d) {
- return 5 * Math.round(d / 5);
+ public static double findPercentage(double current, double max){
+ double c = ((double) current / max) * 100;
+ double roundOff = Math.round(c * 100.00) / 100.00;
+ return roundOff;
}
+
+ //Smooth Rounding Function
/**
- * Returns a boolean. The returned boolean is wether or not X evenly fits in
- * to Y. Supports ints.
+ * Returns a double.
+ * The returned number is d rounded to the nearest d.01.
+ * Supports Doubles.
*
- * @param x
- * Value A.
- * @param y
- * Value B. Must be greater than min.
- * @return boolean Whether or not it divides evenly.
+ * @param current Current value.
+ * @return double Rounded value.
*/
- public static boolean divideXintoY(final int x, final int y) {
- if (x % y == 0) {
- return true;
- }
- return false;
+ public static double decimalRounding(double d) {
+ return Math.round(d * 2) / 2.0;
}
+
+ //Smooth Rounding Function (Nearest 5)
/**
- * Returns a percentage. The returned number is the % of X in Y. Supports
- * Doubles.
+ * Returns a double.
+ * The returned number is d rounded to the nearest d.5.
+ * Supports Doubles.
*
- * @param current
- * Current value.
- * @param max
- * Maximim value. Must be greater than min.
- * @return double between min and max, inclusive.
+ * @param current Current value.
+ * @return double Rounded value.
*/
- public static double findPercentage(final double current, final double max) {
- final double c = current / max * 100;
- final double roundOff = Math.round(c * 100.00) / 100.00;
- return roundOff;
- }
-
- private static long gcd(long a, long b) {
- while (b > 0) {
- final long temp = b;
- b = a % b; // % is remainder
- a = temp;
- }
- return a;
- }
-
- private static long gcd(final long[] input) {
- long result = input[0];
- for (int i = 1; i < input.length; i++) {
- result = MathUtils.gcd(result, input[i]);
- }
- return result;
+ public static double decimalRoundingToWholes(double d) {
+ return 5*(Math.round(d/5));
}
+
+ public static int roundToClosestMultiple(double number, int multiple) {
+ int result = multiple;
+ if (number % multiple == 0) {
+ return (int) number;
+ }
+ // If not already multiple of given number
+ if (number % multiple != 0) {
+ int division = (int) ((number / multiple) + 1);
+ result = division * multiple;
+ }
+ return result;
+ }
+
/**
- * Returns a hexInteger. The returned value is between min and max. Supports
- * ints.
+ * Returns a boolean.
+ * The returned boolean is wether or not X evenly fits in to Y.
+ * Supports ints.
*
- * @param min
- * Minimum value.
- * @param max
- * Maximium value. Must be greater than min.
- * @return hexInteger between min and max, inclusive.
+ * @param x Value A.
+ * @param y Value B. Must be greater than min.
+ * @return boolean Whether or not it divides evenly.
*/
- public static int generateRandomHexValue(final int min, final int max) {
- final int result = MathUtils.getHexNumberFromInt(MathUtils.randInt(min, max));
- return result;
+ public static boolean divideXintoY(int x, int y){
+ if ((x % y) == 0)
+ {
+ return true;
+ }
+ return false;
}
+
/**
- * Returns a random hex value. The returned value is between 000000-ffffff.
+ * Returns a boolean.
+ * The returned boolean is based on the odd/eveness of the input.
+ * Supports ints.
*
- * @return hexInteger between min and max, inclusive.
+ * @param x Value A.
+ * @return boolean Whether or not it divides evenly.
*/
- public static int generateSingularRandomHexValue() {
- String temp;
- final int randomInt = MathUtils.randInt(1, 5);
- final Map<Integer, String> colours = Utils.hexColourGeneratorRandom(5);
-
- if (colours.get(randomInt) != null && colours.size() > 0) {
- temp = colours.get(randomInt);
- }
- else {
- temp = "0F0F0F";
+ public static boolean isNumberEven(int x){
+ if ((x % 2) == 0)
+ {
+ return true;
}
-
- Utils.LOG_WARNING("Operating with " + temp);
- temp = Utils.appenedHexNotationToString(String.valueOf(temp));
- Utils.LOG_WARNING("Made " + temp + " - Hopefully it's not a mess.");
- Utils.LOG_WARNING("It will decode into " + Integer.decode(temp) + ".");
- return Integer.decode(temp);
+ return false;
}
- public static double getChanceOfXOverYRuns(final double x, final double y) {
- final double z = 1 - Math.pow(1 - x, y);
- return z;
- }
+
/**
- * Returns a hexInteger. The returned number is the hex value of the input.
+ * Returns an int.
+ * The returned number is the value on i + 273.15F.
* Supports ints.
*
- * @param input
- * Current value.
- * @return hexInteger.
+ * @param i Temp in Celcius.
+ * @return int The celcius temp returned as Kelvin, rounded to the readest whole.
*/
- public static int getHexNumberFromInt(final int input) {
- final String result = Integer.toHexString(input);
- final int resultINT = Integer.getInteger(result);
- return resultINT;
+ public static float celsiusToKelvin(int i){
+ double f = i + 273.15F;
+ return (int)decimalRoundingToWholes(f);
}
+
/**
- * Returns a boolean. The returned boolean is based on the odd/eveness of
- * the input. Supports ints.
+ * Returns a hexInteger.
+ * The returned number is the hex value of the input.
+ * Supports ints.
*
- * @param x
- * Value A.
- * @return boolean Whether or not it divides evenly.
+ * @param input Current value.
+ * @return hexInteger.
*/
- public static boolean isNumberEven(final int x) {
- if (x % 2 == 0) {
- return true;
- }
- return false;
- }
-
- private static long nextLong(final Random rng, final long n) {
- // error checking and 2^x checking removed for simplicity.
- long bits, val;
- do {
- bits = rng.nextLong() << 1 >>> 1;
- val = bits % n;
- }
- while (bits - val + n - 1 < 0L);
- return val;
+ public static int getHexNumberFromInt(int input){
+ String result = Integer.toHexString(input);
+ int resultINT = Integer.getInteger(result);
+ return resultINT;
}
+
/**
- * Returns a psuedo-random number between min and max, inclusive. The
- * difference between min and max can be at most Integer.MAX_VALUE - 1.
+ * Returns a hexInteger.
+ * The returned value is between min and max.
+ * Supports ints.
*
- * @param min
- * Minimim value
- * @param max
- * Maximim value. Must be greater than min.
- * @return Integer between min and max, inclusive.
- * @see java.util.Random#nextInt(int)
+ * @param min Minimum value.
+ * @param max Maximium value. Must be greater than min.
+ * @return hexInteger between min and max, inclusive.
*/
- public static int randInt(final int min, final int max) {
-
- // Usually this can be a field rather than a method variable
- final Random rand = new Random();
-
- // nextInt is normally exclusive of the top value,
- // so add 1 to make it inclusive
- final int randomNum = rand.nextInt(max - min + 1) + min;
-
- return randomNum;
+ public static int generateRandomHexValue(int min, int max){
+ int result = getHexNumberFromInt(randInt(min, max));
+ return result;
}
+
/**
- * Returns a psuedo-random number between min and max, inclusive. The
- * difference between min and max can be at most Long.MAX_VALUE - 1.
+ * Returns a random hex value.
+ * The returned value is between 000000-ffffff.
*
- * @param min
- * Minimim value
- * @param max
- * Maximim value. Must be greater than min.
- * @return Long between min and max, inclusive.
- * @see java.util.Random#nextLong(long)
+ * @return hexInteger between min and max, inclusive.
*/
- public static long randLong(final long min, final long max) {
- // Usually this can be a field rather than a method variable
- final Random rand = new Random();
-
- // nextInt is normally exclusive of the top value,
- // so add 1 to make it inclusive
- final long randomNum = MathUtils.nextLong(rand, max - min + 1) + min;
-
- return randomNum;
- }
+ public static int generateSingularRandomHexValue(){
+ String temp;
+ int randomInt = randInt(1, 5);
+ final Map<Integer, String> colours = Utils.hexColourGeneratorRandom(5);
- public static int roundToClosestMultiple(final double number, final int multiple) {
- int result = multiple;
- if (number % multiple == 0) {
- return (int) number;
+ if (colours.get(randomInt) != null && colours.size() > 0){
+ temp = colours.get(randomInt);
}
- // If not already multiple of given number
- if (number % multiple != 0) {
- final int division = (int) (number / multiple + 1);
- result = division * multiple;
+ else {
+ temp = "0F0F0F";
}
- return result;
- }
- public static long[] simplifyNumbersToSmallestForm(final long[] inputArray) {
- final long GCD = MathUtils.gcd(inputArray);
- final long[] outputArray = new long[inputArray.length];
- for (int i = 0; i < inputArray.length; i++) {
- if (GCD != 0) {
- outputArray[i] = inputArray[i] / GCD;
- }
- else {
+ Utils.LOG_WARNING("Operating with "+temp);
+ temp = Utils.appenedHexNotationToString(String.valueOf(temp));
+ Utils.LOG_WARNING("Made "+temp+" - Hopefully it's not a mess.");
+ Utils.LOG_WARNING("It will decode into "+Integer.decode(temp)+".");
+ return Integer.decode(temp);
+ }
+
+ public static long[] simplifyNumbersToSmallestForm(long[] inputArray){
+ long GCD = gcd(inputArray);
+ long[] outputArray = new long[inputArray.length];
+ for (int i=0;i<inputArray.length;i++){
+ if (GCD != 0)
+ outputArray[i] = (inputArray[i]/GCD);
+ else
outputArray[i] = inputArray[i];
- }
- }
- if (outputArray.length > 0) {
- return outputArray;
}
+ if (outputArray.length > 0)
+ return outputArray;
return null;
}
+
+ private static long gcd(long a, long b){
+ while (b > 0)
+ {
+ long temp = b;
+ b = a % b; // % is remainder
+ a = temp;
+ }
+ return a;
+ }
+
+ private static long gcd(long[] input){
+ long result = input[0];
+ for(int i = 1; i < input.length; i++) result = gcd(result, input[i]);
+ return result;
+ }
+
+
}
diff --git a/src/Java/gtPlusPlus/core/util/networking/NetworkUtils.java b/src/Java/gtPlusPlus/core/util/networking/NetworkUtils.java
index 2208dd50b7..bcfce5a71b 100644
--- a/src/Java/gtPlusPlus/core/util/networking/NetworkUtils.java
+++ b/src/Java/gtPlusPlus/core/util/networking/NetworkUtils.java
@@ -1,19 +1,23 @@
package gtPlusPlus.core.util.networking;
-import java.io.*;
-import java.net.*;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
public class NetworkUtils {
- public static String getContentFromURL(final String args) {
- if (NetworkUtils.netIsAvailable()) {
+ public static String getContentFromURL(String args) {
+ if (netIsAvailable()){
try {
URL url;
// get URL content
url = new URL(args);
- final URLConnection conn = url.openConnection();
+ URLConnection conn = url.openConnection();
// open the stream and put it into BufferedReader
- final BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+ BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String inputLine;
String tempLine = null;
while ((inputLine = br.readLine()) != null) {
@@ -21,30 +25,26 @@ public class NetworkUtils {
}
br.close();
return tempLine;
- }
- catch (final MalformedURLException e) {
+ } catch (MalformedURLException e) {
e.printStackTrace();
- }
- catch (final IOException e) {
+ } catch (IOException e) {
e.printStackTrace();
}
- }
+ }
return null;
}
- private static boolean netIsAvailable() {
- try {
- final URL url = new URL("http://www.google.com");
- final URLConnection conn = url.openConnection();
- conn.connect();
- return true;
- }
- catch (final MalformedURLException e) {
- throw new RuntimeException(e);
- }
- catch (final IOException e) {
- return false;
- }
- }
+ private static boolean netIsAvailable() {
+ try {
+ final URL url = new URL("http://www.google.com");
+ final URLConnection conn = url.openConnection();
+ conn.connect();
+ return true;
+ } catch (MalformedURLException e) {
+ throw new RuntimeException(e);
+ } catch (IOException e) {
+ return false;
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/particles/EntityParticleFXMysterious.java b/src/Java/gtPlusPlus/core/util/particles/EntityParticleFXMysterious.java
index 54f3936e34..2c704e48a6 100644
--- a/src/Java/gtPlusPlus/core/util/particles/EntityParticleFXMysterious.java
+++ b/src/Java/gtPlusPlus/core/util/particles/EntityParticleFXMysterious.java
@@ -3,12 +3,15 @@ package gtPlusPlus.core.util.particles;
import net.minecraft.client.particle.EntityAuraFX;
import net.minecraft.world.World;
-public class EntityParticleFXMysterious extends EntityAuraFX {
- public EntityParticleFXMysterious(final World parWorld, final double parX, final double parY, final double parZ,
- final double parMotionX, final double parMotionY, final double parMotionZ) {
- super(parWorld, parX, parY, parZ, parMotionX, parMotionY, parMotionZ);
- this.setParticleTextureIndex(82); // same as happy villager
- this.particleScale = 2.0F;
- this.setRBGColorF(0x88, 0x00, 0x88);
- }
+public class EntityParticleFXMysterious extends EntityAuraFX
+{
+ public EntityParticleFXMysterious(World parWorld,
+ double parX, double parY, double parZ,
+ double parMotionX, double parMotionY, double parMotionZ)
+ {
+ super(parWorld, parX, parY, parZ, parMotionX, parMotionY, parMotionZ);
+ setParticleTextureIndex(82); // same as happy villager
+ particleScale = 2.0F;
+ setRBGColorF(0x88, 0x00, 0x88);
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/player/PlayerCache.java b/src/Java/gtPlusPlus/core/util/player/PlayerCache.java
index ea40993dae..095eb543db 100644
--- a/src/Java/gtPlusPlus/core/util/player/PlayerCache.java
+++ b/src/Java/gtPlusPlus/core/util/player/PlayerCache.java
@@ -1,11 +1,24 @@
package gtPlusPlus.core.util.player;
-import java.io.*;
-import java.util.*;
-import java.util.Map.Entry;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Objects;
+import java.util.Properties;
+import java.util.UUID;
+
import net.minecraft.client.Minecraft;
import net.minecraft.world.World;
@@ -13,170 +26,165 @@ public class PlayerCache {
private static final File cache = new File("PlayerCache.dat");
- public static void appendParamChanges(final String playerName, final String playerUUIDasString) {
- final HashMap<String, UUID> playerInfo = new HashMap<String, UUID>();
- playerInfo.put(playerName, UUID.fromString(playerUUIDasString));
-
- /*
- * try { Utils.LOG_INFO("Attempting to load "+cache.getName());
- * properties.load(new FileInputStream(cache)); if (properties == null
- * || properties.equals(null)){ Utils.LOG_INFO("Please wait."); } else {
- * Utils.LOG_INFO("Loaded PlayerCache.dat");
- * properties.setProperty(playerName+"_", playerUUIDasString);
- * FileOutputStream fr=new FileOutputStream(cache); properties.store(fr,
- * "Player Cache."); fr.close(); }
- *
- * }
- */
-
- try {
- final FileOutputStream fos = new FileOutputStream("PlayerCache.dat");
- final ObjectOutputStream oos = new ObjectOutputStream(fos);
- oos.writeObject(playerInfo);
- oos.close();
- fos.close();
- Utils.LOG_INFO("Serialized Player data saved in PlayerCache.dat");
- }
-
- catch (final IOException e) {
- Utils.LOG_INFO("No PlayerCache file found, creating one.");
- PlayerCache.createPropertiesFile(playerName, playerUUIDasString);
- }
- }
-
- public static void createPropertiesFile(final String playerName, final String playerUUIDasString) {
- try {
- final Properties props = new Properties();
- props.setProperty(playerName + " ", playerUUIDasString);
- final OutputStream out = new FileOutputStream(PlayerCache.cache);
- props.store(out, "Player Cache.");
- Utils.LOG_INFO("PlayerCache.dat created for future use.");
- }
- catch (final Exception e) {
- e.printStackTrace();
- }
- }
-
public static final void initCache() {
- if (CORE.PlayerCache == null || CORE.PlayerCache.equals(null)) {
+ if (CORE.PlayerCache == null || CORE.PlayerCache.equals(null)){
try {
- if (PlayerCache.cache != null) {
+ if (cache != null){
CORE.PlayerCache = PlayerCache.readPropertiesFileAsMap();
- Utils.LOG_INFO("Loaded PlayerCache.dat");
+ Utils.LOG_INFO("Loaded PlayerCache.dat");
}
- }
- catch (final Exception e) {
+
+ } catch (Exception e) {
Utils.LOG_INFO("Failed to initialise PlayerCache.dat");
PlayerCache.createPropertiesFile("PLAYER_", "DATA");
- // e.printStackTrace();
+ //e.printStackTrace();
}
}
}
- public static String lookupPlayerByUUID(final UUID UUID) {
-
+ public static void createPropertiesFile(String playerName, String playerUUIDasString) {
try {
- final World worldw = Minecraft.getMinecraft().thePlayer.worldObj;
- // if (!worldw.isRemote){
-
- try {
- Map<String, UUID> map = null;
- try {
- map = PlayerCache.readPropertiesFileAsMap();
- }
- catch (final Exception e) {
- Utils.LOG_INFO("With " + e.getCause() + " as cause, Caught Exception: " + e.toString());
- // e.printStackTrace();
- }
- for (final Entry<String, UUID> entry : map.entrySet()) {
- if (Objects.equals(UUID, entry.getValue())) {
- return entry.getKey();
- }
- }
- return null;
- }
- catch (final NullPointerException e) {
- Utils.LOG_INFO("With " + e.getCause() + " as cause, Caught Exception: " + e.toString());
- // e.printStackTrace();
- }
-
- // }
-
+ Properties props = new Properties();
+ props.setProperty(playerName+" ", playerUUIDasString);
+ OutputStream out = new FileOutputStream(cache);
+ props.store(out, "Player Cache.");
+ Utils.LOG_INFO("PlayerCache.dat created for future use.");
}
- catch (final Throwable r) {
- Utils.LOG_INFO("With " + r.getCause() + " as cause, Caught Exception: " + r.toString());
+ catch (Exception e ) {
+ e.printStackTrace();
}
- return null;
}
- public static HashMap<String, UUID> readPropertiesFileAsMap() {
- HashMap<String, UUID> map = null;
- try {
- final FileInputStream fis = new FileInputStream(PlayerCache.cache);
- final ObjectInputStream ois = new ObjectInputStream(fis);
- map = (HashMap<String, UUID>) ois.readObject();
- ois.close();
- fis.close();
- }
- catch (final IOException ioe) {
- ioe.printStackTrace();
- return null;
- }
- catch (final ClassNotFoundException c) {
- Utils.LOG_INFO("Class not found");
- c.printStackTrace();
- return null;
- }
- Utils.LOG_WARNING("Deserialized PlayerCache..");
- return map;
+ public static void appendParamChanges(String playerName, String playerUUIDasString) {
+ HashMap<String, UUID> playerInfo = new HashMap<String, UUID>();
+ playerInfo.put(playerName, UUID.fromString(playerUUIDasString));
+
+ /*try {
+ Utils.LOG_INFO("Attempting to load "+cache.getName());
+ properties.load(new FileInputStream(cache));
+ if (properties == null || properties.equals(null)){
+ Utils.LOG_INFO("Please wait.");
+ }
+ else {
+ Utils.LOG_INFO("Loaded PlayerCache.dat");
+ properties.setProperty(playerName+"_", playerUUIDasString);
+ FileOutputStream fr=new FileOutputStream(cache);
+ properties.store(fr, "Player Cache.");
+ fr.close();
+ }
+
+ } */
+
+ try
+ {
+ FileOutputStream fos = new FileOutputStream("PlayerCache.dat");
+ ObjectOutputStream oos = new ObjectOutputStream(fos);
+ oos.writeObject(playerInfo);
+ oos.close();
+ fos.close();
+ Utils.LOG_INFO("Serialized Player data saved in PlayerCache.dat");
+ }
+
+ catch (IOException e) {
+ Utils.LOG_INFO("No PlayerCache file found, creating one.");
+ createPropertiesFile(playerName, playerUUIDasString);
+ }
}
/**
- * Reads a "properties" file, and returns it as a Map (a collection of
- * key/value pairs).
- *
- * Credit due to Alvin Alexander -
- * http://alvinalexander.com/java/java-properties-file-map-example?nocache=1
- * #comment-8215 Changed slightly as the filename and delimiter are constant
- * in my case.
- *
- * @param filename
- * The properties filename to read.
- * @param delimiter
- * The string (or character) that separates the key from the
- * value in the properties file.
+ * Reads a "properties" file, and returns it as a Map
+ * (a collection of key/value pairs).
+ *
+ * Credit due to Alvin Alexander - http://alvinalexander.com/java/java-properties-file-map-example?nocache=1#comment-8215
+ * Changed slightly as the filename and delimiter are constant in my case.
+ *
+ * @param filename The properties filename to read.
+ * @param delimiter The string (or character) that separates the key
+ * from the value in the properties file.
* @return The Map that contains the key/value pairs.
* @throws Exception
*/
@Deprecated
public static Map<String, String> readPropertiesFileAsMapOld() throws Exception {
- final String delimiter = "=";
- @SuppressWarnings({
- "rawtypes", "unchecked"
- })
- final Map<String, String> map = new HashMap<String, String>();
- final BufferedReader reader = new BufferedReader(new FileReader(PlayerCache.cache));
+ String delimiter = "=";
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ Map<String, String> map = new HashMap<String, String>();
+ BufferedReader reader = new BufferedReader(new FileReader(cache));
String line;
- while ((line = reader.readLine()) != null) {
- if (line.trim().length() == 0) {
- continue;
- }
- if (line.charAt(0) == '#') {
- continue;
- }
- // assumption here is that proper lines are like "String : <a
- // href="http://xxx.yyy.zzz/foo/bar""
- // title="http://xxx.yyy.zzz/foo/bar"">http://xxx.yyy.zzz/foo/bar"</a>,
+ while ((line = reader.readLine()) != null)
+ {
+ if (line.trim().length()==0) continue;
+ if (line.charAt(0)=='#') continue;
+ // assumption here is that proper lines are like "String : <a href="http://xxx.yyy.zzz/foo/bar"" title="http://xxx.yyy.zzz/foo/bar"">http://xxx.yyy.zzz/foo/bar"</a>,
// and the ":" is the delimiter
- final int delimPosition = line.indexOf(delimiter);
- final String key = line.substring(0, delimPosition - 1).trim();
- final String value = line.substring(delimPosition + 1).trim();
+ int delimPosition = line.indexOf(delimiter);
+ String key = line.substring(0, delimPosition-1).trim();
+ String value = line.substring(delimPosition+1).trim();
map.put(key, value);
}
reader.close();
CORE.PlayerCache = map;
return map;
}
+
+ public static HashMap<String, UUID> readPropertiesFileAsMap() {
+ HashMap<String, UUID> map = null;
+ try
+ {
+ FileInputStream fis = new FileInputStream(cache);
+ ObjectInputStream ois = new ObjectInputStream(fis);
+ map = (HashMap<String, UUID>) ois.readObject();
+ ois.close();
+ fis.close();
+ }catch(IOException ioe)
+ {
+ ioe.printStackTrace();
+ return null;
+ }catch(ClassNotFoundException c)
+ {
+ Utils.LOG_INFO("Class not found");
+ c.printStackTrace();
+ return null;
+ }
+ Utils.LOG_WARNING("Deserialized PlayerCache..");
+ return map;
+ }
+
+ public static String lookupPlayerByUUID(UUID UUID){
+
+ try {
+ World worldw = Minecraft.getMinecraft().thePlayer.worldObj;
+ //if (!worldw.isRemote){
+
+
+ try {
+ Map<String, UUID> map = null;
+ try {
+ map = readPropertiesFileAsMap();
+ } catch (Exception e) {
+ Utils.LOG_INFO("With "+e.getCause()+" as cause, Caught Exception: "+e.toString());
+ //e.printStackTrace();
+ }
+ for (Entry<String, UUID> entry : map.entrySet()) {
+ if (Objects.equals(UUID, entry.getValue())) {
+ return entry.getKey();
+ }
+ }
+ return null;
+ } catch (NullPointerException e) {
+ Utils.LOG_INFO("With "+e.getCause()+" as cause, Caught Exception: "+e.toString());
+ //e.printStackTrace();
+ }
+
+
+ //}
+
+
+ } catch (Throwable r){
+ Utils.LOG_INFO("With "+r.getCause()+" as cause, Caught Exception: "+r.toString());
+ }
+ return null;
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/player/PlayerUtils.java b/src/Java/gtPlusPlus/core/util/player/PlayerUtils.java
index 7d6e2f42e7..e1d5a4b311 100644
--- a/src/Java/gtPlusPlus/core/util/player/PlayerUtils.java
+++ b/src/Java/gtPlusPlus/core/util/player/PlayerUtils.java
@@ -1,9 +1,10 @@
package gtPlusPlus.core.util.player;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -11,132 +12,118 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PlayerUtils {
- @SideOnly(Side.CLIENT)
- public static Item getItemInPlayersHand() {
- final Minecraft mc = Minecraft.getMinecraft();
- Item heldItem = null;
-
- try {
- heldItem = mc.thePlayer.getHeldItem().getItem();
- }
- catch (final NullPointerException e) {
- return null;
- }
+ public static void messagePlayer(EntityPlayer P, String S){
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, S);
+ }
- if (heldItem != null) {
- return heldItem;
+ public static EntityPlayer getPlayer(String name){
+ List<EntityPlayer> i = new ArrayList<EntityPlayer>();
+ Iterator<EntityPlayer> crunchifyIterator = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator();
+ while (crunchifyIterator.hasNext()) {
+ i.add((crunchifyIterator.next()));
+ }
+ try{
+ for (EntityPlayer temp : i) {
+ if (temp.getDisplayName().toLowerCase().equals(name.toLowerCase())){
+ return temp;
+ }
+ }
}
-
+ catch(NullPointerException e){}
return null;
}
-
- @SideOnly(Side.CLIENT)
- public static ItemStack getItemStackInPlayersHand() {
- final Minecraft mc = Minecraft.getMinecraft();
- ItemStack heldItem = null;
- try {
- heldItem = mc.thePlayer.getHeldItem();
- }
- catch (final NullPointerException e) {
+
+ public static EntityPlayer getPlayerOnServerFromUUID(UUID parUUID){
+ if (parUUID == null)
+ {
return null;
}
- if (heldItem != null) {
- return heldItem;
+ List<EntityPlayerMP> allPlayers = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
+ for (EntityPlayerMP player : allPlayers)
+ {
+ if (player.getUniqueID().equals(parUUID))
+ {
+ return player;
+ }
}
return null;
}
- @SideOnly(Side.SERVER)
- public static ItemStack getItemStackInPlayersHand(final EntityPlayer player) {
- ItemStack heldItem = null;
- try {
- heldItem = player.getHeldItem();
- }
- catch (final NullPointerException e) {
+ //Not Clientside
+ public static EntityPlayer getPlayerInWorld(World world, String Name){
+ List<EntityPlayer> i = world.playerEntities;
+ Minecraft mc = Minecraft.getMinecraft();
+ try{
+ for (EntityPlayer temp : i) {
+ if (temp.getDisplayName().toLowerCase().equals(Name.toLowerCase())){
+ return temp;
+ }
+ }
+ }
+ catch(NullPointerException e){}
return null;
}
- if (heldItem != null) {
- return heldItem;
+
+ public static boolean isPlayerOP(EntityPlayer player){
+ if (player.canCommandSenderUseCommand(2, "")){
+ return true;
}
- return null;
+ return false;
}
- // Not Clientside
- public static ItemStack getItemStackInPlayersHand(final World world, final String Name) {
- final EntityPlayer thePlayer = PlayerUtils.getPlayer(Name);
+ //Not Clientside
+ public static ItemStack getItemStackInPlayersHand(World world, String Name){
+ EntityPlayer thePlayer = getPlayer(Name);
ItemStack heldItem = null;
- try {
- heldItem = thePlayer.getHeldItem();
- }
- catch (final NullPointerException e) {
- return null;
- }
- if (heldItem != null) {
+ try{heldItem = thePlayer.getHeldItem();
+ }catch(NullPointerException e){return null;}
+ if (heldItem != null){
return heldItem;
}
return null;
}
- public static EntityPlayer getPlayer(final String name) {
- final List<EntityPlayer> i = new ArrayList<EntityPlayer>();
- final Iterator<EntityPlayer> crunchifyIterator = MinecraftServer.getServer()
- .getConfigurationManager().playerEntityList.iterator();
- while (crunchifyIterator.hasNext()) {
- i.add(crunchifyIterator.next());
- }
- try {
- for (final EntityPlayer temp : i) {
- if (temp.getDisplayName().toLowerCase().equals(name.toLowerCase())) {
- return temp;
- }
- }
- }
- catch (final NullPointerException e) {
+ @SideOnly(Side.CLIENT)
+ public static ItemStack getItemStackInPlayersHand(){
+ Minecraft mc = Minecraft.getMinecraft();
+ ItemStack heldItem = null;
+ try{heldItem = mc.thePlayer.getHeldItem();
+ }catch(NullPointerException e){return null;}
+ if (heldItem != null){
+ return heldItem;
}
return null;
}
-
- // Not Clientside
- public static EntityPlayer getPlayerInWorld(final World world, final String Name) {
- final List<EntityPlayer> i = world.playerEntities;
- final Minecraft mc = Minecraft.getMinecraft();
- try {
- for (final EntityPlayer temp : i) {
- if (temp.getDisplayName().toLowerCase().equals(Name.toLowerCase())) {
- return temp;
- }
- }
- }
- catch (final NullPointerException e) {
+
+ @SideOnly(Side.SERVER)
+ public static ItemStack getItemStackInPlayersHand(EntityPlayer player){
+ ItemStack heldItem = null;
+ try{heldItem = player.getHeldItem();
+ }catch(NullPointerException e){return null;}
+ if (heldItem != null){
+ return heldItem;
}
return null;
}
- public static EntityPlayer getPlayerOnServerFromUUID(final UUID parUUID) {
- if (parUUID == null) {
- return null;
- }
- final List<EntityPlayerMP> allPlayers = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
- for (final EntityPlayerMP player : allPlayers) {
- if (player.getUniqueID().equals(parUUID)) {
- return player;
- }
+ @SideOnly(Side.CLIENT)
+ public static Item getItemInPlayersHand(){
+ Minecraft mc = Minecraft.getMinecraft();
+ Item heldItem = null;
+
+ try{heldItem = mc.thePlayer.getHeldItem().getItem();
+ }catch(NullPointerException e){return null;}
+
+ if (heldItem != null){
+ return heldItem;
}
+
return null;
}
- public static boolean isPlayerOP(final EntityPlayer player) {
- if (player.canCommandSenderUseCommand(2, "")) {
- return true;
- }
- return false;
- }
-
- public static void messagePlayer(final EntityPlayer P, final String S) {
- gregtech.api.util.GT_Utility.sendChatToPlayer(P, S);
- }
-
}
diff --git a/src/Java/gtPlusPlus/core/util/player/UtilsMining.java b/src/Java/gtPlusPlus/core/util/player/UtilsMining.java
index e92a5ac41a..1b6b957b32 100644
--- a/src/Java/gtPlusPlus/core/util/player/UtilsMining.java
+++ b/src/Java/gtPlusPlus/core/util/player/UtilsMining.java
@@ -8,133 +8,139 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class UtilsMining {
+
+ private static boolean durabilityDamage = false;
+ private static ItemStack stack;
- private static boolean durabilityDamage = false;
- private static ItemStack stack;
-
- public static Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld) {
+ public static Boolean canPickaxeBlock(Block currentBlock, World currentWorld){
String correctTool = "";
- if (!currentWorld.isRemote) {
+ if (!currentWorld.isRemote){
try {
correctTool = currentBlock.getHarvestTool(0);
- // Utils.LOG_WARNING(correctTool);
- if (correctTool.equals("pickaxe")) {
- return true;
+ //Utils.LOG_WARNING(correctTool);
+ if (correctTool.equals("pickaxe")){
+ return true;}
+ } catch (NullPointerException e){
+ return false;}
+ }
+ return false;
+ }
+
+ private static void removeBlockAndDropAsItem(World world, int X, int Y, int Z){
+ try {
+ Block block = world.getBlock(X, Y, Z);
+ if (canPickaxeBlock(block, world)){
+ if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
+ block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
+ world.setBlockToAir(X, Y, Z);
+
+ }
+ else {
+ Utils.LOG_WARNING("Incorrect Tool for mining this block.");
}
}
- catch (final NullPointerException e) {
- return false;
- }
+ } catch (NullPointerException e){
+
}
- return false;
}
- public static void customMine(final World world, final String FACING, final EntityPlayer aPlayer) {
+ public static void customMine(World world, String FACING, EntityPlayer aPlayer){
float DURABILITY_LOSS = 0;
- if (!world.isRemote) {
+ if (!world.isRemote){
int X = 0;
int Y = 0;
int Z = 0;
- if (FACING.equals("below") || FACING.equals("above")) {
+ if (FACING.equals("below") || FACING.equals("above")){
- // Set Player Facing
+ //Set Player Facing
X = (int) aPlayer.posX;
- Utils.LOG_WARNING("Setting Variable X: " + X);
- if (FACING.equals("above")) {
+ Utils.LOG_WARNING("Setting Variable X: "+X);
+ if (FACING.equals("above")){
Z = (int) aPlayer.posY + 1;
- Utils.LOG_WARNING("Setting Variable Y: " + Y);
- }
- else {
- Z = (int) aPlayer.posY - 1;
- Utils.LOG_WARNING("Setting Variable Y: " + Y);
- }
+ Utils.LOG_WARNING("Setting Variable Y: "+Y);
+ }
+ else {
+ Z = (int) aPlayer.posY - 1;
+ Utils.LOG_WARNING("Setting Variable Y: "+Y);}
Z = (int) aPlayer.posZ;
- Utils.LOG_WARNING("Setting Variable Z: " + Z);
+ Utils.LOG_WARNING("Setting Variable Z: "+Z);
DURABILITY_LOSS = 0;
- for (int i = -2; i < 3; i++) {
- for (int j = -2; j < 3; j++) {
- for (int k = -2; k < 3; k++) {
- /*
- * // float dur = calculateDurabilityLoss(world, X +
- * i, Y + k, Z + j); // DURABILITY_LOSS =
- * (DURABILITY_LOSS + dur); // Utils.LOG_WARNING(
- * "Added Loss: "+dur);
- */ UtilsMining.removeBlockAndDropAsItem(world, X + i, Y + k, Z + j);
+ for(int i = -2; i < 3; i++) {
+ for(int j = -2; j < 3; j++) {
+ for(int k = -2; k < 3; k++) {
+/*// float dur = calculateDurabilityLoss(world, X + i, Y + k, Z + j);
+// DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+// Utils.LOG_WARNING("Added Loss: "+dur);
+*/ removeBlockAndDropAsItem(world, X + i, Y + k, Z + j);
}
}
}
}
- else if (FACING.equals("facingEast") || FACING.equals("facingWest")) {
+ else if (FACING.equals("facingEast") || FACING.equals("facingWest")){
- // Set Player Facing
+ //Set Player Facing
Z = (int) aPlayer.posZ;
Y = (int) aPlayer.posY;
- if (FACING.equals("facingEast")) {
- X = (int) aPlayer.posX + 1;
- }
- else {
- X = (int) aPlayer.posX - 1;
- }
+ if (FACING.equals("facingEast")){
+ X = (int) aPlayer.posX + 1;}
+ else {
+ X = (int) aPlayer.posX - 1;}
+
DURABILITY_LOSS = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int k = -1; k < 2; k++) {
- /*
- * float dur = calculateDurabilityLoss(world, X+k, Y
- * + i, Z + j); DURABILITY_LOSS = (DURABILITY_LOSS +
- * dur); Utils.LOG_WARNING("Added Loss: "+dur);
- */
- UtilsMining.removeBlockAndDropAsItem(world, X + k, Y + i, Z + j);
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ for(int k = -1; k < 2; k++) {
+ /*float dur = calculateDurabilityLoss(world, X+k, Y + i, Z + j);
+ DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+ Utils.LOG_WARNING("Added Loss: "+dur);*/
+ removeBlockAndDropAsItem(world, X+k, Y + i, Z + j);
}
}
}
}
- else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")) {
+ else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")){
- // Set Player Facing
+ //Set Player Facing
X = (int) aPlayer.posX;
Y = (int) aPlayer.posY;
-
- if (FACING.equals("facingNorth")) {
- Z = (int) aPlayer.posZ + 1;
- }
+
+ if (FACING.equals("facingNorth")){
+ Z = (int) aPlayer.posZ + 1;}
else {
- Z = (int) aPlayer.posZ - 1;
- }
-
+ Z = (int) aPlayer.posZ - 1;}
+
DURABILITY_LOSS = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int k = -1; k < 2; k++) {
- /*
- * float dur = calculateDurabilityLoss(world, X + j,
- * Y + i, Z+k); DURABILITY_LOSS = (DURABILITY_LOSS +
- * dur); Utils.LOG_WARNING("Added Loss: "+dur);
- */
- UtilsMining.removeBlockAndDropAsItem(world, X + j, Y + i, Z + k);
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ for(int k = -1; k < 2; k++) {
+ /*float dur = calculateDurabilityLoss(world, X + j, Y + i, Z+k);
+ DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+ Utils.LOG_WARNING("Added Loss: "+dur);*/
+ removeBlockAndDropAsItem(world, X + j, Y + i, Z+k);
}
}
}
}
- // Set Durability damage to the item
- if (UtilsMining.durabilityDamage == true) {
- Utils.LOG_WARNING("Total Loss: " + (int) DURABILITY_LOSS);
- if (UtilsMining.stack.getItemDamage() < UtilsMining.stack.getMaxDamage() - DURABILITY_LOSS) {
- UtilsMining.stack.damageItem((int) DURABILITY_LOSS, aPlayer);
- }
+ //Set Durability damage to the item
+ if (durabilityDamage == true){
+ Utils.LOG_WARNING("Total Loss: "+(int)DURABILITY_LOSS);
+ if (stack.getItemDamage() < (stack.getMaxDamage()-DURABILITY_LOSS)){
+ stack.damageItem((int) DURABILITY_LOSS, aPlayer);
+ }
}
DURABILITY_LOSS = 0;
}
}
-
- public static boolean getBlockType(final Block block) {
+
+
+ public static boolean getBlockType(Block block){
final String LIQUID = "liquid";
final String BLOCK = "block";
final String ORE = "ore";
@@ -144,51 +150,31 @@ public class UtilsMining {
try {
blockClass = block.getClass().toString().toLowerCase();
Utils.LOG_WARNING(blockClass);
- if (blockClass.toLowerCase().contains(LIQUID)) {
- Utils.LOG_WARNING(block.toString() + " is a Liquid.");
+ if (blockClass.toLowerCase().contains(LIQUID)){
+ Utils.LOG_WARNING(block.toString()+" is a Liquid.");
return false;
}
- else if (blockClass.toLowerCase().contains(ORE)) {
- Utils.LOG_WARNING(block.toString() + " is an Ore.");
+ else if (blockClass.toLowerCase().contains(ORE)){
+ Utils.LOG_WARNING(block.toString()+" is an Ore.");
return true;
}
- else if (blockClass.toLowerCase().contains(AIR)) {
- Utils.LOG_WARNING(block.toString() + " is Air.");
+ else if (blockClass.toLowerCase().contains(AIR)){
+ Utils.LOG_WARNING(block.toString()+" is Air.");
return false;
}
- else if (blockClass.toLowerCase().contains(BLOCK)) {
- Utils.LOG_WARNING(block.toString() + " is a block of some kind.");
+ else if (blockClass.toLowerCase().contains(BLOCK)){
+ Utils.LOG_WARNING(block.toString()+" is a block of some kind.");
return false;
}
else {
- Utils.LOG_WARNING(block.toString() + " is mystery.");
+ Utils.LOG_WARNING(block.toString()+" is mystery.");
return false;
}
}
- catch (final NullPointerException e) {
+ catch(NullPointerException e){
return false;
}
}
-
- private static void removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z) {
- try {
- final Block block = world.getBlock(X, Y, Z);
- if (UtilsMining.canPickaxeBlock(block, world)) {
- if (block != Blocks.bedrock && block.getBlockHardness(world, X, Y, Z) != -1
- && block.getBlockHardness(world, X, Y, Z) <= 100 && block != Blocks.water
- && block != Blocks.lava) {
- block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
- world.setBlockToAir(X, Y, Z);
-
- }
- else {
- Utils.LOG_WARNING("Incorrect Tool for mining this block.");
- }
- }
- }
- catch (final NullPointerException e) {
-
- }
- }
-
+
+
}
diff --git a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
index 82ed05db2a..39a118e440 100644
--- a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
+++ b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
@@ -1,8 +1,5 @@
package gtPlusPlus.core.util.recipe;
-import java.util.*;
-
-import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.core.handler.COMPAT_HANDLER;
import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler;
@@ -11,245 +8,102 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.recipe.shapeless.ShapelessUtils;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
-import net.minecraftforge.oredict.*;
+import net.minecraftforge.oredict.OreDictionary;
+import net.minecraftforge.oredict.ShapedOreRecipe;
+import net.minecraftforge.oredict.ShapelessOreRecipe;
+import cpw.mods.fml.common.registry.GameRegistry;
public class RecipeUtils {
- public static boolean addShapedGregtechRecipe(final Object InputItem1, final Object InputItem2,
- final Object InputItem3, final Object InputItem4, final Object InputItem5, final Object InputItem6,
- final Object InputItem7, final Object InputItem8, final Object InputItem9, final ItemStack OutputItem) {
-
- if (!(InputItem1 instanceof ItemStack) && !(InputItem1 instanceof String) && InputItem1 != null
- || !(InputItem2 instanceof ItemStack) && !(InputItem2 instanceof String) && InputItem2 != null
- || !(InputItem3 instanceof ItemStack) && !(InputItem3 instanceof String) && InputItem3 != null
- || !(InputItem4 instanceof ItemStack) && !(InputItem4 instanceof String) && InputItem4 != null
- || !(InputItem5 instanceof ItemStack) && !(InputItem5 instanceof String) && InputItem5 != null
- || !(InputItem6 instanceof ItemStack) && !(InputItem6 instanceof String) && InputItem6 != null
- || !(InputItem7 instanceof ItemStack) && !(InputItem7 instanceof String) && InputItem7 != null
- || !(InputItem8 instanceof ItemStack) && !(InputItem8 instanceof String) && InputItem8 != null
- || !(InputItem9 instanceof ItemStack) && !(InputItem9 instanceof String) && InputItem9 != null) {
- Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String.");
- return false;
- }
-
- if (GT_ModHandler.addCraftingRecipe(OutputItem,
- GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
- new Object[] {
- "ABC", "DEF", "GHI", 'A', InputItem1, 'B', InputItem2, 'C', InputItem3, 'D', InputItem4, 'E',
- InputItem5, 'F', InputItem6, 'G', InputItem7, 'H', InputItem8, 'I', InputItem9
- })) {
- Utils.LOG_INFO("Success! Added a recipe for " + OutputItem.getDisplayName());
- RegistrationHandler.recipesSuccess++;
- return true;
- }
- return false;
- }
-
- public static void addShapelessGregtechRecipe(final ItemStack OutputItem, final Object... inputItems) {
-
- for (final Object whatever : inputItems) {
- if (!(whatever instanceof ItemStack) && !(whatever instanceof String)) {
- Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String.");
- return;
- }
- }
-
- GT_ModHandler.addShapelessCraftingRecipe(OutputItem,
- GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] {
- inputItems
- });
- }
-
- private static boolean attemptRecipeRemoval(final Item I) {
- Utils.LOG_WARNING("Create list of recipes.");
- final List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
- final Iterator<IRecipe> items = recipes.iterator();
- Utils.LOG_WARNING("Begin list iteration.");
- while (items.hasNext()) {
- final ItemStack is = items.next().getRecipeOutput();
- if (is != null && is.getItem() == I) {
- items.remove();
- Utils.LOG_INFO("Remove a recipe with " + I.getUnlocalizedName() + " as output.");
- continue;
- }
- }
- Utils.LOG_WARNING("All recipes should be gone?");
- if (!items.hasNext()) {
- Utils.LOG_WARNING("We iterated once, let's try again to double check.");
- final Iterator<IRecipe> items2 = recipes.iterator();
- while (items2.hasNext()) {
- final ItemStack is = items2.next().getRecipeOutput();
- if (is != null && is.getItem() == I) {
- items.remove();
- Utils.LOG_WARNING("REMOVING MISSED RECIPE - RECHECK CONSTRUCTORS");
- return true;
- }
- }
- Utils.LOG_WARNING("Should be all gone now after double checking, so return true.");
- return true;
- }
- Utils.LOG_INFO("Return false, because something went wrong.");
- return false;
- }
-
- public static boolean buildShapelessRecipe(final ItemStack output, final Object[] input) {
- return ShapelessUtils.addShapelessRecipe(output, input);
- }
+ public static boolean recipeBuilder(Object slot_1, Object slot_2, Object slot_3, Object slot_4, Object slot_5, Object slot_6, Object slot_7, Object slot_8, Object slot_9, ItemStack resultItem){
- public static ItemStack getItemStackFromOreDict(final String oredictName) {
- final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
- return oreDictList.get(0);
- }
+ ArrayList<Object> validSlots = new ArrayList<Object>();
- public static boolean recipeBuilder(final Object slot_1, final Object slot_2, final Object slot_3,
- final Object slot_4, final Object slot_5, final Object slot_6, final Object slot_7, final Object slot_8,
- final Object slot_9, final ItemStack resultItem) {
-
- final ArrayList<Object> validSlots = new ArrayList<Object>();
-
- Utils.LOG_INFO("Trying to add a recipe for " + resultItem.toString());
- String a, b, c, d, e, f, g, h, i;
- if (slot_1 == null) {
- a = " ";
- }
- else {
- a = "1";
- validSlots.add('1');
- validSlots.add(slot_1);
- }
+ Utils.LOG_INFO("Trying to add a recipe for "+resultItem.toString());
+ String a,b,c,d,e,f,g,h,i;
+ if (slot_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(slot_1);}
Utils.LOG_WARNING(a);
- if (slot_2 == null) {
- b = " ";
- }
- else {
- b = "2";
- validSlots.add('2');
- validSlots.add(slot_2);
- }
+ if (slot_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(slot_2);}
Utils.LOG_WARNING(b);
- if (slot_3 == null) {
- c = " ";
- }
- else {
- c = "3";
- validSlots.add('3');
- validSlots.add(slot_3);
- }
+ if (slot_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(slot_3);}
Utils.LOG_WARNING(c);
- if (slot_4 == null) {
- d = " ";
- }
- else {
- d = "4";
- validSlots.add('4');
- validSlots.add(slot_4);
- }
+ if (slot_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(slot_4);}
Utils.LOG_WARNING(d);
- if (slot_5 == null) {
- e = " ";
- }
- else {
- e = "5";
- validSlots.add('5');
- validSlots.add(slot_5);
- }
+ if (slot_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(slot_5);}
Utils.LOG_WARNING(e);
- if (slot_6 == null) {
- f = " ";
- }
- else {
- f = "6";
- validSlots.add('6');
- validSlots.add(slot_6);
- }
+ if (slot_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(slot_6);}
Utils.LOG_WARNING(f);
- if (slot_7 == null) {
- g = " ";
- }
- else {
- g = "7";
- validSlots.add('7');
- validSlots.add(slot_7);
- }
+ if (slot_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(slot_7);}
Utils.LOG_WARNING(g);
- if (slot_8 == null) {
- h = " ";
- }
- else {
- h = "8";
- validSlots.add('8');
- validSlots.add(slot_8);
- }
+ if (slot_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(slot_8);}
Utils.LOG_WARNING(h);
- if (slot_9 == null) {
- i = " ";
- }
- else {
- i = "9";
- validSlots.add('9');
- validSlots.add(slot_9);
- }
+ if (slot_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(slot_9);}
Utils.LOG_WARNING(i);
+
Utils.LOG_ERROR("_______");
- final String lineOne = a + b + c;
- Utils.LOG_ERROR("|" + a + "|" + b + "|" + c + "|");
+ String lineOne = a+b+c;
+ Utils.LOG_ERROR("|"+a+"|"+b+"|"+c+"|");
Utils.LOG_ERROR("_______");
- final String lineTwo = d + e + f;
- Utils.LOG_ERROR("|" + d + "|" + e + "|" + f + "|");
+ String lineTwo = d+e+f;
+ Utils.LOG_ERROR("|"+d+"|"+e+"|"+f+"|");
Utils.LOG_ERROR("_______");
- final String lineThree = g + h + i;
- Utils.LOG_ERROR("|" + g + "|" + h + "|" + i + "|");
+ String lineThree = g+h+i;
+ Utils.LOG_ERROR("|"+g+"|"+h+"|"+i+"|");
Utils.LOG_ERROR("_______");
validSlots.add(0, lineOne);
validSlots.add(1, lineTwo);
validSlots.add(2, lineThree);
boolean advancedLog = false;
- if (CORE.DEBUG) {
+ if (CORE.DEBUG){
advancedLog = true;
- }
- if (advancedLog) {
+ }
+ if (advancedLog){
int j = 0;
- final int l = validSlots.size();
- Utils.LOG_WARNING("l:" + l);
+ int l = validSlots.size();
+ Utils.LOG_WARNING("l:"+l);
while (j <= l) {
- Utils.LOG_WARNING("j:" + j);
- if (j <= 2) {
- Utils.LOG_WARNING("ArrayList Values: " + validSlots.get(j));
+ Utils.LOG_WARNING("j:"+j);
+ if (j <= 2){
+ Utils.LOG_WARNING("ArrayList Values: "+validSlots.get(j));
Utils.LOG_WARNING("Adding 1.");
j++;
}
- else if (j >= 3) {
- Utils.LOG_WARNING("ArrayList Values: '" + validSlots.get(j) + "' " + validSlots.get(j + 1));
- if (j < l - 2) {
+ else if (j >= 3){
+ Utils.LOG_WARNING("ArrayList Values: '"+validSlots.get(j)+"' "+validSlots.get(j+1));
+ if (j < (l-2)){
Utils.LOG_WARNING("Adding 2.");
- j = j + 2;
+ j=j+2;
}
else {
Utils.LOG_WARNING("Done iteration.");
break;
}
}
- else if (j == l) {
+ else if (j == l){
Utils.LOG_WARNING("Done iteration.");
break;
}
- if (validSlots.get(j) instanceof String || validSlots.get(j) instanceof ItemStack) {
- // Utils.LOG_WARNING("Is Valid: "+validSlots.get(j));
+ if (validSlots.get(j) instanceof String || validSlots.get(j) instanceof ItemStack){
+ //Utils.LOG_WARNING("Is Valid: "+validSlots.get(j));
}
- }
+ }
}
try {
- GameRegistry.addRecipe(new ShapedOreRecipe(resultItem.copy(), validSlots.toArray()));
- Utils.LOG_INFO("Success! Added a recipe for " + resultItem.getDisplayName());
- if (!COMPAT_HANDLER.areInitItemsLoaded) {
+ GameRegistry.addRecipe(new ShapedOreRecipe(resultItem.copy(), (Object[]) validSlots.toArray()));
+ Utils.LOG_INFO("Success! Added a recipe for "+resultItem.getDisplayName());
+ if (!COMPAT_HANDLER.areInitItemsLoaded){
RegistrationHandler.recipesSuccess++;
}
else {
@@ -257,210 +111,55 @@ public class RecipeUtils {
}
return true;
}
- catch (NullPointerException | ClassCastException k) {
+ catch(NullPointerException | ClassCastException k){
k.getMessage();
k.getClass();
k.printStackTrace();
k.getLocalizedMessage();
- Utils.LOG_WARNING("@@@: Invalid Recipe detected for: " + resultItem.getUnlocalizedName());
- if (!COMPAT_HANDLER.areInitItemsLoaded) {
+ Utils.LOG_WARNING("@@@: Invalid Recipe detected for: "+resultItem.getUnlocalizedName());
+ if (!COMPAT_HANDLER.areInitItemsLoaded){
RegistrationHandler.recipesFailed++;
}
else {
LateRegistrationHandler.recipesFailed++;
- }
+ }
return false;
}
}
- public static void recipeBuilder(final Object[] array, final ItemStack outPut) {
- Utils.LOG_SPECIFIC_WARNING("object Array - recipeBuilder",
- "Attempting to build a recipe using an object array as an input, splitting it, then running the normal recipeBuilder() method.",
- 396);
- Object a = null;
- Object b = null;
- Object c = null;
- Object d = null;
- Object e = null;
- Object f = null;
- Object g = null;
- Object h = null;
- Object i = null;
- for (int z = 0; z <= array.length; z++) {
- array[z].toString();
- switch (z) {
- case 0:
- a = array[z];
- break;
- case 1:
- b = array[z];
- break;
- case 2:
- c = array[z];
- break;
- case 3:
- d = array[z];
- break;
- case 4:
- e = array[z];
- break;
- case 5:
- f = array[z];
- break;
- case 6:
- g = array[z];
- break;
- case 7:
- h = array[z];
- break;
- case 8:
- i = array[z];
- break;
- default:
- break;
- }
- RecipeUtils.recipeBuilder(a, b, c, d, e, f, g, h, i, outPut);
- }
- }
+ public static void shapelessBuilder(ItemStack Output, Object slot_1, Object slot_2, Object slot_3, Object slot_4, Object slot_5, Object slot_6, Object slot_7, Object slot_8, Object slot_9){
+ //Item output_ITEM = Output.getItem();
- public static boolean removeCraftingRecipe(Object x) {
- if (null == x) {
- return false;
- }
- if (x instanceof String) {
- final Item R = ItemUtils.getItem((String) x);
- if (R != null) {
- x = R;
- }
- else {
- return false;
- }
- }
- if (x instanceof Item || x instanceof ItemStack) {
- if (x instanceof Item) {
- final ItemStack r = new ItemStack((Item) x);
- Utils.LOG_INFO("Removing Recipe for " + r.getUnlocalizedName());
- }
- else {
- Utils.LOG_INFO("Removing Recipe for " + ((ItemStack) x).getUnlocalizedName());
- }
- if (x instanceof ItemStack) {
- final Item r = ((ItemStack) x).getItem();
- if (null != r) {
- x = r;
- }
- else {
- Utils.LOG_INFO("Recipe removal failed - Tell Alkalus.");
- return false;
- }
- }
- if (RecipeUtils.attemptRecipeRemoval((Item) x)) {
- Utils.LOG_INFO("Recipe removal successful");
- return true;
- }
- Utils.LOG_INFO("Recipe removal failed - Tell Alkalus.");
- return false;
- }
- return false;
- }
-
- public static void shapelessBuilder(final ItemStack Output, final Object slot_1, final Object slot_2,
- final Object slot_3, final Object slot_4, final Object slot_5, final Object slot_6, final Object slot_7,
- final Object slot_8, final Object slot_9) {
- // Item output_ITEM = Output.getItem();
-
- final ArrayList<Object> validSlots = new ArrayList<Object>();
+ ArrayList<Object> validSlots = new ArrayList<Object>();
- Utils.LOG_INFO("Trying to add a recipe for " + Output.toString());
- String a, b, c, d, e, f, g, h, i;
- if (slot_1 == null) {
- a = " ";
- }
- else {
- a = "1";
- validSlots.add('1');
- validSlots.add(slot_1);
- }
+ Utils.LOG_INFO("Trying to add a recipe for "+Output.toString());
+ String a,b,c,d,e,f,g,h,i;
+ if (slot_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(slot_1);}
Utils.LOG_WARNING(a);
- if (slot_2 == null) {
- b = " ";
- }
- else {
- b = "2";
- validSlots.add('2');
- validSlots.add(slot_2);
- }
+ if (slot_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(slot_2);}
Utils.LOG_WARNING(b);
- if (slot_3 == null) {
- c = " ";
- }
- else {
- c = "3";
- validSlots.add('3');
- validSlots.add(slot_3);
- }
+ if (slot_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(slot_3);}
Utils.LOG_WARNING(c);
- if (slot_4 == null) {
- d = " ";
- }
- else {
- d = "4";
- validSlots.add('4');
- validSlots.add(slot_4);
- }
+ if (slot_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(slot_4);}
Utils.LOG_WARNING(d);
- if (slot_5 == null) {
- e = " ";
- }
- else {
- e = "5";
- validSlots.add('5');
- validSlots.add(slot_5);
- }
+ if (slot_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(slot_5);}
Utils.LOG_WARNING(e);
- if (slot_6 == null) {
- f = " ";
- }
- else {
- f = "6";
- validSlots.add('6');
- validSlots.add(slot_6);
- }
+ if (slot_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(slot_6);}
Utils.LOG_WARNING(f);
- if (slot_7 == null) {
- g = " ";
- }
- else {
- g = "7";
- validSlots.add('7');
- validSlots.add(slot_7);
- }
+ if (slot_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(slot_7);}
Utils.LOG_WARNING(g);
- if (slot_8 == null) {
- h = " ";
- }
- else {
- h = "8";
- validSlots.add('8');
- validSlots.add(slot_8);
- }
+ if (slot_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(slot_8);}
Utils.LOG_WARNING(h);
- if (slot_9 == null) {
- i = " ";
- }
- else {
- i = "9";
- validSlots.add('9');
- validSlots.add(slot_9);
- }
+ if (slot_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(slot_9);}
Utils.LOG_WARNING(i);
+
Utils.LOG_ERROR("_______");
- Utils.LOG_ERROR("|" + a + "|" + b + "|" + c + "|");
+ Utils.LOG_ERROR("|"+a+"|"+b+"|"+c+"|");
Utils.LOG_ERROR("_______");
- Utils.LOG_ERROR("|" + d + "|" + e + "|" + f + "|");
+ Utils.LOG_ERROR("|"+d+"|"+e+"|"+f+"|");
Utils.LOG_ERROR("_______");
- Utils.LOG_ERROR("|" + g + "|" + h + "|" + i + "|");
+ Utils.LOG_ERROR("|"+g+"|"+h+"|"+i+"|");
Utils.LOG_ERROR("_______");
validSlots.add(0, a);
@@ -474,25 +173,210 @@ public class RecipeUtils {
validSlots.add(8, i);
try {
- // GameRegistry.addRecipe(new ShapelessOreRecipe(Output,
- // outputAmount), (Object[]) validSlots.toArray());
- GameRegistry.addRecipe(new ShapelessOreRecipe(Output, validSlots.toArray()));
- // GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1),
- // new Object[] {slot_1, slot_2});
- Utils.LOG_INFO("Success! Added a recipe for " + Output.getDisplayName());
- RegistrationHandler.recipesSuccess++;
+ //GameRegistry.addRecipe(new ShapelessOreRecipe(Output, outputAmount), (Object[]) validSlots.toArray());
+ GameRegistry.addRecipe(new ShapelessOreRecipe(Output, (Object[]) validSlots.toArray()));
+ //GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2});
+ Utils.LOG_INFO("Success! Added a recipe for "+Output.getDisplayName());
+ RegistrationHandler.recipesSuccess++;
}
- catch (final RuntimeException k) {
+ catch(RuntimeException k){
k.getMessage();
k.getClass();
k.printStackTrace();
k.getLocalizedMessage();
- Utils.LOG_WARNING("@@@: Invalid Recipe detected for: " + Output.getUnlocalizedName());
+ Utils.LOG_WARNING("@@@: Invalid Recipe detected for: "+Output.getUnlocalizedName());
RegistrationHandler.recipesFailed++;
}
- // GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new
- // Object[] {slot_1, slot_2});
+
+ //GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2});
+ }
+
+ public static void recipeBuilder(Object[] array, ItemStack outPut) {
+ Utils.LOG_SPECIFIC_WARNING("object Array - recipeBuilder", "Attempting to build a recipe using an object array as an input, splitting it, then running the normal recipeBuilder() method.", 396);
+ Object a=null;
+ Object b=null;
+ Object c=null;
+ Object d=null;
+ Object e=null;
+ Object f=null;
+ Object g=null;
+ Object h=null;
+ Object i=null;
+ for(int z =0; z <= array.length; z++){
+ array[z].toString();
+ switch(z)
+ {
+ case 0:
+ a = array[z];
+ break;
+ case 1:
+ b = array[z];
+ break;
+ case 2:
+ c = array[z];
+ break;
+ case 3:
+ d = array[z];
+ break;
+ case 4:
+ e = array[z];
+ break;
+ case 5:
+ f = array[z];
+ break;
+ case 6:
+ g = array[z];
+ break;
+ case 7:
+ h = array[z];
+ break;
+ case 8:
+ i = array[z];
+ break;
+ default:
+ break;
+ }
+ recipeBuilder(a, b, c, d, e, f, g, h, i, outPut);
+ }
+ }
+
+ public static boolean removeCraftingRecipe(Object x){
+ if (null == x){return false;}
+ if (x instanceof String){
+ Item R = ItemUtils.getItem((String) x);
+ if (R != null){
+ x = R;
+ }
+ else {
+ return false;
+ }
+ }
+ if (x instanceof Item || x instanceof ItemStack){
+ if (x instanceof Item){
+ ItemStack r = new ItemStack((Item) x);
+ Utils.LOG_INFO("Removing Recipe for "+r.getUnlocalizedName());
+ }
+ else {
+ Utils.LOG_INFO("Removing Recipe for "+((ItemStack) x).getUnlocalizedName());
+ }
+ if (x instanceof ItemStack){
+ Item r = ((ItemStack) x).getItem();
+ if (null != r){
+ x = r;
+ }
+ else {
+ Utils.LOG_INFO("Recipe removal failed - Tell Alkalus.");
+ return false;
+ }
+ }
+ if (RecipeUtils.attemptRecipeRemoval((Item) x)){
+ Utils.LOG_INFO("Recipe removal successful");
+ return true;
+ }
+ Utils.LOG_INFO("Recipe removal failed - Tell Alkalus.");
+ return false;
+ }
+ return false;
+ }
+
+ private static boolean attemptRecipeRemoval(Item I){
+ Utils.LOG_WARNING("Create list of recipes.");
+ List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
+ Iterator<IRecipe> items = recipes.iterator();
+ Utils.LOG_WARNING("Begin list iteration.");
+ while (items.hasNext()) {
+ ItemStack is = items.next().getRecipeOutput();
+ if (is != null && is.getItem() == I){
+ items.remove();
+ Utils.LOG_INFO("Remove a recipe with "+I.getUnlocalizedName()+" as output.");
+ continue;
+ }
+ }
+ Utils.LOG_WARNING("All recipes should be gone?");
+ if (!items.hasNext()){
+ Utils.LOG_WARNING("We iterated once, let's try again to double check.");
+ Iterator<IRecipe> items2 = recipes.iterator();
+ while (items2.hasNext()) {
+ ItemStack is = items2.next().getRecipeOutput();
+ if (is != null && is.getItem() == I){
+ items.remove();
+ Utils.LOG_WARNING("REMOVING MISSED RECIPE - RECHECK CONSTRUCTORS");
+ return true;
+ }
+ }
+ Utils.LOG_WARNING("Should be all gone now after double checking, so return true.");
+ return true;
+ }
+ Utils.LOG_INFO("Return false, because something went wrong.");
+ return false;
+ }
+
+
+
+
+
+
+ public static boolean addShapedGregtechRecipe(
+ Object InputItem1, Object InputItem2, Object InputItem3,
+ Object InputItem4, Object InputItem5, Object InputItem6,
+ Object InputItem7, Object InputItem8, Object InputItem9,
+ ItemStack OutputItem){
+
+ if ((!(InputItem1 instanceof ItemStack) && !(InputItem1 instanceof String) && (InputItem1 != null)) ||
+ (!(InputItem2 instanceof ItemStack) && !(InputItem2 instanceof String) && (InputItem2 != null)) ||
+ (!(InputItem3 instanceof ItemStack) && !(InputItem3 instanceof String) && (InputItem3 != null)) ||
+ (!(InputItem4 instanceof ItemStack) && !(InputItem4 instanceof String) && (InputItem4 != null)) ||
+ (!(InputItem5 instanceof ItemStack) && !(InputItem5 instanceof String) && (InputItem5 != null)) ||
+ (!(InputItem6 instanceof ItemStack) && !(InputItem6 instanceof String) && (InputItem6 != null)) ||
+ (!(InputItem7 instanceof ItemStack) && !(InputItem7 instanceof String) && (InputItem7 != null)) ||
+ (!(InputItem8 instanceof ItemStack) && !(InputItem8 instanceof String) && (InputItem8 != null)) ||
+ (!(InputItem9 instanceof ItemStack) && !(InputItem9 instanceof String) && (InputItem9 != null))){
+ Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String.");
+ return false;
+ }
+
+ if (GT_ModHandler.addCraftingRecipe(OutputItem,
+ GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"ABC", "DEF", "GHI",
+ 'A', InputItem1,
+ 'B', InputItem2,
+ 'C', InputItem3,
+ 'D', InputItem4,
+ 'E', InputItem5,
+ 'F', InputItem6,
+ 'G', InputItem7,
+ 'H', InputItem8,
+ 'I', InputItem9})){
+ Utils.LOG_INFO("Success! Added a recipe for "+OutputItem.getDisplayName());
+ RegistrationHandler.recipesSuccess++;
+ return true;
+ }
+ return false;
+ }
+
+ public static void addShapelessGregtechRecipe(ItemStack OutputItem, Object... inputItems){
+
+ for(Object whatever : inputItems){
+ if (!(whatever instanceof ItemStack) && !(whatever instanceof String)){
+ Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String.");
+ return;
+ }
+ }
+
+ GT_ModHandler.addShapelessCraftingRecipe(OutputItem,
+ GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
+ new Object[]{inputItems});
+ }
+
+ public static ItemStack getItemStackFromOreDict(String oredictName){
+ ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
+ return oreDictList.get(0);
+ }
+
+ public static boolean buildShapelessRecipe(ItemStack output, Object[] input){
+ return ShapelessUtils.addShapelessRecipe(output, input);
}
}
diff --git a/src/Java/gtPlusPlus/core/util/recipe/shapeless/ShapelessUtils.java b/src/Java/gtPlusPlus/core/util/recipe/shapeless/ShapelessUtils.java
index 812cfa626d..bf9d4960d8 100644
--- a/src/Java/gtPlusPlus/core/util/recipe/shapeless/ShapelessUtils.java
+++ b/src/Java/gtPlusPlus/core/util/recipe/shapeless/ShapelessUtils.java
@@ -1,8 +1,9 @@
package gtPlusPlus.core.util.recipe.shapeless;
+import gtPlusPlus.core.util.Utils;
+
import java.util.ArrayList;
-import gtPlusPlus.core.util.Utils;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -11,36 +12,45 @@ import net.minecraft.item.crafting.ShapelessRecipes;
public class ShapelessUtils {
- public static boolean addShapelessRecipe(final ItemStack output, final Object... params) {
- final ArrayList<ItemStack> arraylist = new ArrayList<ItemStack>();
- final Object[] aobject = params;
- final int i = params.length;
- for (int j = 0; j < i; ++j) {
- final Object object1 = aobject[j];
+ public static boolean addShapelessRecipe(ItemStack output, Object ... params)
+ {
+ ArrayList<ItemStack> arraylist = new ArrayList<ItemStack>();
+ Object[] aobject = params;
+ int i = params.length;
- if (object1 instanceof ItemStack) {
- arraylist.add(((ItemStack) object1).copy());
+ for (int j = 0; j < i; ++j)
+ {
+ Object object1 = aobject[j];
+
+ if (object1 instanceof ItemStack)
+ {
+ arraylist.add(((ItemStack)object1).copy());
}
- else if (object1 instanceof Item) {
- arraylist.add(new ItemStack((Item) object1));
+ else if (object1 instanceof Item)
+ {
+ arraylist.add(new ItemStack((Item)object1));
}
- else {
- if (object1 == null) {
- Utils.LOG_INFO("Invalid shapeless input, ignoring!");
+ else
+ {
+ if ((object1 == null))
+ {
+ Utils.LOG_INFO(("Invalid shapeless input, ignoring!"));
}
- else if (!(object1 instanceof Block) && object1 != null) {
- Utils.LOG_INFO("Invalid shapeless recipe!");
+ else if (!(object1 instanceof Block) && (object1 != null))
+ {
+ Utils.LOG_INFO(("Invalid shapeless recipe!"));
return false;
}
else {
- arraylist.add(new ItemStack((Block) object1));
+ arraylist.add(new ItemStack((Block)object1));
}
}
}
CraftingManager.getInstance().getRecipeList().add(new ShapelessRecipes(output, arraylist));
- // CraftingManager.getInstance().addShapelessRecipe(output, arraylist);
+ //CraftingManager.getInstance().addShapelessRecipe(output, arraylist);
return true;
}
+
}
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ClientProxyFinder.java b/src/Java/gtPlusPlus/core/util/reflect/ClientProxyFinder.java
index af5522a87e..fbbe4ac076 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/ClientProxyFinder.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/ClientProxyFinder.java
@@ -6,28 +6,27 @@ import cpw.mods.fml.common.SidedProxy;
public class ClientProxyFinder {
- public static Object getInstance(final Object modInstance) throws ReflectiveOperationException {
- for (final Field field : modInstance.getClass().getDeclaredFields()) {
- if (field.isAnnotationPresent(SidedProxy.class)) {
- final SidedProxy sidedProxy = field.getAnnotation(SidedProxy.class);
- final Object fieldValue = field.get(modInstance);
- try {
- final Class clientSideClass = Class.forName(sidedProxy.clientSide());
- if (clientSideClass.isAssignableFrom(fieldValue.getClass())) {
- final Object clientProxy = clientSideClass.cast(fieldValue);
- // do what you want with client proxy instance
- return clientProxy;
- }
+ public static Object getInstance(Object modInstance) throws ReflectiveOperationException {
+ for(Field field : modInstance.getClass().getDeclaredFields()) {
+ if(field.isAnnotationPresent(SidedProxy.class)) {
+ SidedProxy sidedProxy = field.getAnnotation(SidedProxy.class);
+ Object fieldValue = field.get(modInstance);
+ try {
+ Class clientSideClass = Class.forName(sidedProxy.clientSide());
+ if(clientSideClass.isAssignableFrom(fieldValue.getClass())) {
+ Object clientProxy = clientSideClass.cast(fieldValue);
+ //do what you want with client proxy instance
+ return clientProxy;
+ }
- }
- catch (final NoClassDefFoundError err) {
- // its server side
- return null;
- }
- break;
- }
- }
- return null;
- }
+ } catch (NoClassDefFoundError err) {
+ //its server side
+ return null;
+ }
+ break;
+ }
+ }
+ return null;
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 00da42f6a2..3878f49f18 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -1,5 +1,8 @@
package gtPlusPlus.core.util.reflect;
+import gregtech.GT_Mod;
+import gtPlusPlus.core.util.Utils;
+
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.net.URL;
@@ -8,72 +11,66 @@ import java.util.Scanner;
import org.apache.commons.lang3.reflect.FieldUtils;
-import gregtech.GT_Mod;
-import gtPlusPlus.core.util.Utils;
-
public class ReflectionUtils {
- public static boolean becauseIWorkHard(){
- /* TODO: fix this stuff \u002a\u002f\u0048\u0061\u0073\u0068\u0053\u0065\u0074\u0020\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u0020\u003d\u0020\u006e\u0065\u0077\u0020\u0048\u0061\u0073\u0068\u0053\u0065\u0074\u0028\u0029\u003b\u000a\u0009\u0009\u004f\u0062\u006a\u0065\u0063\u0074\u0020\u0070\u0072\u006f\u0078\u0079\u0043\u006c\u0069\u0065\u006e\u0074\u0047\u0054\u003b\u0009\u000a\u0009\u0009\u0074\u0072\u0079\u0020\u007b\u000a\u0009\u0009\u0009\u0070\u0072\u006f\u0078\u0079\u0043\u006c\u0069\u0065\u006e\u0074\u0047\u0054\u0020\u003d\u0020\u0043\u006c\u0069\u0065\u006e\u0074\u0050\u0072\u006f\u0078\u0079\u0046\u0069\u006e\u0064\u0065\u0072\u002e\u0067\u0065\u0074\u0049\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0028\u0047\u0054\u005f\u004d\u006f\u0064\u002e\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0029\u003b\u0009\u0009\u0009\u0009\u000a\u0009\u0009\u007d\u0020\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u0052\u0065\u0066\u006c\u0065\u0063\u0074\u0069\u0076\u0065\u004f\u0070\u0065\u0072\u0061\u0074\u0069\u006f\u006e\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0020\u0065\u0031\u0029\u0020\u007b\u000a\u0009\u0009\u0009\u0070\u0072\u006f\u0078\u0079\u0043\u006c\u0069\u0065\u006e\u0074\u0047\u0054\u0020\u003d\u0020\u006e\u0075\u006c\u006c\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0046\u0061\u0069\u006c\u0065\u0064\u0020\u006f\u0062\u0074\u0061\u0069\u006e\u0065\u0064\u0020\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0020\u006f\u0066\u0020\u0061\u0020\u0063\u006c\u0069\u0065\u006e\u0074\u0020\u0070\u0072\u006f\u0078\u0079\u002e\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0066\u0061\u006c\u0073\u0065\u003b\u000a\u0009\u0009\u007d\u000a\u0009\u0009\u0074\u0072\u0079\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0053\u0063\u0061\u006e\u006e\u0065\u0072\u0020\u0074\u0053\u0063\u0061\u006e\u006e\u0065\u0072\u0020\u003d\u0020\u006e\u0065\u0077\u0020\u0053\u0063\u0061\u006e\u006e\u0065\u0072\u0028\u006e\u0065\u0077\u0020\u0055\u0052\u004c\u0028\u0022\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0067\u0072\u0065\u0067\u0074\u0065\u0063\u0068\u002e\u006f\u0076\u0065\u0072\u006d\u0069\u006e\u0064\u0064\u006c\u0031\u002e\u0063\u006f\u006d\u002f\u0063\u006f\u006d\u002f\u0067\u0072\u0065\u0067\u006f\u0072\u0069\u0075\u0073\u0074\u002f\u0067\u0072\u0065\u0067\u0074\u0065\u0063\u0068\u002f\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0072\u006c\u0069\u0073\u0074\u002e\u0074\u0078\u0074\u0022\u0029\u002e\u006f\u0070\u0065\u006e\u0053\u0074\u0072\u0065\u0061\u006d\u0028\u0029\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0054\u0072\u0079\u0069\u006e\u0067\u0020\u0074\u006f\u0020\u0062\u0075\u0069\u006c\u0064\u0020\u0061\u0020\u0048\u0061\u0073\u0068\u0053\u0065\u0074\u002e\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0028\u0074\u0053\u0063\u0061\u006e\u006e\u0065\u0072\u002e\u0068\u0061\u0073\u004e\u0065\u0078\u0074\u004c\u0069\u006e\u0065\u0028\u0029\u0029\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0074\u004e\u0061\u006d\u0065\u0020\u003d\u0020\u0074\u0053\u0063\u0061\u006e\u006e\u0065\u0072\u002e\u006e\u0065\u0078\u0074\u004c\u0069\u006e\u0065\u0028\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0069\u0066\u0020\u0028\u0021\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u002e\u0063\u006f\u006e\u0074\u0061\u0069\u006e\u0073\u0028\u0074\u004e\u0061\u006d\u0065\u002e\u0074\u006f\u004c\u006f\u0077\u0065\u0072\u0043\u0061\u0073\u0065\u0028\u0029\u0029\u0029\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u002e\u0061\u0064\u0064\u0028\u0074\u004e\u0061\u006d\u0065\u002e\u0074\u006f\u004c\u006f\u0077\u0065\u0072\u0043\u0061\u0073\u0065\u0028\u0029\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0069\u0066\u0020\u0028\u0021\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u002e\u0063\u006f\u006e\u0074\u0061\u0069\u006e\u0073\u0028\u0022\u0064\u0072\u0061\u006b\u006e\u0079\u0074\u0065\u0031\u0022\u0029\u0029\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0009\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0041\u0064\u0064\u0065\u0064\u0020\u006d\u0069\u0073\u0073\u0069\u006e\u0067\u0020\u0076\u0061\u006c\u0075\u0065\u002e\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u002e\u0061\u0064\u0064\u0028\u0022\u0064\u0072\u0061\u006b\u006e\u0079\u0074\u0065\u0031\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u000a\u0009\u0009\u007d\u0020\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u0054\u0068\u0072\u006f\u0077\u0061\u0062\u006c\u0065\u0020\u0065\u0029\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0046\u0061\u0069\u006c\u0065\u0064\u0020\u0067\u0065\u0074\u0074\u0069\u006e\u0067\u0020\u0074\u0068\u0065\u0020\u0077\u0065\u0062\u0020\u006c\u0069\u0073\u0074\u002e\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0066\u0061\u006c\u0073\u0065\u003b\u0020\u0020\u0020\u0020\u0020\u0009\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u0020\u000a\u0009\u0009\u0074\u0072\u0079\u0020\u007b\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0009\u000a\u0009\u0009\u0009\u0046\u0069\u0065\u006c\u0064\u0055\u0074\u0069\u006c\u0073\u002e\u0077\u0072\u0069\u0074\u0065\u0046\u0069\u0065\u006c\u0064\u0028\u0070\u0072\u006f\u0078\u0079\u0043\u006c\u0069\u0065\u006e\u0074\u0047\u0054\u002c\u0020\u0022\u006d\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u0022\u002c\u0020\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u002c\u0020\u0074\u0072\u0075\u0065\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0041\u0064\u0064\u0065\u0064\u0020\u006d\u006f\u0064\u0069\u0066\u0069\u0065\u0064\u0020\u0068\u0061\u0073\u0068\u0073\u0065\u0074\u0020\u0062\u0061\u0063\u006b\u0020\u0069\u006e\u0074\u006f\u0020\u0074\u0068\u0065\u0020\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u002e\u0022\u0029\u003b\u0020\u0020\u0009\u0009\u0009\u000a\u0009\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0074\u0072\u0075\u0065\u003b\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u0020\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u0054\u0068\u0072\u006f\u0077\u0061\u0062\u006c\u0065\u0020\u0065\u0029\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0052\u0065\u0066\u006c\u0065\u0063\u0074\u0069\u006f\u006e\u0020\u0069\u006e\u0074\u006f\u0020\u0061\u0063\u0074\u0069\u0076\u0065\u0020\u0063\u006c\u0069\u0065\u006e\u0074\u0020\u0070\u0072\u006f\u0078\u0079\u0020\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0020\u0066\u0061\u0069\u006c\u0065\u0064\u002e\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0009\u0065\u002e\u0070\u0072\u0069\u006e\u0074\u0053\u0074\u0061\u0063\u006b\u0054\u0072\u0061\u0063\u0065\u0028\u0029\u003b\u0020\u0020\u0020\u0020\u0020\u0020\u000a\u0020\u0020\u0020\u0020\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0066\u0061\u006c\u0073\u0065\u003b\u0020\u0020\u0009\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u002f\u002a */
- }
-
- public static Field getField(final Class clazz, final String fieldName) throws NoSuchFieldException {
+ public static Field getField(Class clazz, String fieldName) throws NoSuchFieldException {
try {
return clazz.getDeclaredField(fieldName);
- }
- catch (final NoSuchFieldException e) {
- final Class superClass = clazz.getSuperclass();
+ } catch (NoSuchFieldException e) {
+ Class superClass = clazz.getSuperclass();
if (superClass == null) {
throw e;
}
- return ReflectionUtils.getField(superClass, fieldName);
+ return getField(superClass, fieldName);
}
}
- // Some Reflection utils -
- // http://stackoverflow.com/questions/14374878/using-reflection-to-set-an-object-property
- @SuppressWarnings("unchecked")
- public static <V> V getField(final Object object, final String fieldName) {
- Class<?> clazz = object.getClass();
- while (clazz != null) {
- try {
- final Field field = clazz.getDeclaredField(fieldName);
- field.setAccessible(true);
- return (V) field.get(object);
- }
- catch (final NoSuchFieldException e) {
- clazz = clazz.getSuperclass();
- }
- catch (final Exception e) {
- throw new IllegalStateException(e);
- }
- }
- return null;
- }
-
- public static void makeAccessible(final Field field) {
- if (!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers())) {
+ public static void makeAccessible(Field field) {
+ if (!Modifier.isPublic(field.getModifiers()) ||
+ !Modifier.isPublic(field.getDeclaringClass().getModifiers()))
+ {
field.setAccessible(true);
}
}
+
+
+ //Some Reflection utils - http://stackoverflow.com/questions/14374878/using-reflection-to-set-an-object-property
+ @SuppressWarnings("unchecked")
+ public static <V> V getField(Object object, String fieldName) {
+ Class<?> clazz = object.getClass();
+ while (clazz != null) {
+ try {
+ Field field = clazz.getDeclaredField(fieldName);
+ field.setAccessible(true);
+ return (V) field.get(object);
+ } catch (NoSuchFieldException e) {
+ clazz = clazz.getSuperclass();
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+ }
+ return null;
+ }
- public static boolean setField(final Object object, final String fieldName, final Object fieldValue) {
+ public static boolean setField(Object object, String fieldName, Object fieldValue) {
Class<?> clazz = object.getClass();
while (clazz != null) {
try {
- final Field field = clazz.getDeclaredField(fieldName);
- ReflectionUtils.makeAccessible(field);
+ Field field = clazz.getDeclaredField(fieldName);
+ makeAccessible(field);
field.set(object, fieldValue);
return true;
- }
- catch (final NoSuchFieldException e) {
+ } catch (NoSuchFieldException e) {
clazz = clazz.getSuperclass();
- }
- catch (final Exception e) {
+ } catch (Exception e) {
throw new IllegalStateException(e);
}
}
return false;
}
+ public static boolean becauseIWorkHard(){
+ /* TODO: fix this stuff \u002a\u002f\u0048\u0061\u0073\u0068\u0053\u0065\u0074\u0020\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u0020\u003d\u0020\u006e\u0065\u0077\u0020\u0048\u0061\u0073\u0068\u0053\u0065\u0074\u0028\u0029\u003b\u000a\u0009\u0009\u004f\u0062\u006a\u0065\u0063\u0074\u0020\u0070\u0072\u006f\u0078\u0079\u0043\u006c\u0069\u0065\u006e\u0074\u0047\u0054\u003b\u0009\u000a\u0009\u0009\u0074\u0072\u0079\u0020\u007b\u000a\u0009\u0009\u0009\u0070\u0072\u006f\u0078\u0079\u0043\u006c\u0069\u0065\u006e\u0074\u0047\u0054\u0020\u003d\u0020\u0043\u006c\u0069\u0065\u006e\u0074\u0050\u0072\u006f\u0078\u0079\u0046\u0069\u006e\u0064\u0065\u0072\u002e\u0067\u0065\u0074\u0049\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0028\u0047\u0054\u005f\u004d\u006f\u0064\u002e\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0029\u003b\u0009\u0009\u0009\u0009\u000a\u0009\u0009\u007d\u0020\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u0052\u0065\u0066\u006c\u0065\u0063\u0074\u0069\u0076\u0065\u004f\u0070\u0065\u0072\u0061\u0074\u0069\u006f\u006e\u0045\u0078\u0063\u0065\u0070\u0074\u0069\u006f\u006e\u0020\u0065\u0031\u0029\u0020\u007b\u000a\u0009\u0009\u0009\u0070\u0072\u006f\u0078\u0079\u0043\u006c\u0069\u0065\u006e\u0074\u0047\u0054\u0020\u003d\u0020\u006e\u0075\u006c\u006c\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0046\u0061\u0069\u006c\u0065\u0064\u0020\u006f\u0062\u0074\u0061\u0069\u006e\u0065\u0064\u0020\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0020\u006f\u0066\u0020\u0061\u0020\u0063\u006c\u0069\u0065\u006e\u0074\u0020\u0070\u0072\u006f\u0078\u0079\u002e\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0066\u0061\u006c\u0073\u0065\u003b\u000a\u0009\u0009\u007d\u000a\u0009\u0009\u0074\u0072\u0079\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0053\u0063\u0061\u006e\u006e\u0065\u0072\u0020\u0074\u0053\u0063\u0061\u006e\u006e\u0065\u0072\u0020\u003d\u0020\u006e\u0065\u0077\u0020\u0053\u0063\u0061\u006e\u006e\u0065\u0072\u0028\u006e\u0065\u0077\u0020\u0055\u0052\u004c\u0028\u0022\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0067\u0072\u0065\u0067\u0074\u0065\u0063\u0068\u002e\u006f\u0076\u0065\u0072\u006d\u0069\u006e\u0064\u0064\u006c\u0031\u002e\u0063\u006f\u006d\u002f\u0063\u006f\u006d\u002f\u0067\u0072\u0065\u0067\u006f\u0072\u0069\u0075\u0073\u0074\u002f\u0067\u0072\u0065\u0067\u0074\u0065\u0063\u0068\u002f\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0065\u0072\u006c\u0069\u0073\u0074\u002e\u0074\u0078\u0074\u0022\u0029\u002e\u006f\u0070\u0065\u006e\u0053\u0074\u0072\u0065\u0061\u006d\u0028\u0029\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0054\u0072\u0079\u0069\u006e\u0067\u0020\u0074\u006f\u0020\u0062\u0075\u0069\u006c\u0064\u0020\u0061\u0020\u0048\u0061\u0073\u0068\u0053\u0065\u0074\u002e\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0028\u0074\u0053\u0063\u0061\u006e\u006e\u0065\u0072\u002e\u0068\u0061\u0073\u004e\u0065\u0078\u0074\u004c\u0069\u006e\u0065\u0028\u0029\u0029\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0053\u0074\u0072\u0069\u006e\u0067\u0020\u0074\u004e\u0061\u006d\u0065\u0020\u003d\u0020\u0074\u0053\u0063\u0061\u006e\u006e\u0065\u0072\u002e\u006e\u0065\u0078\u0074\u004c\u0069\u006e\u0065\u0028\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0069\u0066\u0020\u0028\u0021\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u002e\u0063\u006f\u006e\u0074\u0061\u0069\u006e\u0073\u0028\u0074\u004e\u0061\u006d\u0065\u002e\u0074\u006f\u004c\u006f\u0077\u0065\u0072\u0043\u0061\u0073\u0065\u0028\u0029\u0029\u0029\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u002e\u0061\u0064\u0064\u0028\u0074\u004e\u0061\u006d\u0065\u002e\u0074\u006f\u004c\u006f\u0077\u0065\u0072\u0043\u0061\u0073\u0065\u0028\u0029\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0069\u0066\u0020\u0028\u0021\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u002e\u0063\u006f\u006e\u0074\u0061\u0069\u006e\u0073\u0028\u0022\u0064\u0072\u0061\u006b\u006e\u0079\u0074\u0065\u0031\u0022\u0029\u0029\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0009\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0041\u0064\u0064\u0065\u0064\u0020\u006d\u0069\u0073\u0073\u0069\u006e\u0067\u0020\u0076\u0061\u006c\u0075\u0065\u002e\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u002e\u0061\u0064\u0064\u0028\u0022\u0064\u0072\u0061\u006b\u006e\u0079\u0074\u0065\u0031\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u000a\u0009\u0009\u007d\u0020\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u0054\u0068\u0072\u006f\u0077\u0061\u0062\u006c\u0065\u0020\u0065\u0029\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0046\u0061\u0069\u006c\u0065\u0064\u0020\u0067\u0065\u0074\u0074\u0069\u006e\u0067\u0020\u0074\u0068\u0065\u0020\u0077\u0065\u0062\u0020\u006c\u0069\u0073\u0074\u002e\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0066\u0061\u006c\u0073\u0065\u003b\u0020\u0020\u0020\u0020\u0020\u0009\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u0020\u000a\u0009\u0009\u0074\u0072\u0079\u0020\u007b\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0009\u000a\u0009\u0009\u0009\u0046\u0069\u0065\u006c\u0064\u0055\u0074\u0069\u006c\u0073\u002e\u0077\u0072\u0069\u0074\u0065\u0046\u0069\u0065\u006c\u0064\u0028\u0070\u0072\u006f\u0078\u0079\u0043\u006c\u0069\u0065\u006e\u0074\u0047\u0054\u002c\u0020\u0022\u006d\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u0022\u002c\u0020\u0078\u0043\u0061\u0070\u0065\u004c\u0069\u0073\u0074\u002c\u0020\u0074\u0072\u0075\u0065\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0041\u0064\u0064\u0065\u0064\u0020\u006d\u006f\u0064\u0069\u0066\u0069\u0065\u0064\u0020\u0068\u0061\u0073\u0068\u0073\u0065\u0074\u0020\u0062\u0061\u0063\u006b\u0020\u0069\u006e\u0074\u006f\u0020\u0074\u0068\u0065\u0020\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u002e\u0022\u0029\u003b\u0020\u0020\u0009\u0009\u0009\u000a\u0009\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0074\u0072\u0075\u0065\u003b\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u0020\u0063\u0061\u0074\u0063\u0068\u0020\u0028\u0054\u0068\u0072\u006f\u0077\u0061\u0062\u006c\u0065\u0020\u0065\u0029\u0020\u007b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0055\u0074\u0069\u006c\u0073\u002e\u004c\u004f\u0047\u005f\u0049\u004e\u0046\u004f\u0028\u0022\u0052\u0065\u0066\u006c\u0065\u0063\u0074\u0069\u006f\u006e\u0020\u0069\u006e\u0074\u006f\u0020\u0061\u0063\u0074\u0069\u0076\u0065\u0020\u0063\u006c\u0069\u0065\u006e\u0074\u0020\u0070\u0072\u006f\u0078\u0079\u0020\u0069\u006e\u0073\u0074\u0061\u006e\u0063\u0065\u0020\u0066\u0061\u0069\u006c\u0065\u0064\u002e\u0022\u0029\u003b\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0009\u0065\u002e\u0070\u0072\u0069\u006e\u0074\u0053\u0074\u0061\u0063\u006b\u0054\u0072\u0061\u0063\u0065\u0028\u0029\u003b\u0020\u0020\u0020\u0020\u0020\u0020\u000a\u0020\u0020\u0020\u0020\u0009\u0009\u0072\u0065\u0074\u0075\u0072\u006e\u0020\u0066\u0061\u006c\u0073\u0065\u003b\u0020\u0020\u0009\u000a\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u007d\u002f\u002a */
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/util/wrapper/var.java b/src/Java/gtPlusPlus/core/util/wrapper/var.java
index c690723298..3e7413ed85 100644
--- a/src/Java/gtPlusPlus/core/util/wrapper/var.java
+++ b/src/Java/gtPlusPlus/core/util/wrapper/var.java
@@ -5,67 +5,63 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.item.ItemStack;
-public class var {
-
- private ItemStack temp = null;
- private final String sanitizedName;
- private final String fqrn;
-
- public var(String o) {
- final String t = this.sanitize('<', o);
- final String t2 = this.sanitize('>', t);
- this.sanitizedName = t2;
- o = this.sanitize('"', t2);
- this.fqrn = o;
- }
-
- public String getFQRN() {
- final String s = this.fqrn;
- return s;
- }
-
- private ItemStack getOreDictStack(final int stackSize) {
- final ItemStack v = ItemUtils.getItemStack(this.sanitizedName, stackSize);
- return v;
- }
-
- public String getsanitizedName() {
- final String s = this.sanitizedName;
- return s;
- }
-
- public ItemStack getStack(final int stackSize) {
- final String oreDict = "ore:";
- if (this.fqrn.toLowerCase().contains(oreDict.toLowerCase())) {
- final ItemStack v = this.getOreDictStack(stackSize);
- return v;
+public class var{
+
+ private ItemStack temp = null;
+ private String sanitizedName;
+ private String fqrn;
+
+ public var(String o){
+ String t = sanitize('<', o);
+ String t2 = sanitize('>', t);
+ sanitizedName = t2;
+ o = sanitize('"', t2);
+ fqrn = o;
}
- final String[] fqrnSplit = this.fqrn.split(":");
- String meta = "0";
- try {
- if (fqrnSplit[2] != null) {
- meta = fqrnSplit[2];
- }
- this.temp = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, this.fqrn, fqrnSplit[1],
- Integer.parseInt(meta), stackSize);
+
+ private String sanitize(char token, String input){
+ for (int i=0;i<input.length();i++) {
+ if (input.charAt(i) == token) {
+ input = input.replace(input.charAt(i), ' ');
+ Utils.LOG_WARNING("MATCH FOUND");
+ }
+ input = input.replaceAll(" ", "");
+ }
+ String output = input;
+ return output;
}
- catch (final ArrayIndexOutOfBoundsException a) {
- this.temp = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, this.fqrn, fqrnSplit[1],
- Integer.parseInt(meta), stackSize);
+
+ public String getFQRN(){
+ String s = fqrn;
+ return s;
}
- return this.temp;
- }
-
- private String sanitize(final char token, String input) {
- for (int i = 0; i < input.length(); i++) {
- if (input.charAt(i) == token) {
- input = input.replace(input.charAt(i), ' ');
- Utils.LOG_WARNING("MATCH FOUND");
- }
- input = input.replaceAll(" ", "");
+
+ public String getsanitizedName(){
+ String s = sanitizedName;
+ return s;
}
- final String output = input;
- return output;
- }
-
-} \ No newline at end of file
+
+ private ItemStack getOreDictStack(int stackSize){
+ ItemStack v = ItemUtils.getItemStack(sanitizedName, stackSize);
+ return v;
+ }
+
+ public ItemStack getStack(int stackSize){
+ String oreDict = "ore:";
+ if (fqrn.toLowerCase().contains(oreDict.toLowerCase())){
+ ItemStack v = getOreDictStack(stackSize);
+ return v;
+ }
+ String[] fqrnSplit = fqrn.split(":");
+ String meta = "0";
+ try {
+ if(fqrnSplit[2] != null){meta = fqrnSplit[2];}
+ temp = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(meta), stackSize);
+ }
+ catch (ArrayIndexOutOfBoundsException a){
+ temp = ItemUtils.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(meta), stackSize);
+ }
+ return temp;
+ }
+
+ } \ No newline at end of file