aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core
diff options
context:
space:
mode:
authorConnor-Colenso <52056774+Connor-Colenso@users.noreply.github.com>2023-09-04 03:05:22 +0100
committerGitHub <noreply@github.com>2023-09-04 03:05:22 +0100
commit76719d65a90d98e228a914774d3b11ed9f01ac8e (patch)
treece0d35f954e441e9cc4aa95aa347073728e6f4ee /src/main/java/gtPlusPlus/core
parent0393b582eb3edcb5c575330804b6747577a55e27 (diff)
downloadGT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.tar.gz
GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.tar.bz2
GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.zip
Clean-up v2 (#729)
* Remove test items from NEI with no texture * Add number formatting to hand pumps * Remove heavy plates (no recipes & completely unused). * Remove helium generator (no texture, no recipe) * Remove fire pit and fire starter (no use, no recipe, no textures) * Remove giant chicken and associated unused stuff, has no texture and is unobtainable. Used to be relevant but isn't anymore. * Remove villagers with silly trades like 1 motor + 1 hull = 1 hull. Why? * Remove trade bench, no recipe, missing textures. Unused. * Remove farm processors, no texture, no recipe. Unused. * Remove MAX tier components, these exist in GT now, have no recipe here and are unused. * Hide untextured light block from NEI * Update buildscript * Remove unused backpacks, no recipe and contains dupe bugs. Bad. * Remove eatotronic, universal toolbox and magic tool bag. All 3 are missing textures and uncraftable. * Remove eatotronic, universal toolbox and magic tool bag. All 3 are missing textures and uncraftable. part 2 * Remove dragon catcher (what?), no texture, no recipe, unused. * Remove empty item, does nothing, has no recipe, no idea why it is here. * Empty item v2 removal * Revert "Empty item v2 removal" This reverts commit 75bcd3ccfaf55bbfe2c12b2e4167d5c37636030d. * Revert "Remove empty item, does nothing, has no recipe, no idea why it is here." This reverts commit e41a9f484392776331c58530ab1faa5ef978ef36. * Remove debug square. No recipe, unused. * Number formatting overflow covers * Remove JVM garbage collection block. Unused, no recipe. * Remove nanotubes, no recipe for them. Unused. * Remove "git" item, doesn't seem to work. Has no recipe. * Remove uncraftable food with awful textures. * Remove "bat king" mob, unused content. Does not spawn. * Remove uncraftable doors with bad textures. Unused content. * Remove uncraftable, unlocalised redstone stuff that crashes game when placed. * Remove weird spawner item. No recipe, does not exist in world. * Remove sunnarium bit, no recipe, no usage. * Remove unused modularity table and some misc uncraftable, unused items. * Remove Interconnecting Storage Crate, no recipe, unused. * Delete worse debug power gen, this already exists as part of GT. Unneeded duplication. * Delete unused placeholder circuit * Delete uncraftable generator hatches. * Spotless * Remove XP tank thing, unused and uncraftable. * Remove null item, this fluid registry only seemed to register one null fluid. All others exist? * Remove EU -> RF battery. Unused in GTNH. * Remove some shelf nonsense, why is this in this mod? * Remove some weird random tools. These have no realistic usage in GTNH. * Remove firemaker. Useless in GTNH. * Removed helium blob. Deprecated item, not used anymore, uncraftable. * spotlessApply (#730) Co-authored-by: GitHub GTNH Actions <> * Stop modulators generating unused blocks with no textures * Remove more unused untextured casings * Remove more unused untextured casings * Remove more unused untextured casings * Remove more unused untextured casings * Remove more unused untextured casings * Remove some weird methods and uncraftable mining parts, probably part of deprecated multiblock. * spotlessApply (#732) Co-authored-by: GitHub GTNH Actions <> * Remove gem shards, unused. * Remove unused atoms * Remove unused gum * Remove unused elements/materials * Bye bye * Remove some unused reflection stuff * Remove control cores, obsolete now. * Remove mob killing thing with no texture and no recipe. * Remove uncraftable covers * Remove pizza gloves * Net and rope removal, unused * Remove force crop * Removal of some old event stuff * Remove unused nuclear chem items * Remove player safe, mostly because of the horrible event code that was intercepting every block break. I can't see any real usage of this via discord. * Remove Force material and associated other nonsense. Also remove some nuclear chem stuff. * Remove force for realsies * Skookum Chooker purge. * Remove some enderio compat, these plates/dusts are added via GT5 anyway now. This is obsolete. * spotlessApply (#733) Co-authored-by: GitHub GTNH Actions <> * Unused textures * Bump dep * Revert "Remove force for realsies" This reverts commit 0d288912a99f9dabce56d2a2623d4d3510f4804e. * Revert "Remove Force material and associated other nonsense. Also remove some nuclear chem stuff." This reverts commit 3455e6e916defe1f2aef923be6f9696a6cf3095b. * Remove nuclear items that are unused * spotlessApply (#734) Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: Connor Colenso <colen@CONNORSPC> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gtPlusPlus/core')
-rw-r--r--src/main/java/gtPlusPlus/core/block/ModBlocks.java65
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/BlockNet.java37
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java2
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java156
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/FirePit.java238
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/LightGlass.java7
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java485
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java366
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java142
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java211
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/EggBox.java149
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java90
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java101
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java87
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java173
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java131
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java115
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java111
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java152
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java15
-rw-r--r--src/main/java/gtPlusPlus/core/common/CommonProxy.java38
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java37
-rw-r--r--src/main/java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java26
-rw-r--r--src/main/java/gtPlusPlus/core/config/ConfigHandler.java139
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java184
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_EggBox.java133
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_Grindle.java137
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java152
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java193
-rw-r--r--src/main/java/gtPlusPlus/core/container/Container_TradeTable.java174
-rw-r--r--src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java21
-rw-r--r--src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java21
-rw-r--r--src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java17
-rw-r--r--src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java25
-rw-r--r--src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java419
-rw-r--r--src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java117
-rw-r--r--src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java760
-rw-r--r--src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java314
-rw-r--r--src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java5
-rw-r--r--src/main/java/gtPlusPlus/core/fluids/FluidFactory.java206
-rw-r--r--src/main/java/gtPlusPlus/core/fluids/FluidPackage.java80
-rw-r--r--src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java325
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java125
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java589
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java513
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java57
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java40
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java79
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java53
-rw-r--r--src/main/java/gtPlusPlus/core/handler/AchievementHandler.java14
-rw-r--r--src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java20
-rw-r--r--src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java4
-rw-r--r--src/main/java/gtPlusPlus/core/handler/GuiHandler.java150
-rw-r--r--src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java2
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java211
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java85
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java66
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java49
-rw-r--r--src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java118
-rw-r--r--src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java60
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java215
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java219
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java157
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java18
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java18
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java19
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java175
-rw-r--r--src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java185
-rw-r--r--src/main/java/gtPlusPlus/core/item/ModItems.java500
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java75
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java2
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java42
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java39
-rw-r--r--src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java47
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java137
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java40
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java495
-rw-r--r--src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java181
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java44
-rw-r--r--src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java145
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java76
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java205
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java98
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java82
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java67
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java297
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java27
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java307
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java250
-rw-r--r--src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java2
-rw-r--r--src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java70
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java9
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java75
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java15
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java14
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java16
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java287
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java372
-rw-r--r--src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java458
-rw-r--r--src/main/java/gtPlusPlus/core/lib/CORE.java3
-rw-r--r--src/main/java/gtPlusPlus/core/material/ELEMENT.java181
-rw-r--r--src/main/java/gtPlusPlus/core/material/Material.java2
-rw-r--r--src/main/java/gtPlusPlus/core/proxy/ClientProxy.java13
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java37
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java64
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java156
-rw-r--r--src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java84
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java27
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java31
-rw-r--r--src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java56
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java12
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java365
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java38
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java117
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java297
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java482
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java136
-rw-r--r--src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java123
-rw-r--r--src/main/java/gtPlusPlus/core/util/Utils.java129
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java200
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java5
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java18
122 files changed, 75 insertions, 16572 deletions
diff --git a/src/main/java/gtPlusPlus/core/block/ModBlocks.java b/src/main/java/gtPlusPlus/core/block/ModBlocks.java
index 9957ae3f92..5058ac51cd 100644
--- a/src/main/java/gtPlusPlus/core/block/ModBlocks.java
+++ b/src/main/java/gtPlusPlus/core/block/ModBlocks.java
@@ -1,37 +1,24 @@
package gtPlusPlus.core.block;
import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.Fluid;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.general.BlockCompressedObsidian;
-import gtPlusPlus.core.block.general.BlockNet;
-import gtPlusPlus.core.block.general.BlockTankXpConverter;
-import gtPlusPlus.core.block.general.FirePit;
import gtPlusPlus.core.block.general.FluidTankInfinite;
import gtPlusPlus.core.block.general.HellFire;
import gtPlusPlus.core.block.general.LightGlass;
import gtPlusPlus.core.block.general.MiningExplosives;
-import gtPlusPlus.core.block.general.PlayerDoors;
import gtPlusPlus.core.block.general.antigrief.BlockWitherProof;
-import gtPlusPlus.core.block.general.redstone.BlockGenericRedstoneDetector;
-import gtPlusPlus.core.block.general.redstone.BlockGenericRedstoneTest;
import gtPlusPlus.core.block.machine.CircuitProgrammer;
import gtPlusPlus.core.block.machine.DecayablesChest;
-import gtPlusPlus.core.block.machine.EggBox;
import gtPlusPlus.core.block.machine.FishTrap;
-import gtPlusPlus.core.block.machine.HeliumGenerator;
-import gtPlusPlus.core.block.machine.Machine_ModularityTable;
import gtPlusPlus.core.block.machine.Machine_PestKiller;
import gtPlusPlus.core.block.machine.Machine_PooCollector;
import gtPlusPlus.core.block.machine.Machine_ProjectTable;
import gtPlusPlus.core.block.machine.Machine_RoundRobinator;
import gtPlusPlus.core.block.machine.Machine_SuperJukebox;
-import gtPlusPlus.core.block.machine.Machine_TradeTable;
import gtPlusPlus.core.block.machine.VolumetricFlaskSetter;
-import gtPlusPlus.core.block.machine.bedrock.Mining_Head_Fake;
-import gtPlusPlus.core.block.machine.bedrock.Mining_Pipe_Fake;
import gtPlusPlus.core.fluids.FluidRegistryHandler;
public final class ModBlocks {
@@ -39,18 +26,9 @@ public final class ModBlocks {
public static Block blockRoundRobinator;
public static Block blockCircuitProgrammer;
public static Block blockVolumetricFlaskSetter;
- public static Block blockFakeMiningPipe;
- public static Block blockFakeMiningHead;
public static Block blockFishTrap;
public static Block blockDecayablesChest;
- public static Block blockEggBox;
-
- // 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 blockCasings2Misc;
@@ -64,32 +42,18 @@ public final class ModBlocks {
public static Block blockCustomMachineCasings;
public static Block blockCustomPipeGearCasings;
- public static Block blockMetaTileEntity;
- public static Block blockHeliumGenerator;
- public static Block blockNHG;
- public static Block blockCharger;
-
public static Block MatterFabricatorEffectBlock;
public static Fluid fluidSludge = new Fluid("fluid.sludge");
public static Block blockFluidSludge;
- public static Block blockFirePit;
-
- public static Block blockOreFluorite;
-
public static Block blockMiningExplosive;
public static Block blockHellfire;
public static Block blockInfiniteFLuidTank;
public static Block blockProjectTable;
- public static Block blockTradeTable;
- public static Block blockModularTable;
-
public static Block blockWitherGuard;
- public static Block blockXpConverter;
public static Block blockCompressedObsidian;
- public static Block blockNet;
public static Block blockPlayerDoorWooden;
public static Block blockPlayerDoorIron;
@@ -97,8 +61,6 @@ public final class ModBlocks {
public static Block blockPlayerDoorCustom_Ice;
public static Block blockPlayerDoorCustom_Cactus;
- public static Block blockCustomMobSpawner;
- public static Block blockCustomSuperLight;
public static Block blockCustomJukebox;
public static Block blockPooCollector;
@@ -120,41 +82,18 @@ public final class ModBlocks {
FluidRegistryHandler.registerFluids();
// Workbench
- blockHeliumGenerator = new HeliumGenerator();
- blockFirePit = new FirePit();
blockFishTrap = new FishTrap();
blockInfiniteFLuidTank = new FluidTankInfinite();
blockMiningExplosive = new MiningExplosives();
blockHellfire = new HellFire();
blockProjectTable = new Machine_ProjectTable();
- blockTradeTable = new Machine_TradeTable();
- blockModularTable = new Machine_ModularityTable();
blockWitherGuard = new BlockWitherProof();
- blockXpConverter = new BlockTankXpConverter();
blockCompressedObsidian = new BlockCompressedObsidian();
- blockNet = new BlockNet();
-
- blockFakeMiningPipe = new Mining_Pipe_Fake();
- blockFakeMiningHead = new Mining_Head_Fake();
blockCircuitProgrammer = new CircuitProgrammer();
blockDecayablesChest = new DecayablesChest();
- blockEggBox = new EggBox();
-
- blockPlayerDoorWooden = new PlayerDoors(Material.wood, "door_wood", true);
- blockPlayerDoorIron = new PlayerDoors(Material.iron, "door_iron", true);
- blockPlayerDoorCustom_Glass = new PlayerDoors(Material.glass, "door_glass", false);
- blockPlayerDoorCustom_Ice = new PlayerDoors(Material.ice, "door_ice", false);
- blockPlayerDoorCustom_Cactus = new PlayerDoors(
- Material.cactus,
- "door_cactus",
- false,
- 0.6f,
- Block.soundTypeGrass,
- "Cactus");
-
- // blockCustomSuperLight = new BlockSuperLight();
+
blockCustomJukebox = new Machine_SuperJukebox();
blockPooCollector = new Machine_PooCollector();
@@ -165,7 +104,5 @@ public final class ModBlocks {
blockVolumetricFlaskSetter = new VolumetricFlaskSetter();
- new BlockGenericRedstoneDetector();
- new BlockGenericRedstoneTest();
}
}
diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockNet.java b/src/main/java/gtPlusPlus/core/block/general/BlockNet.java
deleted file mode 100644
index c462021374..0000000000
--- a/src/main/java/gtPlusPlus/core/block/general/BlockNet.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package gtPlusPlus.core.block.general;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.Random;
-
-import net.minecraft.block.BlockWeb;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.item.Item;
-
-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.item.ModItems;
-
-public class BlockNet extends BlockWeb {
-
- public BlockNet() {
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setLightOpacity(1);
- this.setHardness(4.0F);
- this.setBlockName("blockNet");
- GameRegistry.registerBlock(this, "blockNet");
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon) {
- this.blockIcon = iIcon.registerIcon(GTPlusPlus.ID + ":" + "net");
- }
-
- @Override
- public Item getItemDropped(final int p_149650_1_, final Random p_149650_2_, final int p_149650_3_) {
- return ModItems.itemRope;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java
index a9c309d5c7..f62fc50a69 100644
--- a/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java
+++ b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java
@@ -179,7 +179,6 @@ public class BlockSuperLight extends BlockContainer {
else if (enable && aLight == 0) {
aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj));
if (aBlockGet instanceof BlockAir) {
- Logger.INFO("Lit air.");
this.worldObj.setBlock(
xOff,
yOff,
@@ -188,7 +187,6 @@ public class BlockSuperLight extends BlockContainer {
0,
3);
}
- // aBlockGet.setLightLevel(15);
aLitCounter++;
}
// Turning Lights off
diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java b/src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java
deleted file mode 100644
index 57b70c1927..0000000000
--- a/src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package gtPlusPlus.core.block.general;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.Random;
-
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-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.item.base.itemblock.ItemBlockEntityBase;
-
-public class BlockTankXpConverter extends BlockContainer {
-
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
-
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
-
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- public BlockTankXpConverter() {
- super(Material.iron);
- this.setBlockName("blockTankXpConverter");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockEntityBase.class, "blockTankXpConverter");
- this.generateRainbowMap();
- if (!this.getTickRandomly()) {
- this.setTickRandomly(true);
- }
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int ordinalSide, final int meta) {
- return ordinalSide == 1 ? this.textureTop
- : (ordinalSide == 0 ? this.textureBottom
- : ((ordinalSide != 2) && (ordinalSide != 4) ? this.blockIcon : this.textureFront));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_) {
- this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlGray");
- this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlGray");
- this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlGray");
- this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlGray");
- }
-
- /**
- * 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) {
-
- return true;
-
- /*
- * if (world.isRemote) { return true; } else { boolean mDidScrewDriver = false; // Check For Screwdriver try {
- * final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName()); final
- * Item mHandItem = mHandStack.getItem(); if (((mHandItem instanceof GT_MetaGenerated_Tool_01) &&
- * ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) { final
- * TileEntityXpConverter tile = (TileEntityXpConverter) world.getTileEntity(x, y, z); if (tile != null) {
- * mDidScrewDriver = true; tile.onScrewdriverRightClick((byte) side, player, x, y, z); } } } catch (final
- * Throwable t) { mDidScrewDriver = false; } if (!mDidScrewDriver) { try { final TileEntityXpConverter tile =
- * (TileEntityXpConverter) world.getTileEntity(x, y, z); if (tile != null) { tile.onRightClick((byte) side,
- * player, x, y, z); } } catch (final Throwable t) { } final TileEntityXpConverter tank =
- * (TileEntityXpConverter) world.getTileEntity(x, y, z); if (tank != null) { if (tank.tankEssence.getFluid() !=
- * null) { PlayerUtils.messagePlayer(player, "This tank contains " + tank.tankEssence.getFluidAmount() + "L of "
- * + tank.tankEssence.getFluid().getLocalizedName()); } if (tank.tankLiquidXp.getFluid() != null) {
- * PlayerUtils.messagePlayer(player, "This tank contains " + tank.tankLiquidXp.getFluidAmount() + "L of " +
- * tank.tankLiquidXp.getFluid().getLocalizedName()); } if ((tank.tankEssence.getFluid() != null) &&
- * (tank.tankLiquidXp.getFluid() != null)) { PlayerUtils.messagePlayer(player, "This is worth " +
- * EnchantingUtils.getLevelForLiquid(tank.tankLiquidXp.getFluidAmount()) + " levels."); } } } } return true;
- */ }
-
- @Override
- public int getRenderBlockPass() {
- return 1;
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- // return new TileEntityXpConverter();
- return null;
- }
-
- @Override
- public void onBlockAdded(final World world, final int x, final int y, final int z) {
- super.onBlockAdded(world, x, y, z);
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
- final int z) {
- return false;
- }
-
- private final boolean generateRainbowMap() {
- return true;
- }
-
- @Override
- public int getBlockColor() {
- return super.getBlockColor();
- }
-
- @Override
- public int colorMultiplier(final IBlockAccess p_149720_1_, final int p_149720_2_, final int p_149720_3_,
- final int p_149720_4_) {
- return super.colorMultiplier(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_);
- }
-
- @Override
- public void updateTick(final World world, final int x, final int y, final int z, final Random rand) {
- // this.mRainbowTick++;
- super.updateTick(world, x, y, z, rand);
- }
-
- @Override
- public void randomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
- // this.mRainbowTick++;
- super.randomDisplayTick(world, x, y, z, rand);
- }
-
- @Override
- public int tickRate(final World p_149738_1_) {
- return 20;
- }
-
- @Override
- public int getLightValue() {
- return 6;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/block/general/FirePit.java b/src/main/java/gtPlusPlus/core/block/general/FirePit.java
deleted file mode 100644
index 4b4390bc78..0000000000
--- a/src/main/java/gtPlusPlus/core/block/general/FirePit.java
+++ /dev/null
@@ -1,238 +0,0 @@
-package gtPlusPlus.core.block.general;
-
-import static net.minecraftforge.common.util.ForgeDirection.DOWN;
-import static net.minecraftforge.common.util.ForgeDirection.EAST;
-import static net.minecraftforge.common.util.ForgeDirection.NORTH;
-import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
-import static net.minecraftforge.common.util.ForgeDirection.UP;
-import static net.minecraftforge.common.util.ForgeDirection.WEST;
-
-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;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.block.base.BasicBlock;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.tileentities.general.TileEntityFirepit;
-
-public class FirePit extends BasicBlock {
-
- private static IIcon[] TEXTURE;
- public static final int META_ANTIBUILDER = 2;
- private int meta;
-
- public FirePit() {
- super("blockFirePit", Material.wood);
- this.setBlockName("blockFirePit");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setHardness(10.0F);
- this.setResistance(35.0F);
- this.setStepSound(Block.soundTypeWood);
- GameRegistry.registerBlock(this, "blockFirePit");
- }
-
- @Override
- public int tickRate(final World aParWorld) {
- return 30;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int i) {
- return new TileEntityFirepit();
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister par1IconRegister) {
- TEXTURE = new IIcon[] { par1IconRegister.registerIcon(this.getTextureName() + "_layer_0"),
- par1IconRegister.registerIcon(this.getTextureName() + "_layer_1") };
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
- par3List.add(new ItemStack(par1, 1, 2));
- }
-
- @Override
- public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random) {
- if (!par1World.isRemote) {
- // Sets meta.
- this.meta = par1World.getBlockMetadata(x, y, z);
- // If Raining, Put out.
- if (par1World.isRaining()
- && (par1World.canLightningStrikeAt(x, y, z) || par1World.canLightningStrikeAt(x - 1, y, z)
- || par1World.canLightningStrikeAt(x + 1, y, z)
- || par1World.canLightningStrikeAt(x, y, z - 1)
- || par1World.canLightningStrikeAt(x, y, z + 1))) {
- // Fire goes out
- par1World.setBlockMetadataWithNotify(x, y, z, 1, 4);
- }
- if (isNeighborBurning(par1World, x, y, z)) {
- // Fire can ignite from a nearby flame source.
- par1World.setBlockMetadataWithNotify(x, y, z, 2, 4);
- }
- }
- }
-
- @Override
- public Item getItemDropped(final int meta, final Random par2Random, final int par3) {
- switch (meta) {
- case 0:
- return null;
- default:
- break;
- }
- return Item.getItemFromBlock(this);
- }
-
- @Override
- public int damageDropped(final int meta) {
- return meta;
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- public int getRenderType() {
- return -1;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderBlockPass() {
- return 1;
- }
-
- @Override
- public boolean renderAsNormalBlock() {
- return false;
- }
-
- /*
- * @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aParWorld, int x, int y, int z){ return
- * null; }
- */
-
- @Override
- protected boolean canSilkHarvest() {
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void randomDisplayTick(final World p_149734_1_, final int p_149734_2_, final int p_149734_3_,
- final int p_149734_4_, final Random p_149734_5_) {
- int l;
- float f;
- float f1;
- float f2;
- if (this.meta == 2) {
- if (p_149734_5_.nextInt(24) == 0) {
- p_149734_1_.playSound(
- p_149734_2_ + 0.5F,
- p_149734_3_ + 0.5F,
- p_149734_4_ + 0.5F,
- "fire.fire",
- 1.0F + p_149734_5_.nextFloat(),
- (p_149734_5_.nextFloat() * 0.7F) + 0.3F,
- false);
- }
- }
- if (this.meta == 2) {
- if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_)
- && !Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)) {
- if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)) {
- for (l = 0; l < 2; ++l) {
- f = p_149734_2_ + (p_149734_5_.nextFloat() * 0.1F);
- f1 = p_149734_3_ + p_149734_5_.nextFloat();
- f2 = p_149734_4_ + p_149734_5_.nextFloat();
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)) {
- for (l = 0; l < 2; ++l) {
- f = p_149734_2_ + 1 - (p_149734_5_.nextFloat() * 0.1F);
- f1 = p_149734_3_ + p_149734_5_.nextFloat();
- f2 = p_149734_4_ + p_149734_5_.nextFloat();
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)) {
- for (l = 0; l < 2; ++l) {
- f = p_149734_2_ + p_149734_5_.nextFloat();
- f1 = p_149734_3_ + p_149734_5_.nextFloat();
- f2 = p_149734_4_ + (p_149734_5_.nextFloat() * 0.1F);
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)) {
- for (l = 0; l < 2; ++l) {
- f = p_149734_2_ + p_149734_5_.nextFloat();
- f1 = p_149734_3_ + p_149734_5_.nextFloat();
- f2 = p_149734_4_ + 1 - (p_149734_5_.nextFloat() * 0.1F);
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)) {
- for (l = 0; l < 2; ++l) {
- f = p_149734_2_ + p_149734_5_.nextFloat();
- f1 = p_149734_3_ + 1 - (p_149734_5_.nextFloat() * 0.1F);
- f2 = p_149734_4_ + p_149734_5_.nextFloat();
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- } else {
- if (this.meta == 2) {
- for (l = 0; l < 3; ++l) {
- f = p_149734_2_ + p_149734_5_.nextFloat();
- f1 = p_149734_3_ + (p_149734_5_.nextFloat() * 0.5F) + 0.5F;
- f2 = p_149734_4_ + p_149734_5_.nextFloat();
- p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
- }
- }
- }
- }
- }
-
- @SideOnly(Side.CLIENT)
- public static IIcon getFireIcon(final int p_149840_1_) {
- return FirePit.TEXTURE[p_149840_1_];
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int ordinalSide, final int meta) {
- return FirePit.TEXTURE[0];
- }
-
- private static boolean isNeighborBurning(final World world, final int x, final int y, final int z) {
- return canCatchFire(world, x + 1, y, z, WEST) || canCatchFire(world, x - 1, y, z, EAST)
- || canCatchFire(world, x, y - 1, z, UP)
- || canCatchFire(world, x, y + 1, z, DOWN)
- || canCatchFire(world, x, y, z - 1, SOUTH)
- || canCatchFire(world, x, y, z + 1, NORTH);
- }
-
- public static boolean canCatchFire(final World world, final int x, final int y, final int z,
- final ForgeDirection face) {
- return world.getBlock(x, y, z).isFireSource(world, x, y, z, face);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/block/general/LightGlass.java b/src/main/java/gtPlusPlus/core/block/general/LightGlass.java
index 4bc120678f..64b2455e41 100644
--- a/src/main/java/gtPlusPlus/core/block/general/LightGlass.java
+++ b/src/main/java/gtPlusPlus/core/block/general/LightGlass.java
@@ -7,9 +7,11 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import codechicken.nei.api.API;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -28,7 +30,6 @@ public class LightGlass extends BlockAir {
private int hex;
public LightGlass(final boolean bool) {
- // super("blockMFEffect", Material.air, bool);
super();
this.setCreativeTab(AddToCreativeTab.tabBlock);
this.setBlockName("blockMFEffect");
@@ -38,9 +39,7 @@ public class LightGlass extends BlockAir {
setStepSound(Block.soundTypeGlass);
GameRegistry.registerBlock(this, "blockMFEffect");
- /*
- * this.setLightOpacity(0); this.setTickRandomly(true); this.setResistance(1);
- */
+ API.hideItem(new ItemStack(this));
}
/**
diff --git a/src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java b/src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java
deleted file mode 100644
index d5cd3ef2fa..0000000000
--- a/src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java
+++ /dev/null
@@ -1,485 +0,0 @@
-package gtPlusPlus.core.block.general;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.HashMap;
-import java.util.Random;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockDoor;
-import net.minecraft.block.ITileEntityProvider;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.IconFlipped;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.MovingObjectPosition;
-import net.minecraft.util.Vec3;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.item.base.itemblock.ItemBlockDoor;
-import gtPlusPlus.core.tileentities.general.TileEntityPlayerDoorBase;
-import gtPlusPlus.core.util.Utils;
-
-public class PlayerDoors extends BlockDoor implements ITileEntityProvider {
-
- @SideOnly(Side.CLIENT)
- private IIcon[] aTextureUpper;
-
- @SideOnly(Side.CLIENT)
- private IIcon[] aTextureLower;
-
- private static final HashMap<Material, BlockDoor> mDoorMap = new HashMap<Material, BlockDoor>();
-
- public PlayerDoors(Material aMaterial, String aTextureName, boolean vanillaType) {
- this(aMaterial, aTextureName, vanillaType, 0f, null, null);
- }
-
- public PlayerDoors(Material aMaterial, String aTextureName, boolean vanillaType, float aHardness,
- SoundType aStepSound, String aBlockExtensionName) {
- super(aMaterial);
- this.disableStats();
- this.isBlockContainer = true;
- if (mDoorMap.get(aMaterial) == null) {
- mDoorMap.put(aMaterial, this);
- }
- float f = 0.5F;
- float f1 = 1.0F;
- this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
-
- this.setBlockName("playerDoor_" + aTextureName);
- if (aMaterial == Material.wood) {
- setHardness(3.0F);
- setStepSound(soundTypeWood);
- setBlockName("playerDoor" + "Wood");
- this.setHarvestLevel("axe", 1);
- } else if (aMaterial == Material.iron) {
- setHardness(5.0F);
- setStepSound(Block.soundTypeMetal);
- setBlockName("playerDoor" + "Iron");
- this.setHarvestLevel("pickaxe", 1);
-
- } else if (aMaterial == Material.glass) {
- setHardness(0.1F);
- setStepSound(Block.soundTypeGlass);
- setBlockName("playerDoor" + "Glass");
- this.setHarvestLevel("pickaxe", 1);
-
- } else if (aMaterial == Material.ice) {
- setHardness(0.5F);
- setStepSound(Block.soundTypeSnow);
- setBlockName("playerDoor" + "Ice");
- this.setHarvestLevel("pickaxe", 1);
- } else {
- setHardness(aHardness);
- setStepSound(aStepSound);
- setBlockName("playerDoor" + aBlockExtensionName);
- this.setHarvestLevel("axe", 1);
- }
- this.setBlockTextureName(vanillaType ? aTextureName : GTPlusPlus.ID + ":" + aTextureName);
- GameRegistry.registerBlock(this, ItemBlockDoor.class, Utils.sanitizeString(this.getUnlocalizedName()));
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(int ordinalSide, int meta) {
- return this.aTextureLower[0];
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(IBlockAccess aAccess, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) {
- if (p_149673_5_ != 1 && p_149673_5_ != 0) {
- int i1 = this.getState(aAccess, p_149673_2_, p_149673_3_, p_149673_4_);
- int j1 = i1 & 3;
- boolean flag = (i1 & 4) != 0;
- boolean flag1 = false;
- boolean flag2 = (i1 & 8) != 0;
-
- if (flag) {
- if (j1 == 0 && p_149673_5_ == 2) {
- flag1 = !flag1;
- } else if (j1 == 1 && p_149673_5_ == 5) {
- flag1 = !flag1;
- } else if (j1 == 2 && p_149673_5_ == 3) {
- flag1 = !flag1;
- } else if (j1 == 3 && p_149673_5_ == 4) {
- flag1 = !flag1;
- }
- } else {
- if (j1 == 0 && p_149673_5_ == 5) {
- flag1 = !flag1;
- } else if (j1 == 1 && p_149673_5_ == 3) {
- flag1 = !flag1;
- } else if (j1 == 2 && p_149673_5_ == 4) {
- flag1 = !flag1;
- } else if (j1 == 3 && p_149673_5_ == 2) {
- flag1 = !flag1;
- }
-
- if ((i1 & 16) != 0) {
- flag1 = !flag1;
- }
- }
-
- return flag2 ? this.aTextureUpper[flag1 ? 1 : 0] : this.aTextureLower[flag1 ? 1 : 0];
- } else {
- return this.aTextureLower[0];
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister p_149651_1_) {
- this.aTextureUpper = new IIcon[2];
- this.aTextureLower = new IIcon[2];
- this.aTextureUpper[0] = p_149651_1_.registerIcon(this.getTextureName() + "_upper");
- this.aTextureLower[0] = p_149651_1_.registerIcon(this.getTextureName() + "_lower");
- this.aTextureUpper[1] = new IconFlipped(this.aTextureUpper[0], true, false);
- this.aTextureLower[1] = new IconFlipped(this.aTextureLower[0], true, false);
- }
-
- @Override
- public boolean getBlocksMovement(IBlockAccess aAccess, int aX, int aY, int aZ) {
- int l = this.getState(aAccess, aX, aY, aZ);
- return (l & 4) != 0;
- }
-
- /**
- * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
- */
- @Override
- public boolean renderAsNormalBlock() {
- return false;
- }
-
- /**
- * The type of render function that is called for this block
- */
- @Override
- public int getRenderType() {
- return 7;
- }
-
- /**
- * Returns the bounding box of the wired rectangular prism to render.
- */
- @Override
- @SideOnly(Side.CLIENT)
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- this.setBlockBoundsBasedOnState(aWorld, aX, aY, aZ);
- return super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- /**
- * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
- * cleared to be reused)
- */
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- this.setBlockBoundsBasedOnState(aWorld, aX, aY, aZ);
- return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- /**
- * Updates the blocks bounds based on its current state. Args: world, x, y, z
- */
- @Override
- public void setBlockBoundsBasedOnState(IBlockAccess aAccess, int aX, int aY, int aZ) {
- this.setBounds(this.getState(aAccess, aX, aY, aZ));
- }
-
- @Override
- public int func_150013_e(IBlockAccess p_150013_1_, int p_150013_2_, int p_150013_3_, int p_150013_4_) {
- return this.getState(p_150013_1_, p_150013_2_, p_150013_3_, p_150013_4_) & 3;
- }
-
- @Override
- public boolean func_150015_f(IBlockAccess p_150015_1_, int p_150015_2_, int p_150015_3_, int p_150015_4_) {
- return (this.getState(p_150015_1_, p_150015_2_, p_150015_3_, p_150015_4_) & 4) != 0;
- }
-
- private void setBounds(int aState) {
- float f = 0.1875F;
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
- int j = aState & 3;
- boolean flag = (aState & 4) != 0;
- boolean flag1 = (aState & 16) != 0;
-
- if (j == 0) {
- if (flag) {
- if (!flag1) {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
- } else {
- this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
- }
- } else {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
- }
- } else if (j == 1) {
- if (flag) {
- if (!flag1) {
- this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- } else {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
- }
- } else {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
- }
- } else if (j == 2) {
- if (flag) {
- if (!flag1) {
- this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
- } else {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
- }
- } else {
- this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- }
- } else if (j == 3) {
- if (flag) {
- if (!flag1) {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
- } else {
- this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- }
- } else {
- this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
- }
- }
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int p_149727_6_,
- float p_149727_7_, float p_149727_8_, float p_149727_9_) {
- if (this.blockMaterial == Material.iron) {
- return false; // Allow items to interact with the door
- } else {
- int i1 = this.getState(aWorld, aX, aY, aZ);
- int j1 = i1 & 7;
- j1 ^= 4;
-
- if ((i1 & 8) == 0) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, j1, 2);
- aWorld.markBlockRangeForRenderUpdate(aX, aY, aZ, aX, aY, aZ);
- } else {
- aWorld.setBlockMetadataWithNotify(aX, aY - 1, aZ, j1, 2);
- aWorld.markBlockRangeForRenderUpdate(aX, aY - 1, aZ, aX, aY, aZ);
- }
-
- aWorld.playAuxSFXAtEntity(aPlayer, 1003, aX, aY, aZ, 0);
- return true;
- }
- }
-
- @Override
- public void func_150014_a(World aWorld, int aX, int aY, int aZ, boolean aFlag) {
- int l = this.getState(aWorld, aX, aY, aZ);
- boolean flag1 = (l & 4) != 0;
-
- if (flag1 != aFlag) {
- int i1 = l & 7;
- i1 ^= 4;
-
- if ((l & 8) == 0) {
- aWorld.setBlockMetadataWithNotify(aX, aY, aZ, i1, 2);
- aWorld.markBlockRangeForRenderUpdate(aX, aY, aZ, aX, aY, aZ);
- } else {
- aWorld.setBlockMetadataWithNotify(aX, aY - 1, aZ, i1, 2);
- aWorld.markBlockRangeForRenderUpdate(aX, aY - 1, aZ, aX, aY, aZ);
- }
-
- aWorld.playAuxSFXAtEntity((EntityPlayer) null, 1003, aX, aY, aZ, 0);
- }
- }
-
- /**
- * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
- * their own) Args: x, y, z, neighbor Block
- */
- @Override
- public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aNeighbour) {
- int l = aWorld.getBlockMetadata(aX, aY, aZ);
-
- if ((l & 8) == 0) {
- boolean flag = false;
-
- if (aWorld.getBlock(aX, aY + 1, aZ) != this) {
- aWorld.setBlockToAir(aX, aY, aZ);
- flag = true;
- }
-
- if (!World.doesBlockHaveSolidTopSurface(aWorld, aX, aY - 1, aZ)) {
- aWorld.setBlockToAir(aX, aY, aZ);
- flag = true;
-
- if (aWorld.getBlock(aX, aY + 1, aZ) == this) {
- aWorld.setBlockToAir(aX, aY + 1, aZ);
- }
- }
-
- if (flag) {
- if (!aWorld.isRemote) {
- this.dropBlockAsItem(aWorld, aX, aY, aZ, l, 0);
- }
- } else {
- boolean flag1 = aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)
- || aWorld.isBlockIndirectlyGettingPowered(aX, aY + 1, aZ);
-
- if ((flag1 || aNeighbour.canProvidePower()) && aNeighbour != this) {
- this.func_150014_a(aWorld, aX, aY, aZ, flag1);
- }
- }
- } else {
- if (aWorld.getBlock(aX, aY - 1, aZ) != this) {
- aWorld.setBlockToAir(aX, aY, aZ);
- }
-
- if (aNeighbour != this) {
- this.onNeighborBlockChange(aWorld, aX, aY - 1, aZ, aNeighbour);
- }
- }
- }
-
- @Override
- public Item getItemDropped(int p_149650_1_, Random aRand, int p_149650_3_) {
- if ((p_149650_1_ & 8) != 0) {
- return null;
- } else {
- Block b = mDoorMap.get(this.blockMaterial);
- if (b != null) {
- return Item.getItemFromBlock(b);
- }
- }
- return null;
- }
-
- /**
- * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world,
- * x, y, z, startVec, endVec
- */
- @Override
- public MovingObjectPosition collisionRayTrace(World p_149731_1_, int p_149731_2_, int p_149731_3_, int p_149731_4_,
- Vec3 p_149731_5_, Vec3 p_149731_6_) {
- this.setBlockBoundsBasedOnState(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_);
- return super.collisionRayTrace(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_, p_149731_5_, p_149731_6_);
- }
-
- /**
- * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
- */
- @Override
- public boolean canPlaceBlockAt(World aWorld, int aX, int aY, int aZ) {
- boolean aHeight = (aY < aWorld.getHeight() - 1);
- boolean aSolidTopSurface = World.doesBlockHaveSolidTopSurface(aWorld, aX, aY - 1, aZ);
-
- boolean aCanPlace = aWorld.getBlock(aX, aY, aZ).isReplaceable(aWorld, aX, aY, aZ);
- boolean aCanPlace2 = aWorld.getBlock(aX, aY, aZ).isReplaceable(aWorld, aX, aY + 1, aZ);
-
- // Logger.INFO(""+aY+"/"+aWorld.getHeight()+" | Trying to place door. Good
- // height? "+aHeight+" | Solid top surface? "+aSolidTopSurface+" | Can Place?
- // "+aCanPlace+"|"+aCanPlace2);
-
- return aHeight && aSolidTopSurface && aCanPlace && aCanPlace2;
- }
-
- /**
- * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility
- * and stop pistons
- */
- @Override
- public int getMobilityFlag() {
- return 1;
- }
-
- public int getState(IBlockAccess aAccess, int aX, int aY, int aZ) {
- int l = aAccess.getBlockMetadata(aX, aY, aZ);
- boolean flag = (l & 8) != 0;
- int i1;
- int j1;
-
- if (flag) {
- i1 = aAccess.getBlockMetadata(aX, aY - 1, aZ);
- j1 = l;
- } else {
- i1 = l;
- j1 = aAccess.getBlockMetadata(aX, aY + 1, aZ);
- }
-
- boolean flag1 = (j1 & 1) != 0;
- return i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0);
- }
-
- /**
- * Gets an item for the block being called on. Args: world, x, y, z
- */
- @Override
- @SideOnly(Side.CLIENT)
- public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
- Block b = mDoorMap.get(this.blockMaterial);
- if (b != null) {
- return Item.getItemFromBlock(b);
- }
- // return this.blockMaterial == Material.iron ? Items.iron_door :
- // Items.wooden_door;
- return null;
- }
-
- /**
- * Called when the block is attempted to be harvested
- */
- @Override
- public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_,
- EntityPlayer p_149681_6_) {
- if (p_149681_6_.capabilities.isCreativeMode && (p_149681_5_ & 8) != 0
- && p_149681_1_.getBlock(p_149681_2_, p_149681_3_ - 1, p_149681_4_) == this) {
- p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_ - 1, p_149681_4_);
- }
- }
-
- /**
- * Called whenever the block is added into the world. Args: world, x, y, z
- */
- @Override
- public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {
- super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_);
- }
-
- @Override
- public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_,
- int p_149749_6_) {
- super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
- p_149749_1_.removeTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
- }
-
- @Override
- public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_,
- int p_149696_5_, int p_149696_6_) {
- super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_);
- TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_);
- return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false;
- }
-
- @Override
- public TileEntity createNewTileEntity(World world, int metadata) {
- return new TileEntityPlayerDoorBase(this, metadata);
- }
-
- @Override
- public TileEntity createTileEntity(World world, int metadata) {
- return new TileEntityPlayerDoorBase(this, metadata);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java
deleted file mode 100644
index 2d2a407057..0000000000
--- a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java
+++ /dev/null
@@ -1,366 +0,0 @@
-package gtPlusPlus.core.block.general.redstone;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Random;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.common.items.GT_MetaGenerated_Tool_01;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta;
-import gtPlusPlus.core.tileentities.general.redstone.TileEntityRedstoneHandler;
-import gtPlusPlus.core.util.minecraft.InventoryUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-
-public abstract class BlockGenericRedstone extends BlockContainer {
-
- public BlockGenericRedstone(String aUnlocalizedSuffix, String aDisplayName) {
- super(Material.redstoneLight);
- this.setBlockName("blockGenericRedstone." + aUnlocalizedSuffix);
- this.setHardness(3f);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockGenericRedstone." + aUnlocalizedSuffix);
- }
-
- private final HashMap<Integer, HashMap<ForgeDirection, IIcon>> mTextures = new HashMap<Integer, HashMap<ForgeDirection, IIcon>>();
-
- /**
- * A map of the textures used for this blocks. The key is the meta, then each internal map holds textures tied to
- * each forge direction. Do not use unknown direction.
- *
- * @return
- */
- public HashMap<Integer, HashMap<ForgeDirection, IIcon>> getTextureArray() {
- return mTextures;
- }
-
- public abstract void generateTextureArray(final IIconRegister iicon);
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void registerBlockIcons(final IIconRegister iicon) {
- generateTextureArray(iicon);
- this.blockIcon = iicon.registerIcon("redstone_block");
- }
-
- /**
- * 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) {
-
- if (world.isRemote) {
- return true;
- }
-
- boolean mDidTool = false;
- // Check For Tools
- try {
- final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName());
- final Item mHandItem = mHandStack.getItem();
- if (ItemUtils.isItemGregtechTool(mHandStack)) {
-
- Logger.INFO("Found Tool in players hand!");
-
- final TileEntityRedstoneHandler tile = (TileEntityRedstoneHandler) world.getTileEntity(x, y, z);
- if (tile != null) {
- if (tile.isScrewdriverable()) {
- if (ItemUtils.isToolScrewdriver(mHandStack)) {
- mDidTool = tile.onScrewdriverRMB();
- PlayerUtils.messagePlayer(
- player,
- "Adjusted Light level by 0.0625f. " + tile.getLightBrightness());
- }
- }
- if (tile.isMalletable()) {
- if (ItemUtils.isToolMallet(mHandStack)) {
- mDidTool = tile.onMalletRMB();
- PlayerUtils.messagePlayer(player, "Light Mode active: " + mDidTool);
- }
- }
- if (tile.isWrenchable()) {
- if (ItemUtils.isToolWrench(mHandStack)) {
- mDidTool = tile.onWrenchRMB();
- }
- }
- }
- }
- } catch (final Throwable t) {}
- if (mDidTool) {
- return true;
- }
-
- return false;
- }
-
- @Override
- public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
-
- boolean mDidTool = false;
- // Check For Tools
- try {
- final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(aWorld, aPlayer.getDisplayName());
- final Item mHandItem = mHandStack.getItem();
- if (mHandItem instanceof GT_MetaGenerated_Tool_01) {
-
- final TileEntityRedstoneHandler tile = (TileEntityRedstoneHandler) aWorld.getTileEntity(aX, aY, aZ);
- if (tile != null) {
- if (tile.isScrewdriverable()) {
- if (ItemUtils.isToolScrewdriver(mHandStack)) {
- mDidTool = tile.onScrewdriverLMB();
- }
- }
- if (tile.isMalletable()) {
- if (ItemUtils.isToolMallet(mHandStack)) {
- mDidTool = tile.onMalletLMB();
- }
- }
- if (tile.isWrenchable()) {
- if (ItemUtils.isToolWrench(mHandStack)) {
- mDidTool = tile.onWrenchLMB();
- }
- }
- }
- }
- } catch (Throwable t) {}
-
- if (!mDidTool && !aPlayer.capabilities.isCreativeMode) {
- super.onBlockClicked(aWorld, aX, aY, aZ, aPlayer);
- } else {
- return;
- }
- }
-
- @Override
- public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_);
-
- @Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block,
- final int number) {
- InventoryUtils.dropInventoryItems(world, x, y, z, block);
- super.breakBlock(world, x, y, z, block, number);
- }
-
- @Override
- public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity,
- final ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityRedstoneHandler) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName());
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
- final int z) {
- return false;
- }
-
- @Override
- public int getLightValue() {
- return super.getLightValue();
- }
-
- @Override
- public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_,
- float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) {
- // TODO Auto-generated method stub
- return super.onBlockPlaced(
- p_149660_1_,
- p_149660_2_,
- p_149660_3_,
- p_149660_4_,
- p_149660_5_,
- p_149660_6_,
- p_149660_7_,
- p_149660_8_,
- p_149660_9_);
- }
-
- @Override
- public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
- TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
- if (aThis != null) {
- return aThis.isProvidingWeakPower(world, x, y, z, side);
- }
- return 0;
- }
-
- @Override
- public boolean canProvidePower() {
- return false;
- }
-
- @Override
- public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) {
- TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
- if (aThis != null) {
- return aThis.isProvidingStrongPower(world, x, y, z, side);
- }
- return 0;
- }
-
- @Override
- public boolean hasComparatorInputOverride() {
- // TODO Auto-generated method stub
- return super.hasComparatorInputOverride();
- }
-
- @Override
- public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_,
- int p_149736_5_) {
- // TODO Auto-generated method stub
- return super.getComparatorInputOverride(p_149736_1_, p_149736_2_, p_149736_3_, p_149736_4_, p_149736_5_);
- }
-
- @Override
- public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) {
- TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
- if (aThis != null) {
- return aThis.canConnectRedstone(world, x, y, z, side);
- }
- return false;
- }
-
- @Override
- public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) {
- TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
- if (aThis != null) {
- return aThis.shouldCheckWeakPower(world, x, y, z, side);
- }
- return isNormalCube();
- }
-
- @Override
- public boolean getWeakChanges(IBlockAccess world, int x, int y, int z) {
- TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z);
- if (aThis != null) {
- return aThis.getWeakChanges(world, x, y, z);
- }
- return false;
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public abstract IIcon getIcon(final int ordinalSide, final int meta);
-
- @Override
- public int damageDropped(final int damage) {
- return damage;
- }
-
- @Override
- public abstract void getSubBlocks(final Item item, final CreativeTabs tab, final List list);
-
- /**
- * Called whenever the block is added into the world. Args: world, x, y, z
- */
- @Override
- public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
- TileEntityRedstoneHandler aThis = getTileEntity(aWorld, aX, aY, aZ);
-
- if (!aWorld.isRemote) {
- if (aThis.hasUpdatedRecently() && !aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
- aWorld.scheduleBlockUpdate(aX, aY, aZ, this, 4);
- } else if (!aThis.hasUpdatedRecently() && aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
- aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 2);
- }
- }
- }
-
- /**
- * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
- * their own) Args: x, y, z, neighbor Block
- */
- @Override
- public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) {
-
- TileEntityRedstoneHandler aThis = getTileEntity(aWorld, aX, aY, aZ);
-
- if (!aWorld.isRemote) {
- if (aThis.hasUpdatedRecently() && !aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
- aWorld.scheduleBlockUpdate(aX, aY, aZ, this, 4);
- } else if (!aThis.hasUpdatedRecently() && aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) {
- aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 2);
- }
- }
- }
-
- /**
- * Ticks the block if it's been scheduled
- */
- @Override
- public void updateTick(World aWorld, int aX, int aY, int aZ, Random p_149674_5_) {
- TileEntityRedstoneHandler aTile = getTileEntity(aWorld, aX, aY, aZ);
- // Client side handling
- if (aTile != null) {
- this.setLightLevel(aTile.getLightBrightness());
- }
- // Only continue on server
- if (aWorld.isRemote) {
- return;
- }
- if (aTile != null) {
- if (aTile.isGettingIndirectlyPowered()) {}
- }
- }
-
- public TileEntityRedstoneHandler getTileEntity(IBlockAccess world, int aX, int aY, int aZ) {
- TileEntity aTemp = world.getTileEntity(aX, aY, aZ);
- if (aTemp != null) {
- if (aTemp instanceof TileEntityRedstoneHandler) {
- TileEntityRedstoneHandler g = (TileEntityRedstoneHandler) aTemp;
- if (g != null) {
- return g;
- }
- }
- }
- return null;
- }
-
- /**
- * Gets an item for the block being called on. Args: world, x, y, z
- */
- @SideOnly(Side.CLIENT)
- @Override
- public abstract Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_);
-
- /**
- * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage
- * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null.
- */
- @Override
- protected abstract ItemStack createStackedBlock(int p_149644_1_);
-
- @Override
- public abstract ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z,
- final int metadata, final int fortune);
-
- @Override
- public abstract Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_);
-}
diff --git a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java
deleted file mode 100644
index 8652a45c04..0000000000
--- a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package gtPlusPlus.core.block.general.redstone;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Random;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import gtPlusPlus.core.tileentities.general.redstone.TileEntityRedstoneHandler;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class BlockGenericRedstoneDetector extends BlockGenericRedstone {
-
- public BlockGenericRedstoneDetector() {
- super("detector", "Redstone Detector");
- setTickRandomly(true);
- }
-
- @Override
- public TileEntity createNewTileEntity(World world, int p_149915_2_) {
- return new TileEntityRedstoneDetector();
- }
-
- public class TileEntityRedstoneDetector extends TileEntityRedstoneHandler {
-
- public TileEntityRedstoneDetector() {
- super(0);
- }
-
- @Override
- protected Class<? extends TileEntity> getTileEntityClass() {
- return this.getClass();
- }
-
- @Override
- protected String getTileEntityNameForRegistration() {
- return "TileEntityRedstoneDetector";
- }
- }
-
- @Override
- public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List aList) {
- aList.add(ItemUtils.getSimpleStack(this));
- }
-
- @Override
- public void updateTick(World aWorld, int aX, int aY, int aZ, Random aRand) {
- super.updateTick(aWorld, aX, aY, aZ, aRand);
- }
-
- @Override
- public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
- // TODO Auto-generated method stub
- return ItemUtils.getSimpleStack(this).getItem();
- }
-
- @Override
- public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
- // TODO Auto-generated method stub
- return ItemUtils.getSimpleStack(this).getItem();
- }
-
- @Override
- protected ItemStack createStackedBlock(int p_149644_1_) {
- return ItemUtils.simpleMetaStack(this, p_149644_1_, 1);
- }
-
- @Override
- public void generateTextureArray(final IIconRegister iicon) {
- HashMap<Integer, HashMap<ForgeDirection, IIcon>> aTextures = new HashMap<Integer, HashMap<ForgeDirection, IIcon>>();
-
- // New Block for Each Meta
- int aMeta = 0;
- {
- HashMap<ForgeDirection, IIcon> aTempMap = new HashMap<ForgeDirection, IIcon>();
- aTempMap.put(
- ForgeDirection.UP,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(
- ForgeDirection.DOWN,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(
- ForgeDirection.NORTH,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(
- ForgeDirection.SOUTH,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(
- ForgeDirection.EAST,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(
- ForgeDirection.WEST,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTextures.put(aMeta++, aTempMap);
- }
- }
-
- @Override
- public IIcon getIcon(int ordinalSide, int meta) {
- HashMap<ForgeDirection, IIcon> aTemp = getTextureArray().get(meta);
- if (aTemp != null) {
- IIcon aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide));
- if (aSide != null) {
- return aSide;
- } else {
- // Smart calculate missing sides
- if (ordinalSide <= 1) {
- for (int ss = 0; ss < 2; ss++) {
- aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide));
- if (aSide != null) {
- return aSide;
- }
- }
- }
- for (int ss = 2; ss < 6; ss++) {
- aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide));
- if (aSide != null) {
- return aSide;
- }
- }
- }
- }
- return blockIcon;
- }
-
- @Override
- public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
- ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
- aDrops.add(ItemUtils.getSimpleStack(this));
- return aDrops;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java
deleted file mode 100644
index 16f8ceef8e..0000000000
--- a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package gtPlusPlus.core.block.general.redstone;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Random;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.tileentities.general.redstone.TileEntityRedstoneHandler;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.world.explosions.ExplosionHandler;
-
-public class BlockGenericRedstoneTest extends BlockGenericRedstone {
-
- public BlockGenericRedstoneTest() {
- super("test", "Redstone Test");
- setTickRandomly(true);
- }
-
- @Override
- public TileEntity createNewTileEntity(World world, int p_149915_2_) {
- return new TileEntityRedstoneTest();
- }
-
- public class TileEntityRedstoneTest extends TileEntityRedstoneHandler {
-
- public TileEntityRedstoneTest() {
- super(2);
- }
-
- @Override
- public boolean isScrewdriverable() {
- return true;
- }
-
- @Override
- public boolean onScrewdriverLMB() {
- return super.onScrewdriverLMB();
- }
-
- @Override
- public boolean onScrewdriverRMB() {
- if (this.mLightValue + 0.0625f <= 1) {
- this.mLightValue += 0.0625f;
- } else {
- this.mLightValue = 0;
- }
- this.markForUpdate();
- return true;
- }
-
- @Override
- public boolean isMalletable() {
- return true;
- }
-
- @Override
- public boolean onMalletLMB() {
- return super.onMalletLMB();
- }
-
- @Override
- public boolean onMalletRMB() {
- this.mLightMode = Utils.invertBoolean(mLightMode);
- this.markForUpdate();
- return mLightMode;
- }
-
- @Override
- public boolean isWrenchable() {
- return true;
- }
-
- @Override
- public boolean onWrenchLMB() {
- return super.onWrenchLMB();
- }
-
- @Override
- public boolean onWrenchRMB() {
- Logger.INFO("Found Wrench");
- ExplosionHandler explode = new ExplosionHandler();
- explode.createExplosion(this.worldObj, null, this.xCoord, this.yCoord, this.zCoord, 1f, false, true);
- return true;
- }
-
- @Override
- protected Class<? extends TileEntity> getTileEntityClass() {
- return this.getClass();
- }
-
- @Override
- protected String getTileEntityNameForRegistration() {
- return "TileEntityRedstoneTest";
- }
-
- @Override
- public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
- return super.isProvidingWeakPower(world, x, y, z, side);
- }
-
- @Override
- public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) {
- return super.isProvidingStrongPower(world, x, y, z, side);
- }
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List aList) {
- aList.add(ItemUtils.getSimpleStack(this));
- }
-
- @Override
- public void updateTick(World aWorld, int aX, int aY, int aZ, Random aRand) {
- super.updateTick(aWorld, aX, aY, aZ, aRand);
- }
-
- @Override
- public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
- return ItemUtils.getSimpleStack(this).getItem();
- }
-
- @Override
- public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
- return ItemUtils.getSimpleStack(this).getItem();
- }
-
- @Override
- protected ItemStack createStackedBlock(int p_149644_1_) {
- return ItemUtils.simpleMetaStack(this, p_149644_1_, 1);
- }
-
- @Override
- public void generateTextureArray(final IIconRegister iicon) {
- HashMap<Integer, HashMap<ForgeDirection, IIcon>> aTextures = new HashMap<Integer, HashMap<ForgeDirection, IIcon>>();
-
- // New Block for Each Meta
- int aMeta = 0;
- {
- HashMap<ForgeDirection, IIcon> aTempMap = new HashMap<ForgeDirection, IIcon>();
- aTempMap.put(
- ForgeDirection.UP,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(
- ForgeDirection.DOWN,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(
- ForgeDirection.NORTH,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(
- ForgeDirection.SOUTH,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(
- ForgeDirection.EAST,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTempMap.put(
- ForgeDirection.WEST,
- iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top"));
- aTextures.put(aMeta++, aTempMap);
- }
- }
-
- @Override
- public IIcon getIcon(int ordinalSide, int meta) {
- HashMap<ForgeDirection, IIcon> aTemp = getTextureArray().get(meta);
- if (aTemp != null) {
- IIcon aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide));
- if (aSide != null) {
- return aSide;
- } else {
- // Smart calculate missing sides
- if (ordinalSide <= 1) {
- for (int ss = 0; ss < 2; ss++) {
- aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide));
- if (aSide != null) {
- return aSide;
- }
- }
- }
- for (int ss = 2; ss < 6; ss++) {
- aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide));
- if (aSide != null) {
- return aSide;
- }
- }
- }
- }
- return blockIcon;
- }
-
- @Override
- public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
- ArrayList<ItemStack> aDrops = new ArrayList<ItemStack>();
- aDrops.add(ItemUtils.getSimpleStack(this));
- return aDrops;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/EggBox.java b/src/main/java/gtPlusPlus/core/block/machine/EggBox.java
deleted file mode 100644
index 90d74c5d37..0000000000
--- a/src/main/java/gtPlusPlus/core/block/machine/EggBox.java
+++ /dev/null
@@ -1,149 +0,0 @@
-package gtPlusPlus.core.block.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.handler.GuiHandler;
-import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile;
-import gtPlusPlus.core.tileentities.general.TileEntityEggBox;
-import gtPlusPlus.core.util.minecraft.InventoryUtils;
-
-public class EggBox extends BlockContainer implements ITileTooltip {
-
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
-
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
-
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 7;
-
- public final int field_149956_a = 0;
-
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
-
- public EggBox() {
- super(Material.wood);
- this.setBlockName("blockEggBox");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setHardness(5f);
- this.setResistance(1f);
- GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockEggBox");
- }
-
- /**
- * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
- */
- @Override
- public boolean renderAsNormalBlock() {
- return true;
- }
-
- /**
- * The type of render function that is called for this block
- */
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderType() {
- return super.getRenderType();
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int ordinalSide, final int meta) {
- return ordinalSide == 1 ? this.textureTop : this.textureFront;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_) {
- this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "EggBox_top");
- this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "EggBox_top");
- this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "EggBox_side");
- this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "EggBox_side");
- }
-
- /**
- * 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) {
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityEggBox)) {
- player.openGui(GTplusplus.instance, GuiHandler.GUI17, world, x, y, z);
- return true;
- }
- return false;
- }
-
- @Override
- public int getRenderBlockPass() {
- return 0;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityEggBox();
- }
-
- @Override
- public void onBlockAdded(final World world, final int x, final int y, final int z) {
- super.onBlockAdded(world, x, y, z);
- }
-
- @Override
- public void breakBlock(final World world, final int x, final int y, final int z, final Block block,
- final int number) {
- InventoryUtils.dropInventoryItems(world, x, y, z, block);
- super.breakBlock(world, x, y, z, block, number);
- }
-
- @Override
- public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity,
- final ItemStack stack) {
- if (stack.hasDisplayName()) {
- ((TileEntityEggBox) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName());
- }
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
- final int z) {
- return false;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java b/src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java
deleted file mode 100644
index a89de43744..0000000000
--- a/src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package gtPlusPlus.core.block.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator;
-
-public class HeliumGenerator extends BlockContainer {
-
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
-
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
-
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- public HeliumGenerator() {
- super(Material.wood);
- this.setBlockName("blockHeliumGenerator");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, "blockHeliumGenerator");
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int ordinalSide, final int meta) {
- return ordinalSide == 1 ? this.textureTop
- : (ordinalSide == 0 ? this.textureBottom
- : ((ordinalSide != 2) && (ordinalSide != 4) ? this.blockIcon : this.textureFront));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_) {
- this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "Chrono/" + "CyberPanel");
- this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "Chrono/" + "CyberPanel");
- this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "Chrono/" + "CyberPanel");
- this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "Chrono/" + "CyberPanel");
- }
-
- /**
- * 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) {
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityHeliumGenerator)) { // TODO
- player.openGui(GTplusplus.instance, 1, world, x, y, z); // TODO
- return true;
- }
- return false;
- }
-
- @Override
- public int getRenderBlockPass() {
- return 1;
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityHeliumGenerator();
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java
deleted file mode 100644
index 8c388f1408..0000000000
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package gtPlusPlus.core.block.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile;
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
-
-public class Machine_ModularityTable extends BlockContainer implements ITileTooltip {
-
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
-
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
-
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 1;
-
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
-
- public Machine_ModularityTable() {
- super(Material.iron);
- this.setBlockName("blockModularity");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockModularity");
- }
-
- /**
- * Gets the block's texture. Args: side, meta
- */
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(final int ordinalSide, final int meta) {
- return ordinalSide == 1 ? this.textureTop
- : (ordinalSide == 0 ? this.textureBottom
- : ((ordinalSide != 2) && (ordinalSide != 4) ? this.blockIcon : this.textureFront));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_) {
- this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "ModularTable_side");
- this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "ModularTable_top");
- this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "ModularTable_output");
- this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "ModularTable_side");
- }
-
- /**
- * 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) {
- if (world.isRemote) {
- return true;
- }
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityModularityTable)) {
- player.openGui(GTplusplus.instance, 1, world, x, y, z);
- Logger.INFO("Player opened GUI");
- return true;
- }
- return false;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityModularityTable();
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
- final int z) {
- return false;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java
deleted file mode 100644
index c299cff6cb..0000000000
--- a/src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package gtPlusPlus.core.block.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.api.interfaces.ITileTooltip;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.block.base.BlockBaseNBT;
-import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
-
-public class Machine_TradeTable extends BlockBaseNBT implements ITileTooltip {
-
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
-
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
-
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- /**
- * Determines which tooltip is displayed within the itemblock.
- */
- private final int mTooltipID = 2;
-
- @Override
- public int getTooltipID() {
- return this.mTooltipID;
- }
-
- public Machine_TradeTable() {
- super(Material.leaves, "blockTradeBench", "Trade-o-Mat");
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister p_149651_1_) {
- this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlYellow");
- this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "workbench_top");
- this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlYellow");
- this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlYellow");
- }
-
- /**
- * 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) {
- if (world.isRemote) {
- return true;
- }
-
- final TileEntity te = world.getTileEntity(x, y, z);
- if ((te != null) && (te instanceof TileEntityTradeTable)) {
- // Utils.LOG_INFO("Clicked on TE - ok");
- player.openGui(GTplusplus.instance, 6, world, x, y, z);
- return true;
- } else {
- Logger.INFO("Bad TE");
- }
- return false;
- }
-
- @Override
- public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
- return new TileEntityTradeTable();
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
- final int z) {
- return false;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java b/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java
deleted file mode 100644
index 61465a59c1..0000000000
--- a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package gtPlusPlus.core.block.machine.bedrock;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.Random;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.util.DamageSource;
-import net.minecraft.world.Explosion;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-
-public class Mining_Head_Fake extends Block {
-
- public Mining_Head_Fake() {
- super(Material.lava);
- this.setBlockName(Utils.sanitizeString("blockMiningHeadFake"));
- this.setBlockTextureName(GTPlusPlus.ID + ":" + "blockFrameGt");
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setHardness(-1F);
- this.setResistance(50000.0F);
- this.setHarvestLevel("pickaxe", 10);
- this.setStepSound(soundTypeMetal);
- // LanguageRegistry.addName(this, "Wither Cage");
- GameRegistry.registerBlock(this, Utils.sanitizeString("blockMiningHeadFake"));
- }
-
- public String GetProperName() {
- return "Hardened Mining Head";
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderBlockPass() {
- return 1;
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon) {
- this.blockIcon = iIcon.registerIcon(GTPlusPlus.ID + ":" + "blockFrameGt");
- }
-
- @Override
- public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion) {
- // prevent from being destroyed by wither and nukes.
- }
-
- @Override
- public void onBlockDestroyedByExplosion(final World p_149723_1_, final int p_149723_2_, final int p_149723_3_,
- final int p_149723_4_, final Explosion p_149723_5_) {}
-
- @Override
- public boolean canDropFromExplosion(final Explosion p_149659_1_) {
- return false;
- }
-
- @Override
- public boolean canEntityDestroy(final IBlockAccess world, final int x, final int y, final int z,
- final Entity entity) {
- return false;
- }
-
- // Colour Handling
- private static final int mWitherColour = Utils.rgbtoHexValue(175, 64, 32);
-
- @Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
- return mWitherColour;
- }
-
- @Override
- public int getRenderColor(final int aMeta) {
- return mWitherColour;
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
- final int z) {
- return false;
- }
-
- @Override
- public boolean isCollidable() {
- return true;
- }
-
- @Override
- public void randomDisplayTick(World world, int posX, int posY, int posZ, Random rand) {
- generateVoidParticlesAroundBlockPos(new BlockPos(posX, posY, posZ, world), 2);
- super.randomDisplayTick(world, posX, posY, posZ, rand);
- }
-
- @Override
- public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_,
- Entity ent) {
- EntityUtils.doDamage(ent, DamageSource.outOfWorld, 20);
- EntityUtils.setEntityOnFire(ent, 100);
- super.onEntityCollidedWithBlock(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, ent);
- }
-
- @Override
- protected boolean canSilkHarvest() {
- return false;
- }
-
- @Override
- public boolean canHarvestBlock(EntityPlayer player, int meta) {
- return false;
- }
-
- public static void generateVoidParticlesAroundBlockPos(BlockPos Pos, int range) {
- for (BlockPos G : Pos.getSurroundingBlocks()) {
- int i1 = G.xPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range);
- int j1 = G.yPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range);
- int k1 = G.zPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range);
-
- Block block = Pos.world.getBlock(i1, j1, k1);
-
- if (block.getMaterial() == Material.air) {
-
- // lava
- if (Pos.yPos <= 7) {
- Pos.world.spawnParticle(
- "portal",
- (double) ((float) i1 + CORE.RANDOM.nextFloat()),
- (double) ((float) j1 + CORE.RANDOM.nextFloat()),
- (double) ((float) k1 + CORE.RANDOM.nextFloat()),
- 0.0D,
- 0.0D,
- 0.0D);
- Pos.world.spawnParticle(
- "lava",
- (double) ((float) i1 + CORE.RANDOM.nextFloat()),
- (double) ((float) j1 + CORE.RANDOM.nextFloat()),
- (double) ((float) k1 + CORE.RANDOM.nextFloat()),
- 0.0D,
- 0.0D,
- 0.0D);
- } else {
- Pos.world.spawnParticle(
- "portal",
- (double) ((float) i1 + CORE.RANDOM.nextFloat()),
- (double) ((float) j1 + CORE.RANDOM.nextFloat()),
- (double) ((float) k1 + CORE.RANDOM.nextFloat()),
- 0.0D,
- 0.0D,
- 0.0D);
- }
- }
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java b/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java
deleted file mode 100644
index 29067dd2c1..0000000000
--- a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package gtPlusPlus.core.block.machine.bedrock;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.Random;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.util.DamageSource;
-import net.minecraft.world.Explosion;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-
-public class Mining_Pipe_Fake extends Block {
-
- public Mining_Pipe_Fake() {
- super(Material.cactus);
- this.setBlockName(Utils.sanitizeString("blockMiningPipeFake"));
- this.setBlockTextureName(GTPlusPlus.ID + ":" + "blockFrameGt");
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setHardness(-1F);
- this.setResistance(50000.0F);
- this.setHarvestLevel("pickaxe", 8);
- this.setStepSound(soundTypeMetal);
- // LanguageRegistry.addName(this, "Wither Cage");
- GameRegistry.registerBlock(this, Utils.sanitizeString("blockMiningPipeFake"));
- }
-
- public String GetProperName() {
- return "Hardened Mining Pipe";
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getRenderBlockPass() {
- return 1;
- }
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon) {
- this.blockIcon = iIcon.registerIcon(GTPlusPlus.ID + ":" + "blockFrameGt");
- }
-
- @Override
- public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion) {
- // prevent from being destroyed by wither and nukes.
- }
-
- @Override
- public void onBlockDestroyedByExplosion(final World p_149723_1_, final int p_149723_2_, final int p_149723_3_,
- final int p_149723_4_, final Explosion p_149723_5_) {}
-
- @Override
- public boolean canDropFromExplosion(final Explosion p_149659_1_) {
- return false;
- }
-
- @Override
- public boolean canEntityDestroy(final IBlockAccess world, final int x, final int y, final int z,
- final Entity entity) {
- return false;
- }
-
- // Colour Handling
- private static final int mWitherColour = Utils.rgbtoHexValue(32, 32, 32);
-
- @Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
- return mWitherColour;
- }
-
- @Override
- public int getRenderColor(final int aMeta) {
- return mWitherColour;
- }
-
- @Override
- public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
- final int z) {
- return false;
- }
-
- @Override
- public boolean isCollidable() {
- return true;
- }
-
- @Override
- public void randomDisplayTick(World world, int posX, int posY, int posZ, Random rand) {
- Mining_Head_Fake.generateVoidParticlesAroundBlockPos(new BlockPos(posX, posY, posZ, world), 2);
- super.randomDisplayTick(world, posX, posY, posZ, rand);
- }
-
- @Override
- public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_,
- Entity ent) {
- if (MathUtils.randInt(0, 100) < 5) {
- EntityUtils.doDamage(ent, DamageSource.outOfWorld, 1);
- }
- super.onEntityCollidedWithBlock(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, ent);
- }
-
- @Override
- protected boolean canSilkHarvest() {
- return false;
- }
-
- @Override
- public boolean canHarvestBlock(EntityPlayer player, int meta) {
- return false;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java b/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java
deleted file mode 100644
index b61027a6f5..0000000000
--- a/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package gtPlusPlus.core.client.model;
-
-import net.minecraft.client.model.ModelBase;
-import net.minecraft.client.model.ModelRenderer;
-import net.minecraft.entity.Entity;
-import net.minecraft.util.MathHelper;
-
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.entity.monster.EntityBatKing;
-
-@SideOnly(Side.CLIENT)
-public class ModelBatKing extends ModelBase {
-
- private ModelRenderer batHead;
- /** The body box of the bat model. */
- private ModelRenderer batBody;
- /** The inner right wing box of the bat model. */
- private ModelRenderer batRightWing;
- /** The inner left wing box of the bat model. */
- private ModelRenderer batLeftWing;
- /** The outer right wing box of the bat model. */
- private ModelRenderer batOuterRightWing;
- /** The outer left wing box of the bat model. */
- private ModelRenderer batOuterLeftWing;
-
- public ModelBatKing() {
- this.textureWidth = 64;
- this.textureHeight = 64;
-
- this.batHead = new ModelRenderer(this, 0, 0);
- this.batHead.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6);
- ModelRenderer modelrenderer = new ModelRenderer(this, 24, 0);
- modelrenderer.addBox(-4.0F, -6.0F, -2.0F, 3, 4, 1);
- this.batHead.addChild(modelrenderer);
- ModelRenderer modelrenderer1 = new ModelRenderer(this, 24, 0);
- modelrenderer1.mirror = true;
- modelrenderer1.addBox(1.0F, -6.0F, -2.0F, 3, 4, 1);
- this.batHead.addChild(modelrenderer1);
- this.batBody = new ModelRenderer(this, 0, 16);
- this.batBody.addBox(-3.0F, 4.0F, -3.0F, 6, 12, 6);
- this.batBody.setTextureOffset(0, 34).addBox(-5.0F, 16.0F, 0.0F, 10, 6, 1);
- this.batRightWing = new ModelRenderer(this, 42, 0);
- this.batRightWing.addBox(-12.0F, 1.0F, 1.5F, 10, 16, 1);
- this.batOuterRightWing = new ModelRenderer(this, 24, 16);
- this.batOuterRightWing.setRotationPoint(-12.0F, 1.0F, 1.5F);
- this.batOuterRightWing.addBox(-8.0F, 1.0F, 0.0F, 8, 12, 1);
- this.batLeftWing = new ModelRenderer(this, 42, 0);
- this.batLeftWing.mirror = true;
- this.batLeftWing.addBox(2.0F, 1.0F, 1.5F, 10, 16, 1);
- this.batOuterLeftWing = new ModelRenderer(this, 24, 16);
- this.batOuterLeftWing.mirror = true;
- this.batOuterLeftWing.setRotationPoint(12.0F, 1.0F, 1.5F);
- this.batOuterLeftWing.addBox(0.0F, 1.0F, 0.0F, 8, 12, 1);
- this.batBody.addChild(this.batRightWing);
- this.batBody.addChild(this.batLeftWing);
- this.batRightWing.addChild(this.batOuterRightWing);
- this.batLeftWing.addChild(this.batOuterLeftWing);
- }
-
- /**
- * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and
- * it seems a good match for a bats size
- */
- public int getBatSize() {
- return 72;
- }
-
- /**
- * Sets the models various rotation angles then renders the model.
- */
- @Override
- public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_,
- float p_78088_6_, float p_78088_7_) {
- EntityBatKing entitybat = (EntityBatKing) p_78088_1_;
- float f6;
-
- if (entitybat.getIsBatHanging()) {
- f6 = (180F / (float) Math.PI);
- this.batHead.rotateAngleX = p_78088_6_ / (180F / (float) Math.PI);
- this.batHead.rotateAngleY = (float) Math.PI - p_78088_5_ / (180F / (float) Math.PI);
- this.batHead.rotateAngleZ = (float) Math.PI;
- this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F);
- this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F);
- this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F);
- this.batBody.rotateAngleX = (float) Math.PI;
- this.batRightWing.rotateAngleX = -0.15707964F;
- this.batRightWing.rotateAngleY = -((float) Math.PI * 2F / 5F);
- this.batOuterRightWing.rotateAngleY = -1.7278761F;
- this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX;
- this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY;
- this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY;
- } else {
- f6 = (180F / (float) Math.PI);
- this.batHead.rotateAngleX = p_78088_6_ / (180F / (float) Math.PI);
- this.batHead.rotateAngleY = p_78088_5_ / (180F / (float) Math.PI);
- this.batHead.rotateAngleZ = 0.0F;
- this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F);
- this.batBody.rotateAngleX = ((float) Math.PI / 4F) + MathHelper.cos(p_78088_4_ * 0.1F) * 0.15F;
- this.batBody.rotateAngleY = 0.0F;
- this.batRightWing.rotateAngleY = MathHelper.cos(p_78088_4_ * 1.3F) * (float) Math.PI * 0.25F;
- this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY;
- this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F;
- this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F;
- }
-
- GL11.glScalef(4, 4, 4);
- this.batHead.render(p_78088_7_);
- this.batBody.render(p_78088_7_);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java b/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java
deleted file mode 100644
index 14ee51a35e..0000000000
--- a/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package gtPlusPlus.core.client.model;
-
-import net.minecraft.client.model.ModelChicken;
-import net.minecraft.client.model.ModelRenderer;
-import net.minecraft.entity.Entity;
-import net.minecraft.util.MathHelper;
-
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-
-@SideOnly(Side.CLIENT)
-public class ModelGiantChicken extends ModelChicken {
-
- public ModelGiantChicken() {
- byte b0 = 16;
- this.head = new ModelRenderer(this, 0, 0);
- this.head.addBox(-2.0F, -6.0F, -2.0F, 4, 6, 3, 0.0F);
- this.head.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F);
- this.bill = new ModelRenderer(this, 14, 0);
- this.bill.addBox(-2.0F, -4.0F, -4.0F, 4, 2, 2, 0.0F);
- this.bill.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F);
- this.chin = new ModelRenderer(this, 14, 4);
- this.chin.addBox(-1.0F, -2.0F, -3.0F, 2, 2, 2, 0.0F);
- this.chin.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F);
- this.body = new ModelRenderer(this, 0, 9);
- this.body.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F);
- this.body.setRotationPoint(0.0F, (float) b0, 0.0F);
- this.rightLeg = new ModelRenderer(this, 26, 0);
- this.rightLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3);
- this.rightLeg.setRotationPoint(-2.0F, (float) (3 + b0), 1.0F);
- this.leftLeg = new ModelRenderer(this, 26, 0);
- this.leftLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3);
- this.leftLeg.setRotationPoint(1.0F, (float) (3 + b0), 1.0F);
- this.rightWing = new ModelRenderer(this, 24, 13);
- this.rightWing.addBox(0.0F, 0.0F, -3.0F, 1, 4, 6);
- this.rightWing.setRotationPoint(-4.0F, (float) (-3 + b0), 0.0F);
- this.leftWing = new ModelRenderer(this, 24, 13);
- this.leftWing.addBox(-1.0F, 0.0F, -3.0F, 1, 4, 6);
- this.leftWing.setRotationPoint(4.0F, (float) (-3 + b0), 0.0F);
- }
-
- /**
- * Sets the models various rotation angles then renders the model.
- */
- @Override
- public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_,
- float p_78088_6_, float p_78088_7_) {
- this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
-
- if (this.isChild) {
- float f6 = 1.0F;
- GL11.glPushMatrix();
- GL11.glTranslatef(0.0F, 0F, 0F);
- this.head.render(p_78088_7_);
- this.bill.render(p_78088_7_);
- this.chin.render(p_78088_7_);
- GL11.glPopMatrix();
- GL11.glPushMatrix();
- GL11.glScalef(1.0F * f6, 1.0F * f6, 1.0F * f6);
- GL11.glTranslatef(0.0F, 0F, 0.0F);
- this.body.render(p_78088_7_);
- this.rightLeg.render(p_78088_7_);
- this.leftLeg.render(p_78088_7_);
- this.rightWing.render(p_78088_7_);
- this.leftWing.render(p_78088_7_);
- GL11.glPopMatrix();
- // super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_);
- } else {
- float f6 = 2.0F;
- GL11.glPushMatrix();
- GL11.glScalef(1.0F * f6, 1.0F * f6, 1.0F * f6);
- GL11.glTranslatef(0.0F, -0.85F, 0F);
- this.head.render(p_78088_7_);
- this.bill.render(p_78088_7_);
- this.chin.render(p_78088_7_);
- GL11.glPopMatrix();
- GL11.glPushMatrix();
- GL11.glScalef(1.0F * f6, 1.0F * f6, 1.0F * f6);
- GL11.glTranslatef(0.0F, -0.75F, 0.0F);
- this.body.render(p_78088_7_);
- this.rightLeg.render(p_78088_7_);
- this.leftLeg.render(p_78088_7_);
- this.rightWing.render(p_78088_7_);
- this.leftWing.render(p_78088_7_);
- GL11.glPopMatrix();
- }
- }
-
- /**
- * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
- * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
- * "far" arms and legs can swing at most.
- */
- @Override
- public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
- float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {
- this.head.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
- this.head.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
- this.bill.rotateAngleX = this.head.rotateAngleX;
- this.bill.rotateAngleY = this.head.rotateAngleY;
- this.chin.rotateAngleX = this.head.rotateAngleX;
- this.chin.rotateAngleY = this.head.rotateAngleY;
- this.body.rotateAngleX = ((float) Math.PI / 2F);
- this.rightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_;
- this.leftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float) Math.PI) * 1.4F * p_78087_2_;
- this.rightWing.rotateAngleZ = p_78087_3_;
- this.leftWing.rotateAngleZ = -p_78087_3_;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java
deleted file mode 100644
index 24cb3f1459..0000000000
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package gtPlusPlus.core.client.renderer;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.renderer.entity.RenderLiving;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLiving;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.util.MathHelper;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.client.model.ModelBatKing;
-import gtPlusPlus.core.entity.monster.EntityBatKing;
-
-@SideOnly(Side.CLIENT)
-public class RenderBatKing extends RenderLiving {
-
- private static final ResourceLocation batTextures = new ResourceLocation(
- GTPlusPlus.ID + ":" + "textures/entity/batKing.png");
-
- /**
- * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and
- * it seems a good match for a bats size
- */
- private int renderedBatSize;
-
- public RenderBatKing() {
- super(new ModelBatKing(), 0.7F);
- this.renderedBatSize = (((ModelBatKing) this.mainModel).getBatSize());
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
- * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
- * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
- */
- public void doRender(EntityBatKing p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- int i = ((ModelBatKing) this.mainModel).getBatSize();
-
- if (i != this.renderedBatSize) {
- this.renderedBatSize = i;
- this.mainModel = new ModelBatKing();
- }
-
- super.doRender((EntityLiving) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(EntityBatKing p_110775_1_) {
- return batTextures;
- }
-
- /**
- * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
- * entityLiving, partialTickTime
- */
- protected void preRenderCallback(EntityBatKing p_77041_1_, float p_77041_2_) {
- GL11.glScalef(0.35F, 0.35F, 0.35F);
- }
-
- /**
- * Sets a simple glTranslate on a LivingEntity.
- */
- protected void renderLivingAt(EntityBatKing p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) {
- super.renderLivingAt(p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_);
- }
-
- protected void rotateCorpse(EntityBatKing p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
- if (!p_77043_1_.getIsBatHanging()) {
- GL11.glTranslatef(0.0F, MathHelper.cos(p_77043_2_ * 0.3F) * 0.1F, 0.0F);
- } else {
- GL11.glTranslatef(0.0F, -0.1F, 0.0F);
- }
-
- super.rotateCorpse(p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
- * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
- * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
- */
- @Override
- public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- this.doRender((EntityBatKing) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-
- /**
- * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
- * entityLiving, partialTickTime
- */
- @Override
- protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) {
- this.preRenderCallback((EntityBatKing) p_77041_1_, p_77041_2_);
- }
-
- @Override
- protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
- this.rotateCorpse((EntityBatKing) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
- }
-
- /**
- * Sets a simple glTranslate on a LivingEntity.
- */
- @Override
- protected void renderLivingAt(EntityLivingBase p_77039_1_, double p_77039_2_, double p_77039_4_,
- double p_77039_6_) {
- this.renderLivingAt((EntityBatKing) p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_);
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
- * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
- * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
- */
- @Override
- public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
- float p_76986_8_, float p_76986_9_) {
- this.doRender((EntityBatKing) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
- */
- @Override
- protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
- return this.getEntityTexture((EntityBatKing) p_110775_1_);
- }
-
- /**
- * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
- * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
- * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
- * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
- */
- @Override
- public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
- float p_76986_9_) {
- this.doRender((EntityBatKing) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java
deleted file mode 100644
index 7a326de3c8..0000000000
--- a/src/main/java/gtPlusPlus/core/client/renderer/RenderGiantChicken.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package gtPlusPlus.core.client.renderer;
-
-import net.minecraft.client.model.ModelBase;
-import net.minecraft.client.renderer.entity.RenderChicken;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-
-@SideOnly(Side.CLIENT)
-public class RenderGiantChicken extends RenderChicken {
-
- public RenderGiantChicken(ModelBase p_i1252_1_, float p_i1252_2_) {
- super(p_i1252_1_, p_i1252_2_);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/common/CommonProxy.java b/src/main/java/gtPlusPlus/core/common/CommonProxy.java
index 1f4e034179..ee624b3f24 100644
--- a/src/main/java/gtPlusPlus/core/common/CommonProxy.java
+++ b/src/main/java/gtPlusPlus/core/common/CommonProxy.java
@@ -24,25 +24,18 @@ import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.entity.InternalEntityRegistry;
-import gtPlusPlus.core.entity.monster.EntityGiantChickenBase;
-import gtPlusPlus.core.entity.monster.EntitySickBlaze;
-import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct;
-import gtPlusPlus.core.fluids.FluidFactory;
import gtPlusPlus.core.handler.BookHandler;
import gtPlusPlus.core.handler.BurnableFuelHandler;
import gtPlusPlus.core.handler.COMPAT_HANDLER;
import gtPlusPlus.core.handler.COMPAT_IntermodStaging;
import gtPlusPlus.core.handler.GuiHandler;
-import gtPlusPlus.core.handler.events.BlockEventHandler;
import gtPlusPlus.core.handler.events.EnderDragonDeathHandler;
import gtPlusPlus.core.handler.events.EntityDeathHandler;
import gtPlusPlus.core.handler.events.GeneralTooltipEventHandler;
import gtPlusPlus.core.handler.events.PickaxeBlockBreakEventHandler;
import gtPlusPlus.core.handler.events.PlayerSleepEventHandler;
-import gtPlusPlus.core.handler.events.ZombieBackupSpawnEventHandler;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.lib.CORE.ConfigSwitches;
import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.tileentities.ModTileEntities;
@@ -51,9 +44,7 @@ import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.player.PlayerCache;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import gtPlusPlus.plugin.villagers.block.BlockGenericSpawner;
import gtPlusPlus.preloader.CORE_Preloader;
-import gtPlusPlus.xmod.eio.handler.HandlerTooltip_EIO;
import gtPlusPlus.xmod.gregtech.api.util.SpecialBehaviourTooltipHandler;
import gtPlusPlus.xmod.gregtech.recipes.GregtechRecipeAdder;
import gtPlusPlus.xmod.ic2.CustomInternalName;
@@ -88,7 +79,6 @@ public class CommonProxy {
ModItems.init();
ModBlocks.init();
CI.preInit();
- FluidFactory.preInit();
COMPAT_IntermodStaging.preInit(e);
BookHandler.run();
// Registration of entities and renderers
@@ -102,10 +92,7 @@ public class CommonProxy {
}
public void init(final FMLInitializationEvent e) {
- registerCustomItemsForMaterials();
- ModBlocks.blockCustomMobSpawner = new BlockGenericSpawner();
CI.init();
- FluidFactory.init();
/**
* Register the Event Handlers.
@@ -114,12 +101,9 @@ public class CommonProxy {
// Prevents my Safes being destroyed.
Utils.registerEvent(new PickaxeBlockBreakEventHandler());
// Block Handler for all events.
- Utils.registerEvent(new BlockEventHandler());
Utils.registerEvent(new GeneralTooltipEventHandler());
// Handles Tooltips for items giving custom multiblock behaviour
Utils.registerEvent(new SpecialBehaviourTooltipHandler());
- // Handles Custom tooltips for EIO.
- Utils.registerEvent(new HandlerTooltip_EIO());
// Handles Sleep Benefits
PlayerSleepEventHandler.init();
// Handles Magic Feather
@@ -128,11 +112,6 @@ public class CommonProxy {
Utils.registerEvent(new EnderDragonDeathHandler());
Utils.registerEvent(new EntityDeathHandler());
- if (ConfigSwitches.disableZombieReinforcement) {
- // Make Zombie reinforcements stop showing up.
- Utils.registerEvent(new ZombieBackupSpawnEventHandler());
- }
-
/**
* End of Subscribe Event registration.
*/
@@ -146,7 +125,6 @@ public class CommonProxy {
public void postInit(final FMLPostInitializationEvent e) {
Logger.INFO("Cleaning up, doing postInit.");
PlayerCache.initCache();
- FluidFactory.postInit();
// Make Burnables burnable
if (!CORE.burnables.isEmpty()) {
@@ -203,25 +181,9 @@ public class CommonProxy {
public void generateMysteriousParticles(final Entity entity) {}
- public void generateMobSpawners() {
- // Try register some test spawners
- Utils.createNewMobSpawner(0, EntityGiantChickenBase.class);
- Utils.createNewMobSpawner(1, EntitySickBlaze.class);
- Utils.createNewMobSpawner(2, EntityStaballoyConstruct.class);
- }
-
- public void registerCustomItemsForMaterials() {
- // Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate,
- // GregtechItemList.Carbyne_Sheet_Finished.get(1));
- }
-
public void registerCustomMobDrops() {
// Zombie
- EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemRope), 3, 100);
- EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemFiber), 5, 250);
- EntityUtils
- .registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemSandstoneHammer), 1, 10);
EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemBomb), 2, 10);
EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.TUMBAGA.getTinyDust(1), 1, 10);
EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.POTIN.getTinyDust(1), 1, 10);
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
index 34642abde6..54620c7f6a 100644
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
+++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
@@ -13,23 +13,12 @@ import static gregtech.client.GT_TooltipHandler.Tier.UV;
import static gregtech.client.GT_TooltipHandler.Tier.ZPM;
import static gregtech.client.GT_TooltipHandler.registerTieredTooltip;
-import net.minecraft.entity.monster.EntityBlaze;
-import net.minecraft.entity.monster.EntityCreeper;
-import net.minecraft.entity.monster.EntityEnderman;
-import net.minecraft.entity.monster.EntityGhast;
-import net.minecraft.entity.monster.EntityMagmaCube;
-import net.minecraft.entity.monster.EntityPigZombie;
-import net.minecraft.entity.monster.EntitySkeleton;
-import net.minecraft.entity.monster.EntitySpider;
-import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.item.bauble.BatteryPackBaseBauble;
-import gtPlusPlus.core.item.bauble.FireProtectionBauble;
-import gtPlusPlus.core.item.bauble.MonsterKillerBaseBauble;
import gtPlusPlus.core.item.general.ItemCloakingDevice;
import gtPlusPlus.core.item.general.ItemHealingDevice;
import gtPlusPlus.core.item.general.ItemSlowBuildingRing;
@@ -46,7 +35,6 @@ public class COMPAT_Baubles {
Logger.INFO("Baubles Found - Loading Wearables.");
ModItems.itemPersonalCloakingDevice = new ItemCloakingDevice(0);
ModItems.itemPersonalHealingDevice = new ItemHealingDevice();
- ModItems.itemPersonalFireProofDevice = new FireProtectionBauble();
ModItems.itemChargePack_Low_1 = new BatteryPackBaseBauble(1);
registerTieredTooltip(new ItemStack(ModItems.itemChargePack_Low_1, 1, OreDictionary.WILDCARD_VALUE), LV);
@@ -67,31 +55,6 @@ public class COMPAT_Baubles {
ModItems.itemChargePack_High_4 = new BatteryPackBaseBauble(9);
registerTieredTooltip(new ItemStack(ModItems.itemChargePack_High_4, 1, OreDictionary.WILDCARD_VALUE), UHV);
- ModItems.itemAmuletMonsterKiller_Zombie = new MonsterKillerBaseBauble(
- new Class[] { EntityZombie.class },
- "Zombie",
- 3);
- ModItems.itemAmuletMonsterKiller_Skeleton = new MonsterKillerBaseBauble(
- new Class[] { EntitySkeleton.class },
- "Skeleton",
- 3);
- ModItems.itemAmuletMonsterKiller_Spider = new MonsterKillerBaseBauble(
- new Class[] { EntitySpider.class },
- "Spider",
- 3);
- ModItems.itemAmuletMonsterKiller_Creeper = new MonsterKillerBaseBauble(
- new Class[] { EntityCreeper.class },
- "Creeper",
- 4);
- ModItems.itemAmuletMonsterKiller_Enderman = new MonsterKillerBaseBauble(
- new Class[] { EntityEnderman.class },
- "Enderman",
- 4);
- ModItems.itemAmuletMonsterKiller_Nether = new MonsterKillerBaseBauble(
- new Class[] { EntityPigZombie.class, EntityGhast.class, EntityMagmaCube.class, EntityBlaze.class },
- "Hellish",
- 6);
-
if (PlayerAPI.isModLoaded()) {
ModItems.itemSlowBuildingRing = new ItemSlowBuildingRing();
}
diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java
deleted file mode 100644
index 041aa1fd18..0000000000
--- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package gtPlusPlus.core.common.compat;
-
-import net.minecraft.item.ItemStack;
-
-import gregtech.api.util.GT_OreDictUnificator;
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class COMPAT_EnderIO {
-
- public static void OreDict() {
- 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));
- GT_OreDictUnificator.registerOre("plateElectricalSteel", new ItemStack(ModItems.itemPlateElectricalSteel));
- GT_OreDictUnificator.registerOre("plateEnergeticAlloy", new ItemStack(ModItems.itemPlateEnergeticAlloy));
- GT_OreDictUnificator.registerOre("platePulsatingIron", new ItemStack(ModItems.itemPlatePulsatingIron));
- GT_OreDictUnificator.registerOre("plateRedstoneAlloy", new ItemStack(ModItems.itemPlateRedstoneAlloy));
- GT_OreDictUnificator.registerOre("plateSoularium", new ItemStack(ModItems.itemPlateSoularium));
- GT_OreDictUnificator.registerOre("plateVibrantAlloy", new ItemStack(ModItems.itemPlateVibrantAlloy));
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java
index 5d7a39c48f..cf71ce6bc7 100644
--- a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java
+++ b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java
@@ -1,120 +1,8 @@
package gtPlusPlus.core.config;
import static gregtech.api.enums.Mods.GregTech;
-import static gtPlusPlus.core.item.general.RF2EU_Battery.rfPerEU;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.MACHINE_INFO;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.baseMaxPollutionPerSecondRocketFuelGenerator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.baseMinPollutionPerSecondRocketFuelGenerator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.basePollutionPerSecondBoiler;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.basePollutionPerSecondGeothermalGenerator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.basePollutionPerSecondSemiFluidGenerator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.boilerSteamPerSecond;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropDrainedShard;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropFluoriteOre;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.disableEnderIOIngotTooltips;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.disableEnderIOIntegration;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.disableIC2Recipes;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.disableZombieReinforcement;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.dumpItemAndBlockData;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableAlternativeBatteryAlloy;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableAlternativeDivisionSigilRecipe;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableAnimatedTextures;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableCustomCapes;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableCustomCircuits;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableCustom_Cables;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableCustom_Pipes;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_Dehydrators;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_FluidTanks;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_GeothermalEngines;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_Pollution;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_RF_Convetor;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_RocketEngines;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_Safes;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_SimpleWasher;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_SolarGenerators;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_SteamConverter;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_Tesseracts;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_WorldAccelerators;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiSizeTools;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_AlloyBlastSmelter;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_Cyclotron;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialCentrifuge;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialCokeOven;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialCuttingMachine;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialElectrolyzer;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialExtrudingMachine;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialFishingPort;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialMacerationStack;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialMultiMachine;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialPlatePress;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialSifter;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialThermalCentrifuge;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialWashPlant;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialWireMill;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_LargeAutoCrafter;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_LiquidFluorideThoriumReactor;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_MatterFabricator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_MultiTank;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_NuclearFuelRefinery;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_NuclearSaltProcessingPlant;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_PowerSubstation;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_ThermalBoiler;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableOldGTcircuits;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableSkookumChoochers;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableSulfuricAcidFix;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableThaumcraftShardUnification;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableWatchdogBGM;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.hideUniversalCells;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiABS;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiAdvDistillationTower_ModeDT;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiAdvDistillationTower_ModeDistillery;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiAdvEBF;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiAdvImplosion;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiAlgaePond;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiAutoCrafter;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiCyclotron;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiFrothFlotationCell;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialAlloySmelter;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialArcFurnace;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialCentrifuge;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialChisel;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialCokeOven;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialCuttingMachine;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialDehydrator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialElectrolyzer;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialExtruder;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialFishingPond;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialForgeHammer;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMacerator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMixer;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialPlatePress_ModeBending;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialPlatePress_ModeForming;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialRockBreaker;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialSifter;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialThermalCentrifuge;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialVacuumFreezer;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWashPlant_ModeWasher;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWireMill;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiIsaMill;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiLargeSemiFluidGenerator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiMassFabricator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiMolecularTransformer;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiPackager;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiRefinery;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiThermalBoiler;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionPerSecondMultiTreeFarm;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionReleasedByTierBoiler;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionReleasedByTierGeothermalGenerator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.pollutionReleasedByTierSemiFluidGenerator;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.showHiddenNEIItems;
-import static gtPlusPlus.core.lib.CORE.EVERGLADESBIOME_ID;
-import static gtPlusPlus.core.lib.CORE.EVERGLADES_ID;
-import static gtPlusPlus.core.lib.CORE.turbineCutoffBase;
+import static gtPlusPlus.core.lib.CORE.*;
+import static gtPlusPlus.core.lib.CORE.ConfigSwitches.*;
import java.io.File;
@@ -196,11 +84,6 @@ public class ConfigHandler {
"Restores circuits and their recipes from Pre-5.09.28 times.");
// Tools
- enableSkookumChoochers = config.getBoolean(
- "enableSkookumChoochers",
- GregTech.ID,
- true,
- "Adds Custom GT Tools, called Skookum Choochers, functioning as a hard hammer and a wrench.");
enableMultiSizeTools = config.getBoolean(
"enableMultiSizeTools",
GregTech.ID,
@@ -247,8 +130,7 @@ public class ConfigHandler {
GregTech.ID,
false,
"These may be overpowered, Consult a local electrician.");
- enableMachine_Safes = config
- .getBoolean("enableMachineSafes", GregTech.ID, true, "These protect your goodies/rare stuff.");
+
enableMachine_Dehydrators = config
.getBoolean("enableMachineDehydrators", GregTech.ID, true, "These dehydrate stuff.");
enableMachine_SteamConverter = config
@@ -390,22 +272,9 @@ public class ConfigHandler {
enableMultiblock_Cyclotron = config
.getBoolean("enableMultiblock_Cyclotron", GregTech.ID, true, "COMET - Scientific Cyclotron.");
- // Options
- rfPerEU = config.getInt(
- "rfUsedPerEUForUniversalBatteries",
- "configurables",
- 4,
- 1,
- 1000,
- "How much RF is a single unit of EU worth? (Most mods use 4:1 ratio)");
-
// Features
enableCustomCapes = config.getBoolean("enableSupporterCape", "features", true, "Enables Custom GT++ Cape.");
- disableZombieReinforcement = config.getBoolean(
- "disableZombieReinforcement",
- "features",
- false,
- "Disables Zombie Reinforcement on hard difficutly.");
+
enableWatchdogBGM = config.getInt(
"enableWatchdogBGM",
"features",
diff --git a/src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java b/src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java
deleted file mode 100644
index 1fc2981722..0000000000
--- a/src/main/java/gtPlusPlus/core/container/Container_BackpackBase.java
+++ /dev/null
@@ -1,184 +0,0 @@
-package gtPlusPlus.core.container;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-import gtPlusPlus.core.inventories.BaseInventoryBackpack;
-import gtPlusPlus.core.slots.SlotBlockedInv;
-import gtPlusPlus.core.slots.SlotItemBackpackInv;
-
-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) {
- 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) {
- // 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
- // 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))));
- }
-
- // 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.
- /*
- * 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) {
- if (i == par1Player.inventory.currentItem) {
- this.addSlotToContainer(new SlotBlockedInv(inventoryPlayer, i, 8 + (i * 18), 142));
- } else {
- this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + (i * 18), 142));
- }
- }
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer entityplayer) {
- // be sure to return the inventory's isUseableByPlayer method
- // if you defined special behavior there:
- return this.inventory.isUseableByPlayer(entityplayer);
- }
-
- /**
- * 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) {
- ItemStack itemstack = null;
- final Slot slot = (Slot) this.inventorySlots.get(index);
-
- if ((slot != null) && slot.getHasStack()) {
- final ItemStack itemstack1 = slot.getStack();
- itemstack = itemstack1.copy();
-
- // If item is in our custom Inventory or armor slot
- if (index < INV_START) {
- // try to place in player inventory / action bar
- 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 {
- /*
- * 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
- */
- if (index >= INV_START) {
- // place in custom inventory
- if (!this.mergeItemStack(itemstack1, 0, INV_START, false)) {
- return null;
- }
- }
-
- /**
- * Implementation number 2: Shift-click items between action bar and inventory
- */
- // item is in player's inventory, but not in action bar
- if ((index >= INV_START) && (index < HOTBAR_START)) {
- // place in action bar
- if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END + 1, false)) {
- return null;
- }
- }
- // item in action bar - place in player inventory
- 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) {
- slot.putStack((ItemStack) null);
- } else {
- slot.onSlotChanged();
- }
-
- if (itemstack1.stackSize == itemstack.stackSize) {
- return null;
- }
-
- slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
- }
-
- 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(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;
- }
-
- // Keybind for moving from hotbar slot to hovered slot, make we don't move the currently held backpack.
- if (flag == 2 && button >= 0 && button < 9) {
- int hotbarIndex = HOTBAR_START + button;
- Slot hotbarSlot = getSlot(hotbarIndex);
- if (hotbarSlot instanceof SlotBlockedInv) {
- return null;
- }
- }
-
- return super.slotClick(slot, button, flag, player);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_EggBox.java b/src/main/java/gtPlusPlus/core/container/Container_EggBox.java
deleted file mode 100644
index 17a72135ec..0000000000
--- a/src/main/java/gtPlusPlus/core/container/Container_EggBox.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package gtPlusPlus.core.container;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.inventories.Inventory_EggBox;
-import gtPlusPlus.core.tileentities.general.TileEntityEggBox;
-
-public class Container_EggBox extends Container {
-
- protected TileEntityEggBox tile_entity;
- public final Inventory_EggBox inventoryChest;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- public static int StorageSlotNumber = 15; // Number of slots in storage area
- public static int InventorySlotNumber = 36; // Inventory Slots (Inventory
- // and Hotbar)
- public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All
- // slots
-
- private final int[] slotStorage = new int[15];
-
- public Container_EggBox(final InventoryPlayer inventory, final TileEntityEggBox te) {
- this.tile_entity = te;
- this.inventoryChest = te.getInventory();
- te.openInventory();
-
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
-
- int o = 0;
-
- // Storage Side
- for (var6 = 0; var6 < 3; var6++) {
- for (var7 = 0; var7 < 5; var7++) {
- this.slotStorage[o] = o;
- this.addSlotToContainer(new Slot(this.inventoryChest, o++, 44 + (var7 * 18), 15 + (var6 * 18)));
- }
- }
-
- // 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) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
- }
-
- @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);
- }
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
- super.onContainerClosed(par1EntityPlayer);
- tile_entity.closeInventory();
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockEggBox) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
- ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack()) {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- /*
- * if (par2 == 0) { if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) { return null;
- * } var4.onSlotChange(var5, var3); } else if (par2 >= InOutputSlotNumber && par2 < InventoryOutSlotNumber)
- * { if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else
- * if (par2 >= InventoryOutSlotNumber && par2 < FullSlotNumber) { if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if
- * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false)) { return null; }
- */
-
- if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
- } else {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
- // Can merge Slot
- @Override
- public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
- return super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_Grindle.java b/src/main/java/gtPlusPlus/core/container/Container_Grindle.java
deleted file mode 100644
index f49d840819..0000000000
--- a/src/main/java/gtPlusPlus/core/container/Container_Grindle.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package gtPlusPlus.core.container;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-import gtPlusPlus.core.inventories.BaseInventoryGrindle;
-import gtPlusPlus.core.slots.SlotDataStick;
-
-public class Container_Grindle extends Container {
-
- /**
- * The Item Inventory for this Container, only needed if you want to reference isUseableByPlayer
- */
- public final BaseInventoryGrindle 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 = BaseInventoryGrindle.INV_SIZE, INV_END = INV_START + 0, HOTBAR_START = INV_END,
- HOTBAR_END = HOTBAR_START + 8;
-
- public Container_Grindle(final EntityPlayer par1Player, final InventoryPlayer inventoryPlayer,
- final BaseInventoryGrindle inventoryItem) {
- this.inventory = inventoryItem;
-
- int i;
-
- // Actual Scan Slot
- this.addSlotToContainer(new SlotDataStick(this.inventory, 0, 152, 5));
-
- for (i = 1; i < BaseInventoryGrindle.INV_SIZE; ++i) {
- this.addSlotToContainer(new SlotDataStick(this.inventory, i, 153, 30 + (18 * 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) {
- return this.inventory.isUseableByPlayer(entityplayer);
- }
-
- /**
- * 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) {
- ItemStack itemstack = null;
- final Slot slot = (Slot) this.inventorySlots.get(index);
-
- if ((slot != null) && slot.getHasStack()) {
- final ItemStack itemstack1 = slot.getStack();
- itemstack = itemstack1.copy();
-
- // If item is in our custom Inventory or armor slot
- if (index < INV_START) {
- // try to place in player inventory / action bar
- 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 {
- /*
- * 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
- */
- /*
- * if (index >= INV_START) { // place in custom inventory if (!this.mergeItemStack(itemstack1, 0,
- * INV_START, false)) { return null; } }
- */
- /**
- * Implementation number 2: Shift-click items between action bar and inventory
- */
- /*
- * // item is in player's inventory, but not in action bar if ((index >= INV_START) && (index <
- * HOTBAR_START)) { // place in action bar if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END
- * + 1, false)) { return null; } } // item in action bar - place in player inventory 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) {
- slot.putStack((ItemStack) null);
- } else {
- slot.onSlotChanged();
- }
-
- if (itemstack1.stackSize == itemstack.stackSize) {
- return null;
- }
-
- slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
- }
-
- 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(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);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java b/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java
deleted file mode 100644
index 1ab23ed315..0000000000
--- a/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package gtPlusPlus.core.container;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.inventories.InventoryHeliumGenerator;
-import gtPlusPlus.core.slots.SlotFuelRod;
-import gtPlusPlus.core.slots.SlotNoInput;
-import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator;
-
-public class Container_HeliumGenerator extends Container {
-
- protected TileEntityHeliumGenerator tile_entity;
- public final InventoryHeliumGenerator inventoryChest;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- public static int StorageSlotNumber = 19; // Number of slots in storage area
- public static int InventorySlotNumber = 36; // Inventory Slots (Inventory and Hotbar)
- public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All slots
-
- // 0 Is output, 1-18 are input.
- private final int[] slotStorage = new int[19];
-
- public Container_HeliumGenerator(final InventoryPlayer inventory, final TileEntityHeliumGenerator te) {
- this.tile_entity = te;
- this.inventoryChest = te.getInventory();
-
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
-
- int o = 0;
-
- // Output
- this.addSlotToContainer(new SlotNoInput(this.inventoryChest, 0, 80, 53));
- this.slotStorage[o] = o;
- o++;
-
- // Side A
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 3; ++var7) {
- Logger.INFO("Adding slots at var:" + (o) + " x:" + (8 + var7 * 18) + " y:" + (9 + var6 * 18));
- this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 8 + (var7 * 18), 18 + (var6 * 18)));
- this.slotStorage[o] = o;
- o++;
- }
- }
-
- // Side B
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 3; ++var7) {
- Logger.INFO("Adding slots at var:" + (o) + " x:" + (90 + 8 + (var7 * 18)) + " y:" + (9 + var6 * 18));
- this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 116 + (var7 * 18), 18 + (var6 * 18)));
- this.slotStorage[o] = o;
- o++;
- }
- }
-
- o = 0;
-
- // 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) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
- }
-
- @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);
- }
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public void onContainerClosed(final EntityPlayer par1EntityPlayer) {
- super.onContainerClosed(par1EntityPlayer);
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockHeliumGenerator) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
- ItemStack var3 = null;
- final Slot var4 = (Slot) this.inventorySlots.get(par2);
-
- if ((var4 != null) && var4.getHasStack()) {
- final ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-
- /*
- * if (par2 == 0) { if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) { return null;
- * } var4.onSlotChange(var5, var3); } else if (par2 >= InOutputSlotNumber && par2 < InventoryOutSlotNumber)
- * { if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else
- * if (par2 >= InventoryOutSlotNumber && par2 < FullSlotNumber) { if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if
- * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false)) { return null; }
- */
-
- if (var5.stackSize == 0) {
- var4.putStack((ItemStack) null);
- } else {
- var4.onSlotChanged();
- }
-
- if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
- var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
- // Can merge Slot
- @Override
- public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) {
- return super.func_94530_a(p_94530_1_, p_94530_2_);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java b/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java
deleted file mode 100644
index 3a615675b5..0000000000
--- a/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java
+++ /dev/null
@@ -1,193 +0,0 @@
-package gtPlusPlus.core.container;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.inventories.modulartable.InventoryModularMain;
-import gtPlusPlus.core.inventories.modulartable.InventoryModularOutput;
-import gtPlusPlus.core.slots.SlotModularBauble;
-import gtPlusPlus.core.slots.SlotModularBaubleUpgrades;
-import gtPlusPlus.core.slots.SlotNoInput;
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
-
-public class Container_ModularityTable extends Container {
-
- /** The crafting matrix inventory (3x3). */
- protected TileEntityModularityTable tile_entity;
-
- public final InventoryModularMain inventoryGrid;
- public final InventoryModularOutput inventoryOutputs;
- public int mRecipeTime;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- private final int[] slotOutputs = new int[3];
- private final int[] slotGrid = new int[9];
-
- public Container_ModularityTable(final InventoryPlayer inventory, final TileEntityModularityTable tile) {
- this.tile_entity = tile;
- this.inventoryGrid = tile.inventoryGrid;
- this.inventoryOutputs = tile.inventoryOutputs;
- this.tile_entity.setContainer(this);
- this.mRecipeTime = this.tile_entity.getRecipeTime();
- Logger.INFO("Container: " + this.mRecipeTime);
-
- int var6;
- int var7;
- this.worldObj = tile.getWorldObj();
- this.posX = tile.xCoord;
- this.posY = tile.yCoord;
- this.posZ = tile.zCoord;
-
- int nextFreeSlot = 0;
-
- // Output slots
- this.addSlotToContainer(new SlotModularBauble(this.inventoryOutputs, 0, 26 + (18 * 6), 8));
- this.addSlotToContainer(new SlotModularBaubleUpgrades(this.inventoryOutputs, 1, 26 + (18 * 5), 8));
- this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 2, 26 + (18 * 6), 44));
-
- int o = 0;
-
- // Storage Side
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 3; ++var7) {
- // Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 *
- // 18));
- this.addSlotToContainer(
- new SlotModularBaubleUpgrades(
- this.inventoryGrid,
- nextFreeSlot,
- 8 + 18 + (var7 * 18),
- 17 + (var6 * 18)));
- this.slotGrid[o] = nextFreeSlot;
- nextFreeSlot++;
- o++;
- }
- }
-
- // 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) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
- // this.onCraftMatrixChanged(this.craftMatrix);
-
- }
-
- /**
- * Callback for when the crafting matrix is changed.
- */
- /*
- * public void onCraftMatrixChanged(IInventory p_75130_1_) { this.craftResult.setInventorySlotContents(0,
- * CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); }
- */
-
- /**
- * Called when the container is closed.
- */
- @Override
- public void onContainerClosed(EntityPlayer p_75134_1_) {
- super.onContainerClosed(p_75134_1_);
- if (!this.worldObj.isRemote) {
- /*
- * for (int i = 0; i < 9; ++i){ ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if
- * (itemstack != null){ p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false); } }
- */
- }
- }
-
- public TileEntityModularityTable getTileentityViaContainer() {
- if (this.tile_entity != null) {
- return this.tile_entity;
- }
- return null;
- }
-
- @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 == 0) {
- Logger.INFO("Player Clicked on the bauble slot");
- // TODO
- } else if (aSlotIndex == 1) {
- Logger.INFO("Player Clicked on the upgrade slot");
- // TODO
- } else if (aSlotIndex == 2) {
- Logger.INFO("Player Clicked on the output slot");
- // TODO
- } else {
- for (final int x : this.slotGrid) {
- if (aSlotIndex == x) {
- Logger.INFO("Player Clicked slot " + aSlotIndex + " in the crafting Grid");
- }
- }
- }
- }
- // Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockModularTable) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
-
- return null;
-
- /*
- * ItemStack var3 = null; final Slot var4 = (Slot)this.inventorySlots.get(par2); if ((var4 != null) &&
- * var4.getHasStack()) { final ItemStack var5 = var4.getStack(); var3 = var5.copy(); if (par2 == 0) { if
- * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) { return null; }
- * var4.onSlotChange(var5, var3); } else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber)) {
- * if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else if
- * ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber)) { if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, FullSlotNumber, false)) { return null; } if (var5.stackSize == 0) {
- * var4.putStack((ItemStack)null); } else { var4.onSlotChanged(); } if (var5.stackSize == var3.stackSize) {
- * return null; } var4.onPickupFromSlot(par1EntityPlayer, var5); } return var3;
- */
- }
-
- // Can merge Slot
- /*
- * public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_){ return p_94530_2_.inventory !=
- * this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_); }
- */
-
- /*
- * public ItemStack getOutputContent(){ ItemStack output = this.craftResult.getStackInSlot(0); if (output != null){
- * return output; } return null; } public ItemStack[] getInputComponents(){ ItemStack inputs[] = new ItemStack[9];
- * for (int r=0;r<this.craftMatrix.getSizeInventory();r++){ ItemStack temp = this.craftMatrix.getStackInSlot(r);
- * inputs[r] = temp; } return inputs; }
- */
-
-}
diff --git a/src/main/java/gtPlusPlus/core/container/Container_TradeTable.java b/src/main/java/gtPlusPlus/core/container/Container_TradeTable.java
deleted file mode 100644
index ff19730c20..0000000000
--- a/src/main/java/gtPlusPlus/core/container/Container_TradeTable.java
+++ /dev/null
@@ -1,174 +0,0 @@
-package gtPlusPlus.core.container;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.inventories.tradetable.InventoryTradeMain;
-import gtPlusPlus.core.inventories.tradetable.InventoryTradeOutput;
-import gtPlusPlus.core.slots.SlotGeneric;
-import gtPlusPlus.core.slots.SlotNoInput;
-import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
-
-public class Container_TradeTable extends Container {
-
- protected TileEntityTradeTable tile_entity;
- public final InventoryTradeMain inventoryChest;
- public final InventoryTradeOutput inventoryOutputs;
-
- private final World worldObj;
- private final int posX;
- private final int posY;
- private final int posZ;
-
- private final int[] slotOutputs = new int[2];
- private final int[] slotGrid = new int[9];
-
- public Container_TradeTable(final InventoryPlayer inventory, final TileEntityTradeTable te) {
-
- this.tile_entity = te;
- this.inventoryChest = te.inventoryGrid;
- this.inventoryOutputs = te.inventoryOutputs;
- this.tile_entity.setContainer(this);
-
- if (te.isServerSide()) Logger.INFO("Container - " + te.mOwnerName);
-
- int var6;
- int var7;
- this.worldObj = te.getWorldObj();
- this.posX = te.xCoord;
- this.posY = te.yCoord;
- this.posZ = te.zCoord;
-
- int nextFreeSlot = 0;
-
- // Output slots
- this.addSlotToContainer(new SlotGeneric(this.inventoryOutputs, 0, 26 + (18 * 6), 8));
- this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 1, 26 + (18 * 6), 44));
-
- // this.addSlotToContainer(new SlotCraftingNoCollect(inventory.player, this.craftMatrix, this.craftResult, 0,
- // 26+(18*4), 25));
-
- int o = 0;
- // Storage Side
- for (var6 = 0; var6 < 3; ++var6) {
- for (var7 = 0; var7 < 3; ++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, nextFreeSlot, 8 + 18 + (var7 * 18), 8 + (var6 * 18)));
- this.slotGrid[o] = nextFreeSlot;
- nextFreeSlot++;
- o++;
- }
- }
-
- // 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) {
- this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142));
- }
-
- // this.onCraftMatrixChanged(this.craftMatrix);
- }
-
- /**
- * Called when the container is closed.
- */
- @Override
- public void onContainerClosed(EntityPlayer p_75134_1_) {
- super.onContainerClosed(p_75134_1_);
- if (!this.worldObj.isRemote) {
- for (int i = 0; i < 9; ++i) {
- ItemStack itemstack = this.inventoryChest.getStackInSlotOnClosing(i);
- if (itemstack != null) {
- p_75134_1_.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 == 0) {
- Logger.INFO("Player Clicked on the Data Stick slot");
- // TODO
- }
- if (aSlotIndex == 1) {
- Logger.INFO("Player Clicked on the output slot");
- // TODO
- }
-
- for (final int x : this.slotGrid) {
- if (aSlotIndex == x) {
- Logger.INFO("Player Clicked slot " + aSlotIndex + " in the crafting Grid");
- }
- }
- }
- // Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid");
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public boolean canInteractWith(final EntityPlayer par1EntityPlayer) {
- if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockTradeTable) {
- return false;
- }
-
- return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D;
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) {
-
- return null;
-
- /*
- * ItemStack var3 = null; final Slot var4 = (Slot)this.inventorySlots.get(par2); if ((var4 != null) &&
- * var4.getHasStack()) { final ItemStack var5 = var4.getStack(); var3 = var5.copy(); if (par2 == 0) { if
- * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) { return null; }
- * var4.onSlotChange(var5, var3); } else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber)) {
- * if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else if
- * ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber)) { if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if (!this.mergeItemStack(var5,
- * InOutputSlotNumber, FullSlotNumber, false)) { return null; } if (var5.stackSize == 0) {
- * var4.putStack((ItemStack)null); } else { var4.onSlotChanged(); } if (var5.stackSize == var3.stackSize) {
- * return null; } var4.onPickupFromSlot(par1EntityPlayer, var5); } return var3;
- */
- }
-
- public ItemStack getOutputContent() {
- ItemStack output = this.inventoryOutputs.getStackInSlot(0);
- if (output != null) {
- return output;
- }
- return null;
- }
-
- public ItemStack[] getInputComponents() {
- ItemStack inputs[] = new ItemStack[9];
- for (int r = 0; r < this.inventoryChest.getSizeInventory(); r++) {
- ItemStack temp = this.inventoryChest.getStackInSlot(r);
- inputs[r] = temp;
- }
- return inputs;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java b/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java
deleted file mode 100644
index 9bd740a5a2..0000000000
--- a/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package gtPlusPlus.core.container.box;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-
-import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
-import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
-import gtPlusPlus.core.slots.SlotLunchBox;
-
-public class LunchBoxContainer extends ContainerBoxBase {
-
- public LunchBoxContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer,
- CustomBoxInventory CustomBoxInventory) {
- super(
- par1Player,
- inventoryPlayer,
- CustomBoxInventory,
- SlotLunchBox.class,
- gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java b/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java
deleted file mode 100644
index 3158631610..0000000000
--- a/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package gtPlusPlus.core.container.box;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-
-import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
-import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
-import gtPlusPlus.core.slots.SlotMagicToolBag;
-
-public class MagicBagContainer extends ContainerBoxBase {
-
- public MagicBagContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer,
- CustomBoxInventory CustomBoxInventory) {
- super(
- par1Player,
- inventoryPlayer,
- CustomBoxInventory,
- SlotMagicToolBag.class,
- gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java b/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java
deleted file mode 100644
index 6af27082fa..0000000000
--- a/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package gtPlusPlus.core.container.box;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-
-import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase;
-import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
-import gtPlusPlus.core.item.tool.misc.box.UniversalToolBox;
-import gtPlusPlus.core.slots.SlotToolBox;
-
-public class ToolBoxContainer extends ContainerBoxBase {
-
- public ToolBoxContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer,
- CustomBoxInventory CustomBoxInventory) {
- super(par1Player, inventoryPlayer, CustomBoxInventory, SlotToolBox.class, UniversalToolBox.SLOTS);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java
index 1254d9bdff..4be3605ff1 100644
--- a/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java
+++ b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java
@@ -3,8 +3,6 @@ package gtPlusPlus.core.entity;
import cpw.mods.fml.common.registry.EntityRegistry;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.entity.monster.EntityBatKing;
-import gtPlusPlus.core.entity.monster.EntityGiantChickenBase;
import gtPlusPlus.core.entity.monster.EntitySickBlaze;
import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct;
import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion;
@@ -109,28 +107,5 @@ public class InternalEntityRegistry {
20,
true);
- /**
- * Globals, which generate spawn eggs. (Currently required for Giant chicken spawning)
- */
- EntityRegistry.registerModEntity(
- EntityGiantChickenBase.class,
- "bigChickenFriendly",
- mEntityID++,
- GTplusplus.instance,
- 64,
- 20,
- true);
- ItemCustomSpawnEgg.registerEntityForSpawnEgg(
- 2,
- "bigChickenFriendly",
- Utils.rgbtoHexValue(255, 0, 0),
- Utils.rgbtoHexValue(175, 175, 175));
- EntityRegistry
- .registerModEntity(EntityBatKing.class, "batKing", mEntityID++, GTplusplus.instance, 64, 20, true);
- ItemCustomSpawnEgg.registerEntityForSpawnEgg(
- 3,
- "batKing",
- Utils.rgbtoHexValue(175, 175, 0),
- Utils.rgbtoHexValue(0, 175, 175));
}
}
diff --git a/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java b/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java
deleted file mode 100644
index 1cfb2154b1..0000000000
--- a/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java
+++ /dev/null
@@ -1,419 +0,0 @@
-package gtPlusPlus.core.entity.ai.batking;
-
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.IRangedAttackMob;
-import net.minecraft.entity.ai.EntityAIBase;
-import net.minecraft.pathfinding.PathEntity;
-import net.minecraft.pathfinding.PathPoint;
-import net.minecraft.util.MathHelper;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.entity.monster.EntityBatKing;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-
-public class EntityAIBatKingAttack extends EntityAIBase {
-
- private final Ranged mRangedAI;
- private final Melee mMeleeAI;
- private boolean mIsMelee = false;
-
- /** The Bat King in control of this AI. */
- private final EntityBatKing mAttackingEntity;
-
- /** The PathEntity of our entity. */
- private PathEntity mEntityPathEntity;
-
- /** The current target of Bat King in control of this AI. */
- private EntityLivingBase mEntityTarget;
-
- private final Class mClassTarget;
-
- public EntityAIBatKingAttack(EntityBatKing aAttacker, Class aClassTarget, double aMovementSpeed, int someInt,
- int aMaxRangedAttackTime, float someFloat, boolean aLongMemory) {
- mRangedAI = new Ranged(this, aMovementSpeed, someInt, 5, someFloat);
- mMeleeAI = new Melee(this, aClassTarget, aMovementSpeed, aLongMemory);
- mAttackingEntity = aAttacker;
- mClassTarget = aClassTarget;
- }
-
- @Override
- public boolean shouldExecute() {
- determineCombatStyle();
- EntityLivingBase entitylivingbase = this.mAttackingEntity.getAttackTarget();
- if (entitylivingbase == null) {
- this.mEntityTarget = null;
- return false;
- } else if (!entitylivingbase.isEntityAlive()) {
- return false;
- } else if (this.mClassTarget != null && !this.mClassTarget.isAssignableFrom(entitylivingbase.getClass())) {
- return false;
- } else {
- if (this.mIsMelee) {
- return this.mMeleeAI.shouldExecute();
- } else {
- this.mEntityTarget = entitylivingbase;
- this.mEntityPathEntity = this.mAttackingEntity.getNavigator().getPathToEntityLiving(entitylivingbase);
- return mRangedAI != null && mMeleeAI != null && hasValidTarget();
- }
- }
- }
-
- public EntityBatKing getBatKing() {
- return this.mAttackingEntity;
- }
-
- public IRangedAttackMob getBatKingAsIRangedAttackMob() {
- return this.mAttackingEntity;
- }
-
- public boolean hasValidTarget() {
- return this.mEntityTarget != null;
- }
-
- public EntityLivingBase getTarget() {
- return mEntityTarget;
- }
-
- @Override
- public boolean continueExecuting() {
- determineCombatStyle();
- if (mIsMelee) {
- return mMeleeAI.continueExecuting();
- } else {
- return mRangedAI.continueExecuting();
- }
- }
-
- @Override
- public boolean isInterruptible() {
- if (mIsMelee) {
-
- } else {
-
- }
- return super.isInterruptible();
- }
-
- @Override
- public void startExecuting() {
- determineCombatStyle();
- if (mIsMelee) {
- mMeleeAI.startExecuting();
- } else {
- mRangedAI.startExecuting();
- }
- }
-
- @Override
- public void resetTask() {
- determineCombatStyle();
- if (mIsMelee) {
- mMeleeAI.resetTask();
- } else {
- mRangedAI.resetTask();
- }
- }
-
- @Override
- public void updateTask() {
- determineCombatStyle();
- if (mIsMelee) {
- mMeleeAI.updateTask();
- } else {
- mRangedAI.updateTask();
- }
- }
-
- private final void determineCombatStyle() {
- boolean aisMeleeNow = this.mIsMelee;
- if (this.mEntityTarget != null && EntityUtils.getDistance(getBatKing(), mEntityTarget) < 4) {
- this.mIsMelee = true;
- } else {
- this.mIsMelee = false;
- }
- if (aisMeleeNow != this.mIsMelee) {
- Logger.INFO(
- "Bat King changed combat style from " + (aisMeleeNow ? "Melee" : "Ranged")
- + " to "
- + (this.mIsMelee ? "Melee" : "Ranged"));
- }
- }
-
- private class Ranged {
-
- private final EntityAIBatKingAttack parentAI;
-
- /**
- * A decrementing tick that spawns a ranged attack once this value reaches 0. It is then set back to the
- * maxRangedAttackTime.
- */
- private int rangedAttackTime;
-
- private double entityMoveSpeed;
- private int mCooldownTime;
- private int field_96561_g;
- /**
- * The maximum time the AI has to wait before performing another ranged attack.
- */
- private int maxRangedAttackTime;
-
- private float field_96562_i;
- private float field_82642_h; // Max range
-
- public Ranged(EntityAIBatKingAttack aParent, double aMovementSpeed, int someInt, int aMaxRangedAttackTime,
- float someFloat) {
- this.rangedAttackTime = -1;
- this.parentAI = aParent;
- this.entityMoveSpeed = aMovementSpeed;
- this.field_96561_g = someInt;
- this.maxRangedAttackTime = aMaxRangedAttackTime;
- this.field_96562_i = someFloat;
- this.field_82642_h = someFloat * someFloat * 8;
- parentAI.setMutexBits(3);
- }
-
- /**
- * Execute a one shot task or start executing a continuous task
- */
- public void startExecuting() {
- parentAI.getBatKing().getNavigator().setPath(parentAI.mEntityPathEntity, this.entityMoveSpeed);
- }
-
- /**
- * Returns whether an in-progress EntityAIBase should continue executing
- */
- public boolean continueExecuting() {
- return parentAI.shouldExecute() || !parentAI.getBatKing().getNavigator().noPath();
- }
-
- /**
- * Resets the task
- */
- public void resetTask() {
- parentAI.mEntityTarget = null;
- this.mCooldownTime = 0;
- this.rangedAttackTime = -1;
- }
-
- /**
- * Updates the task
- */
- public void updateTask() {
-
- if (MathUtils.randInt(0, 100) == 0) {
- maxRangedAttackTime = MathUtils.balance(maxRangedAttackTime, 20, 40);
- }
-
- double d0 = parentAI.getBatKing().getDistanceSq(
- parentAI.mEntityTarget.posX,
- parentAI.mEntityTarget.boundingBox.minY,
- parentAI.mEntityTarget.posZ);
- boolean flag = parentAI.getBatKing().getEntitySenses().canSee(parentAI.mEntityTarget);
-
- if (flag) {
- ++this.mCooldownTime;
- } else {
- this.mCooldownTime = 0;
- }
-
- if (d0 <= (double) this.field_82642_h && this.mCooldownTime >= 20) {
- parentAI.getBatKing().getNavigator().clearPathEntity();
- } else {
- if (parentAI.getBatKing().getNavigator()
- .tryMoveToEntityLiving(parentAI.mEntityTarget, this.entityMoveSpeed)) {
- Logger.INFO("Doing Ranged Ai Task.");
- } else {
- Logger.INFO("Not Doing Ranged Ai Task.");
- }
- }
-
- parentAI.getBatKing().getLookHelper().setLookPositionWithEntity(parentAI.mEntityTarget, 30.0F, 30.0F);
- float f;
- Logger.INFO("Ranged AI - " + rangedAttackTime);
-
- if (--this.rangedAttackTime == 0) {
- if (d0 > (double) this.field_82642_h || !flag) {
- Logger.INFO(
- "Stopping ranged attack. " + flag
- + "|"
- + (d0 > (double) this.field_82642_h)
- + "|"
- + d0
- + "|"
- + (double) this.field_82642_h);
- return;
- }
-
- f = MathHelper.sqrt_double(d0) / this.field_96562_i;
- float f1 = f;
-
- if (f < 0.1F) {
- f1 = 0.1F;
- }
-
- if (f1 > 1.0F) {
- f1 = 1.0F;
- }
- Logger.INFO("Trying to do a ranged attack.");
- parentAI.getBatKingAsIRangedAttackMob().attackEntityWithRangedAttack(parentAI.mEntityTarget, f1);
- this.rangedAttackTime = MathHelper.floor_float(
- f * (float) (this.maxRangedAttackTime - this.field_96561_g) + (float) this.field_96561_g);
- } else if (this.rangedAttackTime < 0) {
- f = MathHelper.sqrt_double(d0) / this.field_96562_i;
- this.rangedAttackTime = MathHelper.floor_float(
- f * (float) (this.maxRangedAttackTime - this.field_96561_g) + (float) this.field_96561_g);
- }
- }
- }
-
- private class Melee {
-
- private final EntityAIBatKingAttack parentAI;
-
- /**
- * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0.
- */
- int attackTick;
- /** The speed with which the mob will approach the target */
- double speedTowardsTarget;
- /**
- * When true, the mob will continue chasing its target, even if it can't find a path to them right now.
- */
- boolean longMemory;
-
- Class classTarget;
- private int field_75445_i;
- private double field_151497_i;
- private double field_151495_j;
- private double field_151496_k;
-
- private int failedPathFindingPenalty;
-
- public Melee(EntityAIBatKingAttack aParent, Class aClassTarget, double aMoveToTargetSpeed,
- boolean aLongMemory) {
- this.parentAI = aParent;
- this.classTarget = aClassTarget;
- this.speedTowardsTarget = aMoveToTargetSpeed;
- this.longMemory = aLongMemory;
- parentAI.setMutexBits(3);
- }
-
- /**
- * Returns whether the EntityAIBase should begin execution.
- */
- public boolean shouldExecute() {
- if (!parentAI.hasValidTarget()) {
- return false;
- }
- EntityLivingBase entitylivingbase = parentAI.getTarget();
-
- if (entitylivingbase == null) {
- return false;
- } else if (!entitylivingbase.isEntityAlive()) {
- return false;
- } else if (this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass())) {
- return false;
- } else {
- if (--this.field_75445_i <= 0) {
- parentAI.mEntityPathEntity = parentAI.mAttackingEntity.getNavigator()
- .getPathToEntityLiving(entitylivingbase);
- this.field_75445_i = 4 + parentAI.mAttackingEntity.getRNG().nextInt(7);
- return parentAI.mEntityPathEntity != null;
- } else {
- return true;
- }
- }
- }
-
- /**
- * Returns whether an in-progress EntityAIBase should continue executing
- */
- public boolean continueExecuting() {
- EntityLivingBase entitylivingbase = parentAI.mAttackingEntity.getAttackTarget();
- return entitylivingbase == null ? false
- : (!entitylivingbase.isEntityAlive() ? false
- : (!this.longMemory ? !parentAI.mAttackingEntity.getNavigator().noPath()
- : parentAI.mAttackingEntity.isWithinHomeDistance(
- MathHelper.floor_double(entitylivingbase.posX),
- MathHelper.floor_double(entitylivingbase.posY),
- MathHelper.floor_double(entitylivingbase.posZ))));
- }
-
- /**
- * Execute a one shot task or start executing a continuous task
- */
- public void startExecuting() {
- parentAI.mAttackingEntity.getNavigator().setPath(parentAI.mEntityPathEntity, this.speedTowardsTarget);
- this.field_75445_i = 0;
- }
-
- /**
- * Resets the task
- */
- public void resetTask() {
- parentAI.mAttackingEntity.getNavigator().clearPathEntity();
- }
-
- /**
- * Updates the task
- */
- public void updateTask() {
- EntityLivingBase entitylivingbase = parentAI.mAttackingEntity.getAttackTarget();
- parentAI.mAttackingEntity.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F);
- double d0 = parentAI.mAttackingEntity
- .getDistanceSq(entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ);
- double d1 = (double) (parentAI.mAttackingEntity.width * 2.0F * parentAI.mAttackingEntity.width * 2.0F
- + entitylivingbase.width);
- --this.field_75445_i;
-
- if ((this.longMemory || parentAI.mAttackingEntity.getEntitySenses().canSee(entitylivingbase))
- && this.field_75445_i <= 0
- && (this.field_151497_i == 0.0D && this.field_151495_j == 0.0D && this.field_151496_k == 0.0D
- || entitylivingbase
- .getDistanceSq(this.field_151497_i, this.field_151495_j, this.field_151496_k)
- >= 1.0D
- || parentAI.mAttackingEntity.getRNG().nextFloat() < 0.05F)) {
- this.field_151497_i = entitylivingbase.posX;
- this.field_151495_j = entitylivingbase.boundingBox.minY;
- this.field_151496_k = entitylivingbase.posZ;
- this.field_75445_i = failedPathFindingPenalty + 4 + parentAI.mAttackingEntity.getRNG().nextInt(7);
-
- if (parentAI.mAttackingEntity.getNavigator().getPath() != null) {
- PathPoint finalPathPoint = parentAI.mAttackingEntity.getNavigator().getPath().getFinalPathPoint();
- if (finalPathPoint != null && entitylivingbase
- .getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) {
- failedPathFindingPenalty = 0;
- } else {
- failedPathFindingPenalty += 10;
- }
- } else {
- failedPathFindingPenalty += 10;
- }
-
- if (d0 > 1024.0D) {
- this.field_75445_i += 10;
- } else if (d0 > 256.0D) {
- this.field_75445_i += 5;
- }
-
- if (!parentAI.mAttackingEntity.getNavigator()
- .tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget)) {
- this.field_75445_i += 15;
- }
- }
-
- this.attackTick = Math.max(this.attackTick - 1, 0);
-
- if (d0 <= d1 && this.attackTick <= 20) {
- this.attackTick = 20;
-
- if (parentAI.mAttackingEntity.getHeldItem() != null) {
- parentAI.mAttackingEntity.swingItem();
- }
-
- parentAI.mAttackingEntity.attackEntityAsMob(entitylivingbase);
- }
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java b/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java
deleted file mode 100644
index d100d3571b..0000000000
--- a/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package gtPlusPlus.core.entity.item;
-
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.World;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.entity.monster.EntityGiantChickenBase;
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
-
-public class ItemEntityGiantEgg extends EntityItem {
-
- /**
- * The maximum age of this Chicken Egg. The item will try hatch once this is reached.
- */
- public int mEggAge = 10000;
-
- public int mEggSize = -1;
-
- public ItemEntityGiantEgg(World aWorld) {
- super(aWorld);
- }
-
- public ItemEntityGiantEgg(World aWorld, double aX, double aY, double aZ) {
- super(aWorld, aX, aY, aZ);
- }
-
- public ItemEntityGiantEgg(World aWorld, double aX, double aY, double aZ, ItemStack aStack) {
- super(aWorld, aX, aY, aZ, aStack);
- }
-
- private boolean spawnGiantChicken() {
- try {
- EntityGiantChickenBase entitychicken = new EntityGiantChickenBase(this.worldObj);
- entitychicken.setGrowingAge(-MathUtils.randInt(20000, 40000));
- entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
- return this.worldObj.spawnEntityInWorld(entitychicken);
- } catch (Throwable t) {
- return false;
- }
- }
-
- // These eggs also do not combine.
- @Override
- public boolean combineItems(EntityItem p_70289_1_) {
- return false;
- }
-
- @Override
- public void writeEntityToNBT(NBTTagCompound aNBT) {
- super.writeEntityToNBT(aNBT);
- aNBT.setInteger("mEggAge", mEggAge);
- aNBT.setInteger("mTicksExisted", this.age);
- }
-
- @Override
- public void readEntityFromNBT(NBTTagCompound aNBT) {
- super.readEntityFromNBT(aNBT);
- mEggAge = aNBT.getInteger("mEggAge");
- }
-
- // They're fireproof
- @Override
- public void setFire(int p_70015_1_) {}
-
- @Override
- public boolean isBurning() {
- return false;
- }
-
- @Override
- public void onEntityUpdate() {
- super.onEntityUpdate();
- Logger.INFO("1");
- // Large eggs don't despawn, because they will try hatch first.
- if (this.lifespan != Integer.MAX_VALUE - 1) {
- this.lifespan = Integer.MAX_VALUE - 1;
- }
-
- if (this.getEntityItem() != null) {
- ItemStack g = this.getEntityItem();
- NBTUtils.setInteger(g, "mTicksExisted", this.age);
- NBTUtils.setInteger(g, "lifespan", this.lifespan);
- NBTUtils.setBoolean(g, "playerHeld", false);
- this.setEntityItemStack(g);
- Logger.INFO("Writing age to NBT of stored stack item.");
- } else {
- ItemStack g = ItemUtils.getSimpleStack(ModItems.itemBigEgg);
- NBTUtils.setInteger(g, "mTicksExisted", this.age);
- NBTUtils.setInteger(g, "lifespan", this.lifespan);
- NBTUtils.setBoolean(g, "playerHeld", false);
- this.setEntityItemStack(g);
- Logger.INFO("Writing age to NBT of new stack item.");
- }
-
- if (this.age >= 1000) {
- // Cache the value for efficiency
- if (mEggSize == -1) mEggSize = (this.getEntityItem() != null
- ? (this.getEntityItem().hasTagCompound()
- ? (this.getEntityItem().getTagCompound().hasKey("size")
- ? this.getEntityItem().getTagCompound().getInteger("size")
- : 1)
- : 1)
- : 1);
- if (MathUtils.randInt(100 * mEggSize, 1000) >= MathUtils.randInt(950, 1000)) {
- // Spawn Chicken
- if (spawnGiantChicken()) {
- this.kill();
- }
- }
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java b/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java
deleted file mode 100644
index 1c786a20b8..0000000000
--- a/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java
+++ /dev/null
@@ -1,760 +0,0 @@
-package gtPlusPlus.core.entity.monster;
-
-import java.lang.reflect.Field;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.EnumCreatureAttribute;
-import net.minecraft.entity.IRangedAttackMob;
-import net.minecraft.entity.SharedMonsterAttributes;
-import net.minecraft.entity.ai.EntityAIAttackOnCollide;
-import net.minecraft.entity.ai.EntityAIHurtByTarget;
-import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
-import net.minecraft.entity.ai.EntityAIWander;
-import net.minecraft.entity.ai.RandomPositionGenerator;
-import net.minecraft.entity.monster.EntityMob;
-import net.minecraft.entity.passive.EntityBat;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.projectile.EntityArrow;
-import net.minecraft.entity.projectile.EntityLargeFireball;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.DamageSource;
-import net.minecraft.util.MathHelper;
-import net.minecraft.util.Vec3;
-import net.minecraft.world.EnumDifficulty;
-import net.minecraft.world.World;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.entity.ai.batking.EntityAIBatKingAttack;
-import gtPlusPlus.core.entity.projectile.EntityThrowableBomb;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-
-public class EntityBatKing extends EntityMob implements IRangedAttackMob {
-
- public int courseChangeCooldown;
- public double waypointX;
- public double waypointY;
- public double waypointZ;
- private Entity targetedEntity;
- private int aggroCooldown;
- public int prevAttackCounter;
- public int attackCounter;
- private int explosionStrength = 1;
-
- private EntityAIBatKingAttack aiAttack = new EntityAIBatKingAttack(this, null, 1.0D, 20, 60, 15.0F, true);
- private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(
- this,
- EntityPlayer.class,
- 1.2D,
- false);
-
- public EntityBatKing(World p_i1680_1_) {
- super(p_i1680_1_);
- this.setSize(2.5F, 1.5F);
-
- this.setIsBatHanging(false);
- this.isImmuneToFire = true;
- this.experienceValue = 1000;
-
- this.tasks.addTask(3, this.aiAttack);
- // this.tasks.addTask(4, this.aiAttackOnCollide);
- // this.tasks.addTask(4, new EntityAIRestrictSun(this));
- // this.tasks.addTask(5, new EntityAIFleeSun(this, 1.0D));
- this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
- // this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
- // this.tasks.addTask(6, new EntityAILookIdle(this));
-
- this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
- // this.targetTasks.addTask(2, this.aiAttack);
- this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
- this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityBat.class, 0, false));
- }
-
- @Override
- protected void entityInit() {
- super.entityInit();
- }
-
- /**
- * Get this Entity's EnumCreatureAttribute
- */
- @Override
- public EnumCreatureAttribute getCreatureAttribute() {
- return EnumCreatureAttribute.UNDEAD;
- }
-
- /**
- * Gets the pitch of living sounds in living entities.
- */
- @Override
- protected float getSoundPitch() {
- return super.getSoundPitch() * 0.15F;
- }
-
- /**
- * Returns the sound this mob makes while it's alive.
- */
- @Override
- protected String getLivingSound() {
- int aRand = MathUtils.randInt(0, 10);
- if (aRand < 6) {
- return null;
- } else if (aRand <= 8) {
- return "mob.bat.idle";
- } else {
- return "mob.blaze.breathe";
- }
- }
-
- /**
- * Returns the sound this mob makes when it is hurt.
- */
- @Override
- protected String getHurtSound() {
- return "mob.blaze.hit";
- }
-
- /**
- * Returns the sound this mob makes on death.
- */
- @Override
- protected String getDeathSound() {
- return "mob.bat.death";
- }
-
- /**
- * Returns true if this entity should push and be pushed by other entities when colliding.
- */
- @Override
- public boolean canBePushed() {
- return true;
- }
-
- @Override
- protected void collideWithEntity(Entity aEntity) {
- if (aEntity != null) {
- if (aEntity instanceof EntityPlayer) {
- EntityUtils.doDamage(aEntity, DamageSource.magic, (int) (((EntityPlayer) aEntity).getHealth() / 20));
- }
- }
- }
-
- @Override
- protected void collideWithNearbyEntities() {}
-
- @Override
- protected void applyEntityAttributes() {
-
- this.getAttributeMap().registerAttribute(SharedMonsterAttributes.maxHealth);
- this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage);
- this.getAttributeMap().registerAttribute(SharedMonsterAttributes.knockbackResistance);
- this.getAttributeMap().registerAttribute(SharedMonsterAttributes.movementSpeed);
- this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange);
-
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(250.0D);
- this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D);
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1D);
- this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(120.0D);
- }
-
- public boolean getIsBatHanging() {
- return false;
- }
-
- public void setIsBatHanging(boolean p_82236_1_) {
- generateParticles(this);
- generateParticles(this);
- generateParticles(this);
- for (int i = 0; i < 32; ++i) {
- //
- String particleName = "lava";
- if (MathUtils.randInt(0, 3) <= 2) {
- particleName = "crit";
- }
- this.worldObj.spawnParticle(
- particleName,
- this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width,
- this.posY + this.rand.nextDouble() * (double) this.height,
- this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width,
- 0.0D,
- 0.0D,
- 0.0D);
- }
- }
-
- /**
- * Returns true if the newer Entity AI code should be run
- */
- @Override
- protected boolean isAIEnabled() {
- return true;
- }
-
- /**
- * Called to update the entity's position/logic.
- */
- @Override
- public void onUpdate() {
- super.onUpdate();
- generateParticles(this);
-
- if (!this.worldObj.isRemote && (this.targetedEntity == null || this.aggroCooldown-- <= 0)) {
- this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D);
-
- if (this.targetedEntity != null) {
- this.aggroCooldown = 30;
- if (aiAttack.hasValidTarget()) {
- this.setAttackTarget(aiAttack.getTarget());
- } else {
- Logger.INFO("No valid target.");
- if (ReflectionUtils.doesFieldExist(aiAttack.getClass(), "mEntityTarget")) {
- Logger.INFO("Found field.");
- } else {
- Logger.INFO("Did not find field.");
- }
- Field target = ReflectionUtils.getField(EntityAIBatKingAttack.class, "mEntityTarget");
- if (target != null) {
- ReflectionUtils.setField(aiAttack, target, this.targetedEntity);
- Logger.INFO("Set target.");
- } else {
- Logger.INFO("Could not set via reflection.");
- }
- }
- } else {
- Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this, 32, 20);
- if (vec3 != null) {
- double xPosition = vec3.xCoord;
- double yPosition = vec3.yCoord;
- double zPosition = vec3.zCoord;
- this.getNavigator().tryMoveToXYZ(xPosition, yPosition, zPosition, 3);
- }
- }
- }
- }
-
- private static void generateParticles(EntityBatKing aKing) {
- for (int i = 0; i < 20; ++i) {
- //
- if (MathUtils.randInt(0, 50) <= 1) {
- String particleName = "smoke";
- if (MathUtils.randInt(0, 3) <= 2) {
- particleName = "largesmoke";
- }
- aKing.worldObj.spawnParticle(
- particleName,
- aKing.posX + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width,
- aKing.posY + aKing.rand.nextDouble() * (double) aKing.height,
- aKing.posZ + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width,
- 0.0D,
- 0.0D,
- 0.0D);
- }
- if (MathUtils.randInt(0, 100) <= 1) {
- String particleName = "smoke";
- int test2 = MathUtils.randInt(0, 3);
- if (test2 == 2) {
- particleName = "dripLava";
- } else if (test2 == 3) {
- particleName = "portal";
- }
- aKing.worldObj.spawnParticle(
- particleName,
- aKing.posX + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width,
- aKing.posY + aKing.rand.nextDouble() * (double) aKing.height,
- aKing.posZ + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width,
- 0.0D,
- 0.0D,
- 0.0D);
- }
- }
- }
-
- @Override
- protected void updateAITasks() {
- super.updateAITasks();
- }
-
- private boolean isFlying() {
- if (this.onGround) {
- return false;
- }
- return true;
- }
-
- private boolean hasAir() {
- BlockPos p = EntityUtils.findBlockPosUnderEntity(this);
- int y = p.yPos;
- int yOriginal = p.yPos;
-
- for (int u = 0; u < 5; u++) {
- if (u > 50 || y <= 0) {
- break;
- }
- if (!this.worldObj.isAirBlock(p.xPos, y, p.zPos)) {
- break;
- }
- y--;
- }
- if (yOriginal != y) {
- for (int i = 0; i < y; y++) {
- this.jump();
- }
- return true;
- }
- return false;
- }
-
- /**
- * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
- * prevent them from trampling crops
- */
- @Override
- protected boolean canTriggerWalking() {
- return false;
- }
-
- /**
- * Return whether this entity should NOT trigger a pressure plate or a tripwire.
- */
- @Override
- public boolean doesEntityNotTriggerPressurePlate() {
- return true;
- }
-
- /**
- * Called when the entity is attacked.
- */
- @Override
- public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
- if (this.isEntityInvulnerable()) {
- return false;
- } else {
- if (!this.worldObj.isRemote && this.getIsBatHanging()) {
- this.setIsBatHanging(false);
- }
-
- return super.attackEntityFrom(p_70097_1_, p_70097_2_);
- }
- }
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- @Override
- public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
- super.readEntityFromNBT(p_70037_1_);
- if (p_70037_1_.hasKey("ExplosionPower", 99)) {
- this.explosionStrength = p_70037_1_.getInteger("ExplosionPower");
- }
- }
-
- /**
- * (abstract) Protected helper method to write subclass entity data to NBT.
- */
- @Override
- public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
- super.writeEntityToNBT(p_70014_1_);
- p_70014_1_.setInteger("ExplosionPower", this.explosionStrength);
- }
-
- /**
- * Attack the specified entity using a ranged attack.
- */
- @Override
- public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) {
- Logger.INFO("Trying to do ranged attack 1 |" + (this.targetedEntity != null) + "|");
-
- if (!this.isFlying() || !this.isAirBorne) {
- // this.hasAir();
- /*
- * for (int i=0;i<3;i++) { this.jump(); }
- */
- }
-
- double d4 = 64.0D;
- if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4 * 8) {
- Logger.INFO("Trying to do ranged attack 2");
- double d5 = this.targetedEntity.posX - this.posX;
- double d6 = this.targetedEntity.boundingBox.minY + (double) (this.targetedEntity.height / 2.0F)
- - (this.posY + (double) (this.height / 2.0F));
- double d7 = this.targetedEntity.posZ - this.posZ;
- this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI;
-
- ++this.attackCounter;
-
- if (this.canEntityBeSeen(this.targetedEntity)) {
- Logger.INFO("Trying to do ranged attack 3a | " + attackCounter);
-
- if (this.attackCounter >= 2) {
- Logger.INFO("Trying to do ranged attack 3a1");
-
- this.worldObj.playAuxSFXAtEntity(
- (EntityPlayer) null,
- 1008,
- (int) this.posX,
- (int) this.posY,
- (int) this.posZ,
- 0);
- setIsBatHanging(true);
-
- EntityThrowableBomb entitylargefireball = new EntityThrowableBomb(
- this.worldObj,
- this /* d5, d6, d7 */);
- // entitylargefireball.field_92057_e = this.explosionStrength;
- // entitylargefireball.accelerationX *= 2;
- // entitylargefireball.accelerationY *= 2;
- // entitylargefireball.accelerationZ *= 2;
- double d8 = 4.0D;
- Vec3 vec3 = this.getLook(1.0F);
- entitylargefireball.posX = this.posX + vec3.xCoord * d8;
- entitylargefireball.posY = this.posY + (double) (this.height / 2.0F) + 0.5D;
- entitylargefireball.posZ = this.posZ + vec3.zCoord * d8;
- this.worldObj.spawnEntityInWorld(entitylargefireball);
-
- for (int u = 0; u < MathUtils.randInt(2, 10); u++) {
- if (this.attackCounter > 0) {
- Logger.INFO("Trying to do ranged attack 5a");
- --this.attackCounter;
- EntityArrow entityarrow = new EntityArrow(
- this.worldObj,
- this,
- p_82196_1_,
- MathUtils.randFloat(1f, 3f),
- (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
- int i = MathUtils.randInt(0, 4);
- int j = MathUtils.randInt(0, 3);
- int k = MathUtils.randInt(0, 3);
- entityarrow.setDamage(
- (double) (p_82196_2_ * 2.0F) + this.rand.nextGaussian() * 0.25D
- + (double) ((float) this.worldObj.difficultySetting.getDifficultyId()
- * 0.11F));
-
- boolean boostAttack = MathUtils.randInt(0, 100) <= 21;
- if (boostAttack) {
- if (i > 0) {
- entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D);
- }
-
- if (j > 0) {
- entityarrow.setKnockbackStrength(j);
- }
- if (k > 0) {
- entityarrow.setFire(50 * k);
- }
- }
-
- this.playSound("mob.skeleton.say", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
- this.worldObj.spawnEntityInWorld(entityarrow);
- Logger.INFO("Trying to do ranged attack 5a done");
- }
- }
-
- this.attackCounter = 0;
- }
- } else if (this.attackCounter > 0) {
- Logger.INFO("Trying to do ranged attack 3b");
- --this.attackCounter;
- }
- } else {
- Logger.INFO("Trying to do ranged attack 4a");
- this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F
- / (float) Math.PI;
-
- if (this.attackCounter > 0) {
- Logger.INFO("Trying to do ranged attack 5a");
- --this.attackCounter;
- EntityArrow entityarrow = new EntityArrow(
- this.worldObj,
- this,
- p_82196_1_,
- 1.6F,
- (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
- int i = MathUtils.randInt(0, 4);
- int j = MathUtils.randInt(0, 3);
- int k = MathUtils.randInt(0, 3);
- entityarrow.setDamage(
- (double) (p_82196_2_ * 2.0F) + this.rand.nextGaussian() * 0.25D
- + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
-
- boolean boostAttack = MathUtils.randInt(0, 100) <= 21;
- if (boostAttack) {
- if (i > 0) {
- entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D);
- }
-
- if (j > 0) {
- entityarrow.setKnockbackStrength(j);
- }
- if (k > 0) {
- entityarrow.setFire(50 * k);
- }
- }
-
- this.playSound("mob.skeleton.say", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
- this.worldObj.spawnEntityInWorld(entityarrow);
- Logger.INFO("Trying to do ranged attack 5a done");
- }
- }
- }
-
- /**
- * Returns the volume for the sounds this mob makes.
- */
- @Override
- protected float getSoundVolume() {
- return 10.0F;
- }
-
- /**
- * Checks if the entity's current position is a valid location to spawn this entity.
- */
- @Override
- public boolean getCanSpawnHere() {
- return super.getCanSpawnHere() && this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL;
- }
-
- /**
- * Will return how many at most can spawn in a chunk at once.
- */
- @Override
- public int getMaxSpawnedInChunk() {
- return 1;
- }
-
- @Override
- protected Item getDropItem() {
- return Items.gunpowder;
- }
-
- /**
- * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
- * par2 - Level of Looting used to kill this mob.
- */
- @Override
- protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
- int j = this.rand.nextInt(2) + this.rand.nextInt(1 + p_70628_2_);
- int k;
-
- for (k = 0; k < j; ++k) {
- this.dropItem(Items.ghast_tear, 1);
- }
-
- j = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_);
-
- for (k = 0; k < j; ++k) {
- this.dropItem(Items.gunpowder, 1);
- }
- }
-
- @Override
- protected void updateEntityActionState() {
- if (!this.worldObj.isRemote && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) {
- this.setDead();
- }
-
- this.despawnEntity();
- this.prevAttackCounter = this.attackCounter;
- double d0 = this.waypointX - this.posX;
- double d1 = this.waypointY - this.posY;
- double d2 = this.waypointZ - this.posZ;
- double d3 = d0 * d0 + d1 * d1 + d2 * d2;
-
- if (d3 < 1.0D || d3 > 3600.0D) {
- this.waypointX = this.posX + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F);
- this.waypointY = this.posY + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F);
- this.waypointZ = this.posZ + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F);
- }
-
- if (this.courseChangeCooldown-- <= 0) {
- this.courseChangeCooldown += this.rand.nextInt(5) + 2;
- d3 = (double) MathHelper.sqrt_double(d3);
-
- if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, d3)) {
- this.motionX += d0 / d3 * 0.1D;
- this.motionY += d1 / d3 * 0.1D;
- this.motionZ += d2 / d3 * 0.1D;
- } else {
- this.waypointX = this.posX;
- this.waypointY = this.posY;
- this.waypointZ = this.posZ;
- }
- }
-
- if (this.targetedEntity != null && this.targetedEntity.isDead) {
- this.targetedEntity = null;
- }
-
- if (this.targetedEntity == null || this.aggroCooldown-- <= 0) {
- this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D);
-
- if (this.targetedEntity != null) {
- this.aggroCooldown = 20;
- }
- }
-
- double d4 = 64.0D;
-
- if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4) {
- double d5 = this.targetedEntity.posX - this.posX;
- double d6 = this.targetedEntity.boundingBox.minY + (double) (this.targetedEntity.height / 2.0F)
- - (this.posY + (double) (this.height / 2.0F));
- double d7 = this.targetedEntity.posZ - this.posZ;
- this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI;
-
- if (this.canEntityBeSeen(this.targetedEntity)) {
- if (this.attackCounter == 10) {
- this.worldObj.playAuxSFXAtEntity(
- (EntityPlayer) null,
- 1007,
- (int) this.posX,
- (int) this.posY,
- (int) this.posZ,
- 0);
- }
-
- ++this.attackCounter;
-
- if (this.attackCounter == 20) {
- this.worldObj.playAuxSFXAtEntity(
- (EntityPlayer) null,
- 1008,
- (int) this.posX,
- (int) this.posY,
- (int) this.posZ,
- 0);
- EntityLargeFireball entitylargefireball = new EntityLargeFireball(this.worldObj, this, d5, d6, d7);
- entitylargefireball.field_92057_e = this.explosionStrength;
- double d8 = 4.0D;
- Vec3 vec3 = this.getLook(1.0F);
- entitylargefireball.posX = this.posX + vec3.xCoord * d8;
- entitylargefireball.posY = this.posY + (double) (this.height / 2.0F) + 0.5D;
- entitylargefireball.posZ = this.posZ + vec3.zCoord * d8;
- this.worldObj.spawnEntityInWorld(entitylargefireball);
- this.attackCounter = -40;
- }
- } else if (this.attackCounter > 0) {
- --this.attackCounter;
- }
- } else {
- this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F
- / (float) Math.PI;
-
- if (this.attackCounter > 0) {
- --this.attackCounter;
- }
- }
-
- if (!this.worldObj.isRemote) {
- byte b1 = this.dataWatcher.getWatchableObjectByte(16);
- byte b0 = (byte) (this.attackCounter > 10 ? 1 : 0);
-
- if (b1 != b0) {
- this.dataWatcher.updateObject(16, Byte.valueOf(b0));
- }
- }
- }
-
- /**
- * True if the ghast has an unobstructed line of travel to the waypoint.
- */
- private boolean isCourseTraversable(double p_70790_1_, double p_70790_3_, double p_70790_5_, double p_70790_7_) {
- double d4 = (this.waypointX - this.posX) / p_70790_7_;
- double d5 = (this.waypointY - this.posY) / p_70790_7_;
- double d6 = (this.waypointZ - this.posZ) / p_70790_7_;
- AxisAlignedBB axisalignedbb = this.boundingBox.copy();
-
- for (int i = 1; (double) i < p_70790_7_; ++i) {
- axisalignedbb.offset(d4, d5, d6);
-
- /*
- * if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty()) { return false; }
- */
- }
-
- return true;
- }
-
- /**
- * Called when the mob is falling. Calculates and applies fall damage.
- */
- @Override
- protected void fall(float p_70069_1_) {}
-
- /**
- * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance
- * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround
- */
- @Override
- protected void updateFallState(double p_70064_1_, boolean p_70064_3_) {}
-
- /**
- * Moves the entity based on the specified heading. Args: strafe, forward
- */
- @Override
- public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) {
- if (this.isInWater()) {
- this.moveFlying(p_70612_1_, p_70612_2_, 0.02F);
- this.moveEntity(this.motionX, this.motionY, this.motionZ);
- this.motionX *= 0.800000011920929D;
- this.motionY *= 0.800000011920929D;
- this.motionZ *= 0.800000011920929D;
- } else if (this.handleLavaMovement()) {
- this.moveFlying(p_70612_1_, p_70612_2_, 0.02F);
- this.moveEntity(this.motionX, this.motionY, this.motionZ);
- this.motionX *= 0.5D;
- this.motionY *= 0.5D;
- this.motionZ *= 0.5D;
- } else {
- float f2 = 0.91F;
-
- if (this.onGround) {
- f2 = this.worldObj.getBlock(
- MathHelper.floor_double(this.posX),
- MathHelper.floor_double(this.boundingBox.minY) - 1,
- MathHelper.floor_double(this.posZ)).slipperiness * 0.91F;
- }
-
- float f3 = 0.16277136F / (f2 * f2 * f2);
- this.moveFlying(p_70612_1_, p_70612_2_, this.onGround ? 0.1F * f3 : 0.02F);
- f2 = 0.91F;
-
- if (this.onGround) {
- f2 = this.worldObj.getBlock(
- MathHelper.floor_double(this.posX),
- MathHelper.floor_double(this.boundingBox.minY) - 1,
- MathHelper.floor_double(this.posZ)).slipperiness * 0.91F;
- }
-
- this.moveEntity(this.motionX, this.motionY, this.motionZ);
- this.motionX *= (double) f2;
- this.motionY *= (double) f2;
- this.motionZ *= (double) f2;
- }
-
- this.prevLimbSwingAmount = this.limbSwingAmount;
- double d1 = this.posX - this.prevPosX;
- double d0 = this.posZ - this.prevPosZ;
- float f4 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F;
-
- if (f4 > 1.0F) {
- f4 = 1.0F;
- }
-
- this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F;
- this.limbSwing += this.limbSwingAmount;
- }
-
- /**
- * returns true if this entity is by a ladder, false otherwise
- */
- @Override
- public boolean isOnLadder() {
- return false;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java b/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java
deleted file mode 100644
index 45bbcab4c8..0000000000
--- a/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java
+++ /dev/null
@@ -1,314 +0,0 @@
-package gtPlusPlus.core.entity.monster;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityAgeable;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.SharedMonsterAttributes;
-import net.minecraft.entity.ai.EntityAIEatGrass;
-import net.minecraft.entity.ai.EntityAIFollowParent;
-import net.minecraft.entity.ai.EntityAILookIdle;
-import net.minecraft.entity.ai.EntityAIMate;
-import net.minecraft.entity.ai.EntityAIPanic;
-import net.minecraft.entity.ai.EntityAISwimming;
-import net.minecraft.entity.ai.EntityAITempt;
-import net.minecraft.entity.ai.EntityAIWander;
-import net.minecraft.entity.ai.EntityAIWatchClosest;
-import net.minecraft.entity.effect.EntityLightningBolt;
-import net.minecraft.entity.passive.EntityChicken;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.potion.Potion;
-import net.minecraft.util.ChunkCoordinates;
-import net.minecraft.util.MathHelper;
-import net.minecraft.world.World;
-import net.minecraftforge.common.ForgeHooks;
-
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.item.general.ItemGemShards;
-import gtPlusPlus.core.util.math.MathUtils;
-
-public class EntityGiantChickenBase extends EntityChicken {
-
- /** The time until the next egg is spawned. */
- public int timeUntilNextBigEgg;
-
- public EntityGiantChickenBase(World aWorld) {
- super(aWorld);
- this.setSize(0.6F, 1.4F); // Double
- this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
- this.timeUntilNextBigEgg = this.rand.nextInt(16000) + 4000;
- this.tasks.addTask(0, new EntityAISwimming(this));
- this.tasks.addTask(1, new EntityAIPanic(this, 1.4D));
- this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
- this.tasks.addTask(3, new EntityAITempt(this, 1.0D, ModItems.itemGemShards, false));
- this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D));
- this.tasks.addTask(4, new EntityAIEatGrass(this));
- this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
- this.tasks.addTask(5, new EntityAILookIdle(this));
- this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
- }
-
- @Override
- protected void applyEntityAttributes() {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D);
- }
-
- /**
- * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
- * use this to react to sunlight and start to burn.
- */
- @Override
- public void onLivingUpdate() {
- super.onLivingUpdate();
- this.field_70888_h = this.field_70886_e;
- this.field_70884_g = this.destPos;
- this.destPos = (float) ((double) this.destPos + (double) (this.onGround ? -1 : 4) * 0.3D);
-
- if (this.destPos < 0.0F) {
- this.destPos = 0.0F;
- }
-
- if (this.destPos > 1.0F) {
- this.destPos = 1.0F;
- }
-
- if (!this.onGround && this.field_70889_i < 1.0F) {
- this.field_70889_i = 1.0F;
- }
-
- this.field_70889_i = (float) ((double) this.field_70889_i * 0.9D);
-
- if (!this.onGround && this.motionY < 0.0D) {
- this.motionY *= 0.6D;
- }
-
- if (MathUtils.randInt(0, 10000) <= 5) {
- jump();
- }
-
- this.field_70886_e += this.field_70889_i * 2.0F;
-
- if (!this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) {
- this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
- this.dropItem(Items.egg, 1);
- this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
- }
- if (!this.worldObj.isRemote && !this.isChild() && --this.timeUntilNextEgg <= 0) {
- this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
- this.dropItem(ModItems.itemBigEgg, MathUtils.randInt(1, 4));
- this.timeUntilNextBigEgg = this.rand.nextInt(16000) + 4000;
- }
- }
-
- /**
- * Called when the mob is falling. Calculates and applies fall damage.
- */
- @Override
- protected void fall(float p_70069_1_) {
-
- if (MathUtils.randInt(0, 10) <= 5) {
- jump();
- }
- }
-
- @Override
- protected Item getDropItem() {
- return ModItems.itemBigEgg;
- }
-
- /**
- * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
- * par2 - Level of Looting used to kill this mob.
- */
- @Override
- protected void dropFewItems(boolean recentHit, int lootLevel) {
- int j = this.rand.nextInt(3) + this.rand.nextInt(1 + lootLevel);
-
- for (int k = 0; k < j; ++k) {
- this.dropItem(Items.feather, 1);
- }
-
- // Large Egg Chance
- for (int k = 0; k < j * 2; ++k) {
- this.dropItem(
- ModItems.itemBigEgg,
- MathUtils.getRandomFromArray(new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2 }));
- }
-
- // Chicken Corpses Dropped
- int mBodies = MathUtils.getRandomFromArray(
- new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4,
- 4, 4, 4, 5, 5, 6 });
- if (this.isBurning()) {
- this.dropItem(Items.cooked_chicken, mBodies);
- } else {
- this.dropItem(Items.chicken, mBodies);
- }
- }
-
- @Override
- public EntityGiantChickenBase createChild(EntityAgeable p_90011_1_) {
- return new EntityGiantChickenBase(this.worldObj);
- }
-
- /**
- * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
- * the animal type)
- */
- @Override
- public boolean isBreedingItem(ItemStack aStack) {
- return aStack != null && aStack.getItem() instanceof ItemGemShards;
- }
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- @Override
- public void readEntityFromNBT(NBTTagCompound aNBT) {
- super.readEntityFromNBT(aNBT);
- timeUntilNextBigEgg = aNBT.getInteger("timeUntilNextBigEgg");
- }
-
- /**
- * Get the experience points the entity currently has.
- */
- @Override
- protected int getExperiencePoints(EntityPlayer p_70693_1_) {
- return this.isChickenJockey() ? 20 : super.getExperiencePoints(p_70693_1_);
- }
-
- /**
- * (abstract) Protected helper method to write subclass entity data to NBT.
- */
- @Override
- public void writeEntityToNBT(NBTTagCompound aNBT) {
- super.writeEntityToNBT(aNBT);
- aNBT.setInteger("timeUntilNextBigEgg", timeUntilNextBigEgg);
- }
-
- /**
- * Determines if an entity can be despawned, used on idle far away entities
- */
- @Override
- protected boolean canDespawn() {
- return this.isChickenJockey() && this.riddenByEntity == null;
- }
-
- @Override
- public void updateRiderPosition() {
- super.updateRiderPosition();
- float f = MathHelper.sin(this.renderYawOffset * (float) Math.PI / 180.0F);
- float f1 = MathHelper.cos(this.renderYawOffset * (float) Math.PI / 180.0F);
- float f2 = 0.1F;
- float f3 = 0.0F;
- this.riddenByEntity.setPosition(
- this.posX + (double) (f2 * f),
- this.posY + (double) (this.height * 0.5F) + this.riddenByEntity.getYOffset() + (double) f3,
- this.posZ - (double) (f2 * f1));
-
- if (this.riddenByEntity instanceof EntityLivingBase) {
- ((EntityLivingBase) this.riddenByEntity).renderYawOffset = this.renderYawOffset;
- }
- }
-
- public boolean isChickenJockey() {
- return func_152116_bZ();
- }
-
- public void setIsChickenJockey(boolean isJockey) {
- func_152117_i(isJockey);
- }
-
- @Override
- protected Entity findPlayerToAttack() {
- // TODO Auto-generated method stub
- return super.findPlayerToAttack();
- }
-
- @Override
- public boolean interact(EntityPlayer p_70085_1_) {
- // TODO Auto-generated method stub
- return super.interact(p_70085_1_);
- }
-
- @Override
- public void setHomeArea(int p_110171_1_, int p_110171_2_, int p_110171_3_, int p_110171_4_) {
- // TODO Auto-generated method stub
- super.setHomeArea(p_110171_1_, p_110171_2_, p_110171_3_, p_110171_4_);
- }
-
- @Override
- public ChunkCoordinates getHomePosition() {
- // TODO Auto-generated method stub
- return super.getHomePosition();
- }
-
- @Override
- public void detachHome() {
- // TODO Auto-generated method stub
- super.detachHome();
- }
-
- @Override
- public boolean hasHome() {
- // TODO Auto-generated method stub
- return super.hasHome();
- }
-
- @Override
- public void eatGrassBonus() {
- if (this.isChild()) {
- this.addGrowth(60);
- }
- }
-
- @Override
- public float getRenderSizeModifier() {
- return 1.0f;
- }
-
- @Override
- protected void jump() {
- this.motionY = 0.68999998688697815D;
- this.motionY += 0.068999998688697815D;
- if (this.isPotionActive(Potion.jump)) {
- this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.5F);
- }
-
- if (this.isSprinting()) {
- float f = this.rotationYaw * 0.017453292F;
- this.motionX -= (double) (MathHelper.sin(f) * 0.2F);
- this.motionZ += (double) (MathHelper.cos(f) * 0.2F);
- }
-
- this.isAirBorne = true;
-
- if (MathUtils.randInt(0, 10) < 10) {
- jump();
- }
-
- ForgeHooks.onLivingJump(this);
- }
-
- @Override
- public void onStruckByLightning(EntityLightningBolt p_70077_1_) {
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- this.spawnExplosionParticle();
- super.onStruckByLightning(p_70077_1_);
- }
-
- @Override
- public boolean shouldDismountInWater(Entity rider) {
- return true;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java
index cea480fda8..3f5e755626 100644
--- a/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java
+++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java
@@ -14,11 +14,6 @@ import cpw.mods.fml.relauncher.SideOnly;
public class EntityLightningAttack extends EntityWitherSkull {
- public EntityLightningAttack(World p_i1793_1_) {
- super(p_i1793_1_);
- this.setSize(0.3125F, 0.3125F);
- }
-
public EntityLightningAttack(World p_i1794_1_, EntityLivingBase p_i1794_2_, double p_i1794_3_, double p_i1794_5_,
double p_i1794_7_) {
super(p_i1794_1_, p_i1794_2_, p_i1794_3_, p_i1794_5_, p_i1794_7_);
diff --git a/src/main/java/gtPlusPlus/core/fluids/FluidFactory.java b/src/main/java/gtPlusPlus/core/fluids/FluidFactory.java
deleted file mode 100644
index 121c217130..0000000000
--- a/src/main/java/gtPlusPlus/core/fluids/FluidFactory.java
+++ /dev/null
@@ -1,206 +0,0 @@
-package gtPlusPlus.core.fluids;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import net.minecraft.block.Block;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.MovingObjectPosition;
-import net.minecraft.world.World;
-import net.minecraftforge.event.entity.player.FillBucketEvent;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidContainerRegistry;
-import net.minecraftforge.fluids.FluidRegistry;
-
-import cpw.mods.fml.common.eventhandler.Event.Result;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.registry.GameRegistry;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.GTplusplus.INIT_PHASE;
-import gtPlusPlus.api.objects.GregtechException;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.item.base.itemblock.FluidItemBlock;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.FluidUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class FluidFactory {
-
- public static final Map<String, Fluid> mNameToFluidMap = new LinkedHashMap<String, Fluid>();
- public static final Map<String, ItemStack> mNameToBucketMap = new LinkedHashMap<String, ItemStack>();
- public static final Map<String, Block> mNameToBlockMap = new LinkedHashMap<String, Block>();
- public static final Map<String, Integer> mNameToMetaMap = new LinkedHashMap<String, Integer>();
-
- public static final Map<Fluid, String> mFluidToNameMap = new LinkedHashMap<Fluid, String>();
- public static final Map<Fluid, ItemStack> mFluidToBucketMap = new LinkedHashMap<Fluid, ItemStack>();
- public static final Map<Fluid, Block> mFluidToBlockMap = new LinkedHashMap<Fluid, Block>();
- public static final Map<Fluid, Integer> mFluidToMetaMap = new LinkedHashMap<Fluid, Integer>();
-
- public static final Map<ItemStack, Fluid> mBucketToFluidMap = new LinkedHashMap<ItemStack, Fluid>();
- public static final Map<ItemStack, String> mBucketToNameMap = new LinkedHashMap<ItemStack, String>();
- public static final Map<ItemStack, Block> mBucketToBlockMap = new LinkedHashMap<ItemStack, Block>();
- public static final Map<ItemStack, Integer> mBucketToMetaMap = new LinkedHashMap<ItemStack, Integer>();
-
- public static final Map<Block, String> mBlockToNameMap = new LinkedHashMap<Block, String>();
- public static final Map<Block, Fluid> mBlockToFluidMap = new LinkedHashMap<Block, Fluid>();
- public static final Map<Block, ItemStack> mBlockToBucketMap = new LinkedHashMap<Block, ItemStack>();
- public static final Map<Block, Integer> mBlockToMetaMap = new LinkedHashMap<Block, Integer>();
-
- public static final Map<Integer, String> mMetaToNameMap = new LinkedHashMap<Integer, String>();
- public static final Map<Integer, Fluid> mMetaToFluidMap = new LinkedHashMap<Integer, Fluid>();
- public static final Map<Integer, ItemStack> mMetaToBucketMap = new LinkedHashMap<Integer, ItemStack>();
- public static final Map<Integer, Block> mMetaToBlockMap = new LinkedHashMap<Integer, Block>();
-
- // Special Colour Handling
- public static final Map<Integer, Integer> mMetaToColourMap = new LinkedHashMap<Integer, Integer>();
-
- public static Item mGenericBucket;
- private static FluidPackage mErrorFluid;
- private static AutoMap<FluidPackage> mGeneratedFluids = new AutoMap<FluidPackage>();
-
- public static void preInit() {}
-
- public static void init() {
- mGenericBucket = new ItemGenericFluidBucket(Blocks.air);
- GameRegistry.registerItem(mGenericBucket, "gtpp.bucket.generic");
- for (FluidPackage y : mGeneratedFluids) {
- if (!y.valid()) {
- continue;
- }
- GameRegistry.registerBlock(y.mBlock, FluidItemBlock.class, "gtpp_" + y.mName);
- FluidContainerRegistry.registerFluidContainer(y.get(), y.mBucket, new ItemStack(Items.bucket));
- }
- Utils.registerEvent(BucketHandler.INSTANCE);
- }
-
- public static void postInit() {}
-
- /**
- * Generates a 'Water' type fluid.
- *
- * @param aID - The Fluid ID (Must be unique)
- * @param aUnlocalName - Unlocalized Fluid Name
- * @param aRGB - a {@link Short[]} containing the RGB of the FluidPackage.
- * @return - A fully constructed & registered {@linkplain FluidPackage}
- */
- public static FluidPackage generate(int aID, String aUnlocalName, short[] aRGB) {
- return generate(aID, aUnlocalName, Short.MIN_VALUE, Short.MIN_VALUE, Short.MIN_VALUE, Short.MIN_VALUE, aRGB);
- }
-
- /**
- * Generate a {@link FluidPackage} from the data provided. This FluidPackage is automatically registered and handled
- * internally. Pass in {@link Short}.MIN_VALUE for any of the Fluid Fields (Besides ID, Name or RGB) and it will
- * default to water values.
- *
- * @param aID - The Fluid ID (Must be unique)
- * @param aUnlocalName - Unlocalized Fluid Name
- * @param luminosity - How bright is the fluid.
- * @param density - completely arbitrary; negative density indicates that the fluid is lighter than air.
- * Default value is approximately the real-life density of water in kg/m^3.
- * @param temp - completely arbitrary; higher temperature indicates that the fluid is hotter than air.
- * Default value is approximately the real-life room temperature of water in degrees Kelvin
- * @param viscosity - completely arbitrary; negative values are not permissible. Default value is approximately
- * the real-life density of water in m/s^2 (x10^-3). * Higher viscosity means that a fluid flows
- * more slowly, like molasses. Lower viscosity means that a fluid flows more quickly, like
- * helium.
- * @param aRGB - a {@link Short[]} containing the RGB of the FluidPackage.
- * @return - A fully constructed & registered {@linkplain FluidPackage}
- */
- public static FluidPackage generate(int aID, String aUnlocalName, int luminosity, int density, int temp,
- int viscosity, short[] aRGB) {
-
- FluidPackage aFluidToGenerate = null;
-
- // Check Load Phase for some Safety, only allow this to be called in Pre-Init.
- if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.PRE_INIT) {
- try {
- throw new GregtechException("Cannot generate Fluid Packages outside of Pre-Init!");
- } catch (GregtechException e) {
- e.printStackTrace();
- CORE.crash("Cannot generate Fluid Packages outside of Pre-Init!");
- }
- }
-
- Fluid aGenFluid = fluid(aUnlocalName, luminosity, density, temp, viscosity, aRGB);
- Block aGenBlock = block(aGenFluid, aRGB);
- ItemStack aGenBucket = bucket(aID);
-
- aFluidToGenerate = new FluidPackage(aID, aUnlocalName, aGenFluid, aGenBucket, aGenBlock);
-
- if (aFluidToGenerate != null && aFluidToGenerate.valid()) {
- FluidRegistry.registerFluid(aFluidToGenerate.get());
- mGeneratedFluids.put(aFluidToGenerate);
- } else {
- // Handle Bad generation
- if (mErrorFluid == null) {
- mErrorFluid = new FluidPackage(
- 0,
- "",
- FluidUtils.getWater(1).getFluid(),
- ItemUtils.getSimpleStack(Items.water_bucket),
- Blocks.water);
- }
- return mErrorFluid;
- }
-
- return aFluidToGenerate;
- }
-
- private static Fluid fluid(String aUnlocalName, int luminosity, int density, int temp, int viscosity,
- short[] aRGB) {
- return new FactoryFluid(aUnlocalName, luminosity, density, temp, viscosity, aRGB);
- }
-
- private static ItemStack bucket(int aID) {
- return ItemGenericFluidBucket.registerFluidForBucket(aID);
- }
-
- private static Block block(Fluid aFluidForBlock, short[] aRGB) {
- if (aFluidForBlock != null) {
- FluidRegistry.registerFluid(aFluidForBlock);
- return new BlockFluidBase(aFluidForBlock, aRGB);
- }
- return Blocks.dirt;
- }
-
- /**
- * Copyright © SpaceToad, 2011 http://www.mod-buildcraft.com BuildCraft is distributed under the terms of the
- * Minecraft Mod Public License 1.0, or MMPL. Please check the contents of the license located in
- * http://www.mod-buildcraft.com/MMPL-1.0.txt
- *
- * Modified version of the BC BucketHandler, except using ItemStacks > Items (Why?)
- *
- * @author Alkalus
- */
- public static class BucketHandler {
-
- public static BucketHandler INSTANCE = new BucketHandler();
-
- private BucketHandler() {}
-
- @SubscribeEvent
- public void onBucketFill(FillBucketEvent event) {
- ItemStack result = fillCustomBucket(event.world, event.target);
- if (result == null) {
- return;
- }
- event.result = result;
- event.setResult(Result.ALLOW);
- }
-
- private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) {
- Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
- ItemStack bucket = mBlockToBucketMap.get(block);
- if (bucket != null && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) {
- world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
- return ItemUtils.getSimpleStack(bucket, 1);
- } else {
- return null;
- }
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/fluids/FluidPackage.java b/src/main/java/gtPlusPlus/core/fluids/FluidPackage.java
deleted file mode 100644
index 10e54d794d..0000000000
--- a/src/main/java/gtPlusPlus/core/fluids/FluidPackage.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package gtPlusPlus.core.fluids;
-
-import static gtPlusPlus.core.fluids.FluidFactory.mBlockToBucketMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mBlockToFluidMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mBlockToMetaMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mBlockToNameMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mBucketToBlockMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mBucketToFluidMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mBucketToMetaMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mBucketToNameMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mFluidToBlockMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mFluidToBucketMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mFluidToMetaMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mFluidToNameMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mMetaToBlockMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mMetaToBucketMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mMetaToColourMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mMetaToFluidMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mMetaToNameMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mNameToBlockMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mNameToBucketMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mNameToFluidMap;
-import static gtPlusPlus.core.fluids.FluidFactory.mNameToMetaMap;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.Fluid;
-
-public class FluidPackage {
-
- public final int mID;
- public final String mName;
- private final Fluid mFluid;
- public final ItemStack mBucket;
- public final Block mBlock;
-
- public FluidPackage(int aID, String aName, Fluid aFluid, ItemStack aBucket, Block aBlock) {
-
- mNameToFluidMap.put(aName, aFluid);
- mNameToBucketMap.put(aName, aBucket);
- mNameToBlockMap.put(aName, aBlock);
- mNameToMetaMap.put(aName, aID);
-
- mFluidToNameMap.put(aFluid, aName);
- mFluidToBucketMap.put(aFluid, aBucket);
- mFluidToBlockMap.put(aFluid, aBlock);
- mFluidToMetaMap.put(aFluid, aID);
-
- mBucketToFluidMap.put(aBucket, aFluid);
- mBucketToNameMap.put(aBucket, aName);
- mBucketToBlockMap.put(aBucket, aBlock);
- mBucketToMetaMap.put(aBucket, aID);
-
- mBlockToNameMap.put(aBlock, aName);
- mBlockToFluidMap.put(aBlock, aFluid);
- mBlockToBucketMap.put(aBlock, aBucket);
- mBlockToMetaMap.put(aBlock, aID);
-
- mMetaToNameMap.put(aID, aName);
- mMetaToFluidMap.put(aID, aFluid);
- mMetaToBucketMap.put(aID, aBucket);
- mMetaToBlockMap.put(aID, aBlock);
-
- mMetaToColourMap.put(aID, aFluid.getColor());
-
- mID = aID;
- mName = aName;
- mFluid = aFluid;
- mBucket = aBucket;
- mBlock = aBlock;
- }
-
- public Fluid get() {
- return mFluid;
- }
-
- public boolean valid() {
- return mName != null && mName.length() > 0 && mFluid != null && mBucket != null && mBlock != null;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java b/src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java
deleted file mode 100644
index 46e56d3f1d..0000000000
--- a/src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java
+++ /dev/null
@@ -1,325 +0,0 @@
-package gtPlusPlus.core.fluids;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemBucket;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-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;
-import gtPlusPlus.api.objects.GregtechException;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class ItemGenericFluidBucket extends ItemBucket {
-
- private static IIcon mBaseBucketTexture;
- private static IIcon mOverlayBucketTexture;
- private static AutoMap<Block> mInternalFluidCache = new AutoMap<Block>();
-
- public ItemGenericFluidBucket(Block aFluid) {
- super(aFluid);
- this.setContainerItem(Items.bucket);
- this.maxStackSize = 1;
- mInternalFluidCache.put(aFluid);
- }
-
- public static ItemStack registerFluidForBucket(int aID) {
-
- if (FluidFactory.mMetaToBucketMap.containsKey(aID)) {
- try {
- // noinspection deprecation
- throw new GregtechException(
- aID + " is already registered! Unable to register fluid: "
- + FluidFactory.mMetaToFluidMap.get(aID).getLocalizedName());
- } catch (GregtechException e) {
- e.printStackTrace();
- // noinspection deprecation
- CORE.crash(
- aID + " is already registered! Unable to register fluid: "
- + FluidFactory.mMetaToFluidMap.get(aID).getLocalizedName());
- }
- }
- mInternalFluidCache.put(FluidFactory.mMetaToBlockMap.get(aID));
- return ItemUtils.simpleMetaStack(FluidFactory.mGenericBucket, aID, 1);
- }
-
- Map<Integer, IIcon> mIconCache = new LinkedHashMap<Integer, IIcon>();
-
- /**
- * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
- */
- @Override
- public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
-
- Block isFull = FluidFactory.mMetaToBlockMap.get(aStack.getItemDamage());
-
- boolean flag = isFull == Blocks.air;
- MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(aWorld, aPlayer, flag);
-
- if (movingobjectposition == null || isFull == null) {
- return aStack;
- } else {
- FillBucketEvent event = new FillBucketEvent(aPlayer, aStack, aWorld, movingobjectposition);
- if (MinecraftForge.EVENT_BUS.post(event)) {
- return aStack;
- }
-
- if (event.getResult() == Event.Result.ALLOW) {
- if (aPlayer.capabilities.isCreativeMode) {
- return aStack;
- }
-
- if (--aStack.stackSize <= 0) {
- return event.result;
- }
-
- if (!aPlayer.inventory.addItemStackToInventory(event.result)) {
- aPlayer.dropPlayerItemWithRandomChoice(event.result, false);
- }
-
- return aStack;
- }
- if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
- int i = movingobjectposition.blockX;
- int j = movingobjectposition.blockY;
- int k = movingobjectposition.blockZ;
-
- if (!aWorld.canMineBlock(aPlayer, i, j, k)) {
- return aStack;
- }
-
- if (flag) {
- if (!aPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, aStack)) {
- return aStack;
- }
-
- Material material = aWorld.getBlock(i, j, k).getMaterial();
- int l = aWorld.getBlockMetadata(i, j, k);
-
- if (material == Material.water && l == 0) {
- aWorld.setBlockToAir(i, j, k);
- return this.func_150910_a(aStack, aPlayer, Items.water_bucket);
- }
-
- if (material == Material.lava && l == 0) {
- aWorld.setBlockToAir(i, j, k);
- return this.func_150910_a(aStack, aPlayer, Items.lava_bucket);
- }
- } else {
- if (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 (!aPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, aStack)) {
- return aStack;
- }
-
- if (this.tryPlaceContainedLiquid(isFull, aWorld, i, j, k) && !aPlayer.capabilities.isCreativeMode) {
- return new ItemStack(Items.bucket);
- }
- }
- }
-
- return aStack;
- }
- }
-
- 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(Block isFull, World aWorld, int aX, int aY, int aZ) {
- if (isFull == Blocks.air) {
- return false;
- } else {
- Material material = aWorld.getBlock(aX, aY, aZ).getMaterial();
- boolean flag = !material.isSolid();
-
- if (!aWorld.isAirBlock(aX, aY, aZ) && !flag) {
- return false;
- } else {
-
- if (!aWorld.isRemote && flag && !material.isLiquid()) {
- aWorld.func_147480_a(aX, aY, aZ, true);
- }
-
- aWorld.setBlock(aX, aY, aZ, isFull, 0, 3);
-
- return true;
- }
- }
- }
-
- @Override
- public IIcon getIconFromDamage(int aMeta) {
- IIcon aTemp = mIconCache.get(aMeta);
- return aTemp != null ? aTemp : super.getIconFromDamage(aMeta);
- }
-
- @Override
- public boolean getHasSubtypes() {
- return mInternalFluidCache.size() > 0;
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- list.add(new ItemStack(item, 1, 0));
- for (Block f : mInternalFluidCache) {
- Integer aMeta;
- if (f != null) {
- aMeta = FluidFactory.mBlockToMetaMap.get(f);
- if (aMeta != null) {
- list.add(new ItemStack(item, 1, aMeta));
- }
- }
- }
- }
-
- @Override
- public int getMaxDamage() {
- return 512;
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
- // TODO Auto-generated method stub
- super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- if (stack != null && renderPass == 1) {
- return mOverlayBucketTexture;
- } else {
- return mBaseBucketTexture;
- }
- /*
- * IIcon aTemp = mIconCache.get(stack.getItemDamage()); return aTemp != null ? aTemp : super.getIcon(stack,
- * renderPass, player, usingItem, useRemaining);
- */
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
-
- @Override
- public int getMaxDamage(ItemStack stack) {
- return 512;
- }
-
- @Override
- public boolean isDamaged(ItemStack stack) {
- return false;
- }
-
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- if (pass == 1) {
- return mOverlayBucketTexture;
- } else {
- return mBaseBucketTexture;
- }
- }
-
- @Override
- public void registerIcons(final IIconRegister i) {
- mBaseBucketTexture = i.registerIcon("bucket_empty");
- mOverlayBucketTexture = i.registerIcon(GTPlusPlus.ID + ":bucket.generic.overlay");
- }
-
- @Override
- public boolean tryPlaceContainedLiquid(World p_77875_1_, int p_77875_2_, int p_77875_3_, int p_77875_4_) {
- return tryPlaceContainedLiquid(Blocks.air, p_77875_1_, p_77875_2_, p_77875_3_, p_77875_4_);
- }
-
- @Override
- public int getColorFromItemStack(ItemStack aStack, int aPass) {
- if (aPass == 0) {
- return super.getColorFromItemStack(aStack, aPass);
- } else {
- return FluidFactory.mMetaToColourMap.get(aStack.getItemDamage());
- }
- }
-
- @Override
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java b/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
deleted file mode 100644
index ad5ec7deaa..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package gtPlusPlus.core.gui.item;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.OpenGlHelper;
-import net.minecraft.client.renderer.RenderHelper;
-import net.minecraft.client.renderer.entity.RenderManager;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL12;
-
-import gtPlusPlus.core.container.Container_BackpackBase;
-import gtPlusPlus.core.inventories.BaseInventoryBackpack;
-
-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(
- GTPlusPlus.ID,
- "textures/gui/itemBackpack.png");
-
- /** The inventory to render on screen */
- private final BaseInventoryBackpack inventory;
-
- public GuiBaseBackpack(final Container_BackpackBase containerItem) {
- super(containerItem);
- this.inventory = containerItem.inventory;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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);
- }
-
- /**
- * 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(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;
- drawPlayerModel(k + 51, l + 75, 30, k + 51 - this.xSize_lo, (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)
- */
- public static void drawPlayerModel(final int x, final int y, final int scale, final float yaw, final float pitch,
- final 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;
- GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
- RenderHelper.enableStandardItemLighting();
- GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(-((float) Math.atan(pitch / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
- entity.renderYawOffset = (float) Math.atan(yaw / 40.0F) * 20.0F;
- entity.rotationYaw = (float) Math.atan(yaw / 40.0F) * 40.0F;
- entity.rotationPitch = -((float) Math.atan(pitch / 40.0F)) * 20.0F;
- entity.rotationYawHead = entity.rotationYaw;
- entity.prevRotationYawHead = entity.rotationYaw;
- GL11.glTranslatef(0.0F, entity.yOffset, 0.0F);
- RenderManager.instance.playerViewY = 180.0F;
- RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
- entity.renderYawOffset = f2;
- entity.rotationYaw = f3;
- entity.rotationPitch = f4;
- entity.prevRotationYawHead = f5;
- entity.rotationYawHead = f6;
- GL11.glPopMatrix();
- RenderHelper.disableStandardItemLighting();
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java b/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java
deleted file mode 100644
index 3b51810e3a..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java
+++ /dev/null
@@ -1,589 +0,0 @@
-package gtPlusPlus.core.gui.item;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.client.gui.GuiButton;
-import net.minecraft.client.gui.GuiScreenBook;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.container.Container_Grindle;
-import gtPlusPlus.core.inventories.BaseInventoryGrindle;
-import gtPlusPlus.core.recipe.common.CI;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-
-public class GuiBaseGrindle extends GuiContainer {
-
- /** The FontRenderer used by GuiScreen */
- protected FontRenderer fontRenderer;
-
- private GrindleGuiButton mButtonNextPage;
- private GrindleGuiButton mButtonPreviousPage;
- private String[][] mPageDataArray;
- private short mCurrentPage = 0;
-
- private static final ResourceLocation iconLocation = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/itemGrindle.png");
-
- /** The inventory to render on screen */
- private final BaseInventoryGrindle inventory;
-
- public GuiBaseGrindle(final Container_Grindle containerItem) {
- super(containerItem);
- this.inventory = containerItem.inventory;
- }
-
- /**
- * 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.updateButtons();
- }
-
- /**
- * Draw the foreground layer for the GuiContainer (everything in front of the items)
- */
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
-
- try {
-
- // Title
- this.fontRendererObj.drawStringWithShadow(
- I18n.format("Gregtech Information Transponder", new Object[0]),
- 0,
- -12,
- Utils.rgbtoHexValue(255, 255, 255));
- ItemStack aStack = this.inventory.getStackInSlot(0);
-
- if (aStack != null) {
-
- GrindleData aDataCurrent = new GrindleData(aStack);
-
- if (aDataCurrent.mValid) {
-
- // Debug NBT Information
- // NBTUtils.tryIterateNBTData(aStack);
-
- this.fontRendererObj
- .drawString(I18n.format(aDataCurrent.mTitle), 10, 8, Utils.rgbtoHexValue(125, 255, 125));
-
- int tTier = aDataCurrent.mExtraInformation;
- if (tTier >= 0) {
- // Draw the GUI
- // List prospection
- this.fontRendererObj.drawString(
- I18n.format(aDataCurrent.mTierDim + " | Page: " + this.mCurrentPage, new Object[0]),
- 10,
- 18,
- Utils.rgbtoHexValue(125, 255, 125));
- // Divider
- this.fontRendererObj.drawString(
- I18n.format("-------------------", new Object[0]),
- 10,
- 23,
- Utils.rgbtoHexValue(125, 125, 255));
- // Pos data
- this.fontRendererObj.drawString(
- I18n.format(aDataCurrent.mPosInfo, new Object[0]),
- 10,
- 29,
- Utils.rgbtoHexValue(125, 125, 255));
- // Divider
- this.fontRendererObj.drawString(
- I18n.format("-------------------", new Object[0]),
- 10,
- 35,
- Utils.rgbtoHexValue(125, 125, 255));
- int aLastYUsed = 41;
-
- int posOuter = 0;
- int posInner = 0;
-
- mPageDataArray = new String[MathUtils
- .roundToClosestInt(Math.ceil(aDataCurrent.mListData.size() / 9.00))][9];
- for (String e : aDataCurrent.mListData) {
- if (e != null) {
- mPageDataArray[posInner][posOuter] = e;
- if (posOuter < 8) {
- posOuter++;
- } else {
- posOuter = 0;
- posInner++;
- }
- } else {
- continue;
- }
- }
-
- String[] aCurrentPage = mPageDataArray[this.mCurrentPage];
-
- if (aCurrentPage != null) {
- // Logger.INFO("valid Current page " + this.mCurrentPage);
- if (aCurrentPage.length > 0) {
- for (int i = 0; i < aCurrentPage.length; i++) {
- if ((aLastYUsed + 9) <= (68 + 56)) {
- String aCP = aCurrentPage[i];
- // Logger.INFO("Printing "+aCP);
- if (aCP != null && aCP.length() > 0) {
- if (!aCP.toLowerCase().contains("empty")
- && !aCP.toLowerCase().contains("null")) {
- this.fontRendererObj.drawString(
- I18n.format(aCP),
- 10,
- aLastYUsed,
- Utils.rgbtoHexValue(125, 255, 125));
- aLastYUsed += 9;
- }
- }
- }
- }
- }
- }
-
- }
-
- // Non-Prospecting Data
- else {
- // Draw the GUI
- // List prospection
- this.fontRendererObj.drawString(
- I18n.format(aDataCurrent.mTierDim, new Object[0]),
- 10,
- 18,
- Utils.rgbtoHexValue(125, 255, 125));
- // Divider
- this.fontRendererObj.drawString(
- I18n.format("-------------------", new Object[0]),
- 10,
- 23,
- Utils.rgbtoHexValue(125, 125, 255));
- // Pos data
- this.fontRendererObj.drawString(
- I18n.format(aDataCurrent.mPosInfo, new Object[0]),
- 10,
- 29,
- Utils.rgbtoHexValue(125, 125, 255));
- // Divider
- this.fontRendererObj.drawString(
- I18n.format("-------------------", new Object[0]),
- 10,
- 35,
- Utils.rgbtoHexValue(125, 125, 255));
- int aLastYUsed = 41;
- /*
- * for (int i=0;i<aDataCurrent.mListData.size();i++) { if ((aLastYUsed + 9) <= (68 + 56)) {
- * this.fontRendererObj.drawString(I18n.format(aDataCurrent.mListData.get(i), new Object[0]),
- * 10, aLastYUsed, Utils.rgbtoHexValue(125, 255, 125)); aLastYUsed = aLastYUsed + 9; } }
- */
- }
- } else {
- this.fontRendererObj.drawStringWithShadow(
- I18n.format("Invalid data item stored in slot.", new Object[0]),
- 10,
- 8,
- Utils.rgbtoHexValue(255, 125, 125));
- }
- } else {
- // Valid Datastick?
- this.fontRendererObj.drawStringWithShadow(
- I18n.format("Insert device into port.", new Object[0]),
- 10,
- 8,
- Utils.rgbtoHexValue(255, 125, 125));
- this.mPageDataArray = new String[][] { {} };
- this.mCurrentPage = 0;
- }
-
- // Inventory Label
- this.fontRendererObj.drawStringWithShadow(
- I18n.format("container.inventory", new Object[0]),
- 8,
- 131,
- Utils.rgbtoHexValue(255, 255, 255));
-
- } catch (Throwable t) {
- Logger.INFO("GUI CRASH - " + t);
- t.printStackTrace();
- }
- }
-
- /**
- * 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(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);
- }
-
- /**
- * Adds the buttons (and other controls) to the screen in question.
- */
- @SuppressWarnings("unchecked")
- @Override
- public void initGui() {
- super.initGui();
- this.buttonList.clear();
- Keyboard.enableRepeatEvents(true);
- final int k = (this.width - this.xSize) - (this.width / 16);
- this.mButtonNextPage = new GrindleGuiButton(1, k, 155, true);
- this.mButtonPreviousPage = new GrindleGuiButton(2, k - 20, 155, false);
- this.buttonList.add(this.mButtonNextPage);
- this.buttonList.add(this.mButtonPreviousPage);
- this.mCurrentPage = 0;
- this.updateButtons();
- }
-
- /**
- * Called when the screen is unloaded. Used to disable keyboard repeat events
- */
- @Override
- public void onGuiClosed() {
- Keyboard.enableRepeatEvents(false);
- this.mCurrentPage = 0;
- super.onGuiClosed();
- }
-
- private void updateButtons() {
- if (this.mCurrentPage >= 0) {
- if (this.mPageDataArray != null) {
- if (this.mCurrentPage < (this.mPageDataArray.length - 1)) {
- this.mButtonNextPage.visible = true;
- } else {
- this.mButtonNextPage.visible = false;
- }
- } else {
- this.mButtonNextPage.visible = false;
- }
- }
- if (this.mCurrentPage > 0) {
- this.mButtonPreviousPage.visible = true;
- } else {
- this.mButtonPreviousPage.visible = false;
- }
- }
-
- /**
- * Scrolling Related
- */
- @Override
- protected void actionPerformed(GuiButton aButton) {
- if (aButton.enabled && aButton.visible) {
- if (aButton.id == 1) {
- if (this.mCurrentPage < this.mPageDataArray.length - 1) {
- ++this.mCurrentPage;
- }
- } else if (aButton.id == 2) {
- if (this.mCurrentPage > 0) {
- --this.mCurrentPage;
- }
- }
- this.updateButtons();
- }
- }
-
- /**
- * Handles mouse input.
- */
- @Override
- public void handleMouseInput() {
- super.handleMouseInput();
- int i = Mouse.getEventDWheel();
- /*
- * if (i != 0) { this.currentScroll = (float) ((double) this.currentScroll - (double) i / (double) j); if
- * (this.currentScroll < 0.0F) { this.currentScroll = 0.0F; } if (this.currentScroll > 1.0F) {
- * this.currentScroll = 1.0F; } this.scrollTo(this.currentScroll); }
- */
- }
-
- /**
- * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is
- * mouseMove, which==0 or which==1 is mouseUp
- */
- @Override
- protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) {
- /*
- * if (p_146286_3_ == 0) { int l = p_146286_1_ - this.guiLeft; int i1 = p_146286_2_ - this.guiTop;
- * CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; int j1 = acreativetabs.length; for (int k1 = 0;
- * k1 < j1; ++k1) { CreativeTabs creativetabs = acreativetabs[k1]; if (creativetabs != null &&
- * this.func_147049_a(creativetabs, l, i1)) { this.setCurrentCreativeTab(creativetabs); return; } } }
- */
-
- super.mouseMovedOrUp(p_146286_1_, p_146286_2_, p_146286_3_);
- }
-
- /**
- * Allows Mouseover Tooltips
- */
- @Override
- protected void renderToolTip(ItemStack aStack, int p_146285_2_, int p_146285_3_) {
- super.renderToolTip(aStack, p_146285_2_, p_146285_3_);
- }
-
- /**
- * Custom Buttons
- */
- @SideOnly(Side.CLIENT)
- static class GrindleGuiButton extends GuiButton {
-
- public static final ResourceLocation mBookTexture;
-
- static {
- ResourceLocation r;
- try {
- r = (ResourceLocation) ReflectionUtils.getField(GuiScreenBook.class, "bookGuiTextures").get(null);
-
- } catch (IllegalArgumentException | IllegalAccessException e) {
- r = new ResourceLocation("textures/gui/book.png");
- }
- mBookTexture = r;
- }
-
- private final boolean aPageForward;
-
- public GrindleGuiButton(int aID, int aX, int aY, boolean aForwards) {
- this(aID, aX, aY, 20, 12, aForwards);
- }
-
- public GrindleGuiButton(int aID, int aX, int aY, int aWidth, int aHeight, boolean aForwards) {
- super(aID, aX, aY, aWidth, aHeight, "");
- this.aPageForward = aForwards;
- }
-
- /**
- * Draws this button to the screen.
- */
- @Override
- public void drawButton(Minecraft aGame, int aX, int aY) {
- if (this.visible) {
- boolean flag = aX >= this.xPosition && aY >= this.yPosition
- && aX < this.xPosition + this.width
- && aY < this.yPosition + this.height;
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- aGame.getTextureManager().bindTexture(iconLocation);
- int k = 0;
- int l = 192;
-
- if (flag) {
- k += 23;
- }
-
- if (!this.aPageForward) {
- l += 13;
- }
-
- this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 22, 12);
- }
- }
- }
-
- public static class GrindleData {
-
- public static enum GrindleMode {
-
- PROSPECTING(0),
- ELEMENT(1);
-
- private final int aModeID;
-
- private GrindleMode(final int aMode) {
- this.aModeID = aMode;
- }
-
- public int getMode() {
- return this.aModeID;
- }
- }
-
- final boolean mValid;
- final ItemStack mStack;
- final String mTitle, mPosInfo, mTierDim;
- final AutoMap<String> mListData;
- final GrindleMode mMode;
- final int mExtraInformation;
-
- public GrindleData(ItemStack iStack) {
-
- if (iStack == null) {
- mValid = false;
- mStack = null;
- mTitle = null;
- mListData = null;
- mMode = null;
- mExtraInformation = 0;
- this.mTierDim = "";
- this.mPosInfo = "";
- } else {
-
- this.mStack = iStack;
-
- int aType = -1;
- boolean isProspecting = false;
-
- // If Input stack is a Data stick/Orb, set a valid type.
- if (GT_Utility.areStacksEqual(iStack, CI.getDataStick(), true)) {
- aType = 0;
- } else if (GT_Utility.areStacksEqual(iStack, CI.getDataOrb(), true)) {
- aType = 1;
- }
-
- NBTTagCompound tNBT = iStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- }
-
- mTitle = tNBT.hasKey("title") ? tNBT.getString("title")
- : (aType == 0 ? "Empty Data Stick" : (aType == 1 ? "Empty Data Orb" : "Unknown Item"));
- if (mTitle.toLowerCase().contains("raw prospection data")) {
- isProspecting = true;
- }
-
- byte tTier = -1;
- if (isProspecting) {
- if (!tNBT.hasKey("prospection_tier") && tNBT.hasKey("prospection")) {
- tTier = 0;
- } else if (tNBT.hasKey("prospection_tier") && !tNBT.hasKey("prospection")) {
- tTier = tNBT.getByte("prospection_tier");
- }
- }
-
- mExtraInformation = isProspecting ? tTier : -1;
-
- if (tTier >= 0) {
- String xPos, yPos, zPos, aDim;
- String aPositionString, aInfoString;
- Set<String> aOreTypes = new LinkedHashSet<String>();
- Set<String> aOilTypes = new LinkedHashSet<String>();
-
- // Set variables that are shared between prospection types.
- if (tTier == 0) {
- String tData = tNBT.getString("prospection");
- String[] tDataArray = tData.split(",");
- xPos = tDataArray[0];
- yPos = tDataArray[1];
- zPos = tDataArray[2];
- aDim = tDataArray[3];
- aOilTypes.add("Oil Type: " + tDataArray[5]);
- aOilTypes.add("--------------------");
- aOreTypes.add("Ore Types: ");
- for (int i = 6; tDataArray.length > i; i++) {
- aOreTypes.add("-" + tDataArray[i]);
- }
- } else {
- String tPos = tNBT.getString("prospection_pos");
- String[] tPosData = tPos.split(" ");
- xPos = tPosData[1];
- yPos = tPosData[3];
- zPos = tPosData[5];
- aDim = tPosData[7];
- // Oil
- String tOil = tNBT.getString("prospection_oils");
- String[] tOilData = tOil.split("\\|");
- if (tOilData.length > 0) {
- aOilTypes.add("Oil Types:");
- for (String s : tOilData) {
- if (s != null) {
- aOilTypes.add(s);
- }
- }
- aOilTypes.add("--------------------");
- }
-
- // Near
- String tOresNear = tNBT.getString("prospection_near");
- String[] tOresNearData = tOresNear.split("\\|");
- // Middle
- String tOresMid = tNBT.getString("prospection_middle");
- String[] tOresMidData = tOresMid.split("\\|");
- // Far
- String tOresFar = tNBT.getString("prospection_far");
- String[] tOresFarData = tOresFar.split("\\|");
-
- if ((tOresNearData.length + tOresMidData.length + tOresFarData.length) > 0) {
- aOreTypes.add("Ore Types:");
- if (tOresNearData.length > 0) {
- for (String s : tOresNearData) {
- if (s != null) {
- aOreTypes.add("-" + s + " - Near");
- }
- }
- }
- if (tOresMidData.length > 0) {
- for (String s : tOresMidData) {
- if (s != null) {
- aOreTypes.add("-" + s + " - Mid");
- }
- }
- }
- if (tOresFarData.length > 0) {
- for (String s : tOresFarData) {
- if (s != null) {
- aOreTypes.add("-" + s + " - Far");
- }
- }
- }
- }
- }
-
- mListData = new AutoMap<String>();
- if (aOilTypes.size() > 0) {
- for (String aOils : aOilTypes) {
- if (aOils != null && aOils.length() > 0) {
- mListData.put(aOils);
- }
- }
- }
-
- if (aOreTypes.size() > 0) {
- for (String aOres : aOreTypes) {
- if (aOres != null && aOres.length() > 0) {
- mListData.put(aOres);
- }
- }
- }
-
- // Set Types
- mMode = GrindleMode.PROSPECTING;
- this.mTierDim = (aInfoString = "Tier: " + tTier + " | Dim: " + aDim);
- this.mPosInfo = (aPositionString = "X:" + xPos + ", Y:" + yPos + ", Z:" + zPos);
- this.mValid = true;
- }
-
- // Non-Prospectic Data
- else {
- mValid = true;
- mListData = null;
- mMode = GrindleMode.ELEMENT;
- this.mTierDim = "PLACEHOLDER";
- this.mPosInfo = "PLACEHOLDER";
- }
- }
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java b/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java
deleted file mode 100644
index 01bf98d9bf..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java
+++ /dev/null
@@ -1,513 +0,0 @@
-package gtPlusPlus.core.gui.item;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.GuiButton;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.nbt.NBTTagString;
-import net.minecraft.network.PacketBuffer;
-import net.minecraft.network.play.client.C17PacketCustomPayload;
-import net.minecraft.util.ChatAllowedCharacters;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.ResourceLocation;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.container.Container_Grindle;
-import gtPlusPlus.core.inventories.BaseInventoryGrindle;
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.Unpooled;
-
-@SideOnly(Side.CLIENT)
-public class GuiScreenGrindle extends GuiContainer {
-
- private static final Logger logger = LogManager.getLogger();
- private static final ResourceLocation bookGuiTextures = new ResourceLocation("textures/gui/book.png");
- /** The player editing the book */
- private final EntityPlayer editingPlayer;
-
- private final ItemStack bookObj;
- /** Whether the book is signed or can still be edited */
- private final boolean bookIsUnsigned;
-
- private boolean field_146481_r;
- private boolean field_146480_s;
- /** Update ticks since the gui was opened */
- private int updateCount;
-
- private final int bookImageWidth = 192;
- private final int bookImageHeight = 192;
- private int bookTotalPages = 1;
- private int currPage;
- private NBTTagList bookPages;
- private String bookTitle = "";
- private GuiScreenGrindle.NextPageButton buttonNextPage;
- private GuiScreenGrindle.NextPageButton buttonPreviousPage;
- private GuiButton buttonDone;
- /** The GuiButton to sign this book. */
- private GuiButton buttonSign;
-
- private GuiButton buttonFinalize;
- private GuiButton buttonCancel;
-
- // Texture
- private static final ResourceLocation iconLocation = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/itemGrindle.png");
-
- /** The inventory to render on screen */
- private final BaseInventoryGrindle inventory;
-
- public GuiScreenGrindle(final Container_Grindle containerItem, final EntityPlayer player) {
- super(containerItem);
- this.inventory = containerItem.inventory;
- this.editingPlayer = player;
- this.bookObj = this.inventory.getStackInSlot(0);
- this.bookIsUnsigned = (this.bookObj == null ? true : false);
-
- if (this.bookObj != null) {
- if (this.bookObj.hasTagCompound()) {
- final NBTTagCompound nbttagcompound = this.bookObj.getTagCompound();
- this.bookPages = nbttagcompound.getTagList("pages", 8);
-
- if (this.bookPages != null) {
- this.bookPages = (NBTTagList) this.bookPages.copy();
- this.bookTotalPages = this.bookPages.tagCount();
-
- if (this.bookTotalPages < 1) {
- this.bookTotalPages = 1;
- }
- }
- }
-
- if ((this.bookPages == null) && this.bookIsUnsigned) {
- this.bookPages = new NBTTagList();
- this.bookPages.appendTag(new NBTTagString(""));
- this.bookTotalPages = 1;
- }
- }
- }
-
- /**
- * Called from the main game loop to update the screen.
- */
- @Override
- public void updateScreen() {
- super.updateScreen();
- ++this.updateCount;
- }
-
- /**
- * Adds the buttons (and other controls) to the screen in question.
- */
- @Override
- @SuppressWarnings("unchecked")
- public void initGui() {
- this.buttonList.clear();
- Keyboard.enableRepeatEvents(true);
-
- if (this.bookIsUnsigned) {
- this.buttonList.add(
- this.buttonSign = new GuiButton(
- 3,
- (this.width / 2) - 100,
- 4 + this.bookImageHeight,
- 98,
- 20,
- I18n.format("book.signButton", new Object[0])));
- this.buttonList.add(
- this.buttonDone = new GuiButton(
- 0,
- (this.width / 2) + 2,
- this.bookImageHeight - 4,
- 98,
- 20,
- I18n.format("gui.close", new Object[0])));
- this.buttonList.add(
- this.buttonFinalize = new GuiButton(
- 5,
- (this.width / 2) - 100,
- 4 + this.bookImageHeight,
- 98,
- 20,
- I18n.format("book.finalizeButton", new Object[0])));
- this.buttonList.add(
- this.buttonCancel = new GuiButton(
- 4,
- (this.width / 2) + 2,
- 4 + this.bookImageHeight,
- 98,
- 20,
- I18n.format("gui.cancel", new Object[0])));
- } else {
- this.buttonList.add(
- this.buttonDone = new GuiButton(
- 0,
- (this.width / 2) - 100,
- this.bookImageHeight + 100,
- 200,
- 20,
- I18n.format("gui.done", new Object[0])));
- }
-
- final int i = (this.width - this.bookImageWidth) / 2;
- final byte b0 = 2;
- this.buttonList.add(this.buttonNextPage = new GuiScreenGrindle.NextPageButton(1, i + 120, b0 + 154, true));
- this.buttonList.add(this.buttonPreviousPage = new GuiScreenGrindle.NextPageButton(2, i + 38, b0 + 154, false));
- this.updateButtons();
- }
-
- /**
- * Called when the screen is unloaded. Used to disable keyboard repeat events
- */
- @Override
- public void onGuiClosed() {
- Keyboard.enableRepeatEvents(false);
- }
-
- private void updateButtons() {
- this.buttonNextPage.visible = !this.field_146480_s
- && ((this.currPage < (this.bookTotalPages - 1)) || this.bookIsUnsigned);
- this.buttonPreviousPage.visible = !this.field_146480_s && (this.currPage > 0);
- this.buttonDone.visible = !this.bookIsUnsigned || !this.field_146480_s;
-
- if (this.bookIsUnsigned) {
- this.buttonSign.visible = !this.field_146480_s;
- this.buttonCancel.visible = this.field_146480_s;
- this.buttonFinalize.visible = this.field_146480_s;
- this.buttonFinalize.enabled = this.bookTitle.trim().length() > 0;
- }
- }
-
- private void sendBookToServer(final boolean p_146462_1_) {
- if (this.bookIsUnsigned && this.field_146481_r) {
- if (this.bookPages != null) {
- String s;
-
- while (this.bookPages.tagCount() > 1) {
- s = this.bookPages.getStringTagAt(this.bookPages.tagCount() - 1);
-
- if (s.length() != 0) {
- break;
- }
-
- this.bookPages.removeTag(this.bookPages.tagCount() - 1);
- }
-
- if (this.bookObj.hasTagCompound()) {
- final NBTTagCompound nbttagcompound = this.bookObj.getTagCompound();
- nbttagcompound.setTag("pages", this.bookPages);
- } else {
- this.bookObj.setTagInfo("pages", this.bookPages);
- }
-
- s = "MC|BEdit";
-
- if (p_146462_1_) {
- s = "MC|BSign";
- this.bookObj.setTagInfo("author", new NBTTagString(this.editingPlayer.getCommandSenderName()));
- this.bookObj.setTagInfo("title", new NBTTagString(this.bookTitle.trim()));
- this.bookObj.func_150996_a(ModItems.itemGrindleTablet);
- }
-
- final ByteBuf bytebuf = Unpooled.buffer();
-
- try {
- (new PacketBuffer(bytebuf)).writeItemStackToBuffer(this.bookObj);
- this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(s, bytebuf));
- } catch (final Exception exception) {
- logger.error("Couldn\'t send book info", exception);
- } finally {
- bytebuf.release();
- }
- }
- }
- }
-
- @Override
- protected void actionPerformed(final GuiButton button) {
- if (button.enabled) {
- if (button.id == 0) {
- this.mc.displayGuiScreen((GuiScreen) null);
- this.sendBookToServer(false);
- } else if ((button.id == 3) && this.bookIsUnsigned) {
- this.field_146480_s = true;
- } else if (button.id == 1) {
- if (this.currPage < (this.bookTotalPages - 1)) {
- ++this.currPage;
- } else if (this.bookIsUnsigned) {
- this.addNewPage();
-
- if (this.currPage < (this.bookTotalPages - 1)) {
- ++this.currPage;
- }
- }
- } else if (button.id == 2) {
- if (this.currPage > 0) {
- --this.currPage;
- }
- } else if ((button.id == 5) && this.field_146480_s) {
- this.sendBookToServer(true);
- this.mc.displayGuiScreen((GuiScreen) null);
- } else if ((button.id == 4) && this.field_146480_s) {
- this.field_146480_s = false;
- }
-
- this.updateButtons();
- }
- }
-
- private void addNewPage() {
- if ((this.bookPages != null) && (this.bookPages.tagCount() < 50)) {
- this.bookPages.appendTag(new NBTTagString(""));
- ++this.bookTotalPages;
- this.field_146481_r = true;
- }
- }
-
- /**
- * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
- */
- @Override
- protected void keyTyped(final char p_73869_1_, final int p_73869_2_) {
- super.keyTyped(p_73869_1_, p_73869_2_);
-
- if (this.bookIsUnsigned) {
- if (this.field_146480_s) {
- this.func_146460_c(p_73869_1_, p_73869_2_);
- } else {
- this.keyTypedInBook(p_73869_1_, p_73869_2_);
- }
- }
- }
-
- /**
- * Processes keystrokes when editing the text of a book
- */
- private void keyTypedInBook(final char p_146463_1_, final int p_146463_2_) {
- switch (p_146463_1_) {
- case 22:
- this.func_146459_b(GuiScreen.getClipboardString());
- return;
- default:
- switch (p_146463_2_) {
- case 14:
- final String s = this.func_146456_p();
-
- if (s.length() > 0) {
- this.func_146457_a(s.substring(0, s.length() - 1));
- }
-
- return;
- case 28:
- case 156:
- this.func_146459_b("\n");
- return;
- default:
- if (ChatAllowedCharacters.isAllowedCharacter(p_146463_1_)) {
- this.func_146459_b(Character.toString(p_146463_1_));
- }
- }
- }
- }
-
- private void func_146460_c(final char p_146460_1_, final int p_146460_2_) {
- switch (p_146460_2_) {
- case 14:
- if (!this.bookTitle.isEmpty()) {
- this.bookTitle = this.bookTitle.substring(0, this.bookTitle.length() - 1);
- this.updateButtons();
- }
-
- return;
- case 28:
- case 156:
- if (!this.bookTitle.isEmpty()) {
- this.sendBookToServer(true);
- this.mc.displayGuiScreen((GuiScreen) null);
- }
-
- return;
- default:
- if ((this.bookTitle.length() < 16) && ChatAllowedCharacters.isAllowedCharacter(p_146460_1_)) {
- this.bookTitle = this.bookTitle + Character.toString(p_146460_1_);
- this.updateButtons();
- this.field_146481_r = true;
- }
- }
- }
-
- private String func_146456_p() {
- return (this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())
- ? this.bookPages.getStringTagAt(this.currPage)
- : "";
- }
-
- private void func_146457_a(final String p_146457_1_) {
- if ((this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())) {
- this.bookPages.func_150304_a(this.currPage, new NBTTagString(p_146457_1_));
- this.field_146481_r = true;
- }
- }
-
- private void func_146459_b(final String p_146459_1_) {
- final String s1 = this.func_146456_p();
- final String s2 = s1 + p_146459_1_;
- final int i = this.fontRendererObj.splitStringWidth(s2 + "" + EnumChatFormatting.BLACK + "_", 118);
-
- if ((i <= 118) && (s2.length() < 256)) {
- this.func_146457_a(s2);
- }
- }
-
- /**
- * Draws the screen and all the components in it.
- */
- @Override
- public void drawScreen(final int p_73863_1_, final int p_73863_2_, final float p_73863_3_) {
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(iconLocation);
- final int k = (this.width - this.xSize) / 2;
- final int l2 = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l2, 0, 0, this.xSize, this.ySize);
-
- // GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- // this.mc.getTextureManager().bindTexture(iconLocation);
- // final int k = (this.width - this.bookImageWidth) / 2;
- // this.drawTexturedModalRect(k, b0, 0, 0, this.bookImageWidth,
- // this.bookImageHeight);
-
- String s;
- String s1;
- int l;
- final byte b0 = 2;
-
- if (this.inventory.getStackInSlot(0) != null) {
- this.fontRendererObj.drawString(
- I18n.format("" + NBTUtils.getBookTitle(this.inventory.getStackInSlot(0)), new Object[0]),
- 10,
- 8,
- Utils.rgbtoHexValue(125, 255, 125));
- }
-
- if (this.field_146480_s) {
- s = this.bookTitle;
-
- if (this.bookIsUnsigned) {
- if (((this.updateCount / 6) % 2) == 0) {
- s = s + "" + EnumChatFormatting.BLACK + "_";
- } else {
- s = s + "" + EnumChatFormatting.GRAY + "_";
- }
- }
-
- s1 = I18n.format("book.editTitle", new Object[0]);
- l = this.fontRendererObj.getStringWidth(s1);
- this.fontRendererObj.drawString(s1, k + 36 + ((116 - l) / 2), b0 + 16 + 16, 0);
- final int i1 = this.fontRendererObj.getStringWidth(s);
- this.fontRendererObj.drawString(s, k + 36 + ((116 - i1) / 2), b0 + 48, 0);
- final String s2 = I18n.format("book.byAuthor", new Object[] { this.editingPlayer.getCommandSenderName() });
- final int j1 = this.fontRendererObj.getStringWidth(s2);
- this.fontRendererObj
- .drawString(EnumChatFormatting.DARK_GRAY + s2, k + 36 + ((116 - j1) / 2), b0 + 48 + 10, 0);
- final String s3 = I18n.format("book.finalizeWarning", new Object[0]);
- this.fontRendererObj.drawSplitString(s3, k + 36, b0 + 80, 116, 0);
- } else {
- s = I18n.format(
- "book.pageIndicator",
- new Object[] { Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages) });
- s1 = "";
-
- if ((this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())) {
- s1 = this.bookPages.getStringTagAt(this.currPage);
- }
-
- if (this.bookIsUnsigned) {
- if (this.fontRendererObj.getBidiFlag()) {
- s1 = s1 + "_";
- } else if (((this.updateCount / 6) % 2) == 0) {
- s1 = s1 + "" + EnumChatFormatting.BLACK + "_";
- } else {
- s1 = s1 + "" + EnumChatFormatting.GRAY + "_";
- }
- }
-
- l = this.fontRendererObj.getStringWidth(s);
- this.fontRendererObj.drawString(s, ((k - l) + this.bookImageWidth) - 44, b0 + 16, 0);
- // this.fontRendererObj.drawString(s, k+36, b0 + 16, 0);
- this.fontRendererObj.drawSplitString(s1, k + 36, b0 + 16 + 16, 116, 0);
- // this.fontRendererObj.drawSplitString(s1, k, b0 + 16 + 16, 116, 0);
- }
-
- super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
- }
-
- @SideOnly(Side.CLIENT)
- static class NextPageButton extends GuiButton {
-
- private final boolean field_146151_o;
-
- public NextPageButton(final int p_i1079_1_, final int p_i1079_2_, final int p_i1079_3_,
- final boolean p_i1079_4_) {
- super(p_i1079_1_, p_i1079_2_, p_i1079_3_, 23, 13, "");
- this.field_146151_o = p_i1079_4_;
- }
-
- /**
- * Draws this button to the screen.
- */
- @Override
- public void drawButton(final Minecraft p_146112_1_, final int p_146112_2_, final int p_146112_3_) {
- if (this.visible) {
- final boolean flag = (p_146112_2_ >= this.xPosition) && (p_146112_3_ >= this.yPosition)
- && (p_146112_2_ < (this.xPosition + this.width))
- && (p_146112_3_ < (this.yPosition + this.height));
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- p_146112_1_.getTextureManager().bindTexture(GuiScreenGrindle.bookGuiTextures);
- int k = 0;
- int l = 192;
-
- if (flag) {
- k += 23;
- }
-
- if (!this.field_146151_o) {
- l += 13;
- }
-
- this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 23, 13);
- }
- }
- }
-
- /**
- * 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(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;
- // drawPlayerModel(k + 51, l + 75, 30, k + 51 - this.xSize_lo, (l + 75)
- // - 50 - this.ySize_lo, this.mc.thePlayer);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java
deleted file mode 100644
index 20f87bf31e..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package gtPlusPlus.core.gui.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-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;
-import gtPlusPlus.core.container.Container_EggBox;
-import gtPlusPlus.core.tileentities.general.TileEntityEggBox;
-
-@SideOnly(Side.CLIENT)
-public class GUI_EggBox extends GuiContainer {
-
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/FishTrap.png");
-
- public GUI_EggBox(final InventoryPlayer player_inventory, final TileEntityEggBox te) {
- super(new Container_EggBox(player_inventory, te));
- }
-
- @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.EggBox", 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(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);
- }
-
- // 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();
-
- // 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!
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java
deleted file mode 100644
index 4f050250df..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package gtPlusPlus.core.gui.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-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;
-import gtPlusPlus.core.container.Container_HeliumGenerator;
-import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator;
-
-@SideOnly(Side.CLIENT)
-public class GUI_HeliumGenerator extends GuiContainer {
-
- private static final ResourceLocation guiTexture = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/helium_collector_gui.png");
-
- public GUI_HeliumGenerator(final InventoryPlayer player_inventory, final TileEntityHeliumGenerator te) {
- super(new Container_HeliumGenerator(player_inventory, te));
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j) {
- // this.fontRendererObj.drawString(I18n.format("", new Object[0]), 28, 6, 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(guiTexture);
- 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);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java
deleted file mode 100644
index 4ddb7105f2..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package gtPlusPlus.core.gui.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.gui.GuiButton;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-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;
-import gtPlusPlus.core.container.Container_ModularityTable;
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
-
-@SideOnly(Side.CLIENT)
-public class GUI_ModularityTable extends GuiContainer {
-
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/ModularityTable.png");
- private Container_ModularityTable mThisContainer;
- private TileEntityModularityTable mThisTile;
- private int mRecipeTime = -1;
-
- public GUI_ModularityTable(final InventoryPlayer player_inventory, final TileEntityModularityTable tile) {
- super(new Container_ModularityTable(player_inventory, tile));
- this.mThisContainer = tile.getContainer();
- this.mThisTile = tile;
- if (this.mThisTile.getRecipeTime() > -1) {
- this.mRecipeTime = this.mThisTile.getRecipeTime();
- }
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j) {
- if (this.mThisTile.getRecipeTime() > -1) {
- this.mRecipeTime = this.mThisTile.getRecipeTime();
- }
- // Utils.LOG_INFO("Container: "+this.mRecipeTime);
- this.fontRendererObj.drawString(I18n.format("Modularity Table", new Object[0]), 8, 6, 4210752);
- if (mRecipeTime > -1) {
- this.fontRendererObj.drawString(I18n.format("Time", new Object[0]), 84, 42, 4210752);
- this.fontRendererObj.drawString(I18n.format("Remaining", new Object[0]), 84, 50, 4210752);
- this.fontRendererObj
- .drawString(I18n.format("" + this.mRecipeTime + " Ticks", new Object[0]), 84, 58, 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(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);
- }
-
- // 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();
-
- // 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!
- }
-
- @Override
- protected void actionPerformed(final GuiButton B) {}
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java
deleted file mode 100644
index 32ae7fa222..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package gtPlusPlus.core.gui.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-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;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.container.Container_TradeTable;
-import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
-
-@SideOnly(Side.CLIENT)
-public class GUI_TradeTable extends GuiContainer {
-
- TileEntityTradeTable mThisTable;
- String mOwnerName;
-
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/ProjectTable.png");
-
- public GUI_TradeTable(final InventoryPlayer player_inventory, final TileEntityTradeTable te,
- final String mOwnerName) {
- super(new Container_TradeTable(player_inventory, te));
- if (te.isServerSide()) {
- mThisTable = te;
- this.mOwnerName = mOwnerName;
- Logger.INFO("Set valid TE in GUI");
- }
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j) {
- this.fontRendererObj.drawString(I18n.format("Owner - " + this.mOwnerName, new Object[0]), 28, 66, 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(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);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java b/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java
index 489d26fa96..74f7287ca3 100644
--- a/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java
@@ -28,7 +28,6 @@ import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
public class AchievementHandler {
@@ -60,17 +59,6 @@ public class AchievementHandler {
"",
true);
- // Useful Info
- boolean cores = CORE.ConfigSwitches.requireControlCores;
- if (cores || GregtechMeta_MultiBlockBase.DEBUG_DISABLE_CORES_TEMPORARILY) {
- this.registerAchievement(
- "hatch.control",
- -2,
- -2,
- GregtechItemList.Hatch_Control_Core.get(1),
- aBaseAchievementName,
- false);
- }
this.registerAchievement(
"hatch.dynamo.buffered",
2,
@@ -84,7 +72,7 @@ public class AchievementHandler {
-4,
-2,
GregtechItemList.Industrial_AlloyBlastSmelter.get(1),
- cores ? "hatch.control" : aBaseAchievementName,
+ aBaseAchievementName,
true);
// Material Advancement
diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index 8e9a1ca330..5b7d1de7fb 100644
--- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -1,6 +1,5 @@
package gtPlusPlus.core.handler;
-import static gregtech.api.enums.Mods.EnderIO;
import static gregtech.api.enums.Mods.ExtraUtilities;
import static gregtech.api.enums.Mods.OpenBlocks;
import static gregtech.api.enums.Mods.PamsHarvestCraft;
@@ -20,7 +19,6 @@ import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.ItemPackage;
-import gtPlusPlus.core.common.compat.COMPAT_EnderIO;
import gtPlusPlus.core.common.compat.COMPAT_ExtraUtils;
import gtPlusPlus.core.common.compat.COMPAT_HarvestCraft;
import gtPlusPlus.core.common.compat.COMPAT_IC2;
@@ -29,7 +27,6 @@ import gtPlusPlus.core.common.compat.COMPAT_Thaumcraft;
import gtPlusPlus.core.common.compat.COMPAT_Witchery;
import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler;
import gtPlusPlus.core.handler.Recipes.RegistrationHandler;
-import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.recipe.RECIPES_GREGTECH;
@@ -37,8 +34,6 @@ import gtPlusPlus.core.recipe.RECIPES_LaserEngraver;
import gtPlusPlus.core.recipe.ShapedRecipeObject;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaGarbageCollector;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_FluidCanning;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling;
import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_ChemicalSkips;
@@ -93,7 +88,6 @@ import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPowerSubStation;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechQuantumForceTransformer;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRTG;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRocketFuelGenerator;
-import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSafeBlock;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSemiFluidgenerators;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSimpleWasher;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarGenerators;
@@ -119,9 +113,6 @@ public class COMPAT_HANDLER {
Logger.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_" + GT_Values.VN[i - 1],
@@ -130,13 +121,6 @@ public class COMPAT_HANDLER {
}
public static void registerGregtechMachines() {
- // Debug
- GregtechItemList.Garbage_Collector_Debug_Machine.set(
- new GregtechMetaGarbageCollector(
- "garbagecollector.01.tier.single",
- "JVM Garbage Collector",
- "Useful for debugging or smoother performance on local servers").getStackForm(1L));
-
// Free IDs
/*
* --- 859 to 868 --- 911 to 940
@@ -148,7 +132,6 @@ public class COMPAT_HANDLER {
GregtechLFTR.run();
GregtechNuclearSaltProcessingPlant.run();
GregtechSteamCondenser.run();
- GregtechSafeBlock.run();
GregtechIndustrialCentrifuge.run();
GregtechIndustrialCokeOven.run();
GregtechIndustrialPlatePress.run();
@@ -210,9 +193,6 @@ public class COMPAT_HANDLER {
// InterMod
public static void intermodOreDictionarySupport() {
- if (EnderIO.isModLoaded()) {
- COMPAT_EnderIO.OreDict();
- }
if (OpenBlocks.isModLoaded()) {
COMPAT_OpenBlocks.OreDict();
}
diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
index d51acebcac..f511e3e6ae 100644
--- a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
+++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
@@ -12,8 +12,6 @@ import gtPlusPlus.xmod.gregtech.HANDLER_GT;
import gtPlusPlus.xmod.ic2.HANDLER_IC2;
import gtPlusPlus.xmod.ob.HANDLER_OpenBlocks;
import gtPlusPlus.xmod.railcraft.HANDLER_Railcraft;
-import gtPlusPlus.xmod.sc2.HANDLER_SC2;
-import gtPlusPlus.xmod.sol.HANDLER_SpiceOfLife;
import gtPlusPlus.xmod.thaumcraft.HANDLER_Thaumcraft;
import gtPlusPlus.xmod.thermalfoundation.HANDLER_TF;
import gtPlusPlus.xmod.tinkers.HANDLER_Tinkers;
@@ -26,10 +24,8 @@ public class COMPAT_IntermodStaging {
HANDLER_FR.preInit();
HANDLER_IC2.preInit();
HANDLER_BiomesOPlenty.preInit();
- HANDLER_SC2.preInit();
HANDLER_CropsPlusPlus.preInit(preinit);
HANDLER_Railcraft.preInit();
- HANDLER_SpiceOfLife.preInit();
}
public static void init(FMLInitializationEvent init) {
diff --git a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java
index 04ad22178b..e0b9e71c2d 100644
--- a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java
@@ -10,86 +10,43 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox;
-import gtPlusPlus.core.container.Container_BackpackBase;
-import gtPlusPlus.core.container.Container_CircuitProgrammer;
-import gtPlusPlus.core.container.Container_DecayablesChest;
-import gtPlusPlus.core.container.Container_EggBox;
-import gtPlusPlus.core.container.Container_FishTrap;
-import gtPlusPlus.core.container.Container_Grindle;
-import gtPlusPlus.core.container.Container_ModularityTable;
-import gtPlusPlus.core.container.Container_PestKiller;
-import gtPlusPlus.core.container.Container_ProjectTable;
-import gtPlusPlus.core.container.Container_RoundRobinator;
-import gtPlusPlus.core.container.Container_SuperJukebox;
-import gtPlusPlus.core.container.Container_TradeTable;
-import gtPlusPlus.core.container.Container_VolumetricFlaskSetter;
-import gtPlusPlus.core.container.box.LunchBoxContainer;
-import gtPlusPlus.core.container.box.MagicBagContainer;
-import gtPlusPlus.core.container.box.ToolBoxContainer;
+import gtPlusPlus.core.container.*;
import gtPlusPlus.core.gui.beta.Gui_ID_Registry;
import gtPlusPlus.core.gui.beta.MU_GuiId;
-import gtPlusPlus.core.gui.item.GuiBaseBackpack;
-import gtPlusPlus.core.gui.item.GuiBaseGrindle;
-import gtPlusPlus.core.gui.item.box.LunchBoxGui;
-import gtPlusPlus.core.gui.item.box.MagicBagGui;
-import gtPlusPlus.core.gui.item.box.ToolBoxGui;
-import gtPlusPlus.core.gui.machine.GUI_CircuitProgrammer;
-import gtPlusPlus.core.gui.machine.GUI_DecayablesChest;
-import gtPlusPlus.core.gui.machine.GUI_EggBox;
-import gtPlusPlus.core.gui.machine.GUI_FishTrap;
-import gtPlusPlus.core.gui.machine.GUI_ModularityTable;
-import gtPlusPlus.core.gui.machine.GUI_PestKiller;
-import gtPlusPlus.core.gui.machine.GUI_ProjectTable;
-import gtPlusPlus.core.gui.machine.GUI_RoundRobinator;
-import gtPlusPlus.core.gui.machine.GUI_SuperJukebox;
-import gtPlusPlus.core.gui.machine.GUI_TradeTable;
-import gtPlusPlus.core.gui.machine.GUI_VolumetricFlaskSetter;
+import gtPlusPlus.core.gui.machine.*;
import gtPlusPlus.core.interfaces.IGuiManager;
-import gtPlusPlus.core.inventories.BaseInventoryBackpack;
-import gtPlusPlus.core.inventories.BaseInventoryGrindle;
-import gtPlusPlus.core.inventories.box.LunchBoxInventory;
-import gtPlusPlus.core.inventories.box.MagicBagInventory;
-import gtPlusPlus.core.inventories.box.ToolBoxInventory;
-import gtPlusPlus.core.tileentities.base.TileEntityBase;
import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer;
import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest;
-import gtPlusPlus.core.tileentities.general.TileEntityEggBox;
import gtPlusPlus.core.tileentities.general.TileEntityFishTrap;
import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter;
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller;
import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable;
import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator;
-import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
public class GuiHandler implements IGuiHandler {
public static final int GUI1 = 0; // Project Table
- public static final int GUI2 = 1; // Helium Generator
- public static final int GUI3 = 2; // BackpackHandler
+ public static final int GUI2 = 1; // None
+ public static final int GUI3 = 2; // None
public static final int GUI4 = 3; // Workbench
public static final int GUI5 = 4; // Workbench Adv
public static final int GUI6 = 5; // Fish trap
- public static final int GUI7 = 6; // Trade table
+ public static final int GUI7 = 6; // None
public static final int GUI8 = 7; // Circuit Programmer
- public static final int GUI9 = 8; // Grindle
- public static final int GUI10 = 9; // Universal Toolbox
- public static final int GUI11 = 10; // Auto Lunchbox
- public static final int GUI12 = 11; // Bag for Magic Tools
+ public static final int GUI9 = 8; // None
+ public static final int GUI10 = 9; // None
+ public static final int GUI11 = 10; // None
+ public static final int GUI12 = 11; // None
public static final int GUI13 = 12; // Decayables Chest
public static final int GUI14 = 13; // Super Jukebox
public static final int GUI15 = 14; // Pest Killer
public static final int GUI16 = 15; // Round-Robinator
- public static final int GUI17 = 16; // Egg Box
+ public static final int GUI17 = 16; // None
public static final int GUI18 = 17; // Volumetric Flask Setter
public static void init() {
-
Logger.INFO("Registering GUIs.");
NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new GuiHandler());
- // Register GuiHandler
- // NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new
- // GuiHandler());
}
@Override // ContainerModTileEntity
@@ -100,29 +57,15 @@ public class GuiHandler implements IGuiHandler {
if (te != null) {
if (ID == GUI1) {
return new Container_ProjectTable(player.inventory, (TileEntityProjectTable) te);
- } else if (ID == GUI2) {
- return new Container_ModularityTable(player.inventory, (TileEntityModularityTable) te);
- }
- }
-
- if (ID == GUI3) {
- // Use the player's held item to create the inventory
- return new Container_BackpackBase(
- player,
- player.inventory,
- new BaseInventoryBackpack(player.getHeldItem()));
+ } else if (ID == GUI2) {}
}
if (te != null) {
- if (ID == GUI4) {
- // return new Container_Workbench(player.inventory, (TileEntityWorkbench) te);
- } else if (ID == GUI5) {
+ if (ID == GUI5) {
Logger.INFO("sad");
// return new Container_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te);
} else if (ID == GUI6) {
return new Container_FishTrap(player.inventory, (TileEntityFishTrap) te);
- } else if (ID == GUI7) {
- return new Container_TradeTable(player.inventory, (TileEntityTradeTable) te);
} else if (ID == GUI8) {
return new Container_CircuitProgrammer(player.inventory, (TileEntityCircuitProgrammer) te);
} else if (ID == GUI13) {
@@ -133,27 +76,11 @@ public class GuiHandler implements IGuiHandler {
return new Container_PestKiller(player.inventory, (TileEntityPestKiller) te);
} else if (ID == GUI16) {
return new Container_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te);
- } else if (ID == GUI17) {
- return new Container_EggBox(player.inventory, (TileEntityEggBox) te);
} else if (ID == GUI18) {
return new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te);
}
}
- if (ID == GUI9) {
- return new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem()));
- }
- // Tool, lunch, magic
- if (ID == GUI10) {
- return new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem()));
- }
- if (ID == GUI11) {
- return new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem()));
- }
- if (ID == GUI12) {
- return new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem()));
- }
-
return null;
}
@@ -175,34 +102,12 @@ public class GuiHandler implements IGuiHandler {
if (te != null) {
if (ID == GUI1) {
return new GUI_ProjectTable(player.inventory, (TileEntityProjectTable) te);
- } else if (ID == GUI2) {
- return new GUI_ModularityTable(player.inventory, (TileEntityModularityTable) te);
}
}
- 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(
- new Container_BackpackBase(
- player,
- player.inventory,
- new BaseInventoryBackpack(player.getHeldItem())));
- }
-
if (te != null) {
- if (ID == GUI4) {
- // return new GUI_Workbench(player.inventory, (TileEntityWorkbench) te);
- } else if (ID == GUI5) {
- Logger.INFO("sad");
- // return new GUI_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te);
- } else if (ID == GUI6) {
+ if (ID == GUI6) {
return new GUI_FishTrap(player.inventory, (TileEntityFishTrap) te);
- } else if (ID == GUI7) {
- return new GUI_TradeTable(
- player.inventory,
- (TileEntityTradeTable) te,
- ((TileEntityBase) te).getOwner());
} else if (ID == GUI8) {
return new GUI_CircuitProgrammer(player.inventory, (TileEntityCircuitProgrammer) te);
} else if (ID == GUI13) {
@@ -213,33 +118,12 @@ public class GuiHandler implements IGuiHandler {
return new GUI_PestKiller(player.inventory, (TileEntityPestKiller) te);
} else if (ID == GUI16) {
return new GUI_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te);
- } else if (ID == GUI17) {
- return new GUI_EggBox(player.inventory, (TileEntityEggBox) te);
} else if (ID == GUI18) {
return new GUI_VolumetricFlaskSetter(
new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te));
}
}
- if (ID == GUI9) {
- return new GuiBaseGrindle(
- new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem())));
- }
-
- // Tool, lunch, magic
- if (ID == GUI10) {
- return new ToolBoxGui(
- new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem())));
- }
- if (ID == GUI11) {
- return new LunchBoxGui(
- new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem())));
- }
- if (ID == GUI12) {
- return new MagicBagGui(
- new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem())));
- }
-
return null;
}
@@ -265,12 +149,4 @@ public class GuiHandler implements IGuiHandler {
return (data << 16) | guiId.getId();
}
- private static MU_GuiId decodeGuiID(final int guiData) {
- final int guiId = guiData & 0xFF;
- return Gui_ID_Registry.getGuiId(guiId);
- }
-
- private static short decodeGuiData(final int guiId) {
- return (short) (guiId >> 16);
- }
}
diff --git a/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java b/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
index 12acc8b4d3..005ebba204 100644
--- a/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
@@ -5,7 +5,6 @@ import gtPlusPlus.core.handler.COMPAT_HANDLER;
import gtPlusPlus.core.recipe.RECIPES_General;
import gtPlusPlus.core.recipe.RECIPES_MachineComponents;
import gtPlusPlus.core.recipe.RECIPES_Machines;
-import gtPlusPlus.core.recipe.RECIPES_Tools;
import gtPlusPlus.core.recipe.RECIPE_Batteries;
public class RegistrationHandler {
@@ -18,7 +17,6 @@ public class RegistrationHandler {
}
private static final void init() {
- RECIPES_Tools.loadRecipes();
RECIPES_General.loadRecipes();
RECIPES_Machines.loadRecipes();
RECIPES_MachineComponents.loadRecipes();
diff --git a/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java
deleted file mode 100644
index e2ea5746a1..0000000000
--- a/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package gtPlusPlus.core.handler.events;
-
-import static gregtech.api.enums.Mods.Thaumcraft;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropDrainedShard;
-import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropFluoriteOre;
-
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.event.entity.living.LivingDropsEvent;
-import net.minecraftforge.event.entity.player.PlayerInteractEvent;
-import net.minecraftforge.event.world.BlockEvent;
-import net.minecraftforge.oredict.OreDictionary;
-
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.material.nuclear.FLUORIDES;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-
-public class BlockEventHandler {
-
- public static ArrayList<ItemStack> oreLimestone;
- public static ArrayList<ItemStack> blockLimestone;
- public static ItemStack fluoriteOre;
-
- public static void init() {
- // Set Variables for Fluorite Block handling
- Logger.INFO("Setting some Variables for the block break event handler.");
- BlockEventHandler.oreLimestone = OreDictionary.getOres("oreLimestone");
- BlockEventHandler.blockLimestone = OreDictionary.getOres("limestone");
- BlockEventHandler.fluoriteOre = FLUORIDES.FLUORITE.getOre(1);
- }
-
- @SubscribeEvent
- public void onBlockLeftClicked(final PlayerInteractEvent event) {
- /*
- * if (event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return; ItemStack heldItem =
- * event.entityPlayer.getHeldItem(); Block block = event.world.getBlock(event.x, event.y, event.z); // If the
- * block clicked was Stone, the player was holding an Iron Pickaxe and a random integer from 0 (inclusive) to 2
- * (exclusive) is 0 (50% chance) if (block == Blocks.stone && heldItem != null && heldItem.getItem() ==
- * Items.iron_pickaxe && random.nextInt(2) == 0) { ForgeDirection direction =
- * ForgeDirection.getOrientation(event.face); // Convert the numeric face to a ForgeDirection int fireX =
- * event.x + direction.offsetX, fireY = event.y + direction.offsetY, fireZ = event.z + direction.offsetZ; //
- * Offset the block's coordinates according to the direction if (event.world.isAirBlock(fireX, fireY, fireZ)) {
- * // If the block at the new coordinates is Air event.world.setBlock(fireX, fireY, fireZ, Blocks.fire); //
- * Replace it with Fire event.useBlock = Event.Result.DENY; // Prevent the Fire from being extinguished (also
- * prevents Block#onBlockClicked from being called) } }
- */
- }
-
- @SubscribeEvent
- public void onEntityDrop(final LivingDropsEvent event) {
- /*
- * if (event.entityLiving instanceof EntityPig && event.source instanceof EntityDamageSource) { // getEntity
- * will return the Entity that caused the damage,even for indirect damage sources like arrows/fireballs //
- * (where it will return the Entity that shot the projectile rather than the projectile itself) Entity
- * sourceEntity = event.source.getEntity(); ItemStack heldItem = sourceEntity instanceof EntityLiving ?
- * ((EntityLiving) sourceEntity).getHeldItem() : sourceEntity instanceof EntityPlayer ? ((EntityPlayer)
- * sourceEntity).getHeldItem() : null; if (heldItem != null && heldItem.getItem() == Items.iron_pickaxe) {
- * System.out.println("EntityPig drops event"); event.drops.clear(); event.entityLiving.dropItem(Items.diamond,
- * 64); } }
- */
- }
-
- @SubscribeEvent
- public void onBlockBreak(final BlockEvent.BreakEvent event) {}
-
- // Used to handle Thaumcraft Shards when TC is not installed.
- @SubscribeEvent
- public void harvestDrops(final BlockEvent.HarvestDropsEvent event) {
- try {
-
- if (event != null && event.harvester != null && event.harvester.worldObj != null) {
- if (!event.harvester.worldObj.isRemote) {
-
- EntityPlayer p = event.harvester;
-
- if (PlayerUtils.isRealPlayer(p)) {
- // Spawns Fluorite from Lime Stone
- if (chanceToDropFluoriteOre != 0) {
- if (!oreLimestone.isEmpty() || !blockLimestone.isEmpty()) {
-
- ArrayList<Block> mBlockTypes = new ArrayList<Block>();
- if (!oreLimestone.isEmpty()) {
- for (int i = 0; i < oreLimestone.size(); i++) {
- if (ItemUtils.getModId(oreLimestone.get(i)) != null
- && !ItemUtils.getModId(oreLimestone.get(i)).toLowerCase()
- .contains("biomesoplenty")) {
- if (!mBlockTypes
- .contains(Block.getBlockFromItem(oreLimestone.get(i).getItem()))) {
- mBlockTypes.add(Block.getBlockFromItem(oreLimestone.get(i).getItem()));
- }
- }
- }
- }
- if (!blockLimestone.isEmpty()) {
- for (int i = 0; i < blockLimestone.size(); i++) {
- if (ItemUtils.getModId(blockLimestone.get(i)) != null
- && !ItemUtils.getModId(blockLimestone.get(i)).toLowerCase()
- .contains("biomesoplenty")) {
- if (!mBlockTypes.contains(
- Block.getBlockFromItem(blockLimestone.get(i).getItem()))) {
- mBlockTypes
- .add(Block.getBlockFromItem(blockLimestone.get(i).getItem()));
- }
- }
- }
- }
-
- Logger.WARNING("Found Limestone in OreDict.");
- if (!mBlockTypes.isEmpty()) {
- Logger.WARNING("1a | " + event.block.getUnlocalizedName());
- for (final Block temp : mBlockTypes) {
- Logger.WARNING("2a - " + temp.getUnlocalizedName());
- if (event.block == temp) {
- Logger.WARNING("3a - found " + temp.getUnlocalizedName());
- if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1) {
- Logger.WARNING("4a");
- event.drops.clear();
- event.drops.add(fluoriteOre.copy());
- }
- }
- }
- }
- }
-
- if (event.block.getUnlocalizedName().toLowerCase().contains("limestone")) {
- Logger.WARNING("1c");
- if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1) {
- Logger.WARNING("2c");
- event.drops.clear();
- event.drops.add(fluoriteOre.copy());
- }
- }
-
- if (event.block == Blocks.sandstone) {
- if (MathUtils.randInt(1, chanceToDropFluoriteOre * 20) == 1) {
- event.drops.clear();
- event.drops.add(fluoriteOre.copy());
- }
- }
- }
- }
-
- // Do things that can occur for fake players and real players
-
- // Spawn Dull Shards (Can spawn from Tree Logs, Grass or Stone. Stone going to
- // be the most common source.)
- if (((event.block == Blocks.stone) || (event.block == Blocks.sandstone)
- || (event.block == Blocks.log)
- || (event.block == Blocks.log2)
- || (event.block == Blocks.grass)) && !Thaumcraft.isModLoaded()
- && (chanceToDropDrainedShard != 0)) {
- // small chance for one to spawn per stone mined. 1 per 3 stacks~
- if (MathUtils.randInt(1, chanceToDropDrainedShard) == 1) {
- // Let's sort out a lucky charm for the player.
- final int FancyChance = MathUtils.randInt(1, 4);
- if (MathUtils.randInt(1, 100) < 90) {
- event.drops.add(new ItemStack(ModItems.shardDull));
- }
- // Make a Fire Shard
- else if (FancyChance == 1) {
- event.drops.add(new ItemStack(ModItems.shardIgnis));
- }
- // Make a Water Shard.
- else if (FancyChance == 2) {
- event.drops.add(new ItemStack(ModItems.shardAqua));
- }
- // Make an Earth Shard.
- else if (FancyChance == 3) {
- event.drops.add(new ItemStack(ModItems.shardTerra));
- }
- // Make an Air Shard.
- else if (FancyChance == 4) {
- event.drops.add(new ItemStack(ModItems.shardAer));
- }
- } else {
- Logger.WARNING("invalid chance");
- }
- }
- }
- }
- } catch (Throwable r) {
- Logger.INFO("Block Event Handler Failed. Please Report this to Alkalus.");
- r.printStackTrace();
- }
- }
-
- @SubscribeEvent
- public void logsHarvest(final BlockEvent.HarvestDropsEvent event) {
- /*
- * if (event.block instanceof BlockLog) { //
- * http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/
- * modification-development/2444501-harvestdropevent-changing-drops-of-vanilla- blocks //
- * Utils.sendServerMessage("Logs! Harvester: %s Drops: %s", event.harvester != null ?
- * event.harvester.getCommandSenderName() : "<none>",
- * event.drops.stream().map(ItemStack.toString()).collect(Collectors. joining(", "))); if (event.harvester !=
- * null) { ItemStack heldItem = event.harvester.getHeldItem(); if (heldItem == null ||
- * heldItem.getItem().getHarvestLevel(heldItem, "axe") < 1) { event.drops.clear();
- * Utils.sendServerMessage("Harvester had wrong tool, clearing drops"); } else {
- * Utils.sendServerMessage("Harvester had correct tool, not clearing drops"); } } else { event.drops.clear();
- * Utils.sendServerMessage("No harvester, clearing drops"); } }
- */
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java
index 6aa9fde2a8..867a2538f3 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java
@@ -1,100 +1,15 @@
package gtPlusPlus.core.handler.events;
-import net.minecraft.block.Block;
import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import advsolar.common.AdvancedSolarPanel;
import cpw.mods.fml.common.Optional;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import gregtech.api.enums.Mods;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.GTplusplus.INIT_PHASE;
-import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
public class GeneralTooltipEventHandler {
- ItemStack[] mGregtechTurbines = new ItemStack[6];
- String mTurbine;
- String mExtra;
-
- @SubscribeEvent
- public void onItemTooltip(ItemTooltipEvent event) {
-
- if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.STARTED
- && GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.SERVER_START) {
- return;
- }
- if (event.itemStack == null) {
- return;
- }
- if (CORE.ConfigSwitches.chanceToDropFluoriteOre > 0) {
- if (BlockEventHandler.blockLimestone != null && !BlockEventHandler.blockLimestone.isEmpty()) {
- for (ItemStack h : BlockEventHandler.blockLimestone) {
- if (h != null && Block.getBlockFromItem(h.getItem())
- == Block.getBlockFromItem(event.itemStack.getItem())) {
- if (ItemUtils.getModId(h) != null
- && !ItemUtils.getModId(h).toLowerCase().contains("biomesoplenty")) {
- event.toolTip.add("May contain Fluorite Ore");
- }
- }
- }
- }
- if (BlockEventHandler.oreLimestone != null && !BlockEventHandler.oreLimestone.isEmpty()) {
- for (ItemStack h : BlockEventHandler.oreLimestone) {
- if (h != null && Block.getBlockFromItem(h.getItem())
- == Block.getBlockFromItem(event.itemStack.getItem())) {
- if (ItemUtils.getModId(h) != null
- && !ItemUtils.getModId(h).toLowerCase().contains("biomesoplenty")) {
- event.toolTip.add("May contain Fluorite Ore");
- }
- }
- }
- }
- }
-
- // Material Collector Tooltips
- if (ModBlocks.blockPooCollector != null
- && Block.getBlockFromItem(event.itemStack.getItem()) == ModBlocks.blockPooCollector) {
- // Normal
- if (event.itemStack.getItemDamage() == 0) {
- event.toolTip.add("Used to collect animal waste");
- event.toolTip.add("Collects in a 5x4x5 area starting at Y+1");
- event.toolTip.add("Use Hoppers/Pipes to empty");
- event.toolTip.add(EnumChatFormatting.GOLD + "Capacity: " + EnumChatFormatting.AQUA + "8000L");
- }
- // Advanced
- else {
- event.toolTip.add("Used to collect waste (Works on more than animals)");
- event.toolTip.add("Significantly faster than the simple version");
- event.toolTip.add("Collects in a 5x4x5 area starting at Y+1");
- event.toolTip.add("Use Hoppers/Pipes to empty");
- event.toolTip.add(EnumChatFormatting.GOLD + "Capacity: " + EnumChatFormatting.AQUA + "128000L");
- }
- }
-
- // Custom Flasks
-
- if (GregtechItemList.VOLUMETRIC_FLASK_8k.hasBeenSet()
- && event.itemStack.getItem() == GregtechItemList.VOLUMETRIC_FLASK_8k.getItem()) {
- event.toolTip.add("Max Capacity: " + MathUtils.formatNumbers(8000) + "L");
- }
- if (GregtechItemList.VOLUMETRIC_FLASK_32k.hasBeenSet()
- && event.itemStack.getItem() == GregtechItemList.VOLUMETRIC_FLASK_32k.getItem()) {
- event.toolTip.add("Max Capacity: " + MathUtils.formatNumbers(32000) + "L");
- }
-
- if (Mods.AdvancedSolarPanel.isModLoaded()) {
- molecularTransformer(event);
- }
- }
-
@Optional.Method(modid = Mods.Names.ADVANCED_SOLAR_PANEL)
public static void molecularTransformer(ItemTooltipEvent event) {
if (event.itemStack.getItem() == Item.getItemFromBlock(AdvancedSolarPanel.blockMolecularTransformer)) {
diff --git a/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
index dbcd3be01b..05dc46b2b2 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
@@ -1,78 +1,12 @@
package gtPlusPlus.core.handler.events;
-import java.util.List;
-import java.util.UUID;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.ChunkPosition;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
-import net.minecraftforge.event.world.BlockEvent.BreakEvent;
-import net.minecraftforge.event.world.ExplosionEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.metatileentity.BaseMetaTileEntity;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines.GregtechMetaSafeBlockBase;
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) {
- if (entity instanceof BaseMetaTileEntity) {
- final EntityPlayer playerInternal = event.getPlayer();
- final IMetaTileEntity X = ((BaseMetaTileEntity) entity).getMetaTileEntity();
- if (X instanceof GregtechMetaSafeBlockBase) {
- final UUID ownerUUID = ((GregtechMetaSafeBlockBase) X).ownerUUID;
- final UUID accessorUUID = playerInternal.getUniqueID();
- if (((GregtechMetaSafeBlockBase) X).bUnbreakable) {
- if (accessorUUID == ownerUUID) {
- PlayerUtils.messagePlayer(
- playerInternal,
- "Since you own this block, it has been destroyed.");
- } else {
- PlayerUtils.messagePlayer(
- playerInternal,
- "Since you do not own this block, it has not been destroyed.");
- event.setCanceled(true);
- }
- }
- }
- }
- }
- } catch (final NullPointerException e) {
- // System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: "+e.getCause());
- }
- }
-
- @SubscribeEvent
- public void onExplode(ExplosionEvent.Detonate event) {
- try {
- @SuppressWarnings("unchecked")
- List<ChunkPosition> pos = event.explosion.affectedBlockPositions;
- for (int i = 0; i < pos.size(); i++) {
- ChunkPosition blockpos = (ChunkPosition) pos.get(i);
- TileEntity entity = event.world
- .getTileEntity(blockpos.chunkPosX, blockpos.chunkPosY, blockpos.chunkPosZ);
- if (entity != null) {
- if (entity instanceof BaseMetaTileEntity) {
- final IMetaTileEntity X = ((BaseMetaTileEntity) entity).getMetaTileEntity();
- if (X instanceof GregtechMetaSafeBlockBase) {
- pos.remove(i);
- }
- }
- }
- }
- } catch (final NullPointerException e) {
-
- }
- }
-
- @SubscribeEvent
public void onPlayerInteraction(final PlayerInteractEvent aEvent) {
if ((aEvent.entityPlayer != null) && (aEvent.entityPlayer.worldObj != null)
&& (aEvent.action != null)
diff --git a/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java
deleted file mode 100644
index 86736fe14b..0000000000
--- a/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package gtPlusPlus.core.handler.events;
-
-import java.lang.reflect.Field;
-
-import net.minecraftforge.event.entity.living.ZombieEvent;
-
-import org.apache.commons.lang3.reflect.FieldUtils;
-
-import cpw.mods.fml.common.eventhandler.Event.Result;
-import cpw.mods.fml.common.eventhandler.EventPriority;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import gtPlusPlus.api.objects.Logger;
-
-public class ZombieBackupSpawnEventHandler {
-
- /**
- *
- * Do we really need this pathetic mechanic to exist when it doesn't work properly at all?
- *
- */
- @SubscribeEvent(priority = EventPriority.HIGHEST)
- public void onZombieReinforcement(final ZombieEvent.SummonAidEvent event) {
- try {
- try {
- Field mChance = FieldUtils.getDeclaredField(this.getClass(), "summonChance", true);
- FieldUtils.removeFinalModifier(mChance, true);
- mChance.set(this, 0);
- } catch (Throwable t) {}
- if (event.attacker != null) {
- // SegmentHelper.getInstance().trackUser(event.attacker.getUniqueID().toString(), "Zombie Backup");
- }
- Logger.WARNING("[Zombie] ZombieEvent.SummonAidEvent.");
- event.setResult(Result.DENY);
- } catch (Throwable t) {}
- }
-
- @SubscribeEvent(priority = EventPriority.HIGHEST)
- public void onZombieReinforcement(final ZombieEvent event) {
- try {
- Logger.WARNING("[Zombie] ZombieEvent.");
- if (event.entity != null) {
- Logger.WARNING("Event Entity: " + event.entity.getCommandSenderName());
- }
- event.setResult(Result.DENY);
- } catch (Throwable t) {
-
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java b/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java
deleted file mode 100644
index e53ce25e3c..0000000000
--- a/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java
+++ /dev/null
@@ -1,118 +0,0 @@
-// Date: 20/12/2016 5:51:14 PM
-// Template version 1.1
-// Java generated by Techne
-// Keep in mind that you still need to fill in some blanks
-// - ZeuX
-
-package gtPlusPlus.core.handler.render;
-
-import net.minecraft.client.model.ModelBase;
-import net.minecraft.client.model.ModelRenderer;
-import net.minecraft.entity.Entity;
-
-import gtPlusPlus.core.lib.CORE;
-
-public class FirepitModel extends ModelBase {
-
- // fields
- ModelRenderer Side_A;
- ModelRenderer Side_B;
- ModelRenderer Side_C;
- ModelRenderer Side_D;
- ModelRenderer Log1;
- ModelRenderer Log2;
- ModelRenderer Log3;
- ModelRenderer Log4;
-
- public FirepitModel() {
- this.textureWidth = 16;
- this.textureHeight = 16;
-
- this.Side_A = new ModelRenderer(this, 0, 0);
- this.Side_A.addBox(0F, 0F, 0F, 12, 6, 1);
- this.Side_A.setRotationPoint(-6F, 18F, -6F);
- this.Side_A.setTextureSize(16, 16);
- this.Side_A.mirror = true;
- setRotation(this.Side_A, -0.3148822F, 0F, 0F);
- // Side_A.mirror = false;
-
- this.Side_B = new ModelRenderer(this, 0, 0);
- this.Side_B.addBox(0F, 0F, 0F, 12, 6, 1);
- this.Side_B.setRotationPoint(-6F, 18F, 6F);
- this.Side_B.setTextureSize(16, 16);
- this.Side_B.mirror = true;
- setRotation(this.Side_B, -0.3148822F, (CORE.PI / 2), 0F);
-
- this.Side_C = new ModelRenderer(this, 0, 0);
- this.Side_C.addBox(0F, 0F, 0F, 12, 6, 1);
- this.Side_C.setRotationPoint(6F, 18F, 6F);
- this.Side_C.setTextureSize(16, 16);
- this.Side_C.mirror = true;
- setRotation(this.Side_C, -0.3148822F, CORE.PI, 0F);
- // Side_C.mirror = false;
-
- this.Side_D = new ModelRenderer(this, 0, 0);
- this.Side_D.addBox(0F, 0F, 0F, 12, 6, 1);
- this.Side_D.setRotationPoint(6F, 18F, -6F);
- this.Side_D.setTextureSize(16, 16);
- this.Side_D.mirror = true;
- setRotation(this.Side_D, -0.3148822F, 4.712389F, 0F);
-
- this.Log1 = new ModelRenderer(this, 0, 10);
- this.Log1.addBox(0F, 0F, 0F, 14, 2, 2);
- this.Log1.setRotationPoint(4F, 10F, -4F);
- this.Log1.setTextureSize(16, 16);
- this.Log1.mirror = true;
- setRotation(this.Log1, 0F, 0F, (CORE.PI / 2));
-
- this.Log2 = new ModelRenderer(this, -2, 10);
- this.Log2.addBox(0F, 0F, 0F, 14, 2, 2);
- this.Log2.setRotationPoint(-4F, 10F, -4F);
- this.Log2.setTextureSize(16, 16);
- this.Log2.mirror = true;
- setRotation(this.Log2, (CORE.PI / 2), 0F, (CORE.PI / 2));
- // Log2.mirror = false;
-
- this.Log3 = new ModelRenderer(this, 0, 10);
- this.Log3.addBox(0F, 0F, 0F, 14, 2, 2);
- this.Log3.setRotationPoint(-4F, 10F, 4F);
- this.Log3.setTextureSize(16, 16);
- this.Log3.mirror = true;
- setRotation(this.Log3, CORE.PI, 0F, (CORE.PI / 2));
-
- this.Log4 = new ModelRenderer(this, -2, 10);
- this.Log4.addBox(0F, 0F, 0F, 14, 2, 2);
- this.Log4.setRotationPoint(4F, 10F, 4F);
- this.Log4.setTextureSize(16, 16);
- this.Log4.mirror = true;
- setRotation(this.Log4, 4.712389F, 0F, (CORE.PI / 2));
- // Log4.mirror = false;
- }
-
- @Override
- public void render(final Entity entity, final float f, final float f1, final float f2, final float f3,
- final float f4, final float f5) {
- super.render(entity, f, f1, f2, f3, f4, f5);
- this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
- this.Side_A.render(f5);
- this.Side_B.render(f5);
- this.Side_C.render(f5);
- this.Side_D.render(f5);
- this.Log1.render(f5);
- this.Log2.render(f5);
- this.Log3.render(f5);
- this.Log4.render(f5);
- }
-
- private static void setRotation(final ModelRenderer model, final float x, final float y, final float z) {
- model.rotateAngleX = x;
- model.rotateAngleY = y;
- model.rotateAngleZ = z;
- }
-
- @Override
- public void setRotationAngles(final float f, final float f1, final float f2, final float f3, final float f4,
- final float f5, final Entity entity) {
- super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java b/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java
deleted file mode 100644
index 0237047121..0000000000
--- a/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package gtPlusPlus.core.handler.render;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.OpenGlHelper;
-import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
-import net.minecraft.entity.Entity;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.world.World;
-
-import org.lwjgl.opengl.GL11;
-
-public class FirepitRender extends TileEntitySpecialRenderer {
-
- ResourceLocation texture = new ResourceLocation(GTPlusPlus.ID + ":" + "textures/blocks/FirePit/mossyFirepit.png");
-
- private final FirepitModel model;
-
- public FirepitRender() {
- this.model = new FirepitModel();
- }
-
- private void adjustRotatePivotViaMeta(final World world, final int x, final int y, final int z) {
- final int meta = world.getBlockMetadata(x, y, z);
- GL11.glPushMatrix();
- GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F);
- GL11.glPopMatrix();
- }
-
- @Override
- public void renderTileEntityAt(final TileEntity entity, final double x, final double y, final double z,
- final float i) {
- GL11.glPushMatrix();
- GL11.glTranslatef((float) x + 0.1F, (float) y + 1.0F, (float) z + 0.5F);
- GL11.glRotatef(180, 0F, 0F, 1F);
-
- this.bindTexture(this.texture);
- GL11.glPushMatrix();
- this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- GL11.glTranslatef(1.0f, 1.0f, 1.0f);
- GL11.glPopMatrix();
- GL11.glPopMatrix();
- }
-
- // Set the lighting stuff, so it changes it's brightness properly.
- private void adjustLightFixture(final World world, final int i, final int j, final int k, final Block block) {
- final Tessellator tess = Tessellator.instance;
- // float brightness = block.getBlockBrightness(world, i, j, k);
- // As of MC 1.7+ block.getBlockBrightness() has become block.getLightValue():
- final float brightness = block.getLightValue(world, i, j, k);
- final int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
- final int modulousModifier = skyLight % 65536;
- final int divModifier = skyLight / 65536;
- tess.setColorOpaque_F(brightness, brightness, brightness);
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java b/src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java
deleted file mode 100644
index f4a632a6fc..0000000000
--- a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java
+++ /dev/null
@@ -1,215 +0,0 @@
-package gtPlusPlus.core.inventories;
-
-import java.util.UUID;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraftforge.common.util.Constants;
-
-import gtPlusPlus.core.item.base.BaseItemBackpack;
-
-public class BaseInventoryBackpack implements IInventory {
-
- private final String name = "Inventory Item";
-
- /** Provides NBT Tag Compound to reference */
- private final ItemStack invItem;
-
- /** 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 final ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- // declaration of variable:
- protected String uniqueID;
-
- /**
- * @param stack - the ItemStack to which this inventory belongs
- */
- public BaseInventoryBackpack(final ItemStack stack) {
- this.invItem = stack;
-
- /** initialize variable within the constructor: */
- this.uniqueID = "";
-
- 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
- if (!stack.hasTagCompound()) {
- stack.setTagCompound(new NBTTagCompound());
- }
- // note that it's okay to use stack instead of invItem right there
- // both reference the same memory location, so whatever you change using
- // either reference will change in the other
-
- // Read the inventory contents from NBT
- this.readFromNBT(stack.getTagCompound());
- }
-
- @Override
- public int getSizeInventory() {
- return this.inventory.length;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
- }
-
- @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);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- } else {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @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();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName() {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
- }
-
- @Override
- 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.
- */
- // 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;
- }
- }
-
- // This line here does the work:
- this.writeToNBT(this.invItem.getTagCompound());
- }
-
- @Override
- public boolean isUseableByPlayer(final 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
- */
- @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);
- }
-
- /**
- * A custom method to read our inventory from an ItemStack's NBT compound
- */
- public void readFromNBT(final 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)) {
- // try to read unique ID from NBT
- this.uniqueID = compound.getString("uniqueID");
- // if it's still "", assign a new one:
- if ("".equals(this.uniqueID)) {
- this.uniqueID = UUID.randomUUID().toString();
- }
- }
-
- 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");
-
- // 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);
- }
- }
- }
-
- /**
- * A custom method to write our inventory to an ItemStack's NBT compound
- */
- public void writeToNBT(final NBTTagCompound tagcompound) {
- // Create a new NBT Tag List to store itemstacks as NBT Tags
- final NBTTagList items = new NBTTagList();
-
- for (int i = 0; i < this.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();
- item.setInteger("Slot", i);
- // Writes the itemstack in slot(i) to the Tag Compound we just made
- this.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"
- tagcompound.setTag("ItemInventory", items);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java b/src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java
deleted file mode 100644
index 5692612d5f..0000000000
--- a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java
+++ /dev/null
@@ -1,219 +0,0 @@
-package gtPlusPlus.core.inventories;
-
-import java.util.UUID;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraftforge.common.util.Constants;
-
-import gtPlusPlus.core.item.base.BaseItemBackpack;
-
-public class BaseInventoryGrindle implements IInventory {
-
- private final String name = "Inventory Item";
-
- /** Provides NBT Tag Compound to reference */
- private final ItemStack invItem;
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 6;
-
- /**
- * Inventory's size must be same as number of slots you add to the Container class
- */
- private final ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- // declaration of variable:
- protected String uniqueID;
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public BaseInventoryGrindle(final ItemStack stack) {
- this.invItem = stack;
-
- /** initialize variable within the constructor: */
- this.uniqueID = "";
-
- 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
- if (!stack.hasTagCompound()) {
- stack.setTagCompound(new NBTTagCompound());
- }
- // note that it's okay to use stack instead of invItem right there
- // both reference the same memory location, so whatever you change using
- // either reference will change in the other
-
- // Read the inventory contents from NBT
- this.readFromNBT(stack.getTagCompound());
- }
-
- @Override
- public int getSizeInventory() {
- return this.inventory.length;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
- }
-
- @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);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- } else {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @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();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName() {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
- }
-
- @Override
- 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.
- */
- // 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;
- }
- }
-
- // This line here does the work:
- this.writeToNBT(this.invItem.getTagCompound());
- }
-
- @Override
- public boolean isUseableByPlayer(final 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
- */
- @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);
- }
-
- /**
- * A custom method to read our inventory from an ItemStack's NBT compound
- */
- public void readFromNBT(final 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)) {
- // try to read unique ID from NBT
- this.uniqueID = compound.getString("uniqueID");
- // if it's still "", assign a new one:
- if ("".equals(this.uniqueID)) {
- this.uniqueID = UUID.randomUUID().toString();
- }
- }
-
- 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");
-
- // 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);
- }
- }
- }
-
- /**
- * A custom method to write our inventory to an ItemStack's NBT compound
- */
- public void writeToNBT(final NBTTagCompound tagcompound) {
- // Create a new NBT Tag List to store itemstacks as NBT Tags
- final NBTTagList items = new NBTTagList();
-
- for (int i = 0; i < this.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();
- item.setInteger("Slot", i);
- // Writes the itemstack in slot(i) to the Tag Compound we just made
- this.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"
- tagcompound.setTag("ItemInventory", items);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java b/src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java
deleted file mode 100644
index fb9b481f88..0000000000
--- a/src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package gtPlusPlus.core.inventories;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-
-public class InventoryHeliumGenerator implements IInventory {
-
- private final String name = "Helium";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 19;
-
- /** Inventory's size must be same as number of slots you add to the Container class */
- private ItemStack[] inventory = new ItemStack[INV_SIZE];
-
- public void readFromNBT(final NBTTagCompound nbt) {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[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 < INV_SIZE)) {
- // Utils.LOG_INFO("Trying to read NBT data from inventory.");
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt) {
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < INV_SIZE; i++) {
- final ItemStack stack = this.inventory[i];
- if (stack != null) {
- // Utils.LOG_INFO("Trying to write NBT data to inventory.");
- final NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
- }
- }
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getSizeInventory() {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory() {
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
- }
-
- @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);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- } else {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @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();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName() {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
- }
-
- @Override
- 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.
- */
- // 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);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final 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
- */
- @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;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java b/src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java
deleted file mode 100644
index 0593bdd237..0000000000
--- a/src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package gtPlusPlus.core.inventories.box;
-
-import net.minecraft.item.ItemStack;
-
-import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
-import gtPlusPlus.core.slots.SlotLunchBox;
-
-public class LunchBoxInventory extends CustomBoxInventory {
-
- public LunchBoxInventory(ItemStack stack) {
- super(stack, "Lunch Box", gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS);
- }
-
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
- return SlotLunchBox.isItemValid_STATIC(itemstack);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java b/src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java
deleted file mode 100644
index 6e47fb0d3c..0000000000
--- a/src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package gtPlusPlus.core.inventories.box;
-
-import net.minecraft.item.ItemStack;
-
-import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
-import gtPlusPlus.core.slots.SlotMagicToolBag;
-
-public class MagicBagInventory extends CustomBoxInventory {
-
- public MagicBagInventory(ItemStack stack) {
- super(stack, "Mystic Bag", gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS);
- }
-
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
- return SlotMagicToolBag.isItemValid_STATIC(itemstack);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java b/src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java
deleted file mode 100644
index 0c0d381c4c..0000000000
--- a/src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package gtPlusPlus.core.inventories.box;
-
-import net.minecraft.item.ItemStack;
-
-import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory;
-import gtPlusPlus.core.item.tool.misc.box.UniversalToolBox;
-import gtPlusPlus.core.slots.SlotToolBox;
-
-public class ToolBoxInventory extends CustomBoxInventory {
-
- public ToolBoxInventory(ItemStack stack) {
- super(stack, "Tool Box", UniversalToolBox.SLOTS);
- }
-
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
- return SlotToolBox.isItemValid_STATIC(itemstack);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java b/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java
deleted file mode 100644
index 0168a5cfdf..0000000000
--- a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java
+++ /dev/null
@@ -1,175 +0,0 @@
-package gtPlusPlus.core.inventories.modulartable;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
-
-public class InventoryModularMain implements IInventory {
-
- private final String name = "Inventory Grid";
-
- /** 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[INV_SIZE];
-
- /**
- * @param itemstack - the ItemStack to which this inventory belongs
- */
- public InventoryModularMain() {}
-
- public void readFromNBT(final NBTTagCompound nbt) {
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[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 < INV_SIZE)) {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt) {
- final NBTTagList list = new NBTTagList();
- for (int i = 0; i < 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);
- }
-
- @Override
- public int getSizeInventory() {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory() {
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- // Utils.LOG_INFO("getStackInSlot["+slot+"]");
- try {
- if (slot >= this.inventory.length) {
- // Utils.LOG_INFO("Returning invalid slot item.");
- return null;
- }
- return this.inventory[slot];
- } catch (Throwable t) {
- t.printStackTrace();
- return null;
- }
- }
-
- @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);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- } else {
- // this method also calls markDirty, so we don't need to call it again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- if (slot >= this.inventory.length) {
- return;
- }
- 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();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName() {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
- }
-
- @Override
- 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.
- */
- // 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);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final 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
- */
- @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 TileEntityModularityTable.isValidUpgrade(itemstack);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java b/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java
deleted file mode 100644
index a1dddd09bd..0000000000
--- a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java
+++ /dev/null
@@ -1,185 +0,0 @@
-package gtPlusPlus.core.inventories.modulartable;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
-
-public class InventoryModularOutput implements IInventory {
-
- private final String name = "Inventory Output";
-
- /** Defining your inventory size this way is handy */
- public static final int INV_SIZE = 3;
-
- private int mRecpeTime = -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
- */
- public InventoryModularOutput() {}
-
- public void readFromNBT(final NBTTagCompound nbt) {
- if (this.mRecpeTime > -1) {
- nbt.setInteger("mRecipeTime", this.mRecpeTime);
- }
- final NBTTagList list = nbt.getTagList("Items", 10);
- this.inventory = new ItemStack[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 < INV_SIZE)) {
- this.inventory[slot] = ItemStack.loadItemStackFromNBT(data);
- }
- }
- }
-
- public void writeToNBT(final NBTTagCompound nbt) {
- final NBTTagList list = new NBTTagList();
- if (nbt.hasKey("mRecipeTime")) {
- this.mRecpeTime = nbt.getInteger("mRecipeTime");
- }
- for (int i = 0; i < 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);
- }
-
- public int setRecipeTime(int mTime) {
- return (this.mRecpeTime = mTime);
- }
-
- public int getRecipeTime() {
- return this.mRecpeTime;
- }
-
- @Override
- public int getSizeInventory() {
- return this.inventory.length;
- }
-
- public ItemStack[] getInventory() {
- return this.inventory;
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.inventory[slot];
- }
-
- @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);
- // Don't forget this line or your inventory will not be saved!
- this.markDirty();
- } else {
- // this method also calls markDirty, so we don't need to call it
- // again
- this.setInventorySlotContents(slot, null);
- }
- }
- return stack;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- final ItemStack stack = this.getStackInSlot(slot);
- this.setInventorySlotContents(slot, null);
- return stack;
- }
-
- @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();
- }
-
- // 1.7.2+ renamed to getInventoryName
- @Override
- public String getInventoryName() {
- return this.name;
- }
-
- // 1.7.2+ renamed to hasCustomInventoryName
- @Override
- public boolean hasCustomInventoryName() {
- return this.name.length() > 0;
- }
-
- @Override
- 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.
- */
- // 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);
- }
-
- if ((temp != null) && (temp.stackSize == 0)) {
- this.inventory[i] = null;
- }
- }
- }
-
- @Override
- public boolean isUseableByPlayer(final 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
- */
- @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 (slot == 0) {
- return TileEntityModularityTable.isValidUpgrade(itemstack);
- }
- return TileEntityModularityTable.isValidModularPiece(itemstack);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java
index 558353ddb3..45dc15b3f2 100644
--- a/src/main/java/gtPlusPlus/core/item/ModItems.java
+++ b/src/main/java/gtPlusPlus/core/item/ModItems.java
@@ -1,22 +1,15 @@
package gtPlusPlus.core.item;
-import static gregtech.api.enums.Mods.Baubles;
-import static gregtech.api.enums.Mods.EnderIO;
import static gregtech.api.enums.Mods.Forestry;
import static gregtech.api.enums.Mods.GTPlusPlus;
import static gregtech.api.enums.Mods.GregTech;
import static gregtech.api.enums.Mods.Thaumcraft;
-import static gtPlusPlus.core.creative.AddToCreativeTab.tabMachines;
import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc;
-import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT;
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 net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
@@ -31,55 +24,37 @@ import gtPlusPlus.core.block.base.BasicBlock.BlockTypes;
import gtPlusPlus.core.block.base.BlockBaseModular;
import gtPlusPlus.core.common.compat.COMPAT_Baubles;
import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.BaseEuItem;
-import gtPlusPlus.core.item.base.BaseItemBackpack;
import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes;
import gtPlusPlus.core.item.base.BaseItemDamageable;
import gtPlusPlus.core.item.base.BaseItemTCShard;
import gtPlusPlus.core.item.base.CoreItem;
import gtPlusPlus.core.item.base.dusts.BaseItemDust;
import gtPlusPlus.core.item.base.foil.BaseItemFoil;
-import gtPlusPlus.core.item.base.foods.BaseItemFood;
-import gtPlusPlus.core.item.base.foods.BaseItemHotFood;
import gtPlusPlus.core.item.base.gears.BaseItemSmallGear;
import gtPlusPlus.core.item.base.ingots.BaseItemIngot;
import gtPlusPlus.core.item.base.ingots.BaseItemIngot_OLD;
-import gtPlusPlus.core.item.base.misc.BaseItemMisc;
-import gtPlusPlus.core.item.base.misc.BaseItemMisc.MiscTypes;
import gtPlusPlus.core.item.base.plates.BaseItemPlate;
import gtPlusPlus.core.item.base.plates.BaseItemPlateDouble;
import gtPlusPlus.core.item.bauble.BatteryPackBaseBauble;
-import gtPlusPlus.core.item.bauble.HealthBoostBauble;
-import gtPlusPlus.core.item.bauble.ModularBauble;
-import gtPlusPlus.core.item.bauble.MonsterKillerBaseBauble;
import gtPlusPlus.core.item.chemistry.AgriculturalChem;
import gtPlusPlus.core.item.chemistry.CoalTar;
import gtPlusPlus.core.item.chemistry.GenericChem;
import gtPlusPlus.core.item.chemistry.IonParticles;
import gtPlusPlus.core.item.chemistry.MilledOreProcessing;
-import gtPlusPlus.core.item.chemistry.NuclearChem;
import gtPlusPlus.core.item.chemistry.RocketFuels;
import gtPlusPlus.core.item.chemistry.StandardBaseParticles;
import gtPlusPlus.core.item.crafting.ItemDummyResearch;
import gtPlusPlus.core.item.food.BaseItemMetaFood;
-import gtPlusPlus.core.item.general.BaseItemGrindle;
import gtPlusPlus.core.item.general.BufferCore;
import gtPlusPlus.core.item.general.ItemAirFilter;
-import gtPlusPlus.core.item.general.ItemAreaClear;
-import gtPlusPlus.core.item.general.ItemBasicFirestarter;
import gtPlusPlus.core.item.general.ItemBasicScrubberTurbine;
import gtPlusPlus.core.item.general.ItemBlueprint;
-import gtPlusPlus.core.item.general.ItemControlCore;
import gtPlusPlus.core.item.general.ItemEmpty;
-import gtPlusPlus.core.item.general.ItemGemShards;
import gtPlusPlus.core.item.general.ItemGenericToken;
-import gtPlusPlus.core.item.general.ItemGiantEgg;
import gtPlusPlus.core.item.general.ItemHalfCompleteCasings;
import gtPlusPlus.core.item.general.ItemLavaFilter;
import gtPlusPlus.core.item.general.ItemMagicFeather;
-import gtPlusPlus.core.item.general.ItemSunnariumBit;
import gtPlusPlus.core.item.general.books.ItemBaseBook;
-import gtPlusPlus.core.item.general.capture.ItemEntityCatcher;
import gtPlusPlus.core.item.general.chassis.ItemBoilerChassis;
import gtPlusPlus.core.item.general.chassis.ItemDehydratorCoil;
import gtPlusPlus.core.item.general.chassis.ItemDehydratorCoilWire;
@@ -91,14 +66,6 @@ import gtPlusPlus.core.item.init.ItemsFoods;
import gtPlusPlus.core.item.materials.DustDecayable;
import gtPlusPlus.core.item.tool.misc.DebugScanner;
import gtPlusPlus.core.item.tool.misc.GregtechPump;
-import gtPlusPlus.core.item.tool.misc.SandstoneHammer;
-import gtPlusPlus.core.item.tool.misc.box.AutoLunchBox;
-import gtPlusPlus.core.item.tool.misc.box.MagicToolBag;
-import gtPlusPlus.core.item.tool.misc.box.UniversalToolBox;
-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.item.wearable.WearableLoader;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.CORE.ConfigSwitches;
@@ -118,112 +85,34 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.everglades.GTplusplus_Everglades;
-import gtPlusPlus.xmod.cofh.HANDLER_COFH;
-import gtPlusPlus.xmod.eio.material.MaterialEIO;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.helpers.VolumetricFlaskHelper;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
public final class ModItems {
- public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18);
-
public static Item ZZZ_Empty;
public static Item AAA_Broken;
public static Item itemAlkalusDisk;
- public static Item itemDebugShapeSpawner;
public static ItemCustomSpawnEgg itemCustomSpawnEgg;
- // 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;
- public static Item itemDustSoularium;
- public static Item itemDustRedstoneAlloy;
- public static Item itemDustElectricalSteel;
- public static Item itemDustPulsatingIron;
- public static Item itemDustEnergeticAlloy;
- public static Item itemDustVibrantAlloy;
- public static Item itemDustConductiveIron;
-
- // 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 itemHydrogenBlob;
- 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 Item itemPersonalFireProofDevice;
public static Item itemSlowBuildingRing;
- public static MultiPickaxeBase MP_GTMATERIAL;
- public static MultiSpadeBase MS_GTMATERIAL;
-
- 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 dustUranium232;
- public static Item dustUraniumTetraFluoride;
- public static Item dustUraniumHexaFluoride;
-
- public static Item dustBerylliumFluoride;
public static Item dustQuicklime;
public static Item dustCalciumHydroxide;
@@ -240,45 +129,20 @@ public final class ModItems {
public static Item cellHydrogenChlorideMix;
- public static BaseEuItem metaItem2;
-
public static Item shardAer;
public static Item shardIgnis;
public static Item shardTerra;
public static Item shardAqua;
- // Tc Compat for energy crystal recipes
- public static Item shardDull;
-
- // Lighter
- public static Item itemBasicFireMaker;
-
// Zirconium
public static Item itemZirconiumChlorideCinterPellet;
public static Item dustZrCl4;
public static Item dustCookedZrCl4;
- public static Item dustZrF4;
-
- public static Item dustNaBF4NaF;
- public static Item dustLiFBeF2ZrF4UF4;
- public static Item dustLiFBeF2ZrF4U235;
- public static Item dustLiFBeF2ThF4UF4;
public static Item dustCalciumSulfate;
public static Item dustFertUN18;
public static Item dustFertUN32;
-
- // public static Fluid fluidFLiBeSalt;
- // public static Fluid fluidFLiBeSaltBurnt;
-
- public static Fluid fluidLftrCore1;
- public static Fluid fluidLftrCore2;
- public static Fluid fluidLftrCore3;
- public static Fluid fluidLftrCore4;
- public static Fluid fluidLftrBlanket1;
- public static Fluid fluidLftrBlanket2;
- public static Fluid fluidLftrBlanket3;
public static Fluid fluidNuclearWaste;
// Possibly missing base items that GT may be missing.
@@ -311,38 +175,23 @@ public final class ModItems {
public static Item itemCircuitLFTR;
public static Item itemBasicTurbine;
- public static Item itemDebugAreaClear;
-
- public static Item itemGemShards;
public static Item itemHalfCompleteCasings;
public static Item itemSulfuricPotion;
public static Item itemHydrofluoricPotion;
- public static Item itemModularBauble;
public static Item itemCustomBook;
- public static Item itemGrindleTablet;
- public static Item itemRope;
- public static Item itemFiber;
- public static Item itemDragonJar;
-
// Unstable Elements & Related Content
public static Item dustNeptunium238;
public static Item dustDecayedRadium226;
public static Item dustRadium226;
public static Item dustProtactinium233;
- public static ItemGiantEgg itemBigEgg;
-
public static GregtechPump toolGregtechPump;
public static ItemGenericToken itemGenericToken;
- public static Item itemControlCore;
-
- public static Item itemSunnariumBit;
-
public static ItemStack itemHotTitaniumIngot;
public static Fluid fluidZrF4;
@@ -350,10 +199,6 @@ public final class ModItems {
public static Fluid fluidFertUN32;
public static Fluid fluidFertUN18;
- public static Item boxTools;
- public static Item boxFood;
- public static Item boxMagic;
-
public static DustDecayable dustMolybdenum99;
public static DustDecayable dustTechnetium99;
public static DustDecayable dustTechnetium99M;
@@ -380,17 +225,6 @@ public final class ModItems {
public static CoreItem itemDetCable;
public static ItemThrowableBomb itemBomb;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Zombie;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Skeleton;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Spider;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Creeper;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Enderman;
-
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Nether;
- public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Infernal;
-
- public static CoreItem itemExquisiteIndustrialDiamond;
-
public static BaseItemMetaFood itemMetaFood;
public static ItemMagicFeather itemMagicFeather;
@@ -407,7 +241,7 @@ public final class ModItems {
ZZZ_Empty = new ItemEmpty();
}
- public static final void init() {
+ public static void init() {
itemDebugScanner = new DebugScanner();
itemMagicFeather = new ItemMagicFeather();
@@ -422,80 +256,24 @@ public final class ModItems {
EnumChatFormatting.AQUA,
false,
null);
- itemBigEgg = new ItemGiantEgg();
+
itemGenericToken = new ItemGenericToken();
itemDummyResearch = new ItemDummyResearch();
itemCustomSpawnEgg = new ItemCustomSpawnEgg();
- itemDebugAreaClear = new ItemAreaClear();
-
// Register meta item, because we need them for everything.
MetaGeneratedGregtechItems.INSTANCE.generateMetaItems();
- // Some Simple forms of materials
- itemStickyRubber = new Item().setUnlocalizedName("itemStickyRubber").setCreativeTab(tabMachines)
- .setTextureName(GTPlusPlus.ID + ":itemStickyRubber");
- GameRegistry.registerItem(itemStickyRubber, "itemStickyRubber");
- GT_OreDictUnificator
- .registerOre("ingotRubber", ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemStickyRubber", 1));
-
// Register Hydrogen Blobs first, so we can replace old helium blobs.
itemHydrogenBlob = new CoreItem("itemHydrogenBlob", "Mysterious Hydrogen Blob", tabMisc)
.setTextureName(GTPlusPlus.ID + ":itemHeliumBlob");
// Register Old Helium Blob, this will be replaced when held by a player.
- itemHeliumBlob = new CoreItem("itemHeliumBlob", tabMisc, ItemUtils.getSimpleStack(itemHydrogenBlob))
- .setTextureName(GTPlusPlus.ID + ":itemHydrogenBlob");
-
- // Register this neato device, for making some fires.
- itemBasicFireMaker = new ItemBasicFirestarter();
-
- // Register Rope
- itemFiber = new CoreItem("itemFiber", "Plant Fiber", tabMisc);
- itemRope = new CoreItem("itemRope", "Rope", tabMisc);
// Load Wearable Items
WearableLoader.run();
- // 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));
-
- // Load Custom Box/bags
- boxTools = new UniversalToolBox("Tool Box");
- boxFood = new AutoLunchBox("Eatotron-9000");
- boxMagic = new MagicToolBag("Mystic Bag");
-
itemBlueprintBase = new ItemBlueprint("itemBlueprint");
- itemGemShards = new ItemGemShards(
- "itemGemShards",
- "Gem Shards",
- AddToCreativeTab.tabMisc,
- 32,
- 0,
- "They glitter in the light",
- EnumRarity.rare,
- EnumChatFormatting.GRAY,
- false,
- Utils.rgbtoHexValue(182, 114, 18)).setTextureName(GTPlusPlus.ID + ":itemHeliumBlob");
itemHalfCompleteCasings = new ItemHalfCompleteCasings(
"itemHalfCompleteCasings",
AddToCreativeTab.tabMisc,
@@ -540,20 +318,13 @@ public final class ModItems {
MaterialGenerator.generate(ELEMENT.getInstance().THALLIUM);
// RADIOACTIVE ELEMENTS
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().TECHNETIUM, false); // LFTR byproduct
MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().POLONIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().ASTATINE, false);
// MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().RADON, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().FRANCIUM, false);
MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().RADIUM, false);
MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PROMETHIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().ACTINIUM, false);
MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PROTACTINIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().NEPTUNIUM, false); // LFTR byproduct
MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().CURIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().BERKELIUM, false);
MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().CALIFORNIUM, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().EINSTEINIUM, false);
MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().FERMIUM, false);
// Nuclear Isotopes
@@ -580,18 +351,12 @@ public final class ModItems {
// and radioisotope heater units - one gram of plutonium-238 generates approximately 0.5 W of thermal power.
MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PLUTONIUM238, false);
- // RTG Fuel Materials
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().STRONTIUM90, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().POLONIUM210, false);
- MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().AMERICIUM241, false);
-
// Custom Materials that will have standalone refinery processes
MaterialGenerator.generate(ELEMENT.STANDALONE.ADVANCED_NITINOL, false);
MaterialGenerator.generate(ELEMENT.STANDALONE.ASTRAL_TITANIUM);
MaterialGenerator.generate(ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
MaterialGenerator.generate(ELEMENT.STANDALONE.HYPOGEN);
MaterialGenerator.generate(ELEMENT.STANDALONE.CHRONOMATIC_GLASS);
- MaterialGenerator.generate(ELEMENT.STANDALONE.FORCE);
// Custom Materials that are from Runescape
MaterialGenerator.generate(ELEMENT.STANDALONE.BLACK_METAL);
@@ -739,21 +504,9 @@ public final class ModItems {
} catch (final Throwable r) {
Logger.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);
}
- // TC Style Shards, for use in making energy crystal mix.
- // A dull shard, able to be infused with an element.
- shardDull = new BaseItemTCShard(
- "Drained",
- Utils.rgbtoHexValue(75, 75, 75),
- new String[] { "Can be infused to create a magical shard.",
- "Obtained from Mining Stone/SandStone, Chopping Logs or Shovelling Dirt." });
-
// Generates four elemental shards when TC is not installed.
if (!Thaumcraft.isModLoaded()) {
shardAer = new BaseItemTCShard("Aer", Utils.rgbtoHexValue(225, 225, 5));
@@ -985,30 +738,6 @@ public final class ModItems {
true);
// Test items
- 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);
-
toolGregtechPump = new GregtechPump();
toolGregtechPump.registerPumpType(0, "Simple Hand Pump", 0, 0);
toolGregtechPump.registerPumpType(1, "Advanced Hand Pump", 32000, 1);
@@ -1023,21 +752,6 @@ public final class ModItems {
FluidUtils.generateFluidNoPrefix("xpjuice", "xpjuice", 0, new short[] { 50, 150, 50, 100 });
}
- // Industrial Diamonds
- itemExquisiteIndustrialDiamond = new CoreItem(
- "IndustrialDiamondExquisite",
- "High Quality Industrial Diamond",
- tabMisc);
- ItemStack tempStack = itemExquisiteIndustrialDiamond.getStack();
- ItemUtils.addItemToOreDictionary(tempStack, "gemDiamond");
- ItemUtils.addItemToOreDictionary(tempStack, "craftingIndustrialDiamond");
- ItemUtils.addItemToOreDictionary(tempStack, "gemExquisiteDiamond");
- ItemUtils.addItemToOreDictionary(tempStack, "craftingExquisiteIndustrialDiamond");
-
- /*
- * Decayable Materials
- */
-
dustNeptunium238 = new DustDecayable(
"dustNeptunium238",
Utils.rgbtoHexValue(175, 240, 75),
@@ -1067,22 +781,6 @@ public final class ModItems {
"Result: Uranium 233(" + StringUtils.superscript("233U") + ")" },
ELEMENT.getInstance().URANIUM233.getDust(1).getItem(),
6);
- dustTechnetium99 = new DustDecayable(
- "dustTechnetium99",
- ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(),
- 164500,
- new String[] { "" + StringUtils.superscript("99Tc"),
- "Result: Ruthenium 99(" + StringUtils.superscript("99Ru") + ")" },
- ELEMENT.getInstance().RUTHENIUM.getDust(1).getItem(),
- 4);
- dustTechnetium99M = new DustDecayable(
- "dustTechnetium99M",
- ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(),
- 8570,
- new String[] { "" + StringUtils.superscript("99ᵐTc"),
- "Result: Technicium 99 (" + StringUtils.superscript("99Tc") + ")" },
- dustTechnetium99,
- 4);
dustMolybdenum99 = new DustDecayable(
"dustMolybdenum99",
ELEMENT.getInstance().MOLYBDENUM.getRgbAsHex(),
@@ -1108,20 +806,10 @@ public final class ModItems {
itemAirFilter = new ItemAirFilter();
itemLavaFilter = new ItemLavaFilter();
- itemGrindleTablet = new BaseItemGrindle();
- itemDragonJar = new ItemEntityCatcher();
-
- itemControlCore = new ItemControlCore();
-
- itemSunnariumBit = new ItemSunnariumBit();
-
// Chemistry
new CoalTar();
new RocketFuels();
- // Nuclear Processing
- new NuclearChem();
-
// Farm Animal Fun
new AgriculturalChem();
@@ -1140,135 +828,6 @@ public final class ModItems {
itemDetCable.setTextureName("string");
itemBomb = new ItemThrowableBomb();
- // Misc Items
- @SuppressWarnings("unused")
- Item tI;
- tI = new BaseItemMisc("Chilly", new short[] { 0, 64, 196 }, 32, MiscTypes.POTION, new String[] { "It's Blue" });
- tI = new BaseItemMisc(
- "4000DC's",
- new short[] { 180, 100, 30 },
- 1,
- MiscTypes.BIGKEY,
- new String[] { "It opens things." });
- tI = new BaseItemMisc("Dull", new short[] { 64, 64, 64 }, 64, MiscTypes.GEM, null);
- tI = new BaseItemMisc(
- "Forest",
- new short[] { 130, 164, 96 },
- 64,
- MiscTypes.MUSHROOM,
- new String[] { "You Found this on the ground.", "Definitely not sure if it's worth eating." });
-
- // Baubles
- if (Baubles.isModLoaded()) {
- tI = new HealthBoostBauble();
- itemModularBauble = new ModularBauble();
- }
-
- // EnderIO Resources
- if ((EnderIO.isModLoaded() || LOAD_ALL_CONTENT)) {
- Logger.INFO("EnderIO Found - Loading Resources.");
- // Enderio Dusts
- itemDustSoularium = ItemUtils.generateSpecialUseDusts(
- "Soularium",
- "Soularium",
- MaterialEIO.SOULARIUM.vChemicalFormula,
- MaterialEIO.SOULARIUM.getRgbAsHex())[0];
- itemDustRedstoneAlloy = ItemUtils.generateSpecialUseDusts(
- "RedstoneAlloy",
- "Redstone Alloy",
- MaterialEIO.REDSTONE_ALLOY.vChemicalFormula,
- MaterialEIO.REDSTONE_ALLOY.getRgbAsHex())[0];
- itemDustElectricalSteel = ItemUtils.generateSpecialUseDusts(
- "ElectricalSteel",
- "Electrical Steel",
- MaterialEIO.ELECTRICAL_STEEL.vChemicalFormula,
- MaterialEIO.ELECTRICAL_STEEL.getRgbAsHex())[0];
- itemDustPulsatingIron = ItemUtils.generateSpecialUseDusts(
- "PulsatingIron",
- "Pulsating Iron",
- MaterialEIO.PULSATING_IRON.vChemicalFormula,
- MaterialEIO.PULSATING_IRON.getRgbAsHex())[0];
- itemDustEnergeticAlloy = ItemUtils.generateSpecialUseDusts(
- "EnergeticAlloy",
- "Energetic Alloy",
- MaterialEIO.ENERGETIC_ALLOY.vChemicalFormula,
- MaterialEIO.ENERGETIC_ALLOY.getRgbAsHex())[0];
- itemDustVibrantAlloy = ItemUtils.generateSpecialUseDusts(
- "VibrantAlloy",
- "Vibrant Alloy",
- MaterialEIO.VIBRANT_ALLOY.vChemicalFormula,
- MaterialEIO.VIBRANT_ALLOY.getRgbAsHex())[0];
- itemDustConductiveIron = ItemUtils.generateSpecialUseDusts(
- "ConductiveIron",
- "Conductive Iron",
- MaterialEIO.CONDUCTIVE_IRON.vChemicalFormula,
- MaterialEIO.CONDUCTIVE_IRON.getRgbAsHex())[0];
-
- // EnderIO Plates
- itemPlateSoularium = ItemUtils.generateSpecialUsePlate(
- "Soularium",
- "Soularium",
- MaterialEIO.SOULARIUM.vChemicalFormula,
- MaterialEIO.SOULARIUM.getRgbAsHex(),
- 0);
- itemPlateRedstoneAlloy = ItemUtils.generateSpecialUsePlate(
- "RedstoneAlloy",
- "Redstone Alloy",
- MaterialEIO.REDSTONE_ALLOY.vChemicalFormula,
- MaterialEIO.REDSTONE_ALLOY.getRgbAsHex(),
- 0);
- itemPlateElectricalSteel = ItemUtils.generateSpecialUsePlate(
- "ElectricalSteel",
- "Electrical Steel",
- MaterialEIO.ELECTRICAL_STEEL.vChemicalFormula,
- MaterialEIO.ELECTRICAL_STEEL.getRgbAsHex(),
- 0);
- itemPlatePulsatingIron = ItemUtils.generateSpecialUsePlate(
- "PhasedIron",
- "Phased Iron",
- MaterialEIO.PULSATING_IRON.vChemicalFormula,
- MaterialEIO.PULSATING_IRON.getRgbAsHex(),
- 0);
- itemPlateEnergeticAlloy = ItemUtils.generateSpecialUsePlate(
- "EnergeticAlloy",
- "Energetic Alloy",
- MaterialEIO.ENERGETIC_ALLOY.vChemicalFormula,
- MaterialEIO.ENERGETIC_ALLOY.getRgbAsHex(),
- 0);
- itemPlateVibrantAlloy = ItemUtils.generateSpecialUsePlate(
- "VibrantAlloy",
- "Vibrant Alloy",
- MaterialEIO.VIBRANT_ALLOY.vChemicalFormula,
- MaterialEIO.VIBRANT_ALLOY.getRgbAsHex(),
- 0);
- itemPlateConductiveIron = ItemUtils.generateSpecialUsePlate(
- "ConductiveIron",
- "Conductive Iron",
- MaterialEIO.CONDUCTIVE_IRON.vChemicalFormula,
- MaterialEIO.CONDUCTIVE_IRON.getRgbAsHex(),
- 0);
-
- // Register odd naming conventions.
- GT_OreDictUnificator.registerOre("dustPhasedGold", ItemUtils.getSimpleStack(itemDustVibrantAlloy));
- GT_OreDictUnificator.registerOre("platePhasedGold", ItemUtils.getSimpleStack(itemPlateVibrantAlloy));
- GT_OreDictUnificator.registerOre("dustPhasedIron", ItemUtils.getSimpleStack(itemDustPulsatingIron));
- GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron));
- GT_OreDictUnificator
- .registerOre("blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1));
-
- } else {
- /*
- * Logger.WARNING("EnderIO not Found - Generating our own Resources.");
- * MaterialGenerator.generate(MaterialEIO.CONDUCTIVE_IRON);
- * MaterialGenerator.generate(MaterialEIO.PULSATING_IRON);
- * MaterialGenerator.generate(MaterialEIO.REDSTONE_ALLOY);
- * MaterialGenerator.generate(MaterialEIO.SOULARIUM);
- * MaterialGenerator.generate(MaterialEIO.ELECTRICAL_STEEL);
- * MaterialGenerator.generate(MaterialEIO.ENERGETIC_ALLOY);
- * MaterialGenerator.generate(MaterialEIO.VIBRANT_ALLOY);
- */
- }
-
// IC2 Exp
Logger.INFO("IndustrialCraft2 Found - Loading Resources.");
@@ -1286,48 +845,17 @@ public final class ModItems {
// Special Item Handling Case
if (ConfigSwitches.enableAlternativeBatteryAlloy) {
- // ModItems.itemIngotBatteryAlloy = new BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", new
- // short[]{35, 228, 141}, 0); TODO
ModItems.itemPlateBatteryAlloy = ItemUtils
.generateSpecialUsePlate("BatteryAlloy", "Battery Alloy", new short[] { 35, 228, 141 }, 0);
}
- // UtilsItems.generateSpawnEgg("ic2", "boatcarbon", Utils.generateSingularRandomHexValue(),
- // Utils.generateSingularRandomHexValue());
-
- HANDLER_COFH.initItems();
-
- /*
- * Misc Items
- */
-
- // 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
- itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer").setCreativeTab(AddToCreativeTab.tabTools);
- GameRegistry.registerItem(itemSandstoneHammer, itemSandstoneHammer.getUnlocalizedName());
-
// Buffer Cores!
Item itemBufferCore;
for (int i = 1; i <= 10; i++) {
- // Utils.LOG_INFO(""+i);
itemBufferCore = new BufferCore("itemBufferCore", i).setCreativeTab(AddToCreativeTab.tabMachines);
GameRegistry.registerItem(itemBufferCore, itemBufferCore.getUnlocalizedName());
- // System.out.println("Buffer Core registration count is: "+i);
}
- itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit")
- .setTextureName(GTPlusPlus.ID + ":itemPLACEHOLDER_Circuit");
- GameRegistry.registerItem(itemPLACEHOLDER_Circuit, "itemPLACEHOLDER_Circuit");
-
- // ItemBlockGtFrameBox = new ItemBlockGtFrameBox(ModBlocks.blockGtFrameSet1);
- // GameRegistry.registerItem(ItemBlockGtFrameBox, "itemGtFrameBoxSet1");
-
itemCustomBook = new ItemBaseBook();
registerCustomTokens();
}
@@ -1462,30 +990,6 @@ public final class ModItems {
MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.TRINIUM_REINFORCED_STEEL);
MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.CHRONOMATIC_GLASS);
- // Dense Plates
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.POTIN);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.AQUATIC_STEEL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.BRONZE);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.OSMIRIDIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.QUANTUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STEEL_BLACK);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STAINLESS_STEEL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.EGLIN_STEEL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.MARAGING300);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.TALONITE);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.HYPOGEN);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.RHUGNOR);
- MaterialUtils
- .generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ADVANCED_NITINOL);
- MaterialUtils
- .generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ASTRAL_TITANIUM);
- MaterialUtils.generateComponentAndAssignToAMaterial(
- ComponentTypes.PLATEHEAVY,
- ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.WHITE_METAL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.BLACK_METAL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.GRANITE);
-
// Special Sillyness
if (true) {
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java
deleted file mode 100644
index b724687c1a..0000000000
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package gtPlusPlus.core.item.base;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-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;
-import gregtech.api.util.GT_OreDictUnificator;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.handler.GuiHandler;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-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(GTPlusPlus.ID + ":" + "itemBackpack");
- this.colourValue = colour;
- GameRegistry.registerItem(this, unlocalizedName);
- GT_OreDictUnificator.registerOre("storageBackpack", ItemUtils.getSimpleStack(this));
- this.setMaxStackSize(1);
- this.setCreativeTab(AddToCreativeTab.tabOther);
- }
-
- // Without this method, your inventory will NOT work!!!
- @Override
- public int getMaxItemUseDuration(final 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) {
- // 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 :)
- else {
- // 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(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colourValue == 0) {
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colourValue;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister iconRegister) {
- this.itemIcon = iconRegister.registerIcon(GTPlusPlus.ID + ":" + "itemBackpack");
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
index dd4cd24366..7b6be7ddfe 100644
--- a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -338,7 +338,6 @@ public class BaseItemComponent extends Item {
return Utils.rgbtoHexValue(255, 255, 255);
}
}
- if (this.componentType == ComponentTypes.PLATEHEAVY) {}
try {
if (this.componentMaterial == null) {
@@ -422,7 +421,6 @@ public class BaseItemComponent extends Item {
PLASMACELL("CellPlasma", "@ Plasma Cell", "cellPlasma", OrePrefixes.cellPlasma),
CELL("Cell", "@ Cell", "cell", OrePrefixes.cell),
NUGGET("Nugget", "@ Nugget", "nugget", OrePrefixes.nugget),
- PLATEHEAVY("HeavyPlate", "Heavy @ Plate", "plateHeavy", OrePrefixes.plateQuadruple),
SPRING("Spring", "@ Spring", "spring", OrePrefixes.spring),
SMALLSPRING("SmallSpring", "Small @ Spring", "springSmall", OrePrefixes.springSmall),
FINEWIRE("FineWire", "Fine @ Wire", "wireFine", OrePrefixes.wireFine),
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java
deleted file mode 100644
index c730deb436..0000000000
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package gtPlusPlus.core.item.base.itemblock;
-
-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;
-import net.minecraft.util.EnumChatFormatting;
-
-import gtPlusPlus.core.block.general.BlockTankXpConverter;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-
-public class ItemBlockEntityBase extends ItemBlock {
-
- public ItemBlockEntityBase(final Block block) {
- super(block);
- this.setMaxDamage(0);
- // this.setHasSubtypes(true);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack p_82790_1_, final int p_82790_2_) {
- return super.getColorFromItemStack(p_82790_1_, p_82790_2_);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list,
- final boolean bool) {
- if (Block.getBlockFromItem(stack.getItem()) instanceof BlockTankXpConverter) {
- /*
- * list.add(EnumChatFormatting.GRAY+"Can convert Liquid Xp to Mob Essence and back.");
- * list.add(EnumChatFormatting.GRAY+"Right click with a Screwdriver to change mode.");
- * list.add(EnumChatFormatting.GRAY+"Shift+Right click to view tank information.");
- */
- list.add(EnumChatFormatting.GRAY + "Currently disabled, Use a GT Brewery instead. (New Recipes Added!)");
- }
- super.addInformation(stack, aPlayer, list, bool);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java
deleted file mode 100644
index b4c2d1c244..0000000000
--- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package gtPlusPlus.core.item.base.itemblock;
-
-import java.util.List;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-
-import cpw.mods.fml.common.registry.EntityRegistry;
-import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration;
-import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner;
-
-public class ItemBlockSpawner extends ItemBlockMeta {
-
- private final Block mBlock;
-
- public ItemBlockSpawner(Block aBlock) {
- super(aBlock);
- mBlock = aBlock;
- }
-
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aBool) {
- if (mBlock != null) {
- int x = this.getMetadata(aStack.getItemDamage());
- if (x >= 0) {
- try {
- EntityRegistration x1 = EntityRegistry.instance()
- .lookupModSpawn(TileEntityGenericSpawner.mSpawners.get(x), false);
- if (x1 != null) {
- aList.add(EnumChatFormatting.RED + x1.getEntityName());
- }
- } catch (Throwable t) {}
- }
- }
- super.addInformation(aStack, aPlayer, aList, aBool);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java
deleted file mode 100644
index a3a8eb6153..0000000000
--- a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package gtPlusPlus.core.item.base.plates;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.util.IIcon;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.item.base.BaseItemComponent;
-import gtPlusPlus.core.material.Material;
-
-public class BaseItemPlateHeavy extends BaseItemComponent {
-
- static final ComponentTypes HEAVY = ComponentTypes.PLATEHEAVY;
-
- public BaseItemPlateHeavy(final Material material) {
- super(material, HEAVY);
- }
-
- @Override
- public String getCorrectTextures() {
- return GTPlusPlus.ID + ":" + "itemHeavyPlate";
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public boolean requiresMultipleRenderPasses() {
- return true;
- }
-
- @Override
- public void registerIcons(final IIconRegister i) {
- this.base = i.registerIcon(GTPlusPlus.ID + ":" + "itemHeavyPlate");
- this.overlay = i.registerIcon(GTPlusPlus.ID + ":" + "itemHeavyPlate_Overlay");
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
-
- if (pass == 0) {
- return this.base;
- } else {
- return this.overlay;
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
deleted file mode 100644
index b5d7b8fdbb..0000000000
--- a/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package gtPlusPlus.core.item.bauble;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.UUID;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-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 cpw.mods.fml.common.registry.GameRegistry;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import gtPlusPlus.preloader.DevHelper;
-
-public class FireProtectionBauble extends BaseBauble {
-
- public static HashMap<UUID, Boolean> mDataMap = new HashMap<UUID, Boolean>();
- public static HashSet<UUID> mPlayerMap = new HashSet<UUID>();
-
- private static Field isImmuneToFire;
-
- static {
- isImmuneToFire = ReflectionUtils
- .getField(Entity.class, DevHelper.isObfuscatedEnvironment() ? "func_70045_F" : "isImmuneToFire");
- }
-
- public static boolean fireImmune(Entity aEntity) {
- return aEntity.isImmuneToFire();
- }
-
- public static boolean setEntityImmuneToFire(Entity aEntity, boolean aImmune) {
- try {
- return ReflectionUtils.setField(aEntity, isImmuneToFire, aImmune);
- } catch (Throwable t) {}
- return false;
- }
-
- public FireProtectionBauble() {
- super(BaubleType.RING, "GTPP.bauble.fireprotection.0" + ".name", 0);
- String aUnlocalName = "GTPP.bauble.fireprotection.0" + ".name";
- this.setUnlocalizedName(aUnlocalName);
- this.setTextureName(GTPlusPlus.ID + ":" + getTextureNameForBauble());
- this.setMaxDamage(100);
- this.setMaxStackSize(1);
- this.setNoRepair();
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- if (GameRegistry.findItem(GTPlusPlus.ID, aUnlocalName) == null) {
- GameRegistry.registerItem(this, aUnlocalName);
- }
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_,
- final boolean p_77663_5_) {
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return (EnumChatFormatting.DARK_RED + super.getItemStackDisplayName(p_77653_1_) + EnumChatFormatting.GRAY);
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return false;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public void onEquipped(final ItemStack arg0, final EntityLivingBase aPlayer) {
- if (!aPlayer.worldObj.isRemote) {
- if (aPlayer instanceof EntityPlayer) {
- EntityPlayer bPlayer = (EntityPlayer) aPlayer;
- mPlayerMap.add(bPlayer.getUniqueID());
- }
- }
- }
-
- @Override
- public void onUnequipped(final ItemStack arg0, final EntityLivingBase aPlayer) {
- if (!aPlayer.worldObj.isRemote) {
- if (aPlayer instanceof EntityPlayer) {
- EntityPlayer bPlayer = (EntityPlayer) aPlayer;
- if (bPlayer.isPotionActive(Potion.fireResistance)) {
- bPlayer.removePotionEffect(Potion.fireResistance.id);
- }
- mPlayerMap.remove(bPlayer.getUniqueID());
- setEntityImmuneToFire(bPlayer, false);
- }
- }
- }
-
- @Override
- public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayer) {
- if (!aPlayer.worldObj.isRemote) {
- if (aPlayer instanceof EntityPlayer) {
- EntityPlayer bPlayer = (EntityPlayer) aPlayer;
- if (!fireImmune(bPlayer)) {
- setEntityImmuneToFire(bPlayer, true);
- }
- if (!bPlayer.isPotionActive(Potion.fireResistance)) {
- bPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 100, 4));
- }
- }
- }
- }
-
- public String getTextureNameForBauble() {
- return "baubles/itemFireProtectGlovesBetter";
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java
deleted file mode 100644
index 703fb7c5bb..0000000000
--- a/src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package gtPlusPlus.core.item.bauble;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.List;
-
-import net.minecraft.entity.SharedMonsterAttributes;
-import net.minecraft.entity.ai.attributes.AttributeModifier;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.DamageSource;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-
-import com.google.common.collect.Multimap;
-
-import baubles.api.BaubleType;
-
-public class HealthBoostBauble extends BaseBauble {
-
- public HealthBoostBauble() {
- super(BaubleType.AMULET, "The Key to the City");
- addDamageNegation(DamageSource.wither);
- this.setTextureName(GTPlusPlus.ID + ":" + "itemKeyGold");
- }
-
- @Override
- void fillModifiers(Multimap<String, AttributeModifier> attributes, ItemStack stack) {
- attributes.put(
- SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 40, 0));
- }
-
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.thekeytothecity.tooltip.0"));
- list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.thekeytothecity.tooltip.1"));
- super.addInformation(stack, player, list, bool);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java
deleted file mode 100644
index 63a812e8ca..0000000000
--- a/src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java
+++ /dev/null
@@ -1,495 +0,0 @@
-package gtPlusPlus.core.item.bauble;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-import static gregtech.api.enums.Mods.Thaumcraft;
-
-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.SharedMonsterAttributes;
-import net.minecraft.entity.ai.attributes.AttributeModifier;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.DamageSource;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.IIcon;
-
-import org.lwjgl.input.Keyboard;
-
-import com.google.common.collect.Multimap;
-
-import baubles.api.BaubleType;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-
-public class ModularBauble extends BaseBauble {
-
- @SideOnly(Side.CLIENT)
- private IIcon mTextureAmulet;
-
- @SideOnly(Side.CLIENT)
- private IIcon mTextureRing;
-
- @SideOnly(Side.CLIENT)
- private IIcon mTextureBelt;
-
- private IIcon iconArray[] = new IIcon[3];
-
- @SideOnly(Side.CLIENT)
- private IIcon mfallback;
-
- public ModularBauble() {
- super(BaubleType.AMULET, "Modular Bauble");
- }
-
- @Override
- void fillModifiers(Multimap<String, AttributeModifier> attributes, ItemStack stack) {
-
- // Get Stats
- int mStatlevel = 0;
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DAMAGE)) > 0) {
- if (mStatlevel > 0 && mStatlevel < 20) {
- attributes.put(
- SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 1, 0));
- } else if (mStatlevel > 20 && mStatlevel < 45) {
- attributes.put(
- SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 2, 0));
- } else if (mStatlevel >= 45 && mStatlevel < 75) {
- attributes.put(
- SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 4, 0));
- } else if (mStatlevel >= 75 && mStatlevel < 99) {
- attributes.put(
- SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 8, 0));
- } else if (mStatlevel >= 100) {
- attributes.put(
- SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 16, 0));
- }
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DEF)) > 0) {
- if (mStatlevel > 0 && mStatlevel < 20) {
- attributes.put(
- SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 1, 0));
- } else if (mStatlevel > 20 && mStatlevel < 45) {
- attributes.put(
- SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 2, 0));
- } else if (mStatlevel > 45 && mStatlevel < 75) {
- attributes.put(
- SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 3, 0));
- } else if (mStatlevel > 75 && mStatlevel < 99) {
- attributes.put(
- SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 6, 0));
- } else if (mStatlevel >= 100) {
- attributes.put(
- SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 10, 0));
- }
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HP)) > 0) {
- if (mStatlevel > 0 && mStatlevel <= 100) {
- int bonus = mStatlevel / 5;
- attributes.put(
- SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "HP" + mStatlevel, bonus * 2, 0));
- }
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_SPEED)) > 0) {
- if (mStatlevel > 0 && mStatlevel < 20) {
- attributes.put(
- SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 1, 0));
- } else if (mStatlevel > 20 && mStatlevel < 45) {
- attributes.put(
- SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 2, 0));
- } else if (mStatlevel > 45 && mStatlevel < 75) {
- attributes.put(
- SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 3, 0));
- } else if (mStatlevel > 75 && mStatlevel < 99) {
- attributes.put(
- SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 4, 0));
- } else if (mStatlevel >= 100) {
- attributes.put(
- SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
- new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 5, 0));
- }
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_MINING)) > 0) {}
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HOLY)) > 0) {}
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- // Bauble Type
- if (ModularArmourUtils.getBaubleType(stack) == BaubleType.AMULET) {
- list.add(
- EnumChatFormatting.GRAY + "Current Form: "
- + EnumChatFormatting.RED
- + "Amulet"
- + EnumChatFormatting.GRAY
- + ".");
- list.add(EnumChatFormatting.GRAY + "You can change this into a Ring or a Belt.");
- } else if (ModularArmourUtils.getBaubleType(stack) == BaubleType.RING) {
- list.add(
- EnumChatFormatting.GRAY + "Current Form: "
- + EnumChatFormatting.RED
- + "Ring"
- + EnumChatFormatting.GRAY
- + ".");
- list.add(EnumChatFormatting.GRAY + "You can change this into an Amulet or a Belt.");
- } else if (ModularArmourUtils.getBaubleType(stack) == BaubleType.BELT) {
- list.add(
- EnumChatFormatting.GRAY + "Current Form: "
- + EnumChatFormatting.RED
- + "Belt"
- + EnumChatFormatting.GRAY
- + ".");
- list.add(EnumChatFormatting.GRAY + "You can change this into a Ring or an Amulet.");
- }
-
- // Get Stats
- int mStatlevel = 0;
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DAMAGE)) > 0) {
- list.add(
- EnumChatFormatting.GRAY + "Damage Boost: "
- + EnumChatFormatting.DARK_RED
- + mStatlevel
- + EnumChatFormatting.GRAY
- + "/100.");
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HP)) > 0) {
- list.add(
- EnumChatFormatting.GRAY + "Health Boost: "
- + EnumChatFormatting.RED
- + mStatlevel
- + EnumChatFormatting.GRAY
- + "/100. Bonus "
- + (mStatlevel / 5)
- + " hearts.");
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_SPEED)) > 0) {
- list.add(
- EnumChatFormatting.GRAY + "Speed Boost: "
- + EnumChatFormatting.WHITE
- + mStatlevel
- + EnumChatFormatting.GRAY
- + "/100.");
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_MINING)) > 0) {
- list.add(
- EnumChatFormatting.GRAY + "Mining Boost: "
- + EnumChatFormatting.DARK_GRAY
- + mStatlevel
- + EnumChatFormatting.GRAY
- + "/100.");
- }
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HOLY)) > 0) {
- list.add(
- EnumChatFormatting.GRAY + "Holy Boost: "
- + EnumChatFormatting.GOLD
- + mStatlevel
- + EnumChatFormatting.GRAY
- + "/100.");
- }
-
- // Defence Boost
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DEF)) > 0) {
- list.add(
- EnumChatFormatting.GRAY + "Defence Boost: "
- + EnumChatFormatting.BLUE
- + mStatlevel
- + EnumChatFormatting.GRAY
- + "/100.");
-
- if ((Keyboard.isKeyDown(42)) || (Keyboard.isKeyDown(54))) {
-
- if (mStatlevel >= 1) {
- list.add(
- EnumChatFormatting.GRAY + "Protected From: "
- + EnumChatFormatting.BLUE
- + "Cactus"
- + EnumChatFormatting.GRAY
- + ".");
- }
- if (mStatlevel >= 10) {
- list.add(
- EnumChatFormatting.GRAY + "Protected From: "
- + EnumChatFormatting.BLUE
- + "Falling Blocks"
- + EnumChatFormatting.GRAY
- + ".");
- }
- if (mStatlevel >= 20) {
- list.add(
- EnumChatFormatting.GRAY + "Protected From: "
- + EnumChatFormatting.BLUE
- + "Wall Suffocation"
- + EnumChatFormatting.GRAY
- + ".");
- }
- if (mStatlevel >= 35) {
- list.add(
- EnumChatFormatting.GRAY + "Protected From: "
- + EnumChatFormatting.BLUE
- + "Drowning"
- + EnumChatFormatting.GRAY
- + ".");
- }
- if (mStatlevel >= 50) {
- list.add(
- EnumChatFormatting.GRAY + "Protected From: "
- + EnumChatFormatting.BLUE
- + "Starvation"
- + EnumChatFormatting.GRAY
- + ".");
- }
- if (mStatlevel >= 60) {
- list.add(
- EnumChatFormatting.GRAY + "Protected From: "
- + EnumChatFormatting.BLUE
- + "Falling"
- + EnumChatFormatting.GRAY
- + ".");
- }
- if (mStatlevel >= 75) {
- list.add(
- EnumChatFormatting.GRAY + "Protected From: "
- + EnumChatFormatting.BLUE
- + "Lava"
- + EnumChatFormatting.GRAY
- + ".");
- }
- if (mStatlevel >= 80) {
- list.add(
- EnumChatFormatting.GRAY + "Protected From: "
- + EnumChatFormatting.BLUE
- + "Magic"
- + EnumChatFormatting.GRAY
- + ".");
- }
- if (mStatlevel >= 95) {
- list.add(
- EnumChatFormatting.GRAY + "Protected From: "
- + EnumChatFormatting.BLUE
- + "Wither"
- + EnumChatFormatting.GRAY
- + ".");
- }
- if (mStatlevel >= 100) {
- list.add(
- EnumChatFormatting.GRAY + "Protected From: "
- + EnumChatFormatting.BLUE
- + "Fire"
- + EnumChatFormatting.GRAY
- + ".");
- }
- if (mStatlevel >= 100) {
- list.add(
- EnumChatFormatting.GRAY + "Protected From: "
- + EnumChatFormatting.BLUE
- + "Void"
- + EnumChatFormatting.GRAY
- + ".");
- }
-
- } else {
- list.add(EnumChatFormatting.GRAY + "<Press Shift to view protections>");
- }
- }
-
- if (NBTUtils.getBotanicaSoulboundOwner(stack) != null) {
- if (!NBTUtils.getBotanicaSoulboundOwner(stack).equals("")) {
- list.add(
- EnumChatFormatting.GRAY + "Owner: "
- + EnumChatFormatting.GREEN
- + NBTUtils.getBotanicaSoulboundOwner(stack)
- + EnumChatFormatting.GRAY
- + ".");
- }
- }
- super.addInformation(stack, player, list, bool);
- }
-
- @Override
- public boolean addDamageNegation(DamageSource damageSource, ItemStack aStack) {
-
- this.clearDamageNegation();
- int mStatlevel = 0;
- if ((mStatlevel = ModularArmourUtils.getModifierLevel(aStack, Modifiers.BOOST_HOLY)) > 0) {
- if (mStatlevel >= 1) {
- addDamageNegation(DamageSource.cactus);
- }
- if (mStatlevel >= 10) {
- addDamageNegation(DamageSource.fallingBlock);
- }
- if (mStatlevel >= 20) {
- addDamageNegation(DamageSource.inWall);
- }
- if (mStatlevel >= 35) {
- addDamageNegation(DamageSource.drown);
- }
- if (mStatlevel >= 50) {
- addDamageNegation(DamageSource.starve);
- }
- if (mStatlevel >= 60) {
- addDamageNegation(DamageSource.fall);
- }
- if (mStatlevel >= 75) {
- addDamageNegation(DamageSource.lava);
- }
- if (mStatlevel >= 80) {
- addDamageNegation(DamageSource.magic);
- }
- if (mStatlevel >= 95) {
- addDamageNegation(DamageSource.wither);
- }
- if (mStatlevel >= 100) {
- addDamageNegation(DamageSource.inFire);
- }
- if (mStatlevel >= 100) {
- addDamageNegation(DamageSource.onFire);
- }
- if (mStatlevel >= 100) {
- addDamageNegation(DamageSource.outOfWorld);
- }
- }
- return super.addDamageNegation(damageSource, null);
- }
-
- @Override
- public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) {
- if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_AMULET.getID()) {
- this.SetBaubleType(BT.TYPE_AMULET);
- } else if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_RING.getID()) {
- this.SetBaubleType(BT.TYPE_RING);
- } else if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_BELT.getID()) {
- this.SetBaubleType(BT.TYPE_BELT);
- } else {
- this.SetBaubleType(BT.TYPE_RING);
- }
- if (PlayerUtils.isPlayerOP((EntityPlayer) arg1)) {
- return true; // Let OPs wear other peoples stuff.
- }
-
- String mOwner;
- if (NBTUtils.getBotanicaSoulboundOwner(arg0) == null || NBTUtils.getBotanicaSoulboundOwner(arg0).equals("")) {
- return true;
- } else if ((mOwner = NBTUtils.getBotanicaSoulboundOwner(arg0)) != null) {
- String mPlayerName = arg1.getCommandSenderName();
- if (mOwner.toLowerCase().equals(mPlayerName.toLowerCase())) {
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
-
- @Override
- public BaubleType getBaubleType(ItemStack arg0) {
- return ModularArmourUtils.getBaubleType(arg0);
- }
-
- @Override
- public void onEquipped(ItemStack stack, EntityLivingBase entity) {
- if (entity instanceof EntityPlayer) {
- if (NBTUtils.getBotanicaSoulboundOwner(stack) == null
- || NBTUtils.getBotanicaSoulboundOwner(stack).equals("")) {
- NBTUtils.setBotanicaSoulboundOwner(stack, entity.getCommandSenderName());
- }
- }
- super.onEquipped(stack, entity);
- }
-
- /*
- * @Override
- * @SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack
- * usingItem, int useRemaining) { if (usingItem == null) { return mfallback; } try { if (stack.getItemDamage() == 0)
- * { return mfallback = mTextureAmulet; } else if (stack.getItemDamage() == 1) { return mfallback = mTextureRing; }
- * else if (stack.getItemDamage() == 2) { return mfallback = mTextureBelt; } else { return mfallback = mTextureRing;
- * } } catch (Throwable t) { return mfallback = mTextureRing; } }
- */
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIconFromDamage(int meta) {
- if (meta < this.iconArray.length && this.iconArray[meta] != null) {
- return this.iconArray[meta];
- }
- return this.mfallback;
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 3; i++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister register) {
- this.mfallback = register.registerIcon(GTPlusPlus.ID + ":" + "itemAmulet");
- // you cannot initialize iconArray when declared nor in the constructor,
- // as it is client-side only, so do it here:
- if (Thaumcraft.isModLoaded()) {
- iconArray[0] = register.registerIcon("thaumcraft" + ":" + "bauble_amulet");
- iconArray[1] = register.registerIcon("thaumcraft" + ":" + "bauble_ring");
- iconArray[2] = register.registerIcon("thaumcraft" + ":" + "bauble_belt");
- } else {
- iconArray[0] = register.registerIcon(GTPlusPlus.ID + ":" + "itemAmulet");
- iconArray[1] = register.registerIcon(GTPlusPlus.ID + ":" + "itemRingWearable");
- iconArray[2] = register.registerIcon(GTPlusPlus.ID + ":" + "itemBelt");
- }
-
- mTextureAmulet = iconArray[0];
- mTextureRing = iconArray[1];
- mTextureBelt = iconArray[2];
- }
-
- @Override
- public void onWornTick(ItemStack stack, EntityLivingBase player) {
- super.onWornTick(stack, player);
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
- @Override
- public Item setFull3D() {
- // TODO Auto-generated method stub
- return super.setFull3D();
- }
-
- @Override
- public boolean isFull3D() {
- return true;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java
deleted file mode 100644
index f7740f73cc..0000000000
--- a/src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java
+++ /dev/null
@@ -1,181 +0,0 @@
-package gtPlusPlus.core.item.bauble;
-
-import java.util.List;
-
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLiving;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-
-import baubles.api.BaubleType;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.enums.GT_Values;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.api.objects.minecraft.AABB;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import ic2.api.item.ElectricItem;
-
-public class MonsterKillerBaseBauble extends ElectricBaseBauble {
-
- private final Class[] mTargets;
-
- public MonsterKillerBaseBauble(Class[] aMonsterBaseClassArray, String aMonsterTypeName, int aPowerTier) {
- super(
- BaubleType.AMULET,
- aPowerTier,
- GT_Values.V[aPowerTier] * 20 * 300,
- "GTPP.MonsterKiller." + aMonsterTypeName + ".name");
- mTargets = aMonsterBaseClassArray;
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
- ItemStack itemStack = new ItemStack(this, 1);
- ItemStack charged;
- if (this.getEmptyItem(itemStack) == this) {
- charged = new ItemStack(this, 1);
- ElectricItem.manager.charge(charged, 0.0D, Integer.MAX_VALUE, true, false);
- itemList.add(charged);
- }
- if (this.getChargedItem(itemStack) == this) {
- charged = new ItemStack(this, 1);
- ElectricItem.manager.charge(charged, Double.POSITIVE_INFINITY, Integer.MAX_VALUE, true, false);
- itemList.add(charged);
- }
- }
-
- @Override
- public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_,
- final boolean p_77663_5_) {
- super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public boolean canProvideEnergy(final ItemStack itemStack) {
- double aItemCharge = ElectricItem.manager.getCharge(itemStack);
- return aItemCharge > 0;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack p_77653_1_) {
- return (EnumChatFormatting.WHITE + super.getItemStackDisplayName(p_77653_1_) + EnumChatFormatting.GRAY);
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add("");
- String aString1 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.1");
- String aString2 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.2");
- String aString3 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.3");
- String aString4 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.4");
- String aEU = StatCollector.translateToLocal("GTPP.info.eu");
- String aEUT = aEU + "/t";
-
- list.add(EnumChatFormatting.GREEN + aString1 + EnumChatFormatting.GRAY);
- list.add(
- EnumChatFormatting.GREEN + aString2
- + " "
- + (int) getTransferLimit(stack)
- + aEUT
- + " "
- + aString3
- + EnumChatFormatting.GRAY);
- list.add("");
- list.add("" + EnumChatFormatting.GREEN + aString4 + " " + EnumChatFormatting.GRAY);
- for (Class cz : mTargets) {
- list.add(
- "- " + EnumChatFormatting.DARK_GREEN
- + cz.getSimpleName().replace("Entity", "")
- + EnumChatFormatting.GRAY);
- }
-
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
- return true;
- }
-
- @Override
- public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {}
-
- @Override
- public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {}
-
- @Override // TODO
- public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayerEntity) {
- if (aPlayerEntity == null) {
- return;
- }
- EntityPlayer aPlayer = (EntityPlayer) aPlayerEntity;
- if (!aPlayer.worldObj.isRemote) {
- if (this.getCharge(aBaubleStack) >= getTransferLimit(aBaubleStack)) {
- AABB aPlayerBox = new AABB(aPlayerEntity, 5, 5, 5);
- if (this.mTargets != null && this.mTargets.length > 0) {
- for (Class clazz : mTargets) {
- AutoMap<?> aEnts = EntityUtils.getEntitiesWithinBoundingBox(clazz, aPlayerBox);
- if (aEnts.isEmpty()) {
- continue;
- } else {
- EntityLiving aClosest = null;
- double aEntityDistance = Short.MIN_VALUE;
- for (Object ent : aEnts) {
- if (!EntityLiving.class.isInstance(ent)) {
- continue;
- } else {
- double aCurEntDis = EntityUtils.getDistance(aPlayerEntity, (Entity) ent);
- if (aEntityDistance == Short.MIN_VALUE || aCurEntDis < aEntityDistance) {
- aEntityDistance = aCurEntDis;
- aClosest = (EntityLiving) ent;
- }
- }
- }
- if (aClosest != null) {
- float aEntHealth = aClosest.getHealth();
- float aEntMaxHealth = aClosest.getMaxHealth();
- double aEntHealthPerc = MathUtils.findPercentage(aEntHealth, aEntMaxHealth);
- long aEuUsage = (long) (aEntHealthPerc * 50 * aEntMaxHealth);
- if (this.discharge(aBaubleStack, aEuUsage, mTier, true, false, false) > 0) {
- aClosest.setDead();
- PlayerUtils.messagePlayer(aPlayer, "Removed 1x " + aClosest.getCommandSenderName());
- break;
- }
- } else {
- continue;
- }
- }
- }
- }
- } else {
- return;
- }
- }
- }
-
- @Override
- public String getTextureNameForBauble() {
- return "baubles/itemAmulet";
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java
index 0db5a9bba3..0096f48148 100644
--- a/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java
+++ b/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java
@@ -1,12 +1,9 @@
package gtPlusPlus.core.item.chemistry;
import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import gtPlusPlus.api.objects.minecraft.ItemPackage;
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.item.chemistry.general.ItemNuclearChemBase;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.FluidUtils;
@@ -23,36 +20,8 @@ public class NuclearChem extends ItemPackage {
public static Fluid GeneticMutagen;
private static boolean generateMutagenRecipe = false;
- public static ItemNuclearChemBase mNuclearChemItem1;
-
- public static ItemStack mResidueUranium;
- public static ItemStack mResiduePlutonium;
- public static ItemStack mResidueFluorides;
- public static ItemStack mResidueNobles;
-
@Override
- public void items() {
-
- mNuclearChemItem1 = new ItemNuclearChemBase();
- registerItemStacks();
- registerOreDict();
- }
-
- public void registerItemStacks() {
-
- mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 0, 1);
- mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 1, 1);
- mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 2, 1);
- mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 3, 1);
- }
-
- public void registerOreDict() {
-
- ItemUtils.addItemToOreDictionary(mResidueUranium, "dustResidueUranium");
- ItemUtils.addItemToOreDictionary(mResiduePlutonium, "dustResiduePlutonium");
- ItemUtils.addItemToOreDictionary(mResidueFluorides, "dustResidueFluoride");
- ItemUtils.addItemToOreDictionary(mResidueNobles, "dustResidueNoble");
- }
+ public void items() {}
@Override
public void blocks() {}
@@ -112,7 +81,6 @@ public class NuclearChem extends ItemPackage {
if (generateMutagenRecipe) {
chemReator_CreateMutagen();
}
- chemReactor_MutagenWithEggs();
return true;
}
@@ -127,14 +95,4 @@ public class NuclearChem extends ItemPackage {
500);
}
- private static void chemReactor_MutagenWithEggs() {
- CORE.RA.addChemicalRecipe(
- CI.getNumberedCircuit(20),
- ItemUtils.getSimpleStack(Items.egg, 2),
- FluidUtils.getFluidStack(GeneticMutagen, 500),
- null,
- ItemUtils.getSimpleStack(ModItems.itemBigEgg, 2),
- 300 * 20,
- 500);
- }
}
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java
deleted file mode 100644
index 0f9f7d0e5c..0000000000
--- a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java
+++ /dev/null
@@ -1,145 +0,0 @@
-package gtPlusPlus.core.item.chemistry.general;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.List;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.EnumRarity;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-import net.minecraft.world.World;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class ItemNuclearChemBase extends Item {
-
- protected final IIcon base[];
-
- private final int aMetaSize = 4;
-
- /*
- * 0 - Uranium Residue 1 - Plutonium Residue 2 - Fluoride Reside 3 - Noble Gas Residue
- */
-
- public ItemNuclearChemBase() {
- this.setHasSubtypes(true);
- this.setNoRepair();
- this.setMaxStackSize(64);
- this.setMaxDamage(0);
- base = new IIcon[aMetaSize];
- this.setUnlocalizedName("BasicNuclearChemItem");
- GameRegistry.registerItem(this, this.getUnlocalizedName());
- }
-
- @Override
- public int getItemStackLimit(ItemStack stack) {
- return super.getItemStackLimit(stack);
- }
-
- @Override
- public boolean isDamageable() {
- return false;
- }
-
- @Override
- public boolean shouldRotateAroundWhenRendering() {
- return super.shouldRotateAroundWhenRendering();
- }
-
- @Override
- public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_,
- boolean p_77663_5_) {
- super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- return super.getItemStackDisplayName(aStack);
- }
-
- @Override
- public EnumRarity getRarity(ItemStack p_77613_1_) {
- return EnumRarity.common;
- }
-
- @Override
- public boolean requiresMultipleRenderPasses() {
- return false;
- }
-
- @Override
- public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) {
- for (int i = 0; i < aMetaSize; i++) {
- aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
- }
- }
-
- @Override
- public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) {
- return false;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-
- @Override
- public boolean isBookEnchantable(ItemStack stack, ItemStack book) {
- return false;
- }
-
- @Override
- public int getItemEnchantability() {
- return 0;
- }
-
- @Override
- public int getItemEnchantability(ItemStack stack) {
- return 0;
- }
-
- @Override
- public void registerIcons(final IIconRegister u) {
- for (int i = 0; i < this.aMetaSize; i++) {
- String aPath = GTPlusPlus.ID + ":" + "science/nuclear/MetaItem1/" + i;
- this.base[i] = u.registerIcon(aPath);
- }
- }
-
- @Override
- public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
- return this.base[damage];
- }
-
- @Override
- public IIcon getIconFromDamage(int damage) {
- return this.base[damage];
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
- return this.base[stack.getItemDamage()];
- }
-
- @Override
- public IIcon getIcon(ItemStack stack, int pass) {
- return this.base[stack.getItemDamage()];
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return super.getUnlocalizedName() + "." + stack.getItemDamage();
- }
-
- @Override
- public void addInformation(ItemStack aStack, EntityPlayer player, List list, boolean bool) {
- super.addInformation(aStack, player, list, bool);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java b/src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java
deleted file mode 100644
index 1ed6e1d32c..0000000000
--- a/src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package gtPlusPlus.core.item.general;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.List;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.EnumRarity;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.handler.GuiHandler;
-
-public class BaseItemGrindle extends Item {
-
- protected final String unlocalName;
-
- public BaseItemGrindle() {
- this.unlocalName = "itemGrindleTablet";
- this.setUnlocalizedName("itemGrindleTablet");
- this.setTextureName(GTPlusPlus.ID + ":" + "itemTablet");
- GameRegistry.registerItem(this, "itemGrindleTablet");
- this.setMaxStackSize(1);
- this.setCreativeTab(AddToCreativeTab.tabOther);
- }
-
- @Override
- public int getMaxItemUseDuration(final ItemStack stack) {
- return 1;
- }
-
- @Override
- public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) {
- if (!world.isRemote) {
- if (!player.isSneaking()) {
- player.openGui(GTplusplus.instance, GuiHandler.GUI9, world, 0, 0, 0);
- }
- }
- return itemstack;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerIcons(final IIconRegister iconRegister) {
- this.itemIcon = iconRegister.registerIcon(GTPlusPlus.ID + ":" + "itemTablet");
- }
-
- @Override
- public String getPotionEffect(ItemStack p_150896_1_) {
- return super.getPotionEffect(p_150896_1_);
- }
-
- @Override
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) {
- super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_);
- aList.add(StatCollector.translateToLocal("item.itemGrindleTablet.tooltip"));
- }
-
- @Override
- public EnumRarity getRarity(ItemStack i) {
- return EnumRarity.uncommon;
- }
-
- @Override
- public boolean isRepairable() {
- return false;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java b/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java
deleted file mode 100644
index 3db9672630..0000000000
--- a/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java
+++ /dev/null
@@ -1,205 +0,0 @@
-package gtPlusPlus.core.item.general;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.List;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-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 net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.common.blocks.GT_Block_Ores;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.block.base.BlockBaseOre;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.CoreItem;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-
-public class ItemAreaClear extends CoreItem {
-
- public IIcon[] mIcon = new IIcon[1];
-
- public ItemAreaClear() {
- super(
- "itemDebugClearing",
- AddToCreativeTab.tabMachines,
- 1,
- 100,
- new String[] { EnumChatFormatting.OBFUSCATED + "F A N C Y N A M E" },
- EnumRarity.rare,
- EnumChatFormatting.BOLD,
- false,
- null);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- this.mIcon[0] = reg.registerIcon(GTPlusPlus.ID + ":" + "itemLavaFilter");
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.mIcon[0];
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 2; i++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- return StatCollector.translateToLocalFormatted("item.itemDebugClearing.name", tItem.getItemDamage() + 1);
- }
-
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
- list.add(
- EnumChatFormatting.GRAY + ""
- + StatCollector
- .translateToLocal("item.itemDebugClearing." + stack.getItemDamage() + ".tooltip"));
- super.addInformation(stack, player, list, bool);
- }
-
- private static boolean createNBT(ItemStack rStack) {
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
- tagNBT.setLong("Mode", 0);
- tagMain.setTag("GTPP_DEBUG", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- public static final long getFilterDamage(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GTPP_DEBUG");
- if (aNBT != null) {
- return aNBT.getLong("Mode");
- }
- } else {
- createNBT(aStack);
- }
- return 0L;
- }
-
- public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("GTPP_DEBUG");
- if (aNBT != null) {
- aNBT.setLong("Mode", aDamage);
- return true;
- }
- }
- return false;
- }
-
- public boolean removeBlocks(World world, BlockPos pos) {
- int x1 = pos.xPos;
- int y1 = pos.yPos;
- int z1 = pos.zPos;
-
- int x2 = (x1 - 24);
- int y2 = (y1 - 10);
- int z2 = (z1 - 24);
-
- removeBlockColumn(world, new BlockPos(x2, y2, z2, world));
- return true;
- }
-
- public boolean removeBlockColumn(World world, BlockPos pos) {
- for (int i = 0; i < 50; i++) {
- removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos - 10, pos.zPos + i, world));
- removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos + i, world));
- removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos + 10, pos.zPos + i, world));
- }
- return true;
- }
-
- public boolean removeBlockRow(World world, BlockPos pos) {
- for (int j = 0; j < 20; j++) {
- for (int i = 0; i < 50; i++) {
-
- if (!(world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) instanceof BlockBaseOre)
- && !(world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) instanceof IGregTechTileEntity)
- && !(world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) instanceof GT_Block_Ores)) {
- if (!world.isAirBlock(pos.xPos + i, pos.yPos + j, pos.zPos)
- && world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) != Blocks.bedrock) {
- int chance = MathUtils.randInt(0, 500);
- if (chance <= 0) {
- if (pos.yPos + j <= 50) {
- world.setBlock(pos.xPos + i, pos.yPos + j, pos.zPos, Blocks.glowstone);
- }
- } else {
- if ((world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) == Blocks.glowstone
- && ((pos.yPos + j) > 50))
- || world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) != Blocks.glowstone) {
- world.setBlockToAir(pos.xPos + i, pos.yPos + j, pos.zPos);
- }
- }
- }
- }
- }
- }
- return true;
- }
-
- public boolean fillBlocks(World world, BlockPos pos) {
- int x1 = pos.xPos;
- int y1 = pos.yPos;
- int z1 = pos.zPos;
-
- int x2 = (x1 - 15);
- int y2 = (y1 - 1);
- int z2 = (z1 - 15);
-
- fillBlockColumn(world, new BlockPos(x2, y2, z2, world));
- return true;
- }
-
- public boolean fillBlockColumn(World world, BlockPos pos) {
- for (int i = 0; i < 30; i++) {
- fillBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos + i, world));
- }
- return true;
- }
-
- public boolean fillBlockRow(World world, BlockPos pos) {
- for (int j = 0; j < 2; j++) {
- for (int i = 0; i < 30; i++) {
- if (world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) != Blocks.bedrock) {
- world.setBlock(pos.xPos + i, pos.yPos + j, pos.zPos, Blocks.dirt);
- world.setBlockMetadataWithNotify(pos.xPos + i, pos.yPos + j, pos.zPos, 2, 2);
- }
- }
- }
- return true;
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack thisItem, World world, EntityPlayer parEntity) {
- BlockPos groundBlock = EntityUtils.findBlockPosUnderEntity(parEntity);
- if (thisItem.getItemDamage() == 0) {
- removeBlocks(world, groundBlock);
- } else {
- Logger.INFO("Filling.");
- fillBlocks(world, groundBlock);
- }
- return super.onItemRightClick(thisItem, world, parEntity);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java b/src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java
deleted file mode 100644
index d473723bf8..0000000000
--- a/src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package gtPlusPlus.core.item.general;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-
-import gtPlusPlus.core.block.general.FirePit;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.CoreItem;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-
-public class ItemBasicFirestarter extends CoreItem {
-
- public ItemBasicFirestarter() {
- super("itemSimpleFiremaker", AddToCreativeTab.tabTools, 1, 5, "Can probably make you a fire");
- this.setTextureName(GTPlusPlus.ID + ":" + "itemFireStarter");
- }
-
- @Override
- public boolean onItemUse(final ItemStack thisItem, final EntityPlayer thisPlayer, final World thisWorld, int blockX,
- int blockY, int blockZ, final int p_77648_7_, final float p_77648_8_, final float p_77648_9_,
- final float p_77648_10_) {
- if (p_77648_7_ == 0) {
- --blockY;
- }
- if (p_77648_7_ == 1) {
- ++blockY;
- }
- if (p_77648_7_ == 2) {
- --blockZ;
- }
- if (p_77648_7_ == 3) {
- ++blockZ;
- }
- if (p_77648_7_ == 4) {
- --blockX;
- }
- if (p_77648_7_ == 5) {
- ++blockX;
- }
- if (!thisPlayer.canPlayerEdit(blockX, blockY, blockZ, p_77648_7_, thisItem)) {
- return false;
- }
- if (thisWorld.getBlock(blockX, blockY, blockZ) instanceof FirePit) {
- thisWorld.setBlockMetadataWithNotify(blockX, blockY, blockZ, 2, 4);
- PlayerUtils.messagePlayer(thisPlayer, StatCollector.translateToLocal("item.itemSimpleFiremaker.message.0"));
- }
- if (thisWorld.isAirBlock(blockX, blockY, blockZ)) {
- final int random = MathUtils.randInt(0, 3);
- // Explode, lol.
- if (random == 0) {
- PlayerUtils.messagePlayer(
- thisPlayer,
- StatCollector.translateToLocal("item.itemSimpleFiremaker.message.1"));
- thisWorld.playSoundEffect(
- thisPlayer.posX + 0.5D,
- thisPlayer.posY + 0.5D,
- thisPlayer.posZ + 0.5D,
- "fire.ignite",
- 1.0F,
- (itemRand.nextFloat() * 0.4F) + 0.8F);
- thisPlayer.setFire(4);
- thisItem.damageItem(thisItem.getMaxDamage(), thisPlayer);
- }
-
- // Create a fire
- else if (random == 2) {
- PlayerUtils.messagePlayer(
- thisPlayer,
- StatCollector.translateToLocal("item.itemSimpleFiremaker.message.2"));
- thisWorld.playSoundEffect(
- blockX + 0.5D,
- blockY + 0.5D,
- blockZ + 0.5D,
- "fire.ignite",
- 1.0F,
- (itemRand.nextFloat() * 0.4F) + 0.8F);
- thisWorld.setBlock(blockX, blockY, blockZ, Blocks.fire);
- }
-
- // Do nothing
- else {
- PlayerUtils.messagePlayer(
- thisPlayer,
- StatCollector.translateToLocal("item.itemSimpleFiremaker.message.3"));
- thisItem.damageItem(1, thisPlayer);
- return false;
- }
- }
- thisItem.damageItem(1, thisPlayer);
- return true;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java b/src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java
deleted file mode 100644
index 0618d451fe..0000000000
--- a/src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package gtPlusPlus.core.item.general;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.List;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.StatCollector;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
-
-public class ItemControlCore extends Item {
-
- public static IIcon[] icons = new IIcon[10];
-
- public ItemControlCore() {
- super();
- this.setHasSubtypes(true);
- String unlocalizedName = "itemControlCore";
- this.setUnlocalizedName(unlocalizedName);
- this.setCreativeTab(GregTech_API.TAB_GREGTECH);
- // this.setCreativeTab(AddToCreativeTab.tabMisc);
- GameRegistry.registerItem(this, unlocalizedName);
- }
-
- @Override
- public void registerIcons(IIconRegister reg) {
- icons[0] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_0");
- icons[1] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_1");
- icons[2] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_2");
- icons[3] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_3");
- icons[4] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_4");
- icons[5] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_5");
- icons[6] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_6");
- icons[7] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_7");
- icons[8] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_8");
- icons[9] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_9");
- }
-
- @Override
- public IIcon getIconFromDamage(int meta) {
- return this.icons[meta];
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 10; i++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- @Override
- public String getUnlocalizedName(ItemStack stack) {
- return this.getUnlocalizedName() + "_" + stack.getItemDamage();
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(
- EnumChatFormatting.GRAY + StatCollector.translateToLocalFormatted(
- "item.itemControlCore.tooltip.0",
- GT_Values.VN[stack.getItemDamage()]));
- list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.itemControlCore.tooltip.1"));
- list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.itemControlCore.tooltip.2"));
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- return StatCollector
- .translateToLocalFormatted("item.itemControlCore.name", GT_Values.VN[tItem.getItemDamage()]);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java b/src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java
deleted file mode 100644
index d88cf3328a..0000000000
--- a/src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package gtPlusPlus.core.item.general;
-
-import java.util.List;
-
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.EnumRarity;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-
-import gtPlusPlus.core.item.base.BaseItemColourable;
-import gtPlusPlus.core.util.Utils;
-
-public class ItemGemShards extends BaseItemColourable {
-
- public ItemGemShards(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg,
- String description, EnumRarity regRarity, EnumChatFormatting colour, boolean Effect, int rgb) {
- super(unlocalizedName, creativeTab, stackSize, maxDmg, description, regRarity, colour, Effect, rgb);
- }
-
- public ItemGemShards(String unlocalizedName, String displayName, CreativeTabs creativeTab, int stackSize,
- int maxDmg, String description, EnumRarity regRarity, EnumChatFormatting colour, boolean Effect, int rgb) {
- super(
- unlocalizedName,
- displayName,
- creativeTab,
- stackSize,
- maxDmg,
- description,
- regRarity,
- colour,
- Effect,
- rgb);
- }
-
- @Override
- public void getSubItems(Item item, CreativeTabs tab, List list) {
- for (int i = 0; i < 4; i++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
- // 0 - Diamond
- // 1 - Emerald
- // 2 - Ruby
- // 3 - Sapphire
-
- @Override
- public String getItemStackDisplayName(final ItemStack tItem) {
- return StatCollector
- .translateToLocal(getUnlocalizedNameInefficiently(tItem) + "." + tItem.getItemDamage() + ".name");
- }
-
- @Override
- public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
- if (this.getDamage(stack) == 0) {
- return Utils.rgbtoHexValue(150, 150, 220);
- } else if (this.getDamage(stack) == 1) {
- return Utils.rgbtoHexValue(75, 182, 75);
- } else if (this.getDamage(stack) == 2) {
- return Utils.rgbtoHexValue(182, 77, 77);
- } else {
- return Utils.rgbtoHexValue(77, 75, 182);
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java b/src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java
deleted file mode 100644
index 8cd9970625..0000000000
--- a/src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java
+++ /dev/null
@@ -1,297 +0,0 @@
-package gtPlusPlus.core.item.general;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-import static gtPlusPlus.core.lib.CORE.RANDOM;
-
-import java.util.List;
-
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.MathHelper;
-import net.minecraft.world.World;
-
-import gregtech.api.enums.ItemList;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.entity.item.ItemEntityGiantEgg;
-import gtPlusPlus.core.item.base.BaseItemTickable;
-import gtPlusPlus.core.item.general.spawn.ItemCustomSpawnEgg;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-
-public class ItemGiantEgg extends BaseItemTickable {
-
- private static ItemStack turnsIntoItem;
- private static ItemStack mCorrectEgg;
- private static ItemStack mCorrectStemCells;
-
- public void registerFuel(int burn) {
- CORE.burnables.add(new Pair<Integer, ItemStack>(burn, ItemUtils.getSimpleStack(this, 1)));
- }
-
- public final void registerOrdictionary(String name) {
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), name);
- }
-
- public ItemGiantEgg() {
- this(
- Utils.rgbtoHexValue(255, 255, 255),
- Short.MAX_VALUE * Byte.MAX_VALUE,
- new String[] { "I had best try disassemble this.. for science!" });
- }
-
- private ItemGiantEgg(int colour, int maxTicks, String[] desc1) {
- super(true, false, "itemBigEgg", colour, maxTicks, desc1);
- setTextureName(GTPlusPlus.ID + ":itemBigEgg");
- this.setMaxStackSize(1);
- registerFuel(5000);
- registerOrdictionary("fuelLargeChickenEgg");
- }
-
- public static void postInit(ItemGiantEgg aGiantEggItem) {
- ItemGiantEgg.turnsIntoItem = getSpawnEggStack();
- // new DecayableRecipe(aGiantEggItem.maxTicks, getSimpleStack(aGiantEggItem),
- // ItemUtils.getSimpleStack(ItemGiantEgg.turnsIntoItem, 1));
- }
-
- private static ItemStack getSpawnEggStack() {
- // Set the correct egg for future hatches
- if (mCorrectEgg == null) {
- /*
- * for (int g=0;g<Byte.MAX_VALUE;g++) { ItemStack mSpawn = ItemUtils.simpleMetaStack(Items.spawn_egg, g, 1);
- * if (mSpawn != null) { //String s = ("" + StatCollector.translateToLocal(mSpawn.getUnlocalizedName() +
- * ".name")).trim(); String s1 = EntityList.getStringFromID(mSpawn.getItemDamage()); if (s1 != null){ //s =
- * s + " " + StatCollector.translateToLocal("entity." + s1 + ".name"); if
- * (s1.equalsIgnoreCase("bigChickenFriendly")) { mCorrectEgg = mSpawn; return mCorrectEgg; } } } }
- */
- ItemStack aTempEgg = ItemCustomSpawnEgg.getSpawnEggForEntityname("bigChickenFriendly", 1);
- if (aTempEgg != null) {
- mCorrectEgg = aTempEgg;
- }
- }
- return mCorrectEgg;
- }
-
- private static ItemStack getStemCellStack() {
- if (mCorrectStemCells == null) {
- mCorrectStemCells = ItemList.Circuit_Chip_Stemcell.get(1);
- }
- return mCorrectStemCells;
- }
-
- @Override
- protected int getMaxTicks(ItemStack aStack) {
- if (aStack != null && aStack.hasTagCompound() && aStack.getTagCompound().hasKey("mEggAge")) {
- return NBTUtils.getInteger(aStack, "mEggAge");
- }
- return maxTicks;
- }
-
- @Override
- public void registerIcons(final IIconRegister i) {
- this.mIcon[0] = i.registerIcon(GTPlusPlus.ID + ":" + "itemBigEgg");
- }
-
- @Override
- protected boolean createNBT(World world, ItemStack aStack) {
-
- if (aStack.getTagCompound() != null && aStack.getTagCompound().hasKey("size")) {
- return false;
- }
- Logger.INFO("Egg: " + ReflectionUtils.getMethodName(1));
- Logger.INFO("Egg: " + ReflectionUtils.getMethodName(2));
- Logger.INFO("Egg: " + ReflectionUtils.getMethodName(3));
- Logger.INFO("Egg: " + ReflectionUtils.getMethodName(4));
- Logger.INFO("Egg: " + ReflectionUtils.getMethodName(5));
- Logger.INFO("Egg: " + ReflectionUtils.getMethodName(6));
- // Logger.INFO("Creating Egg NBT.");
- boolean aSuper = super.createNBT(world, aStack);
- int size = MathUtils.randInt(1, 8);
- NBTUtils.setInteger(aStack, "size", size);
- NBTUtils.setInteger(aStack, "mEggAge", ((MathUtils.randInt(8000, 16000) * size)));
- ItemStack aStemCells = getStemCellStack();
- if (aStemCells != null) {
- int mSize = NBTUtils.getInteger(aStack, "size");
- float mSizeMod = (MathUtils.randInt(-5, 5) / 5);
- mSize += mSizeMod;
- mSize = Math.max(mSize, 1);
- ItemStack eggYolks[] = new ItemStack[mSize];
- for (int u = 0; u < mSize; u++) {
- eggYolks[u] = ItemUtils.getSimpleStack(aStemCells, MathUtils.randInt(1, 4));
- }
- int mexpected = 0;
- for (ItemStack e : eggYolks) {
- if (e != null) {
- mexpected += e.stackSize;
- }
- }
- if (mexpected > 0) {
- NBTUtils.setInteger(aStack, "mExpected", mexpected);
- NBTUtils.writeItemsToGtCraftingComponents(
- aStack,
- new ItemStack[] { ItemUtils.getSimpleStack(aStemCells, mexpected) },
- true);
- }
- }
- return aSuper;
- }
-
- @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 == null || iStack == null) {
- return;
- }
- if (world.isRemote) {
- return;
- }
- if (iStack.getTagCompound() == null || !iStack.getTagCompound().hasKey("size")) {
- this.createNBT(world, iStack);
- Logger.INFO("Egg has no NBT, creating (onUpdate)");
- }
- boolean a1, a2;
- a1 = this.isTicking(world, iStack);
- a2 = a1 ? tickItemTag(world, iStack) : false;
-
- // Logger.INFO("Is Ticking? "+a1);
- // Logger.INFO("Did Tick? "+a2);
- if (!a1 && !a2) {
- if (entityHolding instanceof EntityPlayer) {
- if (MathUtils.randInt(0, 1000) >= 990) {
- if (NBTUtils.hasKey(iStack, "size")) {
- if ((NBTUtils.getInteger(iStack, "size") + 1) >= MathUtils.randInt(0, 9)) {
- ItemStack replacement = ItemUtils.getSimpleStack(getHatchResult(), 1);
- if (replacement == null) {}
-
- // Logger.INFO("Replacing "+iStack.getDisplayName()+" with
- // "+replacement.getDisplayName()+".");
- final ItemStack tempTransform = replacement.copy();
- if (iStack.stackSize > 1) {
- int u = iStack.stackSize;
- tempTransform.stackSize = u;
- ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
- for (int l = 0; l < u; l++) {
- ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
- }
- } else {
- tempTransform.stackSize = 1;
- ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform));
- ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
- }
- }
- }
- }
- }
- }
- }
-
- public ItemStack getHatchResult() {
- return turnsIntoItem;
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- String localName = super.getItemStackDisplayName(aStack);
- /*
- * if (aStack.getTagCompound() == null){ createNBT(null, aStack);
- * Logger.INFO("Egg has no NBT, creating (getDisplayName)"); }
- */
- int size = 1;
- if (NBTUtils.hasKey(aStack, "size")) {
- size = NBTUtils.getInteger(aStack, "size");
- return "" + size + " " + localName;
- }
- return "?? " + localName;
- }
-
- @Override
- public boolean hasCustomEntity(ItemStack stack) {
- return true;
- }
-
- @Override
- public Entity createEntity(World world, Entity location, ItemStack itemstack) {
- if (location instanceof EntityPlayer) {
- EntityPlayer player = (EntityPlayer) location;
- if (itemstack == null) {
- return null;
- } else if (itemstack.stackSize == 0) {
- return null;
- } else {
- ItemEntityGiantEgg entityitem = new ItemEntityGiantEgg(
- world,
- player.posX,
- player.posY - 0.30000001192092896D + (double) player.getEyeHeight(),
- player.posZ,
- itemstack);
- entityitem.delayBeforeCanPickup = 40;
- entityitem.func_145799_b(player.getCommandSenderName());
- float f = 0.1F;
- float f1;
- f = 0.3F;
- entityitem.motionX = (double) (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI)
- * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)
- * f);
- entityitem.motionZ = (double) (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI)
- * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)
- * f);
- entityitem.motionY = (double) (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI) * f
- + 0.1F);
- f = 0.02F;
- f1 = RANDOM.nextFloat() * (float) Math.PI * 2.0F;
- f *= RANDOM.nextFloat();
- entityitem.motionX += Math.cos((double) f1) * (double) f;
- entityitem.motionY += (double) ((RANDOM.nextFloat() - RANDOM.nextFloat()) * 0.1F);
- entityitem.motionZ += Math.sin((double) f1) * (double) f;
- return entityitem;
- }
- }
- return null;
- }
-
- @Override
- public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
- int size = 0;
- long age = 0;
- long life = 0;
- int expected = 0;
- if (this.descriptionString.length > 0) {
- list.add(EnumChatFormatting.GRAY + this.descriptionString[0]);
- }
- if (NBTUtils.hasKey(stack, "size")) {
- size = NBTUtils.getInteger(stack, "size");
- if (size > 0 && NBTUtils.hasKey(stack, "TickableItem")) {
- NBTTagCompound aNBT = stack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("TickableItem");
- if (aNBT != null) {
- age = aNBT.getLong("Tick");
- }
- }
- }
- if (NBTUtils.hasKey(stack, "mEggAge")) {
- life = NBTUtils.getInteger(stack, "mEggAge");
- }
- if (NBTUtils.hasKey(stack, "mExpected")) {
- expected = NBTUtils.getInteger(stack, "mExpected");
- }
- }
- String aSize = size > 0 ? "" + size : "??";
- String aExpected = expected > 0 ? "" + expected : "??";
- String aAge = age > 0 ? "" + (age / 20) : "??";
- String aLife = life > 0 ? "" + (life / 20) : "??";
- list.add("Egg Size: " + aSize + " ounces");
- list.add("Expected Stem Cells: " + aExpected);
- list.add("Age: " + aAge + "s" + " / " + aLife + "s");
- list.add("Larger eggs take longer to hatch,");
- list.add("but have a better chance of hatching.");
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java b/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java
deleted file mode 100644
index 3dd1abe58f..0000000000
--- a/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package gtPlusPlus.core.item.general;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.item.EnumRarity;
-import net.minecraft.util.EnumChatFormatting;
-
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.item.base.CoreItem;
-
-public class ItemSunnariumBit extends CoreItem {
-
- public ItemSunnariumBit() {
- super(
- "SunnariumBit",
- "Sunnarium Bit",
- AddToCreativeTab.tabMisc,
- 64,
- 0,
- new String[] {},
- EnumRarity.uncommon,
- EnumChatFormatting.GOLD,
- false,
- null);
- this.setTextureName(GTPlusPlus.ID + ":" + "itemSunnariumBit");
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java b/src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java
deleted file mode 100644
index 671a1ec344..0000000000
--- a/src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java
+++ /dev/null
@@ -1,307 +0,0 @@
-package gtPlusPlus.core.item.general;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.List;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-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.MathHelper;
-import net.minecraft.util.StatCollector;
-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;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import ic2.api.item.ElectricItem;
-import ic2.api.item.IElectricItem;
-import ic2.api.item.IElectricItemManager;
-
-public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, IElectricItemManager, IFuelHandler {
-
- public static double rfPerEU = 3.4;
- private final String unlocalizedName = "rfEUBattery";
- private final ItemStack thisStack;
- private static final int maxValueEU = 100000000;
- private static final int maxValueRF = (int) (maxValueEU * rfPerEU);
- protected double chargeEU = 0;
-
- public RF2EU_Battery() {
- super(maxValueRF);
- GameRegistry.registerFuelHandler(this);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.setUnlocalizedName(this.unlocalizedName);
- this.setMaxStackSize(1);
- this.setTextureName(GTPlusPlus.ID + ":" + "itemIngot");
- this.thisStack = ItemUtils.getSimpleStack(this);
- GameRegistry.registerItem(this, this.unlocalizedName);
- }
-
- @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_);
- }
-
- @Override
- public boolean canProvideEnergy(final ItemStack itemStack) {
- return true;
- }
-
- @Override
- public Item getChargedItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(maxValueEU);
- return x.getItem();
- }
-
- @Override
- public Item getEmptyItem(final ItemStack itemStack) {
- final ItemStack x = itemStack.copy();
- x.setItemDamage(0);
- return x.getItem();
- }
-
- @Override
- public double getMaxCharge(final ItemStack itemStack) {
- return maxValueEU;
- }
-
- @Override
- public int getTier(final ItemStack itemStack) {
- return 3;
- }
-
- @Override
- public double getTransferLimit(final ItemStack itemStack) {
- return 8196;
- }
-
- @Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- // return 1.0D - getEnergyStored(stack) / this.capacity;
- return MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(final ItemStack par1ItemStack, final int par2) {
- final int i = 30;
-
- final float f13 = (((Minecraft.getSystemTime() % 6000L) / 3000.0F) * CORE.PI * 2.0F);
-
- final float t = 0.9F + (0.1F * MathHelper.cos(f13));
-
- final double v = 1.0D - this.getDurabilityForDisplay(par1ItemStack);
-
- int r = i + (int) (v * (255 - i) * t);
- if (r > 255) {
- r = 255;
- }
- final int g = i + (int) (v * (64 - i) * t);
-
- return (r << 16) | (g << 8) | i;
- }
-
- @Override
- public boolean showDurabilityBar(final ItemStack stack) {
- return false;
- }
-
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- list.add(StatCollector.translateToLocal("item.rfEUBattery.tooltip.0"));
- list.add(
- StatCollector.translateToLocalFormatted(
- "item.rfEUBattery.tooltip.1",
- this.getTier(this.thisStack),
- (long) this.getCharge(stack)));
- list.add(
- StatCollector.translateToLocalFormatted(
- "item.rfEUBattery.tooltip.2",
- this.getTransferLimit(this.thisStack),
- (this.getBurnTime(stack) / 20)));
- list.add("");
- list.add(StatCollector.translateToLocal("item.rfEUBattery.tooltip.3"));
- list.add(
- StatCollector
- .translateToLocalFormatted("item.rfEUBattery.tooltip.4", this.maxExtract, this.maxReceive));
- list.add(
- StatCollector.translateToLocalFormatted(
- "item.rfEUBattery.tooltip.5",
- this.getEnergyStored(stack),
- this.getMaxEnergyStored(stack),
- MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack))));
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public ItemStack getContainerItem(final ItemStack itemStack) {
- final ItemStack newItem = itemStack.copy();
- newItem.stackSize = 1;
- this.extractEnergy(newItem, 150000, false);
- return newItem;
- }
-
- @Override
- public boolean hasContainerItem(final ItemStack stack) {
- return true;
- }
-
- @Override
- public int getBurnTime(final ItemStack fuel) {
- if ((fuel == null) || (fuel.getItem() != this)) {
- return 0;
- }
- return this.extractEnergy(fuel, 150000, true) / 50 / 100;
- }
-
- @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 / rfPerEU, 3, true, false);
- }
- return ElectricItem.manager.charge(stack, amount, tier, ignoreTransferLimit, simulate);
- }
-
- @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 * 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 / rfPerEU, 3, true, false);
- }
-
- return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
- }
-
- @Override
- public double getCharge(final ItemStack stack) {
- return ElectricItem.manager.getCharge(stack);
- }
-
- @Override
- public boolean canUse(final ItemStack stack, final double amount) {
- return ElectricItem.manager.canUse(stack, amount);
- }
-
- @Override
- public boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) {
- return ElectricItem.manager.use(stack, amount, entity);
- }
-
- @Override
- public void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) {
- ElectricItem.manager.chargeFromArmor(stack, entity);
- }
-
- @Override
- public String getToolTip(final 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 * rfPerEU));
- }
- return 0;
- }
- int energy = container.stackTagCompound.getInteger("Energy");
- final 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 / rfPerEU, 3, true, false);
- }
- return energyReceived;
- }
-
- @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 * 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 / rfPerEU, 3, true, false);
- }
- return energyExtracted;
- }
-
- @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 * rfPerEU));
- }
- 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 / rfPerEU, 3, true, false);
- return energy;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java b/src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java
deleted file mode 100644
index 38e34a9a01..0000000000
--- a/src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java
+++ /dev/null
@@ -1,250 +0,0 @@
-package gtPlusPlus.core.item.general.capture;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.List;
-import java.util.UUID;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityList;
-import net.minecraft.entity.EntityLiving;
-import net.minecraft.entity.EntityLivingBase;
-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.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import gtPlusPlus.api.interfaces.IEntityCatcher;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.minecraft.BlockPos;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-
-public class ItemEntityCatcher extends Item implements IEntityCatcher {
-
- // PlayerInteractEvent.EntityInteract;
-
- public ItemEntityCatcher() {
- // Probably won't ever need this event handler.
- // Utils.registerEvent(this);
- this.setUnlocalizedName("itemDragonJar");
- this.setTextureName(GTPlusPlus.ID + ":" + getUnlocalizedName());
- this.setCreativeTab(AddToCreativeTab.tabMisc);
- this.setMaxStackSize(16);
- this.setMaxDamage(0);
- GameRegistry.registerItem(this, getUnlocalizedName());
- }
-
- @Override
- public boolean hasEntity(ItemStack aStack) {
- if (NBTUtils.hasKey(aStack, "mHasEntity")) {
- return NBTUtils.getBoolean(aStack, "mHasEntity");
- }
- return false;
- }
-
- @Override
- public Entity getStoredEntity(World aWorld, ItemStack aStack) {
- if (aStack == null || !hasEntity(aStack)) {
- Logger.INFO("Cannot get stored entity.");
- return null;
- }
-
- Entity mEntityToSpawn;
- int mEntityID;
- Logger.WARNING("getStoredEntity(1)");
-
- mEntityID = NBTUtils.getInteger(aStack, "mEntityID");
- mEntityToSpawn = EntityList.createEntityByID(mEntityID, aWorld);
- if (mEntityToSpawn != null) {
- Logger.WARNING("getStoredEntity(2)");
- return mEntityToSpawn;
- }
-
- Logger.INFO("Failed to get stored entity. - getStoredEntity()");
- return null;
- }
-
- @Override
- public boolean setStoredEntity(World aWorld, ItemStack aStack, Entity aEntity) {
- if (aEntity == null) {
- NBTUtils.setBoolean(aStack, "mHasEntity", false);
- Logger.INFO("Bad Entity being stored.");
- return false;
- }
-
- Logger.WARNING("setStoredEntity(1)");
-
- NBTTagCompound mEntityData;
- Class<? extends Entity> mEntityClass;
- String mClassName;
- String mEntityName;
- int mEntityID, mEntityHashcode;
- UUID mUuidPersistent, mUuidUnique;
- Logger.WARNING("setStoredEntity(2)");
-
- mEntityData = aEntity.getEntityData();
- mEntityClass = aEntity.getClass();
- mClassName = mEntityClass.getName();
- mEntityName = aEntity.getCommandSenderName();
- // mEntityID = aEntity.getEntityId();
- mEntityID = EntityList.getEntityID(aEntity);
- mEntityHashcode = aEntity.hashCode();
- mUuidPersistent = aEntity.getPersistentID();
- mUuidUnique = aEntity.getUniqueID();
- Logger.WARNING("setStoredEntity(3)");
-
- NBTUtils.createTagCompound(aStack, "mEntityData", mEntityData);
- NBTUtils.setString(aStack, "mEntityName", mEntityName);
- NBTUtils.setInteger(aStack, "mEntityID", mEntityID);
- NBTUtils.setString(aStack, "mClassName", mClassName);
- NBTUtils.setString(aStack, "mUuidPersistent", mUuidPersistent.toString());
- NBTUtils.setString(aStack, "mUuidUnique", mUuidUnique.toString());
- NBTUtils.setInteger(aStack, "mEntityHashcode", mEntityHashcode);
- NBTUtils.setBoolean(aStack, "mHasEntity", true);
- Logger.WARNING("setStoredEntity(4)");
- return true;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Entity> getStoredEntityClass(ItemStack aStack) {
- if (aStack == null || !hasEntity(aStack)) {
- return null;
- }
- Class<? extends Entity> mEntityClass;
- String mClassName;
- mClassName = NBTUtils.getString(aStack, "mClassName");
- mEntityClass = (Class<? extends Entity>) ReflectionUtils.getClass(mClassName);
- if (mEntityClass != null) {
- return mEntityClass;
- }
- return null;
- }
-
- @Override
- public boolean spawnStoredEntity(World aWorld, ItemStack aStack, BlockPos aPos) {
- if (aStack == null || !hasEntity(aStack)) {
- Logger.INFO("Cannot release, either invalid Itemstack or no entity stored.");
- return false;
- }
-
- NBTTagCompound mEntityData = NBTUtils.getTagCompound(aStack, "mEntityData");
-
- int mEntityID = NBTUtils.getInteger(aStack, "mEntityID");
- String mClassName = NBTUtils.getString(aStack, "mClassName");
- UUID mUuidPersistent = UUID.fromString(NBTUtils.getString(aStack, "mUuidPersistent"));
- UUID mUuidUnique = UUID.fromString(NBTUtils.getString(aStack, "mUuidUnique"));
- int mEntityHashcode = NBTUtils.getInteger(aStack, "mEntityHashcode");
-
- EntityLiving mEntityToSpawn = (EntityLiving) getStoredEntity(aWorld, aStack);
- Class<? extends Entity> mEntityClass = getStoredEntityClass(aStack);
-
- Logger.WARNING("spawnStoredEntity(1)");
-
- if (mEntityToSpawn != null && mEntityClass != null) {
- Logger.WARNING("spawnStoredEntity(2)");
- if (mEntityToSpawn.getEntityData() != mEntityData) {
- Logger.WARNING("spawnStoredEntity(x)");
- NBTUtils.setEntityCustomData(mEntityToSpawn, mEntityData);
- }
-
- mEntityToSpawn
- .setLocationAndAngles(aPos.xPos, aPos.yPos, aPos.zPos, aWorld.rand.nextFloat() * 360.0F, 0.0F);
- if (mEntityToSpawn != null) {
- mEntityToSpawn.onSpawnWithEgg(null);
- aWorld.spawnEntityInWorld(mEntityToSpawn);
- Logger.WARNING("spawnStoredEntity(3)");
- }
- if (mEntityToSpawn != null) {
- mEntityToSpawn.playLivingSound();
- Logger.WARNING("spawnStoredEntity(4)");
- }
- Logger.WARNING("spawnStoredEntity(5)");
- NBTUtils.setBoolean(aStack, "mHasEntity", false);
- return true;
- }
- Logger.INFO("Failed to spawn stored entity. - spawnStoredEntity()");
- return false;
- }
-
- @Override
- public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- return super.onItemRightClick(aStack, aWorld, aPlayer);
- }
-
- @Override
- public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
- if (hasEntity(p_77624_1_)) {
- String mName = NBTUtils.getString(p_77624_1_, "mEntityName");
- if (mName != null && !mName.equals("")) {
- p_77624_3_.add(
- EnumChatFormatting.GRAY
- + StatCollector.translateToLocalFormatted("item.itemDragonJar.1.tooltip", mName));
- }
- } else {
- p_77624_3_.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.itemDragonJar.0.tooltip"));
- }
- }
-
- @Override
- public boolean showDurabilityBar(ItemStack stack) {
- return false;
- }
-
- @Override
- public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side,
- float xOffset, float yOffset, float zOffset) {
- if (Utils.isServer()) {
- Logger.WARNING("Trying to release (1)");
- if (NBTUtils.hasKey(itemstack, "mHasEntity") && NBTUtils.getBoolean(itemstack, "mHasEntity")) {
- Logger.WARNING("Trying to release (2)");
- boolean mDidSpawn = spawnStoredEntity(world, itemstack, new BlockPos(x, y + 1, z, world));
-
- if (!mDidSpawn) {
- PlayerUtils.messagePlayer(
- player,
- "You failed to release a " + NBTUtils.getString(itemstack, "mEntityName") + ".");
- }
-
- return mDidSpawn;
- }
- }
- return super.onItemUse(itemstack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
- }
-
- @Override
- public boolean itemInteractionForEntity(ItemStack aStack, EntityPlayer aPlayer, EntityLivingBase aEntity) {
- if (Utils.isServer()) {
- Logger.WARNING("Trying to catch (1)");
- if (!hasEntity(aStack)) {
- Logger.WARNING("Trying to catch (2)");
- boolean mStored = setStoredEntity(aPlayer.worldObj, aStack, aEntity);
- if (mStored) {
- Logger.WARNING("Trying to catch (3)");
- aEntity.setDead();
- PlayerUtils.messagePlayer(
- aPlayer,
- "You have captured a " + NBTUtils.getString(aStack, "mEntityName") + " in the Jar.");
- // NBTUtils.tryIterateNBTData(aStack);
- }
- }
- }
- return super.itemInteractionForEntity(aStack, aPlayer, aEntity);
- }
-
- @Override
- public String getItemStackDisplayName(ItemStack aStack) {
- if (hasEntity(aStack)) {
- return StatCollector.translateToLocal("item.itemDragonJar.1.name");
- }
- return StatCollector.translateToLocal("item.itemDragonJar.0.name");
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java b/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java
index 475707e950..31d69044cc 100644
--- a/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java
+++ b/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java
@@ -20,7 +20,6 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.entity.projectile.EntityThrowableBomb;
-import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.item.base.CoreItem;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
@@ -54,7 +53,6 @@ public class ItemThrowableBomb extends CoreItem {
mLighters.put(ItemList.Tool_Lighter_Invar_Used.get(1));
mLighters.put(ItemList.Tool_Lighter_Platinum_Full.get(1));
mLighters.put(ItemList.Tool_Lighter_Platinum_Used.get(1));
- mLighters.put(ItemUtils.getSimpleStack(ModItems.itemBasicFireMaker));
}
// Unlit
diff --git a/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java b/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java
index aa44b467ce..acddd58a7b 100644
--- a/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java
+++ b/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java
@@ -1,20 +1,13 @@
package gtPlusPlus.core.item.init;
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.item.ItemStack;
-import net.minecraft.potion.Potion;
-import net.minecraft.potion.PotionEffect;
-import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.item.base.foods.BaseItemFood;
-import gtPlusPlus.core.item.base.foods.BaseItemHotFood;
import gtPlusPlus.core.item.food.BaseItemMetaFood;
import gtPlusPlus.core.util.minecraft.EntityUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
@@ -28,69 +21,6 @@ public class ItemsFoods {
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.getItemStackFromFQRN(GTPlusPlus.ID + ":itemIngotRaisinBread", 1));
- // Hot Raisin Bread
- ModItems.itemHotIngotRaisinBread = new BaseItemHotFood(
- "itemHotIngotRaisinBread",
- 1,
- 0.5f,
- "Raisin Bread",
- 120,
- ModItems.itemIngotRaisinBread);
- GT_OreDictUnificator.registerOre(
- "foodHotRaisinBread",
- ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemHotIngotRaisinBread", 1));
-
- // Raisin Bread
- ModItems.itemFoodRaisinToast = new BaseItemFood("itemFoodRaisinToast", "Raisin Toast", 1, 0.5f, false)
- .setAlwaysEdible();
- GT_OreDictUnificator.registerOre(
- "foodRaisinToast",
- ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemFoodRaisinToast", 1));
- // Hot Raisin Bread
- ModItems.itemHotFoodRaisinToast = new BaseItemHotFood(
- "itemHotFoodRaisinToast",
- 1,
- 0.5f,
- "Raisin Toast",
- 20,
- ModItems.itemFoodRaisinToast);
- GT_OreDictUnificator.registerOre(
- "foodHotRaisinToast",
- ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemHotFoodRaisinToast", 1));
-
- // Raisin Bread
- ModItems.itemFoodCurriedSausages = new BaseItemFood(
- "itemFoodCurriedSausages",
- "Curried Sausages",
- 5,
- 2f,
- false);
- GT_OreDictUnificator.registerOre(
- "foodCurriedSausages",
- ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemFoodCurriedSausages", 1));
- // Hot Raisin Bread
- ModItems.itemHotFoodCurriedSausages = new BaseItemHotFood(
- "itemHotFoodCurriedSausages",
- 1,
- 0.5f,
- "Curried Sausages",
- 240,
- ModItems.itemFoodCurriedSausages);
- GT_OreDictUnificator.registerOre(
- "foodHotCurriedSausages",
- ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemHotFoodCurriedSausages", 1));
-
ModItems.itemMetaFood = new BaseItemMetaFood();
BaseItemMetaFood.registerFoodsToOreDict();
addCookingRecipes();
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java b/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
index a614a2b737..2c550962c9 100644
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
+++ b/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
@@ -2,6 +2,7 @@ package gtPlusPlus.core.item.tool.misc;
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.Mods.GTPlusPlus;
+import static gregtech.api.util.GT_Utility.formatNumbers;
import java.util.ArrayList;
import java.util.BitSet;
@@ -202,7 +203,7 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
EnumChatFormatting.BLUE + (f != null ? "" + f.amount : "" + 0)
+ "L"
+ " / "
- + getCapacity(aStack)
+ + formatNumbers(getCapacity(aStack))
+ "L");
}
@@ -212,7 +213,7 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
aList.add(
EnumChatFormatting.AQUA + StatCollector.translateToLocalFormatted(
"item.itemBaseEuItem.tooltip.1",
- GT_Utility.formatNumbers(tStats[3]),
+ formatNumbers(tStats[3]),
(tStats[2] >= 0 ? tStats[2] : 0)) + EnumChatFormatting.GRAY);
} else {
final long tCharge = this.getRealCharge(aStack);
@@ -224,8 +225,8 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
aList.add(
EnumChatFormatting.AQUA + StatCollector.translateToLocalFormatted(
"item.itemBaseEuItem.tooltip.3",
- GT_Utility.formatNumbers(tCharge),
- GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: ",
+ formatNumbers(tCharge),
+ formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: ",
V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)])
+ EnumChatFormatting.GRAY);
}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java b/src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java
deleted file mode 100644
index dbaee70bd0..0000000000
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package gtPlusPlus.core.item.tool.misc;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-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;
-import gtPlusPlus.core.item.base.BaseItemWithDamageValue;
-
-public class SandstoneHammer extends BaseItemWithDamageValue {
-
- /*
- * (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 SandstoneHammer(final String unlocalizedName) {
- super(unlocalizedName);
- this.setTextureName(GTPlusPlus.ID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
- this.setMaxDamage(2500);
- }
-
- @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.");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- @Override
- public boolean doesContainerItemLeaveCraftingGrid(final ItemStack itemStack) {
- return false;
- }
-
- @Override
- public boolean getShareTag() {
- return true;
- }
-
- @Override
- public boolean hasContainerItem(final ItemStack itemStack) {
- return true;
- }
-
- @Override
- public ItemStack getContainerItem(final ItemStack itemStack) {
- itemStack.setItemDamage(itemStack.getItemDamage() + 8);
-
- return itemStack;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
- return EnumRarity.uncommon;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack, final int pass) {
- return false;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java
deleted file mode 100644
index 492adc4e07..0000000000
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package gtPlusPlus.core.item.tool.misc.box;
-
-public class AutoLunchBox extends BaseBoxItem {
-
- public static final int SLOTS = 9;
-
- public AutoLunchBox(String displayName) {
- super(
- displayName,
- new String[] { "Stores 9 pieces of food",
- "Food will automatically be eaten from slot 1, through to "
- + gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS },
- gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java
deleted file mode 100644
index e121bb5085..0000000000
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package gtPlusPlus.core.item.tool.misc.box;
-
-public class MagicToolBag extends BaseBoxItem {
-
- public static final int SLOTS = 24;
-
- public MagicToolBag(String displayName) {
- super(
- displayName,
- new String[] { "Can store magic tools from TC, BM, etc",
- "Please ask for additional mod support on Github" },
- gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java
deleted file mode 100644
index b39609fb02..0000000000
--- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package gtPlusPlus.core.item.tool.misc.box;
-
-import gtPlusPlus.core.handler.GuiHandler;
-
-public class UniversalToolBox extends BaseBoxItem {
-
- public static final int SLOTS = 16;
-
- public UniversalToolBox(String displayName) {
- super(
- displayName,
- new String[] { "Can store tools from Gregtech, IC2, BC, Forestry",
- "Please ask for additional mod support on Github" },
- GuiHandler.GUI10);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
deleted file mode 100644
index d4caadc7f7..0000000000
--- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
+++ /dev/null
@@ -1,287 +0,0 @@
-package gtPlusPlus.core.item.tool.staballoy;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-import static gregtech.api.enums.Mods.Minecraft;
-
-import java.util.List;
-
-import net.minecraft.block.Block;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.enchantment.Enchantment;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.EnumRarity;
-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;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.RecipeUtils;
-
-public class MultiPickaxeBase extends StaballoyPickaxe {
-
- /*
- * (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;
- }
-
- protected boolean canBreak = true;
- protected final int colour;
- protected final String materialName;
- protected final String displayName;
- public boolean isValid = true;
- private final Pair<?, ?> enchantment;
-
- public MultiPickaxeBase(final String unlocalizedName, final ToolMaterial material, final long materialDurability,
- final int colour, final Object enchant) {
- super(Utils.sanitizeString(unlocalizedName), material);
- this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName));
- // this.setTextureName(GTPlusPlus.ID + ":" + "itemPickaxe");
- this.setTextureName(Minecraft.ID + ":" + "iron_pickaxe");
- this.setMaxStackSize(1);
- if ((materialDurability * 3) <= Integer.MAX_VALUE) {
- this.setMaxDamage((int) (materialDurability * 3));
- } else {
- this.setMaxDamage(Integer.MAX_VALUE);
- this.canBreak = false;
- }
- this.colour = colour;
- this.materialName = material.name();
- this.displayName = unlocalizedName;
- this.setCreativeTab(AddToCreativeTab.tabTools);
- this.miningLevel = material.getHarvestLevel();
-
- if (enchant != null) {
- if (enchant instanceof Pair) {
- this.enchantment = (Pair<?, ?>) enchant;
- } else {
- this.enchantment = null;
- }
- } else {
- this.enchantment = null;
- }
-
- try {
- this.isValid = this.addRecipe();
- } catch (final Throwable e) {}
- if ((colour != 0) && this.isValid && (materialDurability > 10000)) {
- if (GameRegistry.findItem(GTPlusPlus.ID, Utils.sanitizeString(unlocalizedName)) == null) {
- GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName));
- }
- }
- }
-
- /*
- * Methods
- */
-
- private boolean addRecipe() {
-
- final String cleanName = Utils.sanitizeString(this.materialName);
-
- final String plateDense = "plateDense" + cleanName;
- final String plateDouble = "plateDouble" + cleanName;
- final String rodLong = "stickLong" + cleanName;
- final String toolHammer = "craftingToolHardHammer";
- final String toolWrench = "craftingToolWrench";
- final String toolFile = "craftingToolFile";
- final String toolScrewDriver = "craftingToolScrewdriver";
-
- if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)) {
- Logger.WARNING("stickLong of " + cleanName + " does not exist.");
- return false;
- }
- if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)) {
- Logger.WARNING("plateDense of " + cleanName + " does not exist.");
- if (null != ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDouble, 1)) {
- Logger.WARNING("plateDouble of " + cleanName + " does exist. Using it instead.");
- RecipeUtils.recipeBuilder(
- plateDouble,
- plateDouble,
- plateDouble,
- toolFile,
- rodLong,
- toolHammer,
- toolWrench,
- rodLong,
- toolScrewDriver,
- ItemUtils.getSimpleStack(this));
-
- return true;
- }
- Logger.WARNING("plateDouble of " + cleanName + " does not exist.");
- return false;
- }
-
- RecipeUtils.recipeBuilder(
- plateDense,
- plateDense,
- plateDense,
- toolFile,
- rodLong,
- toolHammer,
- toolWrench,
- rodLong,
- toolScrewDriver,
- ItemUtils.getSimpleStack(this));
-
- return true;
- }
-
- public final String getMaterialName() {
- return this.materialName;
- }
-
- @Override
- public String getItemStackDisplayName(final ItemStack iStack) {
- return this.displayName;
- }
-
- @Override
- public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) {
- if (this.colour == 0) {
- return MathUtils.generateSingularRandomHexValue();
- }
- return this.colour;
- }
-
- 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;
- Logger.INFO("Hardness: " + bHardness);
-
- bDurabilityLoss = 100;
- // Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
-
- correctTool = this.canPickaxeBlock(removalist, world, new int[] { X, Y, Z });
- Logger.WARNING("" + correctTool);
-
- if (!correctTool) {
- return 0;
- }
-
- } catch (final NullPointerException e) {
-
- }
- }
- return bDurabilityLoss;
- }
-
- // Should clear up blocks quicker if I chain it.
- /*
- * @Override public void removeBlockAndDropAsItem(World world, int X, int Y, int Z, ItemStack heldItem){ localWorld
- * = world; try { 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, world, new int[]{X,Y,Z}, miningLevel)){ if
- * (canPickaxeBlock(block, world, new int[]{X,Y,Z})){ 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 { return; } } } else {
- * Utils.LOG_WARNING("Incorrect Tool for mining this block."); } } } catch (NullPointerException e){ } }
- */
-
- @Override
- public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer) {
- if (this.canBreak) {
- item.damageItem(damage, localPlayer);
- }
- }
-
- @Override
- public void setItemDamage(final ItemStack item, final int damage) {
- if (this.canBreak) {
- item.setItemDamage(damage - 1);
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
- return EnumRarity.uncommon;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack, final int pass) {
- return false;
- }
-
- @Override
- public void onCreated(final ItemStack mThisItem, final World mWorld, final EntityPlayer mPlayer) {
- Enchantment enchant = null;
- int enchantmentLevel = 0;
- final Pair<?, ?> Y = this.enchantment;
- if (Y != null) {
- if (Y.getKey() != null) {
- enchant = (Enchantment) this.enchantment.getKey();
- }
- if (Y.getValue() != null) {
- enchantmentLevel = ((Integer) this.enchantment.getValue()).intValue();
- }
- }
- final ItemStack itemToEnchant = mThisItem;
- if ((enchant != null) && (enchantmentLevel != 0) && (enchantmentLevel >= 1)) {
- itemToEnchant.addEnchantment(enchant, enchantmentLevel);
- }
- super.onCreated(itemToEnchant, mWorld, mPlayer);
- }
-
- @Override
- public void getSubItems(final Item mItem, final CreativeTabs mCreativeTab, final List mList) {
- Enchantment enchant = null;
- int enchantmentLevel = 0;
- final Pair<?, ?> Y = this.enchantment;
- if (Y != null) {
- if (Y.getKey() != null) {
- enchant = (Enchantment) this.enchantment.getKey();
- }
- if (Y.getValue() != null) {
- enchantmentLevel = ((Integer) this.enchantment.getValue()).intValue();
- }
- }
-
- final Item thisItem = mItem;
- final ItemStack itemToEnchant = ItemUtils.getSimpleStack(thisItem);
- if ((enchant != null) && (enchantmentLevel != 0) && (enchantmentLevel >= 1)) {
- itemToEnchant.addEnchantment(enchant, enchantmentLevel);
- mList.add(itemToEnchant);
- } else {
- mList.add(new ItemStack(thisItem, 1, 0));
- }
- }
-
- /**
- *
- * Time to Override Minecraft stupid mechanics, allowing unbreakable stuff.
- *
- */
- @Override
- public boolean isDamageable() {
- if (this.getMaxDamage() > 0 && !this.hasSubtypes) {
- if (this.canBreak) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
deleted file mode 100644
index 660ec408c1..0000000000
--- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
+++ /dev/null
@@ -1,372 +0,0 @@
-package gtPlusPlus.core.item.tool.staballoy;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.List;
-
-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.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 String mat;
-
- public StaballoyAxe(final String unlocalizedName, final ToolMaterial material) {
- super(material);
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(GTPlusPlus.ID + ":" + unlocalizedName);
- }
-
- // EXPLODE TREE
- byte[] tre = new byte[32000];
- byte unchecked = 0;
- byte needcheck = 1;
- byte ignore = 2;
- byte harvest = 3;
-
- 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;
- }
- 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.");
- super.addInformation(stack, aPlayer, list, bool);
- }
-
- public static 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());
- 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 (!canIgnore(bit)) {
- return 2;
- }
- }
- }
- return f;
- }
-
- public int checkTree(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.check(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;
- }
- }
- }
- }
- }
- return 1;
- }
-
- 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;
- }
- }
- }
- }
- } else if (bit instanceof BlockLeavesBase) {} else {
- if (!canIgnore(bit)) {
- return 2;
- }
- }
- }
- return f;
- }
-
- 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;
- }
- }
- }
- }
-
- 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 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);
- }
- }
- }
- }
- }
- }
-
- private static 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 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) {
- 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
- 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);
- 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);
- }
- }
-
- 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);
- }
- }
- }
- }
- return super.onBlockDestroyed(itm, wld, blk, x, y, z, plr);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public EnumRarity getRarity(final ItemStack par1ItemStack) {
- return EnumRarity.rare;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack, final int pass) {
- return true;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
deleted file mode 100644
index 9601662c39..0000000000
--- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
+++ /dev/null
@@ -1,458 +0,0 @@
-package gtPlusPlus.core.item.tool.staballoy;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-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.EnumRarity;
-import net.minecraft.item.ItemPickaxe;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-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;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.util.minecraft.MiningUtils;
-
-public class StaballoyPickaxe extends ItemPickaxe {
-
- /*
- * (non-Javadoc)
- * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
- */
- @Override
- public double getDurabilityForDisplay(final ItemStack stack) {
- return (double) stack.getItemDamageForDisplay() / (double) stack.getMaxDamage();
- }
-
- /**
- * Creates an NBT tag for this item if it doesn't have one. This also set some default values.
- *
- * @param rStack
- * @return
- */
- private static boolean createNBT(ItemStack rStack) {
- final NBTTagCompound tagMain = new NBTTagCompound();
- final NBTTagCompound tagNBT = new NBTTagCompound();
-
- tagNBT.setBoolean("FACING_HORIZONTAL", true);
- tagNBT.setString("FACING", "north");
- tagNBT.setString("lookingDirection", "");
-
- tagMain.setTag("PickStats", tagNBT);
- rStack.setTagCompound(tagMain);
- return true;
- }
-
- /*
- * Is the player facing horizontally?
- */
-
- public static final boolean isFacingHorizontal(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- return aNBT.getBoolean("FACING_HORIZONTAL");
- }
- } else {
- createNBT(aStack);
- }
- return true;
- }
-
- public static final boolean setFacingHorizontal(final ItemStack aStack, final boolean aFacingHorizontal) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- aNBT.setBoolean("FACING_HORIZONTAL", aFacingHorizontal);
- return true;
- }
- }
- return false;
- }
-
- /*
- * Handles the Direction the player is facing
- */
-
- public static final String getFacingDirection(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- return aNBT.getString("FACING");
- }
- } else {
- createNBT(aStack);
- }
- return "north";
- }
-
- public static final boolean setFacingDirection(final ItemStack aStack, final String aFacingHorizontal) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- aNBT.setString("FACING", aFacingHorizontal);
- return true;
- }
- }
- return false;
- }
-
- /*
- * The Looking Direction handlers
- */
-
- public static final String getLookingDirection(final ItemStack aStack) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- return aNBT.getString("lookingDirection");
- }
- } else {
- createNBT(aStack);
- }
- return "";
- }
-
- public static final boolean setLookingDirection(final ItemStack aStack, final String aFacingHorizontal) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- aNBT = aNBT.getCompoundTag("PickStats");
- if (aNBT != null) {
- aNBT.setString("lookingDirection", aFacingHorizontal);
- return true;
- }
- }
- return false;
- }
-
- protected int miningLevel;
-
- /*
- * Methods
- */
-
- @Override
- public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer aPlayer) {
- return super.onItemRightClick(stack, world, aPlayer);
- }
-
- @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) {
- if (!world.isRemote) {
- if (entity instanceof EntityPlayer) {
- this.GetDestroyOrientation(
- (EntityPlayer) entity,
- block,
- getLookingDirection(stack),
- world,
- X,
- Y,
- Z,
- stack);
- }
- }
- return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
- }
-
- 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);
- Logger.WARNING("Hardness: " + bHardness);
-
- bDurabilityLoss = (bDurabilityLoss + bHardness);
- // Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
-
- correctTool = this.canPickaxeBlock(removalist, world, new int[] { X, Y, Z });
- Logger.WARNING("" + correctTool);
-
- if (!correctTool) {
- return 0;
- }
-
- } catch (final NullPointerException e) {
-
- }
- }
- return 100;
- }
-
- public Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld, final int[] xyz) {
- String correctTool = "";
- if (!currentWorld.isRemote) {
- try {
- correctTool = currentBlock.getHarvestTool(0);
- if (MiningUtils.getBlockType(currentBlock, currentWorld, xyz, this.miningLevel)
- || correctTool.equals("pickaxe")
- || correctTool.equals("null")) {
- // Utils.LOG_WARNING(correctTool);
- return true;
- }
- } catch (final NullPointerException e) {
- return false;
- }
- }
- return false;
- }
-
- private void GetDestroyOrientation(EntityPlayer entity, final Block block, final String FACING, final World world,
- final int X, final int Y, final int Z, final ItemStack heldItem) {
- float DURABILITY_LOSS = 0;
- if (!world.isRemote) {
-
- Logger.WARNING("hardness:" + block.getBlockHardness(world, X, Y, Z));
- 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);
- Logger.WARNING("Added Loss: " + dur);
- this.removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem);
- }
- }
- } 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);
- Logger.WARNING("Added Loss: " + dur);
- this.removeBlockAndDropAsItem(world, X, Y + i, Z + j, heldItem);
- }
- }
- } 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);
- Logger.WARNING("Added Loss: " + dur);
- this.removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem);
- }
- }
- }
-
- // int heldItemDurability = heldItem.getDamage(1);
- Logger.WARNING("Total Loss: " + (int) DURABILITY_LOSS);
- // heldItem.setDamage(heldStack, DURABILITY_LOSS);
- // Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
- // Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack));
- Logger.WARNING("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);
-
- Logger.WARNING(
- "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
- Logger.WARNING("Breaking Tool");
- heldItem.stackSize = 0;
- }
- // Do Damage
- else {
- // setItemDamage(heldItem, durLeft);
- Logger.WARNING("" + (durNow - durLeft));
- this.damageItem(heldItem, (durNow - durLeft) - 1, entity);
- }
-
- /*
- * if (heldItem.getItemDamage() <= ((heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS)){
- * Utils.LOG_WARNING("2: "+DURABILITY_LOSS+" 3: "+((heldItem.getMaxDamage()-heldItem.getItemDamage())-
- * DURABILITY_LOSS)); setItemDamage(heldItem, (int)
- * (heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS)); } else {
- * Utils.LOG_WARNING("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;
- }
- }
-
- public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer) {
- item.damageItem(damage, localPlayer);
- }
-
- public void setItemDamage(final ItemStack item, final int damage) {
- item.setItemDamage(damage - 1);
- }
-
- // Should clear up blocks quicker if I chain it.
- public final void removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z,
- final ItemStack heldItem) {
- try {
- final Block block = world.getBlock(X, Y, Z);
- final float dur = this.calculateDurabilityLoss(world, X, Y, Z);
- Logger.WARNING(block.toString());
- String removalTool = "";
- removalTool = block.getHarvestTool(1);
-
- Logger.WARNING("Removing.1 " + removalTool);
- /*
- * if ((removalTool.equalsIgnoreCase("pickaxe") || removalTool.equalsIgnoreCase("null") || removalTool ==
- * null)){ Utils.LOG_WARNING("Removing.2"); if (UtilsMining.getBlockType(block, world, new int[]{X,Y,Z},
- * miningLevel)) { Utils.LOG_WARNING("Removing.3");
- */
- if (this.canPickaxeBlock(block, world, new int[] { X, Y, Z })) {
- Logger.WARNING("Removing.4");
-
- if (block == Blocks.air) {
- return;
- }
-
- if ((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) >= 0)
- && (block.getBlockHardness(world, X, Y, Z) <= 100)
- && (block != Blocks.water)
- && (block != Blocks.lava)) {
-
- Logger.WARNING("Removing.5");
- if (heldItem.getItemDamage() <= (heldItem.getMaxDamage() - dur)) {
-
- if (X == 0 && Y == 0 && Z == 0) {
-
- } else {
- block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
- world.setBlockToAir(X, Y, Z);
- }
- }
- }
- /*
- * } }
- */
- } else {
- Logger.WARNING("Incorrect Tool for mining this block.");
- }
- } catch (final NullPointerException e) {
-
- }
- }
-
- public boolean checkFacing(final ItemStack aStack, final EntityPlayer aPlayer, final World world) {
- if (aPlayer != null) {
- final int direction = MathHelper.floor_double((aPlayer.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, aPlayer, 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";
- setFacingHorizontal(aStack, false);
- } else if (sideHit == 1) {
- playerStandingPosition = "below";
- setFacingHorizontal(aStack, false);
- } else if (sideHit == 2) {
- playerStandingPosition = "facingSouth";
- setFacingHorizontal(aStack, true);
- } else if (sideHit == 3) {
- playerStandingPosition = "facingNorth";
- setFacingHorizontal(aStack, true);
- } else if (sideHit == 4) {
- playerStandingPosition = "facingEast";
- setFacingHorizontal(aStack, true);
- } else if (sideHit == 5) {
- playerStandingPosition = "facingWest";
- setFacingHorizontal(aStack, true);
- }
- setLookingDirection(aStack, playerStandingPosition);
-
- if (direction == 0) {
- setFacingDirection(aStack, "south");
- } else if (direction == 1) {
- setFacingDirection(aStack, "west");
- } else if (direction == 2) {
- setFacingDirection(aStack, "north");
- } else if (direction == 3) {
- setFacingDirection(aStack, "east");
- }
- }
-
- return true;
- }
- return false;
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
- 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(final ItemStack par1ItemStack) {
- return EnumRarity.rare;
- }
-
- @Override
- public boolean hasEffect(final ItemStack par1ItemStack, final int pass) {
- return true;
- }
-
- @Override
- public boolean onBlockStartBreak(final ItemStack itemstack, final int X, final int Y, final int Z,
- final EntityPlayer aPlayer) {
- this.checkFacing(itemstack, aPlayer, aPlayer.getEntityWorld());
- return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer);
- }
-
- public StaballoyPickaxe(final String unlocalizedName, final ToolMaterial material) {
- super(material);
- this.setUnlocalizedName(unlocalizedName);
- this.setTextureName(GTPlusPlus.ID + ":" + unlocalizedName);
- this.setMaxStackSize(1);
- this.setMaxDamage(3200);
- this.miningLevel = 5;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/lib/CORE.java b/src/main/java/gtPlusPlus/core/lib/CORE.java
index bec7c04c56..acb2ab1a07 100644
--- a/src/main/java/gtPlusPlus/core/lib/CORE.java
+++ b/src/main/java/gtPlusPlus/core/lib/CORE.java
@@ -134,7 +134,6 @@ public class CORE {
public static boolean dumpItemAndBlockData = false;
// Tools
- public static boolean enableSkookumChoochers = true;
public static boolean enableMultiSizeTools = true;
// Block Drops
@@ -153,7 +152,6 @@ public class CORE {
public static boolean enableCustomCapes = false;
public static boolean enableCustomCircuits = true;
public static boolean enableOldGTcircuits = false;
- public static boolean disableZombieReinforcement = false;
public static int enableWatchdogBGM = CORE_Preloader.enableWatchdogBGM;
public static boolean hideUniversalCells = true;
@@ -162,7 +160,6 @@ public class CORE {
// Single Block Machines
public static boolean enableMachine_SolarGenerators = false;
- public static boolean enableMachine_Safes = true;
public static boolean enableMachine_Dehydrators = true;
public static boolean enableMachine_SteamConverter = true;
public static boolean enableMachine_FluidTanks = true;
diff --git a/src/main/java/gtPlusPlus/core/material/ELEMENT.java b/src/main/java/gtPlusPlus/core/material/ELEMENT.java
index a46559b56b..71580fb81f 100644
--- a/src/main/java/gtPlusPlus/core/material/ELEMENT.java
+++ b/src/main/java/gtPlusPlus/core/material/ELEMENT.java
@@ -10,20 +10,7 @@ import gtPlusPlus.core.util.minecraft.MaterialUtils;
public final class ELEMENT {
- public static final String[] NAMES = new String[] { "Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon",
- "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon", "Phosphorus",
- "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium",
- "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium",
- "Bromine", "Krypton", "Rubidium", "Strontium", "Yttrium", "Zirconium", "Niobium", "Molybdenum",
- "Technetium", "Ruthenium", "Rhodium", "Palladium", "Silver", "Cadmium", "Indium", "Tin", "Antimony",
- "Tellurium", "Iodine", "Xenon", "Caesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium",
- "Promethium", "Samarium", "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium",
- "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum",
- "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Francium", "Radium",
- "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium", "Americium", "Curium",
- "Berkelium", "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium",
- "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium", "Meitnerium", "Darmstadtium", "Roentgenium",
- "Copernicium", "Nihonium", "Flerovium", "Moscovium", "Livermorium", "Tennessine", "Oganesson" };
+ public static final String[] NAMES = new String[] { "Hydrogen", "Helium" };
// First 50 Elements
public final Material HYDROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Hydrogen);
@@ -131,18 +118,7 @@ public final class ELEMENT {
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 = new Material(
- "Technetium",
- MaterialState.SOLID,
- TextureSets.NUCLEAR.get(),
- new short[] { 220, 220, 220 },
- 2200,
- 4877,
- 43,
- 55,
- false,
- "Tc",
- 2); // Not a GT Inherited Material
+
public final Material RUTHENIUM = new Material(
"Ruthenium",
MaterialState.SOLID,
@@ -165,6 +141,32 @@ public final class ELEMENT {
false,
"Rh",
0); // Not a GT Inherited Material
+ public final Material AMERICIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Americium);
+ public final Material TECHNETIUM = new Material(
+ "Technetium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] { 220, 220, 220 },
+ 2200,
+ 4877,
+ 43,
+ 55,
+ false,
+ "Tc",
+ 2); // Not a GT Inherited Material
+ public final Material NEPTUNIUM = new Material(
+ "Neptunium",
+ MaterialState.SOLID,
+ TextureSets.NUCLEAR.get(),
+ new short[] { 200, 220, 205 },
+ 640,
+ 3902,
+ 93,
+ 144,
+ false,
+ "Np",
+ 2); // Not a GT Inherited Material
+
public final Material PALLADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Palladium);
public final Material SILVER = MaterialUtils.generateMaterialFromGtENUM(Materials.Silver);
public final Material CADMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Cadmium);
@@ -288,31 +290,9 @@ public final class ELEMENT {
false,
"Po",
1); // Not a GT Inherited Material
- public final Material ASTATINE = new Material(
- "Astatine",
- MaterialState.SOLID,
- TextureSets.NUCLEAR.get(),
- new short[] { 170, 180, 170 },
- 302,
- 337,
- 85,
- 125,
- false,
- "At",
- 1); // Not a GT Inherited Material
+
public final Material RADON = MaterialUtils.generateMaterialFromGtENUM(Materials.Radon);
- public final Material FRANCIUM = new Material(
- "Francium",
- MaterialState.SOLID,
- TextureSets.NUCLEAR.get(),
- new short[] { 170, 160, 170 },
- 27,
- 677,
- 87,
- 136,
- false,
- "Fr",
- 1); // Not a GT Inherited Material
+
public final Material RADIUM = new Material(
"Radium",
MaterialState.SOLID,
@@ -325,18 +305,7 @@ public final class ELEMENT {
false,
"Ra",
1); // Not a GT Inherited Material
- public final Material ACTINIUM = new Material(
- "Actinium",
- MaterialState.SOLID,
- TextureSets.NUCLEAR.get(),
- new short[] { 150, 165, 165 },
- 1050,
- 3200,
- 89,
- 138,
- false,
- "Ac",
- 1); // Not a GT Inherited Material
+
public final Material THORIUM = new Material(
"Thorium",
MaterialState.SOLID,
@@ -362,24 +331,7 @@ public final class ELEMENT {
1); // Not a GT Inherited Material
public final Material URANIUM238 = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium);
public final Material URANIUM235 = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium235);
- public final Material NEPTUNIUM = new Material(
- "Neptunium",
- MaterialState.SOLID,
- TextureSets.NUCLEAR.get(),
- new short[] { 200, 220, 205 },
- 640,
- 3902,
- 93,
- 144,
- false,
- "Np",
- 2); // Not a GT Inherited Material
-
- public final Material PLUTONIUM244 = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium); // This one
- // looks
- // incorrect.
public final Material PLUTONIUM241 = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium241);
- public final Material AMERICIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Americium); // Americium
public final Material CURIUM = new Material(
"Curium",
MaterialState.SOLID,
@@ -392,18 +344,7 @@ public final class ELEMENT {
false,
"Cm",
3); // Not a GT Inherited Material
- public final Material BERKELIUM = new Material(
- "Berkelium",
- MaterialState.SOLID,
- TextureSets.NUCLEAR.get(),
- new short[] { 110, 250, 85 },
- 985,
- 710,
- 97,
- 150,
- false,
- "Bk",
- 4); // Not a GT Inherited Material
+
public final Material CALIFORNIUM = new Material(
"Californium",
MaterialState.SOLID,
@@ -416,18 +357,7 @@ public final class ELEMENT {
false,
"Cf",
4); // Not a GT Inherited Material
- public final Material EINSTEINIUM = new Material(
- "Einsteinium",
- MaterialState.SOLID,
- TextureSets.NUCLEAR.get(),
- new short[] { 255, 85, 110 },
- 860,
- 3500,
- 99,
- 153,
- false,
- "Es",
- 5); // Not a GT Inherited Material //Boiling Point is made up
+
public final Material FERMIUM = new Material(
"Fermium",
MaterialState.LIQUID,
@@ -454,9 +384,6 @@ public final class ELEMENT {
public final Material ORDO = MaterialUtils
.generateMaterialFromGtENUM(Materials.InfusedOrder, TextureSets.GEM_A.get());
- // Fictional
- public final Material YELLORIUM = MaterialUtils
- .generateMaterialFromGtENUM(Materials.Yellorium, new short[] { 255, 242, 10 }, TextureSets.NUCLEAR.get());
public final Material NAQUADAH = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadah);
public final Material NAQUADAH_ENRICHED = MaterialUtils.generateMaterialFromGtENUM(Materials.NaquadahEnriched);
public final Material NAQUADRIA = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadria);
@@ -531,48 +458,6 @@ public final class ELEMENT {
StringUtils.superscript("238Pu"),
2,
false); // Not a GT Inherited Material
- public final Material STRONTIUM90 = new Material(
- "Strontium-90",
- MaterialState.SOLID,
- TextureSets.NUCLEAR.get(),
- Materials.Strontium.mDurability,
- Materials.Strontium.mRGBa,
- Materials.Strontium.mMeltingPoint,
- Materials.Strontium.mBlastFurnaceTemp,
- 38,
- 52,
- false,
- StringUtils.superscript("90Sr"),
- 2,
- false); // Not a GT Inherited Material
- public final Material POLONIUM210 = new Material(
- "Polonium-210",
- MaterialState.SOLID,
- TextureSets.NUCLEAR.get(),
- POLONIUM.vDurability,
- POLONIUM.getRGBA(),
- POLONIUM.getMeltingPointK(),
- POLONIUM.getBoilingPointK(),
- 84,
- 126,
- false,
- StringUtils.superscript("210Po"),
- 2,
- false); // Not a GT Inherited Material
- public final Material AMERICIUM241 = new Material(
- "Americium-241",
- MaterialState.SOLID,
- TextureSets.NUCLEAR.get(),
- Materials.Americium.mDurability,
- Materials.Americium.mRGBa,
- Materials.Americium.mMeltingPoint,
- Materials.Americium.mBlastFurnaceTemp,
- 95,
- 146,
- false,
- StringUtils.superscript("241Am"),
- 2,
- false); // Not a GT Inherited Material
public final Material MAGIC = MaterialUtils
.generateMaterialFromGtENUM(Materials.Magic, new short[] { 10, 185, 140 });
diff --git a/src/main/java/gtPlusPlus/core/material/Material.java b/src/main/java/gtPlusPlus/core/material/Material.java
index 6e1c9b8b92..8068d6ab35 100644
--- a/src/main/java/gtPlusPlus/core/material/Material.java
+++ b/src/main/java/gtPlusPlus/core/material/Material.java
@@ -784,8 +784,6 @@ public class Material {
aShiny++;
} else if (m.getStackMaterial() == ELEMENT.getInstance().PLATINUM) {
aShiny++;
- } else if (m.getStackMaterial() == ELEMENT.getInstance().AMERICIUM) {
- aShiny++;
} else if (m.getStackMaterial() == ELEMENT.getInstance().TITANIUM) {
aShiny++;
} else if (m.getStackMaterial() == ELEMENT.getInstance().GERMANIUM) {
diff --git a/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java b/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java
index e6c441d4e8..f1052d9332 100644
--- a/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java
+++ b/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java
@@ -36,12 +36,9 @@ import gregtech.api.enums.Mods;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.client.model.ModelGiantChicken;
import gtPlusPlus.core.client.renderer.CustomItemBlockRenderer;
import gtPlusPlus.core.client.renderer.CustomOreBlockRenderer;
-import gtPlusPlus.core.client.renderer.RenderBatKing;
import gtPlusPlus.core.client.renderer.RenderDecayChest;
-import gtPlusPlus.core.client.renderer.RenderGiantChicken;
import gtPlusPlus.core.client.renderer.RenderMiningExplosivesPrimed;
import gtPlusPlus.core.client.renderer.RenderSickBlaze;
import gtPlusPlus.core.client.renderer.RenderStaballoyConstruct;
@@ -49,8 +46,6 @@ import gtPlusPlus.core.client.renderer.RenderToxinball;
import gtPlusPlus.core.common.CommonProxy;
import gtPlusPlus.core.common.compat.COMPAT_PlayerAPI;
import gtPlusPlus.core.entity.EntityPrimedMiningExplosive;
-import gtPlusPlus.core.entity.monster.EntityBatKing;
-import gtPlusPlus.core.entity.monster.EntityGiantChickenBase;
import gtPlusPlus.core.entity.monster.EntitySickBlaze;
import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct;
import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion;
@@ -58,12 +53,10 @@ import gtPlusPlus.core.entity.projectile.EntityLightningAttack;
import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion;
import gtPlusPlus.core.entity.projectile.EntityThrowableBomb;
import gtPlusPlus.core.entity.projectile.EntityToxinballSmall;
-import gtPlusPlus.core.handler.render.FirepitRender;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.CORE.ConfigSwitches;
import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest;
-import gtPlusPlus.core.tileentities.general.TileEntityFirepit;
import gtPlusPlus.core.util.minecraft.particles.EntityParticleFXMysterious;
import gtPlusPlus.xmod.gregtech.common.render.GTPP_CapeRenderer;
import gtPlusPlus.xmod.gregtech.common.render.GTPP_FlaskRenderer;
@@ -150,10 +143,6 @@ public class ClientProxy extends CommonProxy implements Runnable {
RenderingRegistry.registerEntityRenderingHandler(
EntityHydrofluoricAcidPotion.class,
new RenderSnowball(ModItems.itemHydrofluoricPotion));
- RenderingRegistry.registerEntityRenderingHandler(
- EntityGiantChickenBase.class,
- new RenderGiantChicken(new ModelGiantChicken(), 1f));
- RenderingRegistry.registerEntityRenderingHandler(EntityBatKing.class, new RenderBatKing());
RenderingRegistry
.registerEntityRenderingHandler(EntityThrowableBomb.class, new RenderSnowball(ModItems.itemBomb, 1));
RenderingRegistry.registerEntityRenderingHandler(EntityLightningAttack.class, new RenderFireball(1F));
@@ -161,8 +150,6 @@ public class ClientProxy extends CommonProxy implements Runnable {
/**
* Tiles
*/
- Logger.INFO("Registering Custom Renderer for the Fire Pit.");
- ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFirepit.class, new FirepitRender());
Logger.INFO("Registering Custom Renderer for the Lead Lined Chest.");
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecayablesChest.class, new RenderDecayChest());
Logger.INFO("Registering Custom Renderer for the Egg Box.");
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
index 87bd3ef8c4..57a2ed8345 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -1092,34 +1092,8 @@ public class RECIPES_GREGTECH {
GregtechItemList.Bomb_Cast.get(4),
30,
120);
- addAR(
- ItemUtils.getSimpleStack(Items.redstone, 32),
- ItemUtils.getSimpleStack(ModItems.itemRope, 16),
- Materials.Glue.getFluid(500),
- ItemUtils.getSimpleStack(ModItems.itemDetCable, 24),
- 30,
- 120);
-
- /*
- * addAR(ItemUtils.getItemStackOfAmountFromOreDict("plateIncoloy020", 16),
- * ItemUtils.getItemStackOfAmountFromOreDict("frameGtIncoloyMA956", 4), null,
- * GregtechItemList.Casing_Power_SubStation.get(4), 80, 120);
- */
-
- /*
- * CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { GregtechItemList.Casing_Multi_Use.get(1),
- * ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 1),
- * ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(4), 8), CI.sensor_HV, CI.emitter_HV,
- * CI.fieldGenerator_HV, }, null, ItemUtils.getSimpleStack(Dimension_Everglades.blockPortalFrame), 20*20, 2048);
- */
CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] { ItemUtils.getSimpleStack(ModItems.itemRope, 6), ItemUtils.getGregtechCircuit(6) },
- null,
- ItemUtils.getSimpleStack(ModBlocks.blockNet, 2),
- 1 * 20,
- 8);
- CORE.RA.addSixSlotAssemblingRecipe(
new ItemStack[] { ItemUtils.getSimpleStack(CI.explosiveITNT, 2),
ItemUtils.getSimpleStack(CI.explosiveTNT, 4), ELEMENT.getInstance().SULFUR.getDust(2),
ELEMENT.getInstance().IRON.getFrameBox(1) },
@@ -1261,17 +1235,6 @@ public class RECIPES_GREGTECH {
ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_9_CLOAKING, 1),
20 * 60 * 10,
(int) GT_Values.V[7]);
-
- // Supreme Pizza Gloves
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] { ItemUtils.getGregtechCircuit(19), ItemUtils.getSimpleStack(ModItems.itemRope, 32),
- ItemUtils.getItemStackOfAmountFromOreDict("gearGtSmallWroughtIron", 8),
- ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", 32),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), 2) },
- FluidUtils.getFluidStack("molten.rubber", 2000),
- ItemUtils.getSimpleStack(ModItems.itemPersonalFireProofDevice),
- 20 * 60 * 5,
- 30);
}
}
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java
index b3371fc815..154ec9b940 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java
@@ -266,70 +266,6 @@ public class RECIPES_General {
Logger.INFO("Added a recipe for Wither Cages.");
}
- /*
- * Logger.RECIPE("[Inspection] Xp Converter"); if (RecipeUtils.addShapedRecipe(
- * getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 2, 1),
- * getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1),
- * getSimpleStack(Items.nether_star), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1),
- * getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 2, 1),
- * getSimpleStack(Items.experience_bottle), ItemUtils.getSimpleStack(ModBlocks.blockXpConverter, 1))){
- * Logger.INFO("Added a recipe for XP Converter."); }
- */
-
- // Rope/Fiber/Net
- if (RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1),
- ItemUtils.getSimpleStack(Items.reeds) },
- ItemUtils.getSimpleStack(ModItems.itemFiber, 16))) {
- Logger.INFO("Added a recipe for Fiber.");
- }
-
- if (RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1),
- ItemUtils.getSimpleStack(Blocks.sapling) },
- ItemUtils.getSimpleStack(ModItems.itemFiber, 32))) {
- Logger.INFO("Added a recipe for Fiber.");
- }
-
- if (RecipeUtils.addShapedRecipe(
- null,
- ItemUtils.getSimpleStack(ModItems.itemFiber, 1),
- null,
- ItemUtils.getSimpleStack(ModItems.itemFiber, 1),
- CI.craftingToolKnife,
- ItemUtils.getSimpleStack(ModItems.itemFiber, 1),
- null,
- ItemUtils.getSimpleStack(ModItems.itemFiber, 1),
- null,
- ItemUtils.getSimpleStack(ModItems.itemRope, 3))) {
- Logger.INFO("Added a recipe for Rope.");
- }
-
- Logger.RECIPE("[Inspection] Net");
- if (RecipeUtils.addShapedRecipe(
- ItemUtils.getSimpleStack(ModItems.itemRope, 1),
- ItemUtils.getSimpleStack(ModItems.itemRope, 1),
- ItemUtils.getSimpleStack(ModItems.itemRope, 1),
- ItemUtils.getSimpleStack(ModItems.itemRope, 1),
- ItemUtils.getSimpleStack(ModItems.itemRope, 1),
- ItemUtils.getSimpleStack(ModItems.itemRope, 1),
- null,
- null,
- null,
- ItemUtils.getSimpleStack(ModBlocks.blockNet, 2))) {
- Logger.INFO("Added a recipe for Nets.");
- }
-
- // Slow Builders Ring
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] { ItemUtils.getSimpleStack(Blocks.ice, 8),
- ItemUtils.getSimpleStack(ModBlocks.blockNet, 8), ItemUtils.getSimpleStack(Blocks.vine, 8),
- ALLOY.TUMBAGA.getRing(1), },
- FluidUtils.getWater(1000), // Fluid
- ItemUtils.getItemStackFromFQRN("miscutils:SlowBuildingRing", 1), // Output
- 20 * 30, // Dur
- 16); // Eu
-
// Magic Feather
CORE.RA.addSixSlotAssemblingRecipe(
new ItemStack[] { ItemUtils.getSimpleStack(Items.feather, 64),
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java
index 6a738158de..bd75847153 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java
@@ -1,18 +1,9 @@
package gtPlusPlus.core.recipe;
-import static gregtech.api.enums.Mods.BartWorks;
-import static gregtech.api.enums.Mods.COFHCore;
-import static gregtech.api.enums.Mods.EternalSingularity;
-import static gregtech.api.enums.Mods.GoodGenerator;
-import static gregtech.api.enums.Mods.GregTech;
-import static gregtech.api.enums.Mods.Railcraft;
-import static gregtech.api.enums.Mods.RemoteIO;
-import static gregtech.api.enums.Mods.ZTones;
-
-import net.minecraft.block.Block;
+import static gregtech.api.enums.Mods.*;
+
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
-import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
@@ -39,19 +30,15 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.material.MISC_MATERIALS;
-import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.recipe.common.CI;
-import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.everglades.dimension.Dimension_Everglades;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.covers.CoverManager;
import gtPlusPlus.xmod.gregtech.common.helpers.VolumetricFlaskHelper;
-import gtPlusPlus.xmod.gregtech.common.items.MetaCustomCoverItem;
public class RECIPES_Machines {
@@ -241,13 +228,11 @@ public class RECIPES_Machines {
initModItems();
tieredMachineHulls();
- controlCores();
energyCores();
wirelessChargers();
largeArcFurnace();
industrialVacuumFurnace();
fakeMachineCasingCovers();
- ztonesCoverRecipes();
overflowValveCovers();
superBuses();
roundRobinators();
@@ -1195,16 +1180,6 @@ public class RECIPES_Machines {
GregtechItemList.Energy_Buffer_RF_Convertor.get(1));
}
- // Egg Box
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] { CI.getNumberedAdvancedCircuit(8), CI.getTieredMachineHull(3),
- ItemUtils.getSimpleStack(Items.egg, 64), ItemUtils.getSimpleStack(ModItems.itemRope, 32),
- CI.getPlate(4, 8) },
- FluidUtils.getFluidStack("mobessence", 4096),
- ItemUtils.getSimpleStack(ModBlocks.blockEggBox, 1),
- 20 * 60,
- 480);
-
// Flask Configurator
CORE.RA.addSixSlotAssemblingRecipe(
new ItemStack[] { CI.getNumberedAdvancedCircuit(8), CI.getTieredMachineHull(2),
@@ -2400,35 +2375,6 @@ public class RECIPES_Machines {
RECIPE_SaltPlantController);
}
- // Shelves
- RecipeUtils.addShapedGregtechRecipe(
- "screwWood",
- "plateWood",
- "screwWood",
- CI.craftingToolHammer_Hard,
- "frameGtWood",
- CI.craftingToolHammer_Soft,
- "plateWood",
- "plateWood",
- "plateWood",
- GregtechItemList.GT4_Shelf.get(2));
-
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[] { GregtechItemList.GT4_Shelf.get(1) },
- GregtechItemList.GT4_Shelf_Compartment.get(1));
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[] { GregtechItemList.GT4_Shelf_Compartment.get(1) },
- GregtechItemList.GT4_Shelf_Desk.get(1));
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[] { GregtechItemList.GT4_Shelf_Desk.get(1) },
- GregtechItemList.GT4_Shelf_Iron.get(1));
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[] { GregtechItemList.GT4_Shelf_Iron.get(1) },
- GregtechItemList.GT4_Shelf_FileCabinet.get(1));
- RecipeUtils.addShapelessGregtechRecipe(
- new ItemStack[] { GregtechItemList.GT4_Shelf_FileCabinet.get(1) },
- GregtechItemList.GT4_Shelf.get(1));
-
// Cyclotron
if (CORE.ConfigSwitches.enableMultiblock_Cyclotron) {
RECIPE_CyclotronController = GregtechItemList.COMET_Cyclotron.get(1);
@@ -2975,76 +2921,6 @@ public class RECIPES_Machines {
Logger.INFO("Done loading recipes for the Various machine blocks.");
}
- private static void controlCores() {
-
- Material[] aMat_A = new Material[] { ALLOY.POTIN, ALLOY.ZIRCONIUM_CARBIDE, ALLOY.TANTALLOY_61,
- ALLOY.INCONEL_792, ALLOY.STABALLOY, ALLOY.TALONITE, ALLOY.HASTELLOY_N, ALLOY.HG1223, ALLOY.LAFIUM,
- ALLOY.PIKYONIUM };
- Material[] aMat_B = new Material[] { ALLOY.TUMBAGA, ALLOY.SILICON_CARBIDE, ALLOY.EGLIN_STEEL, ALLOY.NICHROME,
- ALLOY.TUNGSTEN_CARBIDE, ALLOY.STELLITE, ALLOY.HASTELLOY_C276, ALLOY.NITINOL_60, ALLOY.ZERON_100,
- ALLOY.CINOBITE };
-
- Item aBaseCore = ModItems.itemControlCore;
- ItemStack[] aInputPrevTier = new ItemStack[] {
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore2", 1),
- ItemUtils.simpleMetaStack(aBaseCore, 0, 1), ItemUtils.simpleMetaStack(aBaseCore, 1, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 2, 1), ItemUtils.simpleMetaStack(aBaseCore, 3, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 4, 1), ItemUtils.simpleMetaStack(aBaseCore, 5, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 6, 1), ItemUtils.simpleMetaStack(aBaseCore, 7, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 8, 1), };
- ItemStack[] aOutput = new ItemStack[] { ItemUtils.simpleMetaStack(aBaseCore, 0, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 1, 1), ItemUtils.simpleMetaStack(aBaseCore, 2, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 3, 1), ItemUtils.simpleMetaStack(aBaseCore, 4, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 5, 1), ItemUtils.simpleMetaStack(aBaseCore, 6, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 7, 1), ItemUtils.simpleMetaStack(aBaseCore, 8, 1),
- ItemUtils.simpleMetaStack(aBaseCore, 9, 1), };
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] { CI.machineHull_HV, aOutput[1], aMat_A[1].getGear(2), aMat_B[2].getPlateDouble(8),
- ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + ("1"), 2),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(2), 5) },
- aMat_B[3].getFluidStack(144 * 8), // Input Fluid
- GregtechItemList.Hatch_Control_Core.get(1),
- 60 * 20 * 5,
- MaterialUtils.getVoltageForTier(3));
-
- for (int i = 0; i < 10; i++) {
- ItemStack aPlateStack = aMat_A[i].getPlateDouble(8);
- ItemStack aGearStack = aMat_B[i].getGear(2);
- ItemStack aRodStack = aMat_A[i].getLongRod(8);
- ItemStack aScrewStack = aMat_B[i].getScrew(32);
-
- if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
- aPlateStack = aMat_A[i].getPlate(16);
- if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
- aPlateStack = aMat_B[i].getPlateDouble(8);
- if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
- aPlateStack = aMat_B[i].getPlate(16);
- }
- }
- }
- if (!ItemUtils.checkForInvalidItems(aGearStack)) {
- aGearStack = aMat_A[i].getGear(4);
- }
- if (!ItemUtils.checkForInvalidItems(aRodStack)) {
- aRodStack = aMat_B[i].getLongRod(16);
- }
- if (!ItemUtils.checkForInvalidItems(aScrewStack)) {
- aScrewStack = aMat_A[i].getScrew(32);
- }
-
- CORE.RA.addSixSlotAssemblingRecipe(
- new ItemStack[] { CI.getEnergyCore(i, 4), aPlateStack, aGearStack, aRodStack, aScrewStack,
- ItemUtils.getItemStackOfAmountFromOreDict(
- CI.getTieredCircuitOreDictName((int) (4 + Math.ceil((double) i / (double) 2))),
- i * 2) },
- CI.getTieredFluid(i, 144 * 4 * (i + 1)), // Input Fluid
- aOutput[i],
- 60 * 20 * 1 * (i + 1),
- MaterialUtils.getVoltageForTier(i));
- }
- }
-
private static void energyCores() {
ItemStack[] aBufferOutput = new ItemStack[] { RECIPE_Buffer_ULV, RECIPE_Buffer_LV, RECIPE_Buffer_MV,
@@ -3369,34 +3245,6 @@ public class RECIPES_Machines {
}
}
- private static void ztonesCoverRecipes() {
- if (!ZTones.isModLoaded()) {
- return;
- }
- Class ModBlocksClass = ReflectionUtils.getClass("com.riciJak.Ztones.init.ModBlocks");
- Block agon = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "agonBlock"));
- Block korp = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "korpBlock"));
- Block jelt = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "jeltBlock"));
- Block bitt = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "bittBlock"));
- Block iszm = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "iszmBlock"));
-
- // "agon", "iszm", "korp", "jelt", "bitt"
-
- ItemStack[] aBlocks = new ItemStack[] { ItemUtils.getSimpleStack(agon), ItemUtils.getSimpleStack(iszm),
- ItemUtils.getSimpleStack(korp), ItemUtils.getSimpleStack(jelt), ItemUtils.getSimpleStack(bitt) };
- MetaCustomCoverItem[] aCovers = new MetaCustomCoverItem[] { CoverManager.Cover_Agon, CoverManager.Cover_Iszm,
- CoverManager.Cover_Korp, CoverManager.Cover_Jelt, CoverManager.Cover_Bitt };
-
- ItemStack aInputs[][] = new ItemStack[5][16];
- ItemStack aOutputs[][] = new ItemStack[5][16];
- for (int a = 0; a < 5; a++) {
- for (int i = 0; i < 16; i++) {
- aInputs[a][i] = ItemUtils.simpleMetaStack(aBlocks[a].getItem(), i, 1);
- aOutputs[a][i] = ItemUtils.simpleMetaStack(aCovers[a], i, 9);
- }
- }
- }
-
private static void superBuses() {
GregtechItemList[] mSuperBusesInput = new GregtechItemList[] { GregtechItemList.Hatch_SuperBus_Input_ULV,
GregtechItemList.Hatch_SuperBus_Input_LV, GregtechItemList.Hatch_SuperBus_Input_MV,
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java
index 54deeab3a8..229b7cc045 100644
--- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java
+++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java
@@ -5,22 +5,15 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import net.minecraftforge.oredict.OreDictionary;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.RecipeUtils;
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_FireStarter = ItemUtils.getSimpleStack(ModItems.itemBasicFireMaker);
public static ItemStack RECIPE_DivisionSigil;
@@ -118,85 +111,8 @@ public class RECIPES_Tools {
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 loadRecipes() {
-
- run();
- }
-
- private static void run() {
- // Staballoy Pickaxe
- RecipeUtils.addShapedRecipe(
- plateStaballoy,
- plateStaballoy,
- ingotStaballoy,
- craftingToolFile,
- stickTungsten,
- craftingToolHardHammer,
- craftingToolWrench,
- stickTungsten,
- craftingToolHardHammer,
- RECIPE_StaballoyPickaxe);
-
- // Staballoy Axe
- RecipeUtils.addShapedRecipe(
- plateStaballoy,
- ingotStaballoy,
- craftingToolHardHammer,
- plateStaballoy,
- stickTungsten,
- craftingToolHardHammer,
- craftingToolFile,
- stickTungsten,
- craftingToolWrench,
- RECIPE_StaballoyAxe);
-
- // Cobble to Sand
- RecipeUtils.addShapedRecipe(
- CobbleStone,
- CobbleStone,
- CobbleStone,
- CobbleStone,
- sandHammer,
- CobbleStone,
- CobbleStone,
- CobbleStone,
- CobbleStone,
- RECIPE_Sand);
-
- // Sand to Sandstone
- RecipeUtils.addShapedRecipe(Sand, Sand, Sand, Sand, sandHammer, Sand, Sand, Sand, Sand, RECIPE_SandStone);
-
- // Sandstone Hammer
- RecipeUtils.addShapedRecipe(
- plateElectrum,
- ingotElectrum,
- plateElectrum,
- craftingToolScrewdriver,
- stickBronze,
- craftingToolHardHammer,
- null,
- stickSteel,
- null,
- RECIPE_SandstoneHammer);
-
- // Basic Firemaker
- RecipeUtils.addShapedRecipe(
- "cropWheat",
- "cropWheat",
- "cropWheat",
- ItemUtils.getSimpleStack(Items.string),
- stickWood,
- ItemUtils.getSimpleStack(Items.string),
- "cropWheat",
- "cropWheat",
- "cropWheat",
- RECIPE_FireStarter);
- }
}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java b/src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java
deleted file mode 100644
index cf13bab8c9..0000000000
--- a/src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package gtPlusPlus.core.slots;
-
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-import gtPlusPlus.core.item.base.BaseItemBackpack;
-
-public class SlotItemBackpackInv extends Slot {
-
- public SlotItemBackpackInv(final IInventory inv, final int index, final int xPos, final int yPos) {
- super(inv, index, xPos, yPos);
- }
-
- // This is the only method we need to override so that
- // we can't place our inventory-storing Item within
- // its own inventory (thus making it permanently inaccessible)
- // as well as preventing abuse of storing backpacks within backpacks
- /**
- * Check if the stack is a valid item for this slot.
- */
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- // Everything returns true except an instance of our Item
- return !(itemstack.getItem() instanceof BaseItemBackpack);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java b/src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java
deleted file mode 100644
index 7d91852e80..0000000000
--- a/src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package gtPlusPlus.core.slots;
-
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-import gtPlusPlus.core.item.bauble.ModularBauble;
-
-public class SlotModularBauble extends Slot {
-
- public SlotModularBauble(final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- boolean isValid = false;
-
- if (itemstack != null) {
- if (itemstack.getItem() instanceof ModularBauble) {
- isValid = true;
- }
- }
- return isValid;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java b/src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java
deleted file mode 100644
index 0c90a50b89..0000000000
--- a/src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package gtPlusPlus.core.slots;
-
-import static gtPlusPlus.core.tileentities.machines.TileEntityModularityTable.mValidUpgradeList;
-import static gtPlusPlus.core.tileentities.machines.TileEntityModularityTable.mValidUpgradeListFormChange;
-
-import java.util.Iterator;
-import java.util.Map.Entry;
-
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers;
-
-public class SlotModularBaubleUpgrades extends Slot {
-
- public SlotModularBaubleUpgrades(final IInventory inventory, final int slot, final int x, final int y) {
- super(inventory, slot, x, y);
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- boolean isValid = false;
- if (itemstack != null) {
- Logger.INFO("trying to insert " + itemstack.getDisplayName());
- Logger.INFO("Valid Upgrade count: " + mValidUpgradeList.size());
-
- Iterator<Entry<ItemStack, BT>> it = mValidUpgradeListFormChange.entrySet().iterator();
- while (it.hasNext()) {
- Entry<ItemStack, BT> pair = it.next();
- if (pair.getKey().getItem() == itemstack.getItem()
- && pair.getKey().getItemDamage() == itemstack.getItemDamage()) {
- isValid = true;
- }
- }
-
- Iterator<Entry<ItemStack, Pair<Modifiers, Integer>>> it2 = mValidUpgradeList.entrySet().iterator();
- while (it2.hasNext()) {
- Entry<ItemStack, Pair<Modifiers, Integer>> pair = it2.next();
- if (pair.getKey().getItem() == itemstack.getItem()
- && pair.getKey().getItemDamage() == itemstack.getItemDamage()) {
- isValid = true;
- }
- }
- }
- return isValid;
- }
-
- @Override
- public int getSlotStackLimit() {
- return 64;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java b/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java
index f7ed248669..1cb6e5699c 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java
@@ -6,21 +6,15 @@ import gtPlusPlus.core.block.general.BlockSuperLight.TileEntitySuperLight;
import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox;
import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer;
import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest;
-import gtPlusPlus.core.tileentities.general.TileEntityEggBox;
-import gtPlusPlus.core.tileentities.general.TileEntityFirepit;
import gtPlusPlus.core.tileentities.general.TileEntityFishTrap;
import gtPlusPlus.core.tileentities.general.TileEntityInfiniteFluid;
import gtPlusPlus.core.tileentities.general.TileEntityPlayerDoorBase;
import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter;
-import gtPlusPlus.core.tileentities.general.TileEntityXpConverter;
import gtPlusPlus.core.tileentities.machines.TileEntityAdvPooCollector;
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller;
import gtPlusPlus.core.tileentities.machines.TileEntityPooCollector;
import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable;
import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator;
-import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
-import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner;
public class ModTileEntities {
@@ -29,13 +23,8 @@ public class ModTileEntities {
GameRegistry.registerTileEntity(TileEntityPooCollector.class, "TileEntityPooCollector");
GameRegistry.registerTileEntity(TileEntityAdvPooCollector.class, "TileEntityAdvPooCollector");
GameRegistry.registerTileEntity(TileEntityFishTrap.class, "TileFishTrap");
- GameRegistry.registerTileEntity(TileEntityFirepit.class, "TileFirePit");
GameRegistry.registerTileEntity(TileEntityInfiniteFluid.class, "TileInfiniteFluid");
GameRegistry.registerTileEntity(TileEntityProjectTable.class, "TileProjectTable");
- GameRegistry.registerTileEntity(TileEntityTradeTable.class, "TileTradeTable");
- GameRegistry.registerTileEntity(TileEntityModularityTable.class, "TileEntityModularityTable");
- GameRegistry.registerTileEntity(TileEntityXpConverter.class, "TileEntityXpConverter");
- GameRegistry.registerTileEntity(TileEntityGenericSpawner.class, "TileEntityGenericSpawner");
GameRegistry.registerTileEntity(TileEntityCircuitProgrammer.class, "TileCircuitProgrammer");
GameRegistry.registerTileEntity(TileEntityPlayerDoorBase.class, "TilePlayerDoorBase");
GameRegistry.registerTileEntity(TileEntityDecayablesChest.class, "TileDecayablesChest");
@@ -43,7 +32,6 @@ public class ModTileEntities {
GameRegistry.registerTileEntity(TileEntitySuperLight.class, "TileEntitySuperLight");
GameRegistry.registerTileEntity(TileEntityPestKiller.class, "TileEntityPestKiller");
GameRegistry.registerTileEntity(TileEntityRoundRobinator.class, "TileEntityRoundRobinator");
- GameRegistry.registerTileEntity(TileEntityEggBox.class, "TileEggBox");
GameRegistry.registerTileEntity(TileEntityVolumetricFlaskSetter.class, "TileEntityVolumetricFlaskSetter");
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java
deleted file mode 100644
index 27a1c4ad0c..0000000000
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java
+++ /dev/null
@@ -1,365 +0,0 @@
-package gtPlusPlus.core.tileentities.general;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.ISidedInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.inventories.Inventory_EggBox;
-import gtPlusPlus.core.item.general.ItemGiantEgg;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class TileEntityEggBox extends TileEntity implements ISidedInventory {
-
- private final Inventory_EggBox inventoryContents;
-
- /** Determines if the check for adjacent chests has taken place. */
- public boolean adjacentChestChecked;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityEggBox adjacentChestZNeg;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityEggBox adjacentChestXPos;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityEggBox adjacentChestXNeg;
- /** Contains the chest tile located adjacent to this one (if any) */
- public TileEntityEggBox adjacentChestZPos;
- /** The current angle of the lid (between 0 and 1) */
- public float lidAngle;
- /** The angle of the lid last tick */
- public float prevLidAngle;
- /** The number of players currently using this chest */
- public int numPlayersUsing;
-
- private String customName;
-
- private int cachedChestType;
- private int tickCount = 0;
-
- public TileEntityEggBox() {
- this.inventoryContents = new Inventory_EggBox();
- }
-
- public Inventory_EggBox getInventory() {
- return this.inventoryContents;
- }
-
- @Override
- public void updateEntity() {
-
- // Try do chesty stuff
- try {
- this.updateEntityChest();
- } catch (Throwable t) {
-
- }
-
- try {
- if (!this.worldObj.isRemote) {
- this.tickCount++;
- if ((this.tickCount % 10) == 0) {
- cachedChestType = 1;
- }
-
- if ((this.tickCount % 20) == 0) {
- for (ItemStack inv : this.getInventory().getInventory()) {
- if (inv == null) {
- continue;
- }
- if (inv.getItem() instanceof ItemGiantEgg) {
- ItemGiantEgg D = (ItemGiantEgg) inv.getItem();
- tryUpdateDecayable(D, inv, this.worldObj);
- }
- }
- }
- updateSlots();
- }
- } catch (final Throwable t) {}
- }
-
- public void tryUpdateDecayable(final ItemGiantEgg d, ItemStack iStack, final World world) {
- if (world == null || iStack == null) {
- return;
- }
- if (world.isRemote) {
- return;
- }
-
- boolean a1, a2;
- int u = 0;
- a1 = d.isTicking(world, iStack);
- a2 = false;
- int SECONDS_TO_PROCESS = 1;
- while (u < (20 * SECONDS_TO_PROCESS)) {
- if (!a1) {
- break;
- }
- a1 = d.isTicking(world, iStack);
- a2 = d.tickItemTag(world, iStack);
- u++;
- }
- Logger.MACHINE_INFO("| " + d.getUnlocalizedName() + " | " + a1 + "/" + a2);
-
- if (!a1 && !a2) {
- ItemStack replacement = ItemUtils.getSimpleStack(d.getHatchResult(), 1);
- replacement.stackSize = 1;
- // iStack = replacement.copy();
- for (int fff = 0; fff < this.inventoryContents.getSizeInventory(); fff++) {
- if (this.inventoryContents.getStackInSlot(fff) == iStack) {
- this.inventoryContents.setInventorySlotContents(fff, replacement.copy());
- }
- }
-
- updateSlots();
- this.inventoryContents.markDirty();
- }
- }
-
- public boolean anyPlayerInRange() {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- // Utils.LOG_WARNING("Trying to write NBT data to TE.");
- final NBTTagCompound chestData = new NBTTagCompound();
- this.inventoryContents.writeToNBT(chestData);
- nbt.setTag("ContentsChest", chestData);
- if (this.hasCustomInventoryName()) {
- nbt.setString("CustomName", this.getCustomName());
- }
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- // Utils.LOG_WARNING("Trying to read NBT data from TE.");
- this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
- if (nbt.hasKey("CustomName", 8)) {
- this.setCustomName(nbt.getString("CustomName"));
- }
- }
-
- @Override
- public int getSizeInventory() {
- return this.getInventory().getSizeInventory();
- }
-
- @Override
- public ItemStack getStackInSlot(final int slot) {
- return this.getInventory().getStackInSlot(slot);
- }
-
- @Override
- public ItemStack decrStackSize(final int slot, final int count) {
- return this.getInventory().decrStackSize(slot, count);
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(final int slot) {
- return this.getInventory().getStackInSlotOnClosing(slot);
- }
-
- @Override
- public void setInventorySlotContents(final int slot, final ItemStack stack) {
- this.getInventory().setInventorySlotContents(slot, stack);
- }
-
- @Override
- public int getInventoryStackLimit() {
- return this.getInventory().getInventoryStackLimit();
- }
-
- @Override
- public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
- return this.getInventory().isUseableByPlayer(entityplayer);
- }
-
- @Override
- public void openInventory() {
- if (this.numPlayersUsing < 0) {
- this.numPlayersUsing = 0;
- }
- if (!this.worldObj.isRemote) {
- this.numPlayersUsing++;
- cachedChestType = 1;
- }
- this.worldObj
- .addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().openInventory();
- }
-
- @Override
- public void closeInventory() {
- if (!this.worldObj.isRemote) {
- this.numPlayersUsing--;
- cachedChestType = 1;
- }
- this.worldObj
- .addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().closeInventory();
- }
-
- @Override
- public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
- return this.getInventory().isItemValidForSlot(slot, itemstack);
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
- final int[] accessibleSides = new int[this.getSizeInventory()];
- for (int r = 0; r < this.getInventory().getSizeInventory(); r++) {
- accessibleSides[r] = r;
- }
- return accessibleSides;
- }
-
- @Override
- public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
- return this.getInventory().isItemValidForSlot(0, p_102007_2_);
- }
-
- @Override
- public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
- return this.getInventory().isItemValidForSlot(0, p_102008_2_);
- }
-
- public String getCustomName() {
- return this.customName;
- }
-
- public void setCustomName(final String customName) {
- this.customName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.customName : "container.EggBox";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return (this.customName != null) && !this.customName.equals("");
- }
-
- /**
- * Causes the TileEntity to reset all it's cached values for it's container Block, metadata and in the case of
- * chests, the adjacent chest check
- */
- @Override
- public void updateContainingBlockInfo() {
- super.updateContainingBlockInfo();
- this.adjacentChestChecked = false;
- }
-
- /**
- * Performs the check for adjacent chests to determine if this chest is double or not.
- */
- public void checkForAdjacentChests() {
- if (!this.adjacentChestChecked) {
- this.adjacentChestChecked = true;
- this.adjacentChestZNeg = null;
- this.adjacentChestXPos = null;
- this.adjacentChestXNeg = null;
- this.adjacentChestZPos = null;
- }
- }
-
- public void updateEntityChest() {
- float f;
- this.prevLidAngle = this.lidAngle;
- f = 0.04F;
- double d2;
- if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F
- && this.adjacentChestZNeg == null
- && this.adjacentChestXNeg == null) {
- double d1 = (double) this.xCoord + 0.5D;
- d2 = (double) this.zCoord + 0.5D;
- this.worldObj.playSoundEffect(
- d1,
- (double) this.yCoord + 0.5D,
- d2,
- "random.chestopen",
- 0.5F,
- this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
- }
-
- if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) {
- float f1 = this.lidAngle;
- if (this.numPlayersUsing > 0) {
- // this.lidAngle += f;
- this.lidAngle += (float) (f * (1 + 0.10 * 0.01));
- } else {
- // this.lidAngle -= f;
- this.lidAngle -= (float) (f * (1 + 0.10 * 0.01));
- }
- if (this.lidAngle > 1.0F) {
- this.lidAngle = 1.0F;
- }
- float f2 = 0.5F;
- if (this.lidAngle < f2 && f1 >= f2 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) {
- d2 = (double) this.xCoord + 0.5D;
- double d0 = (double) this.zCoord + 0.5D;
- this.worldObj.playSoundEffect(
- d2,
- (double) this.yCoord + 0.5D,
- d0,
- "random.chestclosed",
- 0.5F,
- this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
- }
-
- if (this.lidAngle < 0.0F) {
- this.lidAngle = 0.0F;
- }
- }
- }
-
- /**
- * Called when a client event is received with the event number and argument, see World.sendClientEvent
- */
- @Override
- public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) {
- if (p_145842_1_ == 1) {
- this.numPlayersUsing = p_145842_2_;
- return true;
- } else {
- return super.receiveClientEvent(p_145842_1_, p_145842_2_);
- }
- }
-
- /**
- * invalidates a tile entity
- */
- @Override
- public final void invalidate() {
- super.invalidate();
- cachedChestType = 1;
- this.updateContainingBlockInfo();
- this.checkForAdjacentChests();
- }
-
- private final int updateSlots() {
- // Have slots changed?
- if (cachedChestType == 0) {
- return 0;
- }
- ItemUtils.organiseInventory(getInventory());
- cachedChestType = 0;
- return cachedChestType;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java
deleted file mode 100644
index 08feceb192..0000000000
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package gtPlusPlus.core.tileentities.general;
-
-import java.util.UUID;
-
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-
-public class TileEntityFirepit extends TileEntity {
-
- private UUID ownerUUID;
-
- public UUID getOwnerUUID() {
- return this.ownerUUID;
- }
-
- public void setOwnerUUID(final UUID ownerUUID) {
- this.ownerUUID = ownerUUID;
- this.markDirty();
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound tagCompound) {
- super.writeToNBT(tagCompound);
-
- final UUID ownerUUID = this.getOwnerUUID();
- if (ownerUUID != null) {
- tagCompound.setLong("OwnerUUIDMost", ownerUUID.getMostSignificantBits());
- tagCompound.setLong("OwnerUUIDLeast", ownerUUID.getLeastSignificantBits());
- }
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound tagCompound) {
- super.readFromNBT(tagCompound);
-
- this.setOwnerUUID(new UUID(tagCompound.getLong("OwnerUUIDMost"), tagCompound.getLong("OwnerUUIDLeast")));
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java
deleted file mode 100644
index 3e24c7fe96..0000000000
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package gtPlusPlus.core.tileentities.general;
-
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-
-import gregtech.api.enums.GT_Values;
-import gtPlusPlus.core.inventories.InventoryHeliumGenerator;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-
-public class TileEntityHeliumGenerator extends TileEntity {
-
- private int tickCount = 0;
- private final InventoryHeliumGenerator inventoryContents; // TODO
- private int locationX;
- private int locationY;
- private int locationZ;
- private int baseTickRate = 1200;
-
- public TileEntityHeliumGenerator() {
- this.inventoryContents = new InventoryHeliumGenerator(); // number of slots - without product slot
- this.setTileLocation();
- }
-
- public boolean setTileLocation() {
- if (this.hasWorldObj()) {
- if (!this.getWorldObj().isRemote) {
- this.locationX = this.xCoord;
- this.locationY = this.yCoord;
- this.locationZ = this.zCoord;
- return true;
- }
- }
- return false;
- }
-
- public InventoryHeliumGenerator getInventory() {
- return this.inventoryContents;
- }
-
- public boolean tryAddLoot() {
- if (this.getInventory().getInventory() != null) {
- int checkingSlot = 0;
- final ItemStack loot = this.generateLootForFishTrap();
- for (final ItemStack contents : this.getInventory().getInventory()) {
- if (contents == null) {
- this.getInventory().setInventorySlotContents(checkingSlot, loot);
- this.markDirty();
- return true;
- } else if (contents.getItem() == loot.getItem()) {
- if (contents.stackSize < contents.getMaxStackSize()) {
- contents.stackSize++;
- this.markDirty();
- return true;
- } else {
- this.getInventory().setInventorySlotContents(checkingSlot, loot);
- this.markDirty();
- return true;
- }
- } else {
-
- }
- checkingSlot++;
- }
- }
- this.markDirty();
- return false;
- }
-
- private ItemStack generateLootForFishTrap() {
- final int lootWeight = MathUtils.randInt(0, 1000);
- ItemStack loot = GT_Values.NI;
- if (lootWeight > 990) {
- loot = ItemUtils.getSimpleStack(Items.slime_ball);
- }
- return loot;
- }
-
- @Override
- public void updateEntity() {
- if (!this.worldObj.isRemote) {}
- }
-
- public void calculateTickrate() {
- int calculateTickrate = 0;
- this.baseTickRate = calculateTickrate;
- }
-
- public boolean anyPlayerInRange() {
- return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
- }
-
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- // Utils.LOG_INFO("Trying to write NBT data to TE.");
- final NBTTagCompound chestData = new NBTTagCompound();
- this.inventoryContents.writeToNBT(chestData);
- nbt.setTag("ContentsChest", chestData);
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- // Utils.LOG_INFO("Trying to read NBT data from TE.");
- this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java
deleted file mode 100644
index 8fa0580158..0000000000
--- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java
+++ /dev/null
@@ -1,297 +0,0 @@
-package gtPlusPlus.core.tileentities.general;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.network.NetworkManager;
-import net.minecraft.network.Packet;
-import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-
-import org.lwjgl.input.Keyboard;
-
-import gtPlusPlus.api.objects.minecraft.BTF_FluidTank;
-import gtPlusPlus.core.tileentities.base.TileBasicTank;
-import gtPlusPlus.core.util.minecraft.EnchantingUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-
-public class TileEntityXpConverter extends TileBasicTank {
-
- public BTF_FluidTank tankEssence = new BTF_FluidTank(
- (int) (64000 * EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP));
- public BTF_FluidTank tankLiquidXp = new BTF_FluidTank(64000);
- private boolean mConvertToEssence = true;
-
- public TileEntityXpConverter() {
- super(4, 32000);
- }
-
- private void changeMode() {
- if (this.mConvertToEssence) {
- this.mConvertToEssence = false;
- return;
- } else {
- this.mConvertToEssence = true;
- return;
- }
- }
-
- public float getAdjustedVolume() {
- if (this.mConvertToEssence) {
- if ((this.tankLiquidXp.getFluid() != null) && (this.tankLiquidXp.getFluidAmount() >= 100)
- && (this.tankEssence.getFluidAmount() <= (this.tankEssence.getCapacity()
- - (100 * EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP)))) {
- final FluidStack bigStorage = EnchantingUtils.getEssenceFromLiquidXp(100);
- this.tankEssence.fill(bigStorage, true);
- this.tankLiquidXp.drain(100, true);
- return (this.tankEssence.getCapacity() - this.tankEssence.getFluidAmount());
- }
- } else {
- final double rm = EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP;
- if ((this.tankEssence.getFluid() != null) && (this.tankEssence.getFluidAmount() >= rm)
- && (this.tankLiquidXp.getFluidAmount() <= (this.tankLiquidXp.getCapacity() - rm))) {
- final FluidStack bigStorage = EnchantingUtils.getLiquidXP(1);
- this.tankLiquidXp.fill(bigStorage, true);
- this.tankEssence.drain((int) rm, true);
- return (this.tankLiquidXp.getCapacity() - this.tankLiquidXp.getFluidAmount());
- }
- }
- return 0f;
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound tag) {
- this.tankEssence.readFromNBT(tag);
- this.tankLiquidXp.readFromNBT(tag);
- this.mConvertToEssence = tag.getBoolean("mConvertToEssence");
- super.readFromNBT(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound tag) {
- this.tankEssence.writeToNBT(tag);
- this.tankLiquidXp.writeToNBT(tag);
- tag.setBoolean("mConvertToEssence", this.mConvertToEssence);
- super.writeToNBT(tag);
- }
-
- @Override
- public Packet getDescriptionPacket() {
- final NBTTagCompound tag = new NBTTagCompound();
- this.writeToNBT(tag);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
- }
-
- @Override
- public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
- final NBTTagCompound tag = pkt.func_148857_g();
- this.readFromNBT(tag);
- }
-
- public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY,
- final float aZ) {
- if (this.isServerSide()) {
- if (this.mConvertToEssence) {
- PlayerUtils.messagePlayer(aPlayer, "Converting from Mob Essence to Liquid Xp.");
- } else {
- PlayerUtils.messagePlayer(aPlayer, "Converting from Liquid Xp to Mob Essence.");
- }
- // Mode Change
- this.changeMode();
- }
- }
-
- public void onRightClick(final byte aSide, final EntityPlayer aPlayer, final int aX, final int aY, final int aZ) {
- if ((Keyboard.isKeyDown(42)) || (Keyboard.isKeyDown(54))) {
- String mInput;
- String mOutput;
-
- if (this.mConvertToEssence) {
- mInput = "Liquid Xp";
- mOutput = "Mob Essence";
- } else {
- mInput = "Mob Essence";
- mOutput = "Liquid Xp";
- }
-
- PlayerUtils.messagePlayer(aPlayer, "Input: " + mInput + ".");
- PlayerUtils.messagePlayer(aPlayer, "Output: " + mOutput + ".");
- }
- }
-
- @Override
- public boolean onPreTick(long aTick) {
- boolean aSuperResult = super.onPreTick(aTick);
- long aTankSpaceLeft = 0;
- double aAmount = 0;
- int aRuns = 0;
- if (this.mConvertToEssence) {
- aTankSpaceLeft = (this.tankEssence.getCapacity() - this.tankEssence.getFluidAmount());
- aAmount = EnchantingUtils.getEssenceFromLiquidXp(100).amount;
- } else {
- aTankSpaceLeft = (this.tankLiquidXp.getCapacity() - this.tankLiquidXp.getFluidAmount());
- aAmount = EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP;
- }
- aRuns = (int) (aTankSpaceLeft / aAmount);
- for (int i = 0; i < aRuns; i++) {
- if (getAdjustedVolume() == 0) {
- break;
- }
- }
- return aSuperResult;
- }
-
- @Override
- public boolean isLiquidInput(ForgeDirection side) {
- if (mConvertToEssence) {
- if (side.offsetY != 0) {
- return false;
- }
- } else {
- if (side.offsetY != 0) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean isLiquidOutput(ForgeDirection side) {
- if (mConvertToEssence) {
- if (side.offsetY != 0) {
- return true;
- }
- } else {
- if (side.offsetY != 0) {
- return false;
- }
- }
- return false;
- }
-
- @Override
- public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (mConvertToEssence) {
- if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) {
- return this.tankLiquidXp.fill(aFluid, doFill);
- }
- } else {
- if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) {
- return this.tankEssence.fill(aFluid, doFill);
- }
- }
- return 0;
- }
-
- @Override
- public FluidStack drain(ForgeDirection side, int maxDrain, boolean doDrain) {
- if (mConvertToEssence) {
- if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) {
- return this.tankEssence.drain(maxDrain, doDrain);
- }
- } else {
- if (side != ForgeDirection.UP && side != ForgeDirection.DOWN) {
- return this.tankLiquidXp.drain(maxDrain, doDrain);
- }
- }
- return null;
- }
-
- @Override
- public FluidStack drain(ForgeDirection side, FluidStack aFluid, boolean doDrain) {
- if (mConvertToEssence) {
- if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) {
- return this.tankEssence.drain(aFluid, doDrain);
- }
- } else {
- if (side != ForgeDirection.UP && side != ForgeDirection.DOWN) {
- return this.tankLiquidXp.drain(aFluid, doDrain);
- }
- }
- return null;
- }
-
- @Override
- public boolean canFill(ForgeDirection side, Fluid aFluid) {
- if (mConvertToEssence) {
- if (side != ForgeDirection.UP && side != ForgeDirection.DOWN) {
- return this.tankLiquidXp.canTankBeFilled();
- }
- } else {
- if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) {
- return this.tankEssence.canTankBeFilled();
- }
- }
- return false;
- }
-
- @Override
- public boolean canDrain(ForgeDirection side, Fluid aFluid) {
- if (mConvertToEssence) {
- if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) {
- return this.tankEssence.canTankBeEmptied();
- }
- } else {
- if (side != ForgeDirection.UP && side != ForgeDirection.DOWN) {
- return this.tankLiquidXp.canTankBeEmptied();
- }
- }
- return false;
- }
-
- @Override
- public FluidTankInfo[] getTankInfo(ForgeDirection side) {
- if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) {
- return new FluidTankInfo[] { this.tankEssence.getInfo() };
- } else {
- return new FluidTankInfo[] { this.tankLiquidXp.getInfo() };
- }
- }
-
- @Override
- public FluidStack getFluid() {
- if (mConvertToEssence) {
- return this.tankEssence.getFluid();
- } else {
- return this.tankLiquidXp.getFluid();
- }
- }
-
- @Override
- public int getFluidAmount() {
- if (mConvertToEssence) {
- return this.tankEssence.getFluidAmount();
- } else {
- return this.tankLiquidXp.getFluidAmount();
- }
- }
-
- @Override
- public FluidTankInfo getInfo() {
- if (mConvertToEssence) {
- return this.tankEssence.getInfo();
- } else {
- return this.tankLiquidXp.getInfo();
- }
- }
-
- @Override
- public int fill(FluidStack resource, boolean doFill) {
- if (mConvertToEssence) {
- return this.tankEssence.fill(resource, doFill);
- } else {
- return this.tankLiquidXp.fill(resource, doFill);
- }
- }
-
- @Override
- public FluidStack drain(int maxDrain, boolean doDrain) {
- if (mConvertToEssence) {
- return this.tankEssence.drain(maxDrain, doDrain);
- } else {
- return this.tankLiquidXp.drain(maxDrain, doDrain);
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java
deleted file mode 100644
index 45c20ce07d..0000000000
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java
+++ /dev/null
@@ -1,482 +0,0 @@
-package gtPlusPlus.core.tileentities.machines;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
-import net.minecraft.inventory.ISidedInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-import gregtech.api.enums.ItemList;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.Pair;
-import gtPlusPlus.core.container.Container_ModularityTable;
-import gtPlusPlus.core.inventories.modulartable.InventoryModularMain;
-import gtPlusPlus.core.inventories.modulartable.InventoryModularOutput;
-import gtPlusPlus.core.item.bauble.ModularBauble;
-import gtPlusPlus.core.tileentities.base.TileEntityBase;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers;
-
-public class TileEntityModularityTable extends TileEntityBase implements ISidedInventory {
-
- public InventoryModularMain inventoryGrid;
- public InventoryModularOutput inventoryOutputs;
- public InventoryModularOutput mTempRecipeStorage;
- private Container_ModularityTable container;
- private String customName;
- private int mRecipeTimeRemaining = -1;
-
- public TileEntityModularityTable() {
- super(16);
- this.inventoryGrid = new InventoryModularMain();
- this.inventoryOutputs = new InventoryModularOutput();
- this.mTempRecipeStorage = new InventoryModularOutput();
- this.canUpdate();
- generateAllValidUpgrades();
- }
-
- public void setContainer(Container_ModularityTable container_ModularityTable) {
- this.container = container_ModularityTable;
- }
-
- public Container_ModularityTable getContainer() {
- return this.container;
- }
-
- public int getRecipeTime() {
- return this.mRecipeTimeRemaining;
- }
-
- @Override
- public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) {
- if (!nbt.hasKey(tag)) {
- nbt.setTag(tag, new NBTTagCompound());
- }
- return nbt.getCompoundTag(tag);
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- nbt.setInteger("mRecipeTime", this.mRecipeTimeRemaining);
- this.inventoryOutputs.writeToNBT(this.getTag(nbt, "ContentsOutput"));
- this.inventoryGrid.writeToNBT(this.getTag(nbt, "ContentsGrid"));
- this.mTempRecipeStorage.writeToNBT(this.getTag(nbt, "ContentsRecipeTemp"));
- if (this.hasCustomInventoryName()) {
- nbt.setString("CustomName", this.getCustomName());
- }
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- super.readFromNBT(nbt);
- this.mRecipeTimeRemaining = nbt.getInteger("mRecipeTime");
- this.inventoryOutputs.readFromNBT(nbt.getCompoundTag("ContentsOutput"));
- this.inventoryGrid.readFromNBT(nbt.getCompoundTag("ContentsGrid"));
- this.mTempRecipeStorage.readFromNBT(nbt.getCompoundTag("ContentsRecipeTemp"));
- if (nbt.hasKey("CustomName", 8)) {
- this.setCustomName(nbt.getString("CustomName"));
- }
- }
-
- protected ItemStack mOutputStack; // Upgraded Bauble
- protected ItemStack mInputstackA; // Bauble
- protected ItemStack mInputstackB; // Upgrade
-
- public ItemStack getPendingOutputItem() {
- this.mRecipeTimeRemaining--;
- return this.mOutputStack;
- }
-
- public ItemStack[] getCurrentInputItems() {
- if (this.mRecipeTimeRemaining < 0) {
- return null;
- } else {
- return new ItemStack[] { this.mInputstackA, this.mInputstackB };
- }
- }
-
- public boolean setInputStacks(ItemStack tBauble, ItemStack tUpgrade) {
- if (tBauble != null) {
- this.mInputstackA = tBauble;
- } else {
- this.mInputstackA = null;
- }
- if (tUpgrade != null) {
- this.mInputstackB = tBauble;
- } else {
- this.mInputstackB = null;
- }
- if (this.mInputstackA != null && this.mInputstackB != null) {
- return true;
- }
- return false;
- }
-
- public boolean setOutputStack(ItemStack mNewBauble) {
- if (mNewBauble != null) {
- this.mOutputStack = mNewBauble;
- return true;
- } else {
- this.mOutputStack = null;
- return false;
- }
- }
-
- public boolean clearRecipeData() {
- this.mInputstackA = null;
- this.mInputstackB = null;
- this.mOutputStack = null;
- return true;
- }
-
- @Override
- public boolean canUpdate() {
- return true;
- }
-
- public static Map<ItemStack, Pair<Modifiers, Integer>> mValidUpgradeList = new HashMap<ItemStack, Pair<Modifiers, Integer>>();
- public static Map<ItemStack, BT> mValidUpgradeListFormChange = new HashMap<ItemStack, BT>();
-
- private static boolean generateAllValidUpgrades() {
-
- // Form Change
- generateUpgradeFormData(ItemList.Sensor_MV.get(1), BT.TYPE_RING);
- generateUpgradeFormData(ItemList.Electric_Piston_MV.get(1), BT.TYPE_BELT);
- generateUpgradeFormData(ItemList.Emitter_MV.get(1), BT.TYPE_AMULET);
-
- // Damage Boost
- generateUpgradeData(ItemList.Electric_Motor_LV.get(1), Modifiers.BOOST_DAMAGE, 1);
- generateUpgradeData(ItemList.Electric_Motor_MV.get(1), Modifiers.BOOST_DAMAGE, 2);
- generateUpgradeData(ItemList.Electric_Motor_HV.get(1), Modifiers.BOOST_DAMAGE, 3);
- generateUpgradeData(ItemList.Electric_Motor_EV.get(1), Modifiers.BOOST_DAMAGE, 4);
- generateUpgradeData(ItemList.Electric_Motor_IV.get(1), Modifiers.BOOST_DAMAGE, 5);
-
- // Defence Boost
- generateUpgradeData(
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateAluminium", 1),
- Modifiers.BOOST_DEF,
- 1);
- generateUpgradeData(
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateStainlessSteel", 1),
- Modifiers.BOOST_DEF,
- 2);
- generateUpgradeData(
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateTungsten", 1),
- Modifiers.BOOST_DEF,
- 3);
- generateUpgradeData(
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateTungstenSteel", 1),
- Modifiers.BOOST_DEF,
- 4);
- generateUpgradeData(
- ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateNaquadah", 1),
- Modifiers.BOOST_DEF,
- 5);
-
- // Hp Boost
- generateUpgradeData(ItemUtils.simpleMetaStack(Items.golden_apple, 0, 1), Modifiers.BOOST_HP, 1);
- generateUpgradeData(ItemUtils.simpleMetaStack(Items.golden_apple, 1, 1), Modifiers.BOOST_HP, 2);
- generateUpgradeData(ItemUtils.simpleMetaStack(Items.nether_star, 0, 1), Modifiers.BOOST_HP, 3);
- generateUpgradeData(
- ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32725", 32725, 1),
- Modifiers.BOOST_HP,
- 4);
- generateUpgradeData(
- ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32726", 32726, 1),
- Modifiers.BOOST_HP,
- 5);
-
- return true;
- }
-
- public static boolean generateUpgradeData(ItemStack tStack, Modifiers tMod, int tLevel) {
- Pair<Modifiers, Integer> tTemp = new Pair<Modifiers, Integer>(tMod, tLevel);
- if (mValidUpgradeList.put(tStack, tTemp) != null) {
- return true;
- }
- return false;
- }
-
- public static boolean generateUpgradeFormData(ItemStack tStack, BT tMod) {
- if (mValidUpgradeListFormChange.put(tStack, tMod) != null) {
- return true;
- }
- return false;
- }
-
- public static boolean addUpgrade(ItemStack tStack, ItemStack tBauble) {
-
- try {
- Iterator<Entry<ItemStack, BT>> it = mValidUpgradeListFormChange.entrySet().iterator();
- while (it.hasNext()) {
- Entry<ItemStack, BT> pair = it.next();
- if (pair.getKey().getItem() == tStack.getItem()
- && pair.getKey().getItemDamage() == tStack.getItemDamage()) {
- ModularArmourUtils.setBaubleType(tBauble, pair.getValue());
- tBauble.setItemDamage(ModularArmourUtils.getBaubleTypeID(tBauble));
- return true;
- }
- }
- } catch (Throwable t) {
-
- }
- try {
- Iterator<Entry<ItemStack, Pair<Modifiers, Integer>>> it2 = mValidUpgradeList.entrySet().iterator();
- while (it2.hasNext()) {
- Entry<ItemStack, Pair<Modifiers, Integer>> pair = it2.next();
- if (pair.getKey().getItem() == tStack.getItem()
- && pair.getKey().getItemDamage() == tStack.getItemDamage()) {
- Pair<Modifiers, Integer> newPair = pair.getValue();
- ModularArmourUtils.setModifierLevel(tBauble, newPair);
- return true;
- }
- }
- } catch (Throwable t) {
-
- }
- return false;
- }
-
- @Override
- public int getSizeInventory() {
- return 11;
- }
-
- @Override
- public ItemStack getStackInSlot(int slot) {
- if (slot >= this.inventoryGrid.getSizeInventory()) {
- return this.inventoryOutputs.getStackInSlot(slot - 9);
- } else if (slot < this.inventoryGrid.getSizeInventory()) {
- return this.inventoryGrid.getStackInSlot(slot);
- } else {
- return null;
- }
- }
-
- @Override
- public ItemStack decrStackSize(int slot, int count) {
- if (slot < this.inventoryGrid.getSizeInventory()) {
- return this.inventoryGrid.decrStackSize(slot, count);
- } else if (slot >= this.inventoryGrid.getSizeInventory()) {
- return this.inventoryOutputs.decrStackSize(slot - 9, count);
- } else {
- return null;
- }
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int slot) {
- return this.getStackInSlot(slot);
- }
-
- @Override
- public void setInventorySlotContents(int slot, ItemStack stack) {
- if (slot >= this.inventoryGrid.getSizeInventory()) {
- this.inventoryOutputs.setInventorySlotContents(slot - 9, stack);
- } else if (slot < this.inventoryGrid.getSizeInventory()) {
- this.inventoryGrid.setInventorySlotContents(slot, stack);
- }
- }
-
- @Override
- public int getInventoryStackLimit() {
- return 64;
- }
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer entityplayer) {
- return true;
- }
-
- @Override
- public void openInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.inventoryGrid.openInventory();
- this.inventoryOutputs.openInventory();
- }
-
- @Override
- public void closeInventory() {
- this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
- this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.inventoryGrid.openInventory();
- this.inventoryOutputs.openInventory();
- }
-
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
- if (slot >= this.inventoryGrid.getSizeInventory()) {
- return this.inventoryOutputs.isItemValidForSlot(slot - 9, itemstack);
- } else if (slot < this.inventoryGrid.getSizeInventory()) {
- return this.inventoryGrid.isItemValidForSlot(slot, itemstack);
- } else {
- return false;
- }
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(int side) {
- int[] accessibleSides = new int[this.getSizeInventory()];
- for (int r = 0; r < this.getSizeInventory(); r++) {
- accessibleSides[r] = r;
- }
- return accessibleSides;
- }
-
- @Override
- public boolean canInsertItem(int slot, ItemStack item, int side) {
- Logger.INFO("Slot:" + slot + " | side? " + side);
-
- /*
- * if (side == 1){ return this.inventoryOutputs.isItemValidForSlot(slot-9, item); }
- */
- if (slot >= 9) {
- return this.inventoryOutputs.isItemValidForSlot(slot - 9, item);
- } else {
- return this.inventoryGrid.isItemValidForSlot(slot, item);
- }
- }
-
- @Override
- public boolean canExtractItem(int slot, ItemStack item, int side) {
- Logger.INFO("Slot:" + slot + " | side? " + side);
- if (slot == 11 || slot <= 8) {
- return true;
- }
- return false;
- }
-
- @Override
- public String getCustomName() {
- return this.customName;
- }
-
- @Override
- public void setCustomName(String customName) {
- this.customName = customName;
- }
-
- @Override
- public String getInventoryName() {
- return this.hasCustomInventoryName() ? this.customName : "container.fishtrap";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return this.customName != null && !this.customName.equals("");
- }
-
- @Override
- public boolean onPreTick(long aTick) {
- // Check for active recipe
- if (this.mRecipeTimeRemaining > -1
- || (this.mTempRecipeStorage != null) && (this.mTempRecipeStorage.getRecipeTime() > -1)) {
- if ((this.mTempRecipeStorage != null) && this.mTempRecipeStorage.getRecipeTime() > -1) {
- if (this.mRecipeTimeRemaining < this.mTempRecipeStorage.getRecipeTime()) {
- this.mRecipeTimeRemaining = this.mTempRecipeStorage.getRecipeTime();
- this.markDirty();
- }
- }
- if (this.mInputstackA != null && this.mInputstackB != null && this.mOutputStack != null) {
- this.mTempRecipeStorage.setInventorySlotContents(0, this.mInputstackA);
- this.mTempRecipeStorage.setInventorySlotContents(1, this.mInputstackB);
- this.mTempRecipeStorage.setInventorySlotContents(2, this.mOutputStack);
- this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining);
- this.markDirty();
- }
- }
- return true;
- }
-
- @Override
- public boolean onPostTick(long aTick) {
- if (mRecipeTimeRemaining == 0) {
- this.inventoryOutputs.setInventorySlotContents(2, this.getPendingOutputItem());
- clearRecipeData();
- this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining);
- this.markDirty();
- } else if (mRecipeTimeRemaining > 0) {
- mRecipeTimeRemaining--;
- this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining);
- }
- return true;
- }
-
- @Override
- public boolean processRecipe() {
- boolean removeInputA = false;
- boolean removeInputB = false;
- // Data stick
- ItemStack tBauble = this.inventoryOutputs.getStackInSlot(0);
- ItemStack tUpgrade = this.inventoryOutputs.getStackInSlot(1);
- if (tBauble != null && tUpgrade != null && this.container != null) {
- if (tBauble.getItem() instanceof ModularBauble && this.mRecipeTimeRemaining == -1) {
- if (tUpgrade != null && tBauble != null) {
- removeInputA = true;
- this.setInputStacks(tBauble, tUpgrade);
- try {
- removeInputB = addUpgrade(tUpgrade, tBauble);
- if (!removeInputB) {}
- } catch (Throwable t) {}
- if (removeInputA && removeInputB) {
- if (this.setOutputStack(tBauble)) {
- if (this.inventoryOutputs.getStackInSlot(1).stackSize > 1) {
- ItemStack mTempStack = this.inventoryOutputs.getStackInSlot(1);
- mTempStack.stackSize--;
- this.inventoryOutputs.setInventorySlotContents(1, mTempStack);
- } else {
- this.inventoryOutputs.setInventorySlotContents(1, null);
- }
- this.inventoryOutputs.setInventorySlotContents(0, null);
- this.mRecipeTimeRemaining = 80;
- this.markDirty();
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- public static boolean isValidModularPiece(final ItemStack itemstack) {
- if (itemstack.getItem() instanceof ModularBauble) {
- return true;
- }
- return false;
- }
-
- public static boolean isValidUpgrade(final ItemStack itemstack) {
- boolean isValid = false;
- if (itemstack != null) {
- Iterator<Entry<ItemStack, BT>> it = mValidUpgradeListFormChange.entrySet().iterator();
- while (it.hasNext()) {
- Entry<ItemStack, BT> pair = it.next();
- if (pair.getKey().getItem() == itemstack.getItem()
- && pair.getKey().getItemDamage() == itemstack.getItemDamage()) {
- isValid = true;
- }
- }
- Iterator<Entry<ItemStack, Pair<Modifiers, Integer>>> it2 = mValidUpgradeList.entrySet().iterator();
- while (it2.hasNext()) {
- Entry<ItemStack, Pair<Modifiers, Integer>> pair = it2.next();
- if (pair.getKey().getItem() == itemstack.getItem()
- && pair.getKey().getItemDamage() == itemstack.getItemDamage()) {
- isValid = true;
- }
- }
- }
- return isValid;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java
index 0d74b69fb2..0229f89402 100644
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java
+++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java
@@ -4,7 +4,6 @@ import java.util.List;
import java.util.Vector;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
@@ -17,11 +16,6 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.container.Container_ProjectTable;
import gtPlusPlus.core.inventories.projecttable.InventoryProjectMain;
import gtPlusPlus.core.inventories.projecttable.InventoryProjectOutput;
-import gtPlusPlus.core.item.bauble.ModularBauble;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT;
-import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers;
import gtPlusPlus.core.util.minecraft.NBTUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
@@ -165,136 +159,6 @@ public class TileEntityProjectTable extends TileEntity
}
}
- // Utils.LOG_INFO("Doing thing 1");
- if (dataStick != null) if (dataStick.getItem() instanceof ModularBauble) {
- Logger.INFO("Doing thing 2");
- ItemStack tBauble = dataStick;
- dataStick = null;
- this.inventoryOutputs.setInventorySlotContents(0, dataStick);
- if (this.inventoryGrid != null) {
- Logger.INFO("Doing things");
- ItemStack[] tStack = container.getInputComponents();
- if (tStack != null) {
- // Utils.LOG_INFO(""+tStack.length);
- if (tBauble != null) {
- for (int i = 0; i < tStack.length; i++) {
-
- ItemStack testStack;
- if ((testStack = container.inventoryGrid.getStackInSlot(i)) != null) {
- Logger.INFO("FOUND: " + testStack.getDisplayName());
- }
-
- if (tStack[i] != null) {
- Logger.INFO("found " + tStack[i].getDisplayName());
- try {
- if (tStack[i].getItem() == Items.feather) {
- ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_BELT);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
- if (tStack[i].getItem() == Items.bed) {
- ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_RING);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
- if (tStack[i].getItem() == Items.boat) {
- ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_AMULET);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
-
- if (tStack[i].getItem() == Items.egg) {
- ModularArmourUtils.setModifierLevel(
- tBauble,
- Modifiers.BOOST_HOLY,
- ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_HOLY)
- + 1);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
-
- if (tStack[i].getItem() == Items.baked_potato) {
- ModularArmourUtils.setModifierLevel(
- tBauble,
- Modifiers.BOOST_DEF,
- ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DEF)
- + 1);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
-
- if (tStack[i].getItem() == Items.cooked_beef) {
- ModularArmourUtils.setModifierLevel(
- tBauble,
- Modifiers.BOOST_HP,
- ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_HP)
- + 1);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- this.inventoryGrid.setInventorySlotContents(i, null);
- }
-
- if (tStack[i] == ItemUtils
- .simpleMetaStack("gregtech:gt.metaitem.01:17019", 17019, 1)) {
- ModularArmourUtils.setModifierLevel(
- tBauble,
- Modifiers.BOOST_DEF,
- ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DEF)
- + 1);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- }
- if (tStack[i] == ItemList.Electric_Motor_LV.get(1)) {
- ModularArmourUtils.setModifierLevel(
- tBauble,
- Modifiers.BOOST_DAMAGE,
- ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DAMAGE)
- + 1);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- } else if (tStack[i] == ItemList.Electric_Motor_MV.get(1)) {
- ModularArmourUtils.setModifierLevel(
- tBauble,
- Modifiers.BOOST_DAMAGE,
- ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DAMAGE)
- + 2);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- } else if (tStack[i] == ItemList.Electric_Motor_HV.get(1)) {
- ModularArmourUtils.setModifierLevel(
- tBauble,
- Modifiers.BOOST_DAMAGE,
- ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DAMAGE)
- + 3);
- Logger.INFO("buffed Modular bauble");
- tStack[i] = null;
- container.inventoryGrid.setInventorySlotContents(i, null);
- }
- } catch (Throwable t) {
-
- }
- }
- }
- Logger.INFO("set new Modular bauble");
- this.inventoryOutputs.setInventorySlotContents(1, tBauble);
- }
- }
- }
- }
}
super.updateEntity();
}
diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java
deleted file mode 100644
index bf3a3c704e..0000000000
--- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package gtPlusPlus.core.tileentities.machines;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-import gtPlusPlus.core.container.Container_TradeTable;
-import gtPlusPlus.core.inventories.tradetable.InventoryTradeMain;
-import gtPlusPlus.core.inventories.tradetable.InventoryTradeOutput;
-import gtPlusPlus.core.tileentities.base.TileEntityBase;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
-
-public class TileEntityTradeTable extends TileEntityBase {
-
- public InventoryTradeMain inventoryGrid;
- public InventoryTradeOutput inventoryOutputs;
-
- private Container_TradeTable container;
-
- public TileEntityTradeTable() {
- super(2);
- this.inventoryGrid = new InventoryTradeMain(); // number of slots - without product slot
- this.inventoryOutputs = new InventoryTradeOutput(); // number of slots - without product slot
- }
-
- public void setContainer(Container_TradeTable container_TradeTable) {
- this.container = container_TradeTable;
- }
-
- @Override
- public void writeToNBT(final NBTTagCompound nbt) {
- super.writeToNBT(nbt);
- this.inventoryGrid.writeToNBT(this.getTag(nbt, "ContentsGrid"));
- this.inventoryOutputs.writeToNBT(this.getTag(nbt, "ContentsOutput"));
- }
-
- @Override
- public void readFromNBT(final NBTTagCompound nbt) {
- this.inventoryGrid.readFromNBT(nbt);
- this.inventoryOutputs.readFromNBT(nbt);
- super.readFromNBT(nbt);
- }
-
- @Override
- public void updateEntity() {
- if (!this.worldObj.isRemote) {
- ItemStack slot0;
- try {
-
- slot0 = this.inventoryOutputs.getStackInSlot(0);
- if (slot0 != null && slot0.hasTagCompound()) {
- NBTUtils.tryIterateNBTData(slot0);
- this.inventoryOutputs.setInventorySlotContents(0, null);
- this.inventoryOutputs.setInventorySlotContents(1, slot0);
- }
-
- } catch (Throwable t) {
- t.printStackTrace();
- this.inventoryOutputs.setInventorySlotContents(0, null);
- }
- }
- super.updateEntity();
- }
-
- @Override
- public int getSizeInventory() {
- return 0;
- }
-
- @Override
- public ItemStack getStackInSlot(int p_70301_1_) {
- return null;
- }
-
- @Override
- public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
- return null;
- }
-
- @Override
- public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {}
-
- @Override
- public int getInventoryStackLimit() {
- return 64;
- }
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
- return true;
- }
-
- @Override
- public void openInventory() {}
-
- @Override
- public void closeInventory() {}
-
- @Override
- public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
- return false;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(int side) {
- return new int[] {};
- }
-
- @Override
- public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int side) {
- return false;
- }
-
- @Override
- public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
- return false;
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/util/Utils.java b/src/main/java/gtPlusPlus/core/util/Utils.java
index 5908941dfc..2b6ad41f13 100644
--- a/src/main/java/gtPlusPlus/core/util/Utils.java
+++ b/src/main/java/gtPlusPlus/core/util/Utils.java
@@ -1,15 +1,8 @@
package gtPlusPlus.core.util;
import java.awt.*;
-import java.io.ByteArrayOutputStream;
import java.io.File;
-import java.io.IOException;
-import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
import java.lang.reflect.Method;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -18,8 +11,6 @@ import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
-import javax.xml.bind.DatatypeConverter;
-
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
@@ -42,8 +33,6 @@ import net.minecraftforge.oredict.OreDictionary;
import org.apache.commons.lang3.EnumUtils;
import cpw.mods.fml.common.FMLCommonHandler;
-import cpw.mods.fml.common.registry.EntityRegistry;
-import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
@@ -57,13 +46,10 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.NBTUtils;
-import gtPlusPlus.core.util.sys.SystemUtils;
-import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner;
import ic2.core.Ic2Items;
import ic2.core.init.InternalName;
import ic2.core.item.resources.ItemCell;
@@ -659,28 +645,7 @@ public class Utils {
return temp;
}
- public static ToolMaterial generateToolMaterial(final Material material) {
- final String name = material.getLocalizedName();
- final int harvestLevel = material.vHarvestLevel;
- final int durability = (int) material.vDurability;
- final float damage = material.vToolQuality;
- final int efficiency = material.vToolQuality;
- // int enchantability = material.mEnchantmentToolsLevel;
- Logger.INFO(
- "ToolMaterial stats for " + material.getLocalizedName()
- + " | harvestLevel:"
- + harvestLevel
- + " | durability:"
- + durability
- + " | toolQuality:"
- + damage
- + " | toolSpeed:"
- + damage);
- final ToolMaterial temp = EnumHelper.addToolMaterial(name, harvestLevel, durability, efficiency, damage, 0);
- return temp;
- }
-
- public static enum Versioning {
+ public enum Versioning {
EQUAL(0),
NEWER(1),
@@ -688,7 +653,7 @@ public class Utils {
private final int versioningInfo;
- private Versioning(final int versionStatus) {
+ Versioning(final int versionStatus) {
this.versioningInfo = versionStatus;
}
@@ -746,13 +711,12 @@ public class Utils {
Logger.INFO("WARNING: String for written Book too long! -> " + aPages[i]);
GT_Log.err.println(
new StringBuilder().append("WARNING: String for written Book too long! -> ")
- .append(aPages[i]).toString());
+ .append(aPages[i]));
}
} else {
Logger.INFO("WARNING: Too much Pages for written Book! -> " + aTitle);
GT_Log.err.println(
- new StringBuilder().append("WARNING: Too much Pages for written Book! -> ").append(aTitle)
- .toString());
+ new StringBuilder().append("WARNING: Too much Pages for written Book! -> ").append(aTitle));
break;
}
}
@@ -765,100 +729,17 @@ public class Utils {
rStack.setTagCompound(tNBT);
GT_Log.out.println(
new StringBuilder().append("GT++_Mod: Added Book to Book++ List - Mapping: '").append(aMapping)
- .append("' - Name: '").append(aTitle).append("' - Author: '").append(aAuthor).append("'")
- .toString());
+ .append("' - Name: '").append(aTitle).append("' - Author: '").append(aAuthor).append("'"));
NBTUtils.createIntegerTagCompound(rStack, "stats", "mMeta", vMeta);
CORE.sBookList.put(aMapping, rStack);
Logger.INFO("Creating book: " + aTitle + " by " + aAuthor + ". Using Meta " + vMeta + ".");
return GT_Utility.copy(new Object[] { rStack });
}
- public static SecureRandom generateSecureRandom() {
- SecureRandom secRan;
- String secRanType;
-
- if (SystemUtils.isWindows()) {
- secRanType = "Windows-PRNG";
- } else {
- secRanType = "NativePRNG";
- }
- try {
- secRan = SecureRandom.getInstance(secRanType);
- // Default constructor would have returned insecure SHA1PRNG algorithm, so make an explicit call.
- byte[] b = new byte[64];
- secRan.nextBytes(b);
- return secRan;
- } catch (NoSuchAlgorithmException e) {
- return null;
- }
- }
-
- public static String calculateChecksumMD5(Object bytes) {
- byte[] result = new byte[] {};
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- ObjectOutput out = null;
- try {
- out = new ObjectOutputStream(bos);
- out.writeObject(bytes);
- out.flush();
- result = bos.toByteArray();
- } catch (IOException e) {} finally {
- try {
- bos.close();
- } catch (IOException e) {}
- }
- return calculateChecksumMD5(result);
- }
-
- public static String calculateChecksumMD5(byte[] bytes) {
- MessageDigest md;
- try {
- md = MessageDigest.getInstance("MD5");
- md.update(bytes);
- byte[] digest = md.digest();
- String myHash = DatatypeConverter.printHexBinary(digest).toUpperCase();
- return myHash;
- } catch (NoSuchAlgorithmException e) {
- return null;
- }
- }
-
- public static boolean createNewMobSpawner(int aID, Entity aEntity) {
- if (aEntity instanceof Entity) {
- Class c = aEntity.getClass();
- return createNewMobSpawner(aID, c);
- }
- return false;
- }
-
- public static boolean createNewMobSpawner(int aID, Class aEntity) {
- Logger.INFO("[Spawn] Generating new spawner for entity with class (" + aEntity.getSimpleName() + ").");
- if (TileEntityGenericSpawner.registerNewMobSpawner(aID, (Class<Entity>) aEntity)) {
- EntityRegistration x = EntityRegistry.instance().lookupModSpawn((Class<? extends Entity>) aEntity, true);
- if (x != null) {
- Logger.INFO("[Spawn] Registration for " + x.getEntityName() + " successful");
- return true;
- } else {
- Logger.INFO("[Spawn] Registration for " + aEntity.getSimpleName() + " successful");
- return true;
- }
- }
- Logger.INFO("[Spawn] Mob Spawner creation for " + aEntity.getName() + " failed");
- return false;
- }
-
public static long getMillisSince(long aStartTime, long aCurrentTime) {
return (aCurrentTime - aStartTime);
}
- public static long getSecondsFromMillis(long aMillis) {
- return (aMillis / 1000);
- }
-
- public static long getTicksFromSeconds(long aSeconds) {
- return (aSeconds * 20);
- }
-
public static byte getTier(long l) {
byte i = -1;
do {
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java
index 58832e095b..6e9bd64c61 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java
@@ -1,9 +1,6 @@
package gtPlusPlus.core.util.minecraft;
-import static gregtech.api.enums.Mods.GTPlusPlus;
-import static gregtech.api.enums.Mods.GregTech;
-import static gregtech.api.enums.Mods.IndustrialCraft2;
-import static gregtech.api.enums.Mods.Minecraft;
+import static gregtech.api.enums.Mods.*;
import java.util.ArrayList;
import java.util.HashMap;
@@ -16,7 +13,6 @@ import net.minecraft.enchantment.EnchantmentData;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
-import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
@@ -42,13 +38,9 @@ import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.item.base.BasicSpawnEgg;
import gtPlusPlus.core.item.base.dusts.BaseItemDustUnique;
-import gtPlusPlus.core.item.base.dusts.decimal.BaseItemCentidust;
-import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust;
import gtPlusPlus.core.item.base.plates.BaseItemPlate_OLD;
import gtPlusPlus.core.item.chemistry.AgriculturalChem;
import gtPlusPlus.core.item.chemistry.GenericChem;
-import gtPlusPlus.core.item.tool.staballoy.MultiPickaxeBase;
-import gtPlusPlus.core.item.tool.staballoy.MultiSpadeBase;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.recipe.common.CI;
@@ -103,31 +95,12 @@ public class ItemUtils {
public static final int WILDCARD_VALUE = Short.MAX_VALUE;
- public static ItemStack getWildcardStack(final Item x) {
- final ItemStack y = new ItemStack(x, 1, WILDCARD_VALUE);
- return y;
- }
-
public static ItemStack getWildcardStack(final ItemStack x) {
- final ItemStack y = ItemUtils.simpleMetaStack(x, WILDCARD_VALUE, 1);
- return y;
- }
-
- public static ItemStack getIC2Cell(final String S) {
- final ItemStack moreTemp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + S, 1);
-
- if (moreTemp == null) {
- final int cellID = 0;
- final ItemStack temp = GT_ModHandler.getModItem(IndustrialCraft2.ID, "itemCellEmpty", 1L, cellID);
- return temp != null ? temp : null;
- }
-
- return moreTemp;
+ return ItemUtils.simpleMetaStack(x, WILDCARD_VALUE, 1);
}
public static ItemStack getIC2Cell(final int meta) {
- final ItemStack temp = GT_ModHandler.getModItem(IndustrialCraft2.ID, "itemCellEmpty", 1L, meta);
- return temp != null ? temp : null;
+ return GT_ModHandler.getModItem(IndustrialCraft2.ID, "itemCellEmpty", 1L, meta);
}
public static ItemStack getEmptyCell() {
@@ -241,14 +214,7 @@ public class ItemUtils {
if (size < 0 || size > 64) {
size = 1;
}
- // Logger.INFO("Found Metastack: " + item.getUnlocalizedName() + ":" + meta);
- // Logger.INFO(""+ReflectionUtils.getMethodName(0));
- // Logger.INFO(""+ReflectionUtils.getMethodName(1));
- // Logger.INFO(""+ReflectionUtils.getMethodName(2));
- // Logger.INFO(""+ReflectionUtils.getMethodName(3));
- // Logger.INFO(""+ReflectionUtils.getMethodName(4));
- final ItemStack metaStack = new ItemStack(item, size, meta);
- return metaStack;
+ return new ItemStack(item, size, meta);
}
public static ItemStack simpleMetaStack(final Block block, final int meta, final int size) {
@@ -580,164 +546,6 @@ public class ItemUtils {
return output;
}
- public static MultiPickaxeBase generateMultiPick(final boolean GT_Durability, final Materials material) {
- final ToolMaterial customMaterial = Utils.generateToolMaterialFromGT(material);
- final int enchantLevel = material.mEnchantmentToolsLevel;
- final Object enchant = new Pair(material.mEnchantmentTools, enchantLevel);
- return generateMultiPick(
- GT_Durability,
- customMaterial,
- material.mDefaultLocalName,
- material.mDurability,
- material.mRGBa,
- enchant);
- }
-
- public static MultiPickaxeBase generateMultiPick(final Material material) {
- final ToolMaterial customMaterial = Utils.generateToolMaterial(material);
- return generateMultiPick(
- true,
- customMaterial,
- material.getLocalizedName(),
- (int) material.vDurability,
- material.getRGBA(),
- null);
- }
-
- public static MultiPickaxeBase generateMultiPick(final boolean GT_Durability, final ToolMaterial customMaterial,
- final String name, final int durability, final short[] rgba, final Object enchantment) {
- Logger.WARNING("Generating a Multi-Pick out of " + name);
- final short[] rgb = rgba;
- int dur = customMaterial.getMaxUses();
- Logger.WARNING("Determined durability for " + name + " is " + dur);
- if (GT_Durability) {
- dur = durability * 100;
- Logger.WARNING("Using gregtech durability value, " + name + " is now " + dur + ".");
- } else if (dur <= 0) {
- dur = durability;
- Logger.WARNING(
- "Determined durability too low, " + name
- + " is now "
- + dur
- + " based on the GT material durability.");
- }
- if (dur <= 0) {
- Logger.WARNING("Still too low, " + name + " will now go unused.");
- return null;
- }
-
- Object enchant;
- if (enchantment != null) {
- if (enchantment instanceof Pair) {
- enchant = enchantment;
- }
- } else {
- enchant = null;
- }
-
- final MultiPickaxeBase MP_Redstone = new MultiPickaxeBase(
- name + " Multipick",
- (customMaterial),
- dur,
- Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]),
- enchantment);
-
- if (MP_Redstone.isValid) {
- return MP_Redstone;
- }
- Logger.WARNING("Pickaxe was not valid.");
- return null;
- }
-
- public static MultiSpadeBase generateMultiShovel(final boolean GT_Durability, final Materials material) {
- final ToolMaterial customMaterial = Utils.generateToolMaterialFromGT(material);
- return generateMultiShovel(
- GT_Durability,
- customMaterial,
- material.mDefaultLocalName,
- material.mDurability,
- material.mRGBa);
- }
-
- public static MultiSpadeBase generateMultiShovel(final Material material) {
- final ToolMaterial customMaterial = Utils.generateToolMaterial(material);
- return generateMultiShovel(
- true,
- customMaterial,
- material.getLocalizedName(),
- (int) material.vDurability,
- material.getRGBA());
- }
-
- public static MultiSpadeBase generateMultiShovel(final boolean GT_Durability, final ToolMaterial customMaterial,
- final String name, final int durability, final short[] rgba) {
- Logger.WARNING("Generating a Multi-Spade out of " + name);
- final short[] rgb = rgba;
- int dur = customMaterial.getMaxUses();
- Logger.WARNING("Determined durability for " + name + " is " + dur);
- if (GT_Durability) {
- dur = durability * 100;
- Logger.WARNING("Using gregtech durability value, " + name + " is now " + dur + ".");
- } else if (dur <= 0) {
- dur = durability;
- Logger.WARNING(
- "Determined durability too low, " + name
- + " is now "
- + dur
- + " based on the GT material durability.");
- }
- if (dur <= 0) {
- Logger.WARNING("Still too low, " + name + " will now go unused.");
- return null;
- }
- final MultiSpadeBase MP_Redstone = new MultiSpadeBase(
- name + " Multispade",
- (customMaterial),
- dur,
- Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]));
-
- if (MP_Redstone.isValid) {
- return MP_Redstone;
- }
- 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) {
- generateDecidust(placeholder);
- }
- }
- return null;
- }
-
- public static BaseItemDecidust generateDecidust(final Material material) {
- if ((material.getDust(1) != null) && MaterialUtils.hasValidRGBA(material.getRGBA())) {
- final BaseItemDecidust Decidust = new BaseItemDecidust(material);
- return Decidust;
- }
- 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) {
- generateCentidust(placeholder);
- }
- }
- 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;
- }
- return null;
- }
-
public static boolean isRadioactive(final String materialName) {
int sRadiation = 0;
if (materialName.toLowerCase().contains("uranium")) {
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
index 3fdef9f94f..36c630051b 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
@@ -22,7 +22,6 @@ import gtPlusPlus.core.client.CustomTextureSet.TextureSets;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes;
import gtPlusPlus.core.item.base.foil.BaseItemFoil;
-import gtPlusPlus.core.item.base.plates.BaseItemPlateHeavy;
import gtPlusPlus.core.item.base.wire.BaseItemFineWire;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
@@ -382,9 +381,7 @@ public class MaterialUtils {
public static void generateComponentAndAssignToAMaterial(ComponentTypes aType, Material aMaterial,
boolean generateRecipes) {
Item aGC;
- if (aType == ComponentTypes.PLATEHEAVY) {
- aGC = new BaseItemPlateHeavy(aMaterial);
- } else if (aType == ComponentTypes.FINEWIRE) {
+ if (aType == ComponentTypes.FINEWIRE) {
aGC = new BaseItemFineWire(aMaterial);
} else if (aType == ComponentTypes.FOIL) {
aGC = new BaseItemFoil(aMaterial);
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
index 74b0ad6a62..2be3f781a3 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
@@ -194,24 +194,6 @@ public class PlayerUtils {
return null;
}
- @SideOnly(Side.CLIENT)
- public static final boolean isPlayerAlkalus() {
- if (Utils.isServer()) {
- return false;
- }
- return isPlayerAlkalus(Minecraft.getMinecraft().thePlayer);
- }
-
- public static final boolean isPlayerAlkalus(EntityPlayer player) {
- if (player != null) {
- if (player.getDisplayName().toLowerCase().equals("draknyte1")
- || player.getDisplayName().toLowerCase().equals("alkalus")) {
- return true;
- }
- }
- return false;
- }
-
public static void messageAllPlayers(String string) {
Utils.sendServerMessage(string);
}