From cbe0e497be8e466c380a5b4fa781b314ede9ada3 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sun, 6 Nov 2016 19:32:27 +1000 Subject: Revert "$ Cleaned up the entire project." This reverts commit 0669f5eb9d5029a8b94ec552171b0837605f7747. # Conflicts: # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java Revert "% Cleaned up Imports." This reverts commit 3654052fb63a571c5eaca7f20714b87c17f7e966. --- src/Java/gtPlusPlus/core/block/ModBlocks.java | 56 +- .../gtPlusPlus/core/block/base/AdvancedBlock.java | 38 +- .../gtPlusPlus/core/block/base/BasicBlock.java | 80 +- .../core/block/base/BlockBaseModular.java | 196 ++- src/Java/gtPlusPlus/core/block/base/MetaBlock.java | 36 +- .../core/block/base/MultiTextureBlock.java | 47 +- .../gtPlusPlus/core/block/general/LightGlass.java | 152 +- .../core/block/general/antigrief/TowerDevice.java | 488 +++--- .../general/fluids/BlockFluidJackDaniels.java | 78 +- .../core/block/machine/BlockGtFrameBox.java | 35 +- .../core/block/machine/Machine_Charger.java | 131 +- .../gtPlusPlus/core/block/machine/Machine_NHG.java | 131 +- .../core/block/machine/Machine_WireiusDeletus.java | 3 +- .../core/block/machine/Machine_Workbench.java | 133 +- .../block/machine/Machine_WorkbenchAdvanced.java | 94 +- .../machine/heliumgen/block/HeliumGenerator.java | 279 ++-- .../container/ContainerHeliumGenerator.java | 69 +- .../machine/heliumgen/gui/GUIHeliumGenerator.java | 111 +- .../machine/heliumgen/slots/InvSlotRadiation.java | 88 +- .../tileentity/TileEntityHeliumGenerator.java | 854 +++++----- src/Java/gtPlusPlus/core/commands/CommandMath.java | 235 +-- .../gtPlusPlus/core/commands/CommandUtils.java | 8 +- src/Java/gtPlusPlus/core/common/CommonProxy.java | 138 +- .../core/common/compat/COMPAT_Baubles.java | 28 +- .../core/common/compat/COMPAT_BigReactors.java | 10 +- .../common/compat/COMPAT_CompactWindmills.java | 316 ++-- .../core/common/compat/COMPAT_EnderIO.java | 10 +- .../core/common/compat/COMPAT_ExtraUtils.java | 21 +- .../gtPlusPlus/core/common/compat/COMPAT_IC2.java | 84 +- .../core/common/compat/COMPAT_MorePlanets.java | 23 +- .../core/common/compat/COMPAT_PneumaticCraft.java | 12 +- .../core/common/compat/COMPAT_RFTools.java | 12 +- .../core/common/compat/COMPAT_SimplyJetpacks.java | 12 +- .../core/common/compat/COMPAT_Thaumcraft.java | 46 +- .../core/container/Container_BackpackBase.java | 231 +-- .../core/container/Container_Charger.java | 71 +- .../gtPlusPlus/core/container/Container_NHG.java | 104 +- .../core/container/Container_Workbench.java | 581 ++++--- .../container/Container_WorkbenchAdvanced.java | 512 +++--- .../gtPlusPlus/core/creative/AddToCreativeTab.java | 36 +- .../creative/tabs/MiscUtilCreativeTabBlock.java | 2 +- .../creative/tabs/MiscUtilCreativeTabMachines.java | 5 +- .../creative/tabs/MiscUtilCreativeTabMisc.java | 2 +- .../creative/tabs/MiscUtilCreativeTabOther.java | 2 +- .../creative/tabs/MiscUtilCreativeTabTools.java | 2 +- .../gtPlusPlus/core/entity/EntityTeleportFX.java | 444 ++--- .../gtPlusPlus/core/fluids/BlockFluidBase.java | 165 +- .../core/fluids/FluidRegistryHandler.java | 80 +- src/Java/gtPlusPlus/core/fluids/GenericFluid.java | 115 +- .../gtPlusPlus/core/gui/beta/Gui_ID_Registry.java | 67 +- src/Java/gtPlusPlus/core/gui/beta/Gui_Types.java | 12 +- src/Java/gtPlusPlus/core/gui/beta/MU_GuiId.java | 51 +- .../gtPlusPlus/core/gui/item/GuiBaseBackpack.java | 153 +- .../gtPlusPlus/core/gui/machine/GUI_Charger.java | 73 +- src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java | 74 +- .../gtPlusPlus/core/gui/machine/GUI_Workbench.java | 90 +- .../core/gui/machine/GUI_WorkbenchAdvanced.java | 36 +- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 187 ++- .../core/handler/COMPAT_IntermodStaging.java | 25 +- .../gtPlusPlus/core/handler/CraftingManager.java | 14 +- src/Java/gtPlusPlus/core/handler/GuiHandler.java | 188 ++- .../handler/Recipes/LateRegistrationHandler.java | 30 +- .../core/handler/Recipes/RegistrationHandler.java | 33 +- .../core/handler/events/LoginEventHandler.java | 136 +- .../events/PickaxeBlockBreakEventHandler.java | 74 +- .../handler/events/UnbreakableBlockManager.java | 179 +- .../workbench/Workbench_CraftingHandler.java | 207 ++- .../handler/workbench/Workbench_RecipeSorter.java | 44 +- .../gtPlusPlus/core/interfaces/IGuiManager.java | 8 +- .../core/interfaces/IGuiManagerMiscUtils.java | 3 +- .../gtPlusPlus/core/interfaces/IItemBlueprint.java | 74 +- .../core/inventories/BaseInventoryBackpack.java | 255 +-- .../core/inventories/InventoryWorkbenchChest.java | 231 +-- .../inventories/InventoryWorkbenchCrafting.java | 260 +-- .../InventoryWorkbenchHoloCrafting.java | 180 +- .../inventories/InventoryWorkbenchHoloSlots.java | 344 ++-- .../core/inventories/InventoryWorkbenchTools.java | 232 +-- .../InventoryWorkbenchToolsElectric.java | 234 +-- src/Java/gtPlusPlus/core/item/ModItems.java | 744 ++++----- src/Java/gtPlusPlus/core/item/base/BaseEuItem.java | 920 +++++------ .../core/item/base/BaseItemBackpack.java | 106 +- .../gtPlusPlus/core/item/base/BaseItemBrain.java | 108 +- .../core/item/base/BaseItemComponent.java | 194 +-- .../gtPlusPlus/core/item/base/BaseItemGeneric.java | 29 +- .../gtPlusPlus/core/item/base/BaseItemLoot.java | 135 +- .../core/item/base/BaseItemWithCharge.java | 67 +- .../core/item/base/BaseItemWithDamageValue.java | 27 +- .../gtPlusPlus/core/item/base/BasicSpawnEgg.java | 435 ++--- src/Java/gtPlusPlus/core/item/base/CoreItem.java | 132 +- .../core/item/base/bolts/BaseItemBolt.java | 4 +- .../core/item/base/cell/BaseItemCell.java | 43 +- .../core/item/base/dusts/BaseItemDust.java | 326 ++-- .../core/item/base/dusts/BaseItemDustAbstract.java | 40 +- .../core/item/base/dusts/BaseItemDustUnique.java | 126 +- .../item/base/dusts/decimal/BaseItemCentidust.java | 54 +- .../item/base/dusts/decimal/BaseItemDecidust.java | 54 +- .../core/item/base/foods/BaseItemFood.java | 33 +- .../core/item/base/foods/BaseItemHotFood.java | 87 +- .../core/item/base/gears/BaseItemGear.java | 6 +- .../core/item/base/ingots/BaseItemIngot.java | 127 +- .../core/item/base/ingots/BaseItemIngotHot.java | 66 +- .../core/item/base/itemblock/ItemBlockBase.java | 21 +- .../core/item/base/itemblock/ItemBlockFluid.java | 84 +- .../core/item/base/itemblock/ItemBlockGtBlock.java | 59 +- .../item/base/itemblock/ItemBlockGtFrameBox.java | 19 +- .../item/base/itemblock/ItemBlockTileEntity.java | 46 +- .../core/item/base/nugget/BaseItemNugget.java | 6 +- .../core/item/base/plates/BaseItemPlate.java | 15 +- .../core/item/base/plates/BaseItemPlateDouble.java | 10 +- .../core/item/base/rings/BaseItemRing.java | 4 +- .../core/item/base/rods/BaseItemRod.java | 25 +- .../core/item/base/rods/BaseItemRodLong.java | 45 +- .../core/item/base/rotors/BaseItemRotor.java | 4 +- .../core/item/base/screws/BaseItemScrew.java | 25 +- .../gtPlusPlus/core/item/effects/RarityEffect.java | 22 +- .../gtPlusPlus/core/item/effects/RarityEpic.java | 18 +- .../gtPlusPlus/core/item/effects/RarityRare.java | 18 +- .../core/item/effects/RarityUncommon.java | 14 +- .../core/item/general/BedLocator_Base.java | 107 +- .../gtPlusPlus/core/item/general/BufferCore.java | 100 +- .../core/item/general/ItemBlueprint.java | 384 +++-- .../core/item/general/ItemCloakingDevice.java | 308 ++-- .../core/item/general/ItemHealingDevice.java | 276 ++-- .../core/item/general/NuclearFuelRodBase.java | 331 ++-- .../core/item/general/RF2EU_Battery.java | 378 ++--- .../core/item/general/fuelrods/FuelRod_Base.java | 300 ++-- .../item/general/fuelrods/FuelRod_Thorium.java | 4 +- src/Java/gtPlusPlus/core/item/init/ItemsFoods.java | 66 +- .../core/item/materials/MaterialHandler.java | 4 +- .../core/item/tool/misc/SandstoneHammer.java | 73 +- .../core/item/tool/staballoy/MultiPickaxeBase.java | 260 ++- .../core/item/tool/staballoy/MultiSpadeBase.java | 134 +- .../core/item/tool/staballoy/StaballoyAxe.java | 519 +++--- .../core/item/tool/staballoy/StaballoyPickaxe.java | 526 +++--- .../core/item/tool/staballoy/StaballoySpade.java | 483 +++--- src/Java/gtPlusPlus/core/lib/CORE.java | 187 ++- src/Java/gtPlusPlus/core/lib/LoadedMods.java | 264 ++- src/Java/gtPlusPlus/core/material/ALLOY.java | 1268 +++++--------- src/Java/gtPlusPlus/core/material/ELEMENT.java | 171 +- src/Java/gtPlusPlus/core/material/Material.java | 606 +++---- .../core/material/MaterialGenerator.java | 88 +- .../gtPlusPlus/core/material/MaterialStack.java | 101 +- src/Java/gtPlusPlus/core/proxy/ClientProxy.java | 108 +- src/Java/gtPlusPlus/core/proxy/ServerProxy.java | 18 +- .../core/recipe/Gregtech_Recipe_Adder.java | 144 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 612 ++++--- .../gtPlusPlus/core/recipe/RECIPES_General.java | 60 +- .../core/recipe/RECIPES_LaserEngraver.java | 39 +- .../gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java | 217 +-- .../core/recipe/RECIPES_MachineComponents.java | 627 ++++--- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 1259 +++++++------- .../gtPlusPlus/core/recipe/RECIPES_Shapeless.java | 61 +- src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java | 317 ++-- .../gtPlusPlus/core/recipe/RECIPE_Batteries.java | 69 +- .../gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java | 218 +-- .../gtPlusPlus/core/recipe/ShapedRecipeObject.java | 39 +- src/Java/gtPlusPlus/core/slots/SlotBlueprint.java | 22 +- src/Java/gtPlusPlus/core/slots/SlotCrafting.java | 290 ++-- src/Java/gtPlusPlus/core/slots/SlotFrame.java | 14 +- src/Java/gtPlusPlus/core/slots/SlotGeneric.java | 12 +- src/Java/gtPlusPlus/core/slots/SlotGtTool.java | 22 +- .../gtPlusPlus/core/slots/SlotGtToolElectric.java | 74 +- .../gtPlusPlus/core/slots/SlotItemBackpackInv.java | 9 +- src/Java/gtPlusPlus/core/slots/SlotNoInput.java | 12 +- src/Java/gtPlusPlus/core/slots/SlotOutput.java | 94 +- src/Java/gtPlusPlus/core/slots/SlotRTG.java | 12 +- .../core/tileentities/ModTileEntities.java | 22 +- .../core/tileentities/base/TILE_ENTITY_BASE.java | 33 +- .../tileentities/general/TileEntityReverter.java | 469 +++--- .../tileentities/machines/TileEntityCharger.java | 215 +-- .../core/tileentities/machines/TileEntityNHG.java | 715 ++++---- .../tileentities/machines/TileEntityWorkbench.java | 201 +-- .../machines/TileEntityWorkbenchAdvanced.java | 300 ++-- src/Java/gtPlusPlus/core/util/BaseHandler.java | 8 +- src/Java/gtPlusPlus/core/util/ClassUtils.java | 83 +- src/Java/gtPlusPlus/core/util/Log.java | 41 +- src/Java/gtPlusPlus/core/util/LoggingUtils.java | 60 +- src/Java/gtPlusPlus/core/util/Quality.java | 87 +- src/Java/gtPlusPlus/core/util/Utils.java | 741 ++++----- .../gtPlusPlus/core/util/UtilsChatFormatting.java | 271 +-- src/Java/gtPlusPlus/core/util/UtilsRarity.java | 29 +- src/Java/gtPlusPlus/core/util/UtilsText.java | 24 +- .../gtPlusPlus/core/util/array/ArrayUtils.java | 16 +- src/Java/gtPlusPlus/core/util/array/Pair.java | 28 +- src/Java/gtPlusPlus/core/util/array/Triplet.java | 38 +- .../core/util/debug/DEBUG_BLOCK_ShapeSpawner.java | 145 +- .../gtPlusPlus/core/util/debug/DEBUG_INIT.java | 29 +- .../core/util/debug/DEBUG_ITEM_ShapeSpawner.java | 51 +- .../util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java | 1722 +++++++++----------- .../core/util/debug/DEBUG_ScreenOverlay.java | 60 +- .../core/util/debug/DEBUG_TimerThread.java | 71 +- .../core/util/debug/UtilityGL11Debug.java | 853 ++++------ .../gtPlusPlus/core/util/entity/EntityUtils.java | 92 +- src/Java/gtPlusPlus/core/util/fluid/FluidGT6.java | 42 +- .../gtPlusPlus/core/util/fluid/FluidUtils.java | 539 +++--- .../gregtech/recipehandlers/GregtechRecipe.java | 74 +- src/Java/gtPlusPlus/core/util/item/ItemUtils.java | 681 ++++---- .../core/util/materials/MaterialUtils.java | 343 ++-- src/Java/gtPlusPlus/core/util/math/MathUtils.java | 376 ++--- .../core/util/networking/NetworkUtils.java | 50 +- .../util/particles/EntityParticleFXMysterious.java | 19 +- .../gtPlusPlus/core/util/player/PlayerCache.java | 282 ++-- .../gtPlusPlus/core/util/player/PlayerUtils.java | 179 +- .../gtPlusPlus/core/util/player/UtilsMining.java | 204 ++- .../gtPlusPlus/core/util/recipe/RecipeUtils.java | 648 +++----- .../core/util/recipe/shapeless/ShapelessUtils.java | 46 +- .../core/util/reflect/ClientProxyFinder.java | 43 +- .../core/util/reflect/ReflectionUtils.java | 81 +- src/Java/gtPlusPlus/core/util/wrapper/var.java | 116 +- 209 files changed, 17350 insertions(+), 18262 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java index 69ecb9ed5b..3b6f061ca7 100644 --- a/src/Java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java @@ -1,60 +1,60 @@ package gtPlusPlus.core.block; -import cpw.mods.fml.common.registry.GameRegistry; import gtPlusPlus.core.block.general.LightGlass; import gtPlusPlus.core.block.machine.Machine_Workbench; import gtPlusPlus.core.block.machine.Machine_WorkbenchAdvanced; import gtPlusPlus.core.fluids.FluidRegistryHandler; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks2; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraftforge.fluids.Fluid; +import cpw.mods.fml.common.registry.GameRegistry; public final class ModBlocks { - public static Block blockWorkbench; - public static Block blockWorkbenchAdvanced; - // Blocks - // public static Block blockBloodSteel; - // public static Block blockStaballoy; + public static Block blockWorkbench; + public static Block blockWorkbenchAdvanced; + //Blocks + //public static Block blockBloodSteel; + //public static Block blockStaballoy; // WIP TODO public static Block blockToolBuilder; - public static Block blockGriefSaver; - public static Block blockCasingsMisc; - public static Block blockMetaTileEntity; - public static Block blockHeliumGenerator; - public static Block blockNHG; - public static Block blockCharger; + public static Block blockGriefSaver; + public static Block blockCasingsMisc; + public static Block blockMetaTileEntity; + public static Block blockHeliumGenerator; + public static Block blockNHG; + public static Block blockCharger; + + public static Block MatterFabricatorEffectBlock; + + public static Fluid fluidJackDaniels = new Fluid("fluidJackDaniels"); + public static Block blockFluidJackDaniels; + public static Block blockCasings2Misc; - public static Block MatterFabricatorEffectBlock; - public static Fluid fluidJackDaniels = new Fluid("fluidJackDaniels"); - public static Block blockFluidJackDaniels; - public static Block blockCasings2Misc; public static void init() { Utils.LOG_INFO("Initializing Blocks."); - // blockGriefSaver = new - // TowerDevice().setBlockName("blockGriefSaver").setCreativeTab(AddToCreativeTab.tabBlock).setBlockTextureName("blockDefault"); + //blockGriefSaver = new TowerDevice().setBlockName("blockGriefSaver").setCreativeTab(AddToCreativeTab.tabBlock).setBlockTextureName("blockDefault"); - ModBlocks.registerBlocks(); + registerBlocks(); } - public static void registerBlocks() { + public static void registerBlocks(){ Utils.LOG_INFO("Registering Blocks."); - GameRegistry.registerBlock( - ModBlocks.MatterFabricatorEffectBlock = new LightGlass(Material.glass, false).setHardness(0.1F) - .setBlockTextureName(CORE.MODID + ":" + "blockMFEffect").setStepSound(Block.soundTypeGlass), - "blockMFEffect"); + GameRegistry.registerBlock(MatterFabricatorEffectBlock = new LightGlass(Material.glass, false).setHardness(0.1F).setBlockTextureName(CORE.MODID + ":" + "blockMFEffect").setStepSound(Block.soundTypeGlass), "blockMFEffect"); - // Fluids + //Fluids FluidRegistryHandler.registerFluids(); - // Workbench - ModBlocks.blockWorkbench = new Machine_Workbench().setHardness(1.5F); - ModBlocks.blockWorkbenchAdvanced = new Machine_WorkbenchAdvanced().setHardness(2.5F); + //Workbench + blockWorkbench = new Machine_Workbench().setHardness(1.5F); + blockWorkbenchAdvanced = new Machine_WorkbenchAdvanced().setHardness(2.5F); + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java b/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java index 0160da883f..b7ac24a71b 100644 --- a/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java +++ b/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java @@ -9,25 +9,23 @@ import net.minecraft.world.World; public class AdvancedBlock extends Block { - protected AdvancedBlock(final String unlocalizedName, final Material material, final CreativeTabs x, - final float blockHardness, final float blockResistance, final float blockLightLevel, - final String blockHarvestTool, final int blockHarvestLevel, final SoundType BlockSound) { - super(material); - this.setBlockName(unlocalizedName); - this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName); - this.setCreativeTab(x); - this.setHardness(blockHardness); // block Hardness - this.setResistance(blockResistance); - this.setLightLevel(blockLightLevel); - this.setHarvestLevel(blockHarvestTool, blockHarvestLevel); - this.setStepSound(BlockSound); - } - - @Override - public boolean onBlockActivated(final World p_149727_1_, final int p_149727_2_, final int p_149727_3_, - final int p_149727_4_, final EntityPlayer p_149727_5_, final int p_149727_6_, final float p_149727_7_, - final float p_149727_8_, final float p_149727_9_) { - return false; - } + protected AdvancedBlock(String unlocalizedName, Material material, CreativeTabs x, float blockHardness, float blockResistance, float blockLightLevel, + String blockHarvestTool, int blockHarvestLevel, SoundType BlockSound) { + super(material); + this.setBlockName(unlocalizedName); + this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName); + this.setCreativeTab(x); + this.setHardness(blockHardness); //block Hardness + this.setResistance(blockResistance); + this.setLightLevel(blockLightLevel); + this.setHarvestLevel(blockHarvestTool, blockHarvestLevel); + this.setStepSound(BlockSound); + } + + @Override + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) + { + return false; + } } diff --git a/src/Java/gtPlusPlus/core/block/base/BasicBlock.java b/src/Java/gtPlusPlus/core/block/base/BasicBlock.java index 64ee68224e..c95f37d9c5 100644 --- a/src/Java/gtPlusPlus/core/block/base/BasicBlock.java +++ b/src/Java/gtPlusPlus/core/block/base/BasicBlock.java @@ -8,43 +8,45 @@ import net.minecraft.block.material.Material; public class BasicBlock extends Block { - public static enum BlockTypes { - STANDARD("blockBlock", "pickaxe", Block.soundTypeStone), FRAME("blockFrameGt", "wrench", Block.soundTypeMetal); - - private String TEXTURE_NAME; - private String HARVEST_TOOL; - private SoundType soundOfBlock; - - private BlockTypes(final String textureName, final String harvestTool, final SoundType blockSound) { - this.TEXTURE_NAME = textureName; - this.HARVEST_TOOL = harvestTool; - this.soundOfBlock = blockSound; - } - - public SoundType getBlockSoundType() { - return this.soundOfBlock; - } - - public String getHarvestTool() { - return this.HARVEST_TOOL; - } - - public String getTexture() { - return this.TEXTURE_NAME; - } - - } - - public BasicBlock(final String unlocalizedName, final Material material) { - super(material); - this.setBlockName(Utils.sanitizeString(unlocalizedName)); - this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName); - this.setCreativeTab(AddToCreativeTab.tabBlock); - this.setHardness(2.0F); - this.setResistance(6.0F); - this.setLightLevel(0.0F); - this.setHarvestLevel("pickaxe", 2); - this.setStepSound(Block.soundTypeMetal); - } - + public BasicBlock(final String unlocalizedName, final Material material) { + super(material); + this.setBlockName(Utils.sanitizeString(unlocalizedName)); + this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName); + this.setCreativeTab(AddToCreativeTab.tabBlock); + this.setHardness(2.0F); + this.setResistance(6.0F); + this.setLightLevel(0.0F); + this.setHarvestLevel("pickaxe", 2); + this.setStepSound(soundTypeMetal); + } + + + public static enum BlockTypes { + STANDARD("blockBlock", "pickaxe", soundTypeStone), + FRAME("blockFrameGt", "wrench", soundTypeMetal); + + private String TEXTURE_NAME; + private String HARVEST_TOOL; + private SoundType soundOfBlock; + private BlockTypes (final String textureName, final String harvestTool, final SoundType blockSound) + { + this.TEXTURE_NAME = textureName; + this.HARVEST_TOOL = harvestTool; + this.soundOfBlock = blockSound; + } + + public String getTexture() { + return TEXTURE_NAME; + } + + public String getHarvestTool(){ + return HARVEST_TOOL; + } + + public SoundType getBlockSoundType(){ + return soundOfBlock; + } + + } + } diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java index f389f5bf32..a2d2589f5e 100644 --- a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java +++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java @@ -1,9 +1,5 @@ package gtPlusPlus.core.block.base; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.LanguageRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.item.base.itemblock.ItemBlockGtBlock; import gtPlusPlus.core.item.base.itemblock.ItemBlockGtFrameBox; import gtPlusPlus.core.lib.CORE; @@ -12,142 +8,142 @@ import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.world.IBlockAccess; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class BlockBaseModular extends BasicBlock { +public class BlockBaseModular extends BasicBlock{ - protected int blockColour; - protected BlockTypes thisBlock; - protected String thisBlockMaterial; - protected final String thisBlockType; + protected int blockColour; + protected BlockTypes thisBlock; + protected String thisBlockMaterial; + protected final String thisBlockType; - public BlockBaseModular(final String unlocalizedName, final String blockMaterial, final BlockTypes blockType, - final int colour) { - super(blockType.getTexture() + unlocalizedName, Material.iron); + public BlockBaseModular(String unlocalizedName, String blockMaterial, BlockTypes blockType, int colour) { + super(blockType.getTexture()+unlocalizedName, Material.iron); this.setHarvestLevel(blockType.getHarvestTool(), 2); - this.setBlockTextureName(CORE.MODID + ":" + blockType.getTexture()); + this.setBlockTextureName(CORE.MODID+":"+blockType.getTexture()); this.blockColour = colour; this.thisBlock = blockType; this.thisBlockMaterial = blockMaterial; this.thisBlockType = blockType.name().toUpperCase(); - this.setBlockName(this.GetProperName()); - - if (!CORE.DEBUG) { - // Utils.LOG_INFO("=============Block Info Dump============="); - // Utils.LOG_INFO("thisBlock.name().toLowerCase() - - // "+thisBlock.name().toLowerCase()); - // Utils.LOG_INFO("This Blocks Type - "+thisBlockType); - // Utils.LOG_INFO("BlockTypes.STANDARD.name().toLowerCase() - - // "+BlockTypes.STANDARD.name().toLowerCase()); - // Utils.LOG_INFO("BlockTypes.FRAME.name().toLowerCase() - - // "+BlockTypes.FRAME.name().toLowerCase()); - // Utils.LOG_INFO("blockMaterial - "+blockMaterial); - // Utils.LOG_INFO("=========================================="); + this.setBlockName(GetProperName()); + + if (!CORE.DEBUG){ + //Utils.LOG_INFO("=============Block Info Dump============="); + //Utils.LOG_INFO("thisBlock.name().toLowerCase() - "+thisBlock.name().toLowerCase()); + //Utils.LOG_INFO("This Blocks Type - "+thisBlockType); + //Utils.LOG_INFO("BlockTypes.STANDARD.name().toLowerCase() - "+BlockTypes.STANDARD.name().toLowerCase()); + //Utils.LOG_INFO("BlockTypes.FRAME.name().toLowerCase() - "+BlockTypes.FRAME.name().toLowerCase()); + //Utils.LOG_INFO("blockMaterial - "+blockMaterial); + //Utils.LOG_INFO("=========================================="); } - - if (this.thisBlockType == BlockTypes.STANDARD.name().toUpperCase()) { - LanguageRegistry.addName(this, "Block of " + blockMaterial); - // Utils.LOG_INFO("Registered Block in Language Registry as: - // "+"Block of "+blockMaterial); + + if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){ + LanguageRegistry.addName(this, "Block of "+blockMaterial); + //Utils.LOG_INFO("Registered Block in Language Registry as: "+"Block of "+blockMaterial); } - else if (this.thisBlockType == BlockTypes.FRAME.name().toUpperCase()) { - LanguageRegistry.addName(this, blockMaterial + " Frame Box"); - // Utils.LOG_INFO("Registered Block in Language Registry as: - // "+blockMaterial+ " Frame Box"); + else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){ + LanguageRegistry.addName(this, blockMaterial+ " Frame Box"); + //Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial+ " Frame Box"); } else { LanguageRegistry.addName(this, blockMaterial); - // Utils.LOG_INFO("Registered Block in Language Registry as: - // "+blockMaterial); - } - - // setOreDict(unlocalizedName, blockType); - if (this.thisBlockType == BlockTypes.STANDARD.name().toUpperCase()) { - GameRegistry.registerBlock(this, ItemBlockGtBlock.class, - Utils.sanitizeString(blockType.getTexture() + unlocalizedName)); - // Utils.LOG_INFO("Registered Block in Block Registry as: "+"Block - // of "+blockMaterial); + //Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial); + } + + //setOreDict(unlocalizedName, blockType); + if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){ + GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName)); + //Utils.LOG_INFO("Registered Block in Block Registry as: "+"Block of "+blockMaterial); } - else if (this.thisBlockType == BlockTypes.FRAME.name().toUpperCase()) { - GameRegistry.registerBlock(this, ItemBlockGtFrameBox.class, - Utils.sanitizeString(blockType.getTexture() + unlocalizedName)); - // Utils.LOG_INFO("Registered Block in Block Registry as: - // "+blockMaterial+" Frame Box"); + else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){ + GameRegistry.registerBlock(this, ItemBlockGtFrameBox.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName)); + //Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial+" Frame Box"); } else { - GameRegistry.registerBlock(this, ItemBlockGtBlock.class, - Utils.sanitizeString(blockType.getTexture() + unlocalizedName)); - // Utils.LOG_INFO("Registered Block in Block Registry as: - // "+blockMaterial); + GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName)); + //Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial); } - + + } + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ @Override - public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) { - - if (this.blockColour == 0) { - return MathUtils.generateSingularRandomHexValue(); + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + if (thisBlock == BlockTypes.FRAME){ + return 1; } - - return this.blockColour; + return 0; } + + /*@Override + public String getLocalizedName() { + String tempIngot; + if (thisBlock == BlockTypes.STANDARD){ + tempIngot = "Block of "+thisBlockMaterial; + } + else if (thisBlock == BlockTypes.FRAME){ + tempIngot = thisBlockMaterial + " Frame Box"; + } + else { - /* - * @Override public String getLocalizedName() { String tempIngot; if - * (thisBlock == BlockTypes.STANDARD){ tempIngot = "Block of " - * +thisBlockMaterial; } else if (thisBlock == BlockTypes.FRAME){ tempIngot - * = thisBlockMaterial + " Frame Box"; } else { - * - * tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot"); } - * return tempIngot; } - */ - + tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot"); + } + return tempIngot; + }*/ + public String GetProperName() { - String tempIngot; - if (this.thisBlock == BlockTypes.STANDARD) { - tempIngot = "Block of " + this.thisBlockMaterial; + String tempIngot; + if (thisBlock == BlockTypes.STANDARD){ + tempIngot = "Block of "+thisBlockMaterial; } - else if (this.thisBlock == BlockTypes.FRAME) { - tempIngot = this.thisBlockMaterial + " Frame Box"; + else if (thisBlock == BlockTypes.FRAME){ + tempIngot = thisBlockMaterial + " Frame Box"; } else { - tempIngot = this.getUnlocalizedName().replace("tile.blockGt", "ingot"); + tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot"); } return tempIngot; } - /** - * Returns which pass should this block be rendered on. 0 for solids and 1 - * for alpha - */ + @Override + public boolean isOpaqueCube() + { + return false; + } + @Override @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - if (this.thisBlock == BlockTypes.FRAME) { - return 1; - } - return 0; + public void registerBlockIcons(IIconRegister iIcon) + { + this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + thisBlock.getTexture()); } @Override - public int getRenderColor(final int aMeta) { - if (this.blockColour == 0) { + public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4){ + + if (this.blockColour == 0){ return MathUtils.generateSingularRandomHexValue(); } - + return this.blockColour; } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister iIcon) { - this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture()); - } + + @Override + public int getRenderColor(int aMeta) { + if (this.blockColour == 0){ + return MathUtils.generateSingularRandomHexValue(); + } + + return this.blockColour; + } } diff --git a/src/Java/gtPlusPlus/core/block/base/MetaBlock.java b/src/Java/gtPlusPlus/core/block/base/MetaBlock.java index 3763b71448..4009c36726 100644 --- a/src/Java/gtPlusPlus/core/block/base/MetaBlock.java +++ b/src/Java/gtPlusPlus/core/block/base/MetaBlock.java @@ -7,22 +7,22 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -public class MetaBlock extends MultiTextureBlock { +public class MetaBlock extends MultiTextureBlock { - protected MetaBlock(final String unlocalizedName, final Material material, final SoundType soundType) { - super(unlocalizedName, material, soundType); - } - - @Override - public int damageDropped(final int meta) { - return meta; - } - - @Override - public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) { - for (int i = 0; i < 6; i++) { - list.add(new ItemStack(item, 1, i)); - } - } - -} \ No newline at end of file + protected MetaBlock(String unlocalizedName, Material material, SoundType soundType) { + super(unlocalizedName, material, soundType); + } + + @Override + public int damageDropped(int meta) { + return meta; + } + + @Override + public void getSubBlocks(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < 6; i ++) { + list.add(new ItemStack(item, 1, i)); + } + } + +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java b/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java index 9953dfa991..4f022bae6d 100644 --- a/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java +++ b/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java @@ -7,29 +7,30 @@ import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; -public class MultiTextureBlock extends Block { +public class MultiTextureBlock extends Block { public IIcon[] icons = new IIcon[6]; - - protected MultiTextureBlock(final String unlocalizedName, final Material material, final SoundType blockSound) { - super(material); - this.setBlockName(unlocalizedName); - this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName); - this.setCreativeTab(AddToCreativeTab.tabBlock); - this.setHardness(2.0F); - this.setResistance(6.0F); - this.setStepSound(blockSound); - } - - @Override - public IIcon getIcon(final int side, final int meta) { - return this.icons[side]; - } - - @Override - public void registerBlockIcons(final IIconRegister reg) { - for (int i = 0; i < 6; i++) { - this.icons[i] = reg.registerIcon(this.textureName + "_" + i); - } - } + + protected MultiTextureBlock(String unlocalizedName, Material material, SoundType blockSound) + { + super(material); + this.setBlockName(unlocalizedName); + this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName); + this.setCreativeTab(AddToCreativeTab.tabBlock); + this.setHardness(2.0F); + this.setResistance(6.0F); + this.setStepSound(blockSound); + } + + @Override + public void registerBlockIcons(IIconRegister reg) { + for (int i = 0; i < 6; i ++) { + this.icons[i] = reg.registerIcon(this.textureName + "_" + i); + } + } + + @Override + public IIcon getIcon(int side, int meta) { + return this.icons[side]; + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/general/LightGlass.java b/src/Java/gtPlusPlus/core/block/general/LightGlass.java index 9b4d8bf1b8..5aa9f5b818 100644 --- a/src/Java/gtPlusPlus/core/block/general/LightGlass.java +++ b/src/Java/gtPlusPlus/core/block/general/LightGlass.java @@ -1,27 +1,30 @@ package gtPlusPlus.core.block.general; -import java.util.Random; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; + +import java.util.Random; + import net.minecraft.block.BlockBreakable; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class LightGlass extends BlockBreakable { - private int state = 0; - private final int a = 255; - private int r = 255; - private int g = 0; - private int b = 0; - private int hex; +public class LightGlass extends BlockBreakable +{ + private int state = 0; + private int a = 255; + private int r = 255; + private int g = 0; + private int b = 0; + private int hex; - public LightGlass(final Material mat, final boolean bool) { + public LightGlass(Material mat, boolean bool) + { super("blockMFEffect", mat, bool); this.setCreativeTab(AddToCreativeTab.tabBlock); this.setBlockName("blockMFEffect"); @@ -32,99 +35,94 @@ public class LightGlass extends BlockBreakable { } /** - * Return true if a player with Silk Touch can harvest this block directly, - * and not its normal drops. + * Returns the quantity of items to drop on block destruction. */ @Override - protected boolean canSilkHarvest() { - return false; - } - - @Override - // http://stackoverflow.com/questions/31784658/how-can-i-loop-through-all-rgb-combinations-in-rainbow-order-in-java - public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) { - if (this.state == 0) { - this.g++; - if (this.g == 255) { - this.state = 1; - } - } - if (this.state == 1) { - this.r--; - if (this.r == 0) { - this.state = 2; - } - } - if (this.state == 2) { - this.b++; - if (this.b == 255) { - this.state = 3; - } - } - if (this.state == 3) { - this.g--; - if (this.g == 0) { - this.state = 4; - } - } - if (this.state == 4) { - this.r++; - if (this.r == 255) { - this.state = 5; - } - } - if (this.state == 5) { - this.b--; - if (this.b == 0) { - this.state = 0; - } - } - this.hex = (this.a << 24) + (this.r << 16) + (this.g << 8) + this.b; - return this.hex; + public int quantityDropped(Random rand) + { + return 0; } /** - * Returns which pass should this block be rendered on. 0 for solids and 1 - * for alpha + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha */ @Override @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { + public int getRenderBlockPass() + { return 0; } /** - * Returns the quantity of items to drop on block destruction. + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ @Override - public int quantityDropped(final Random rand) { - return 0; + public boolean renderAsNormalBlock() + { + return true; } /** - * A randomly called display update to be able to add particles or other - * items for display + * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. */ @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(final World world, final int posX, final int posY, final int posZ, - final Random random) { - Utils.spawnFX(world, posX, posY, posZ, "smoke", "cloud"); - + protected boolean canSilkHarvest() + { + return false; } @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister iIcon) { + public void registerBlockIcons(IIconRegister iIcon) + { this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockMFEffect"); } + @Override + //http://stackoverflow.com/questions/31784658/how-can-i-loop-through-all-rgb-combinations-in-rainbow-order-in-java + public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + if(state == 0){ + g++; + if(g == 255) + state = 1; + } + if(state == 1){ + r--; + if(r == 0) + state = 2; + } + if(state == 2){ + b++; + if(b == 255) + state = 3; + } + if(state == 3){ + g--; + if(g == 0) + state = 4; + } + if(state == 4){ + r++; + if(r == 255) + state = 5; + } + if(state == 5){ + b--; + if(b == 0) + state = 0; + } + hex = (a << 24) + (r << 16) + (g << 8) + (b); + return hex; + } + /** - * If this block doesn't render as an ordinary block it will return False - * (examples: signs, buttons, stairs, etc) + * A randomly called display update to be able to add particles or other items for display */ @Override - public boolean renderAsNormalBlock() { - return true; + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World world, int posX, int posY, int posZ, Random random){ + Utils.spawnFX(world, posX, posY, posZ, "smoke", "cloud"); + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java index 2f659b7806..7fa890b6c8 100644 --- a/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java +++ b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java @@ -1,15 +1,14 @@ package gtPlusPlus.core.block.general.antigrief; -import java.util.List; -import java.util.Random; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.block.ModBlocks; +import static gtPlusPlus.core.block.ModBlocks.blockGriefSaver; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.general.TileEntityReverter; import gtPlusPlus.core.util.Utils; + +import java.util.List; +import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -24,241 +23,254 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class TowerDevice extends Block { - private static IIcon TEX_ANTIBUILDER; - public static final int META_ANTIBUILDER = 9; - public static boolean areNearbyLockBlocks(final World world, final int x, final int y, final int z) { - boolean locked = false; - for (int dx = x - 2; dx <= x + 2; dx++) { - for (int dy = y - 2; dy <= y + 2; dy++) { - for (int dz = z - 2; dz <= z + 2; dz++) { - if (world.getBlock(dx, dy, dz) == ModBlocks.blockGriefSaver - && world.getBlockMetadata(dx, dy, dz) == 4) { - locked = true; - } - } - } - } - return locked; - } - - public static void changeToActiveVanishBlock(final World par1World, final int x, final int y, final int z, - final int meta) { - TowerDevice.changeToBlockMeta(par1World, x, y, z, meta); - par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.pop", 0.3F, 0.6F); - - final Block thereBlockID = par1World.getBlock(x, y, z); - par1World.scheduleBlockUpdate(x, y, z, thereBlockID, - TowerDevice.getTickRateFor(thereBlockID, meta, par1World.rand)); - } - - private static void changeToBlockMeta(final World par1World, final int x, final int y, final int z, - final int meta) { - final Block thereBlockID = par1World.getBlock(x, y, z); - if (thereBlockID == ModBlocks.blockGriefSaver) { - par1World.setBlock(x, y, z, thereBlockID, meta, 3); - par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); - par1World.notifyBlocksOfNeighborChange(x, y, z, thereBlockID); - } - } - - public static void checkAndActivateVanishBlock(final World world, final int x, final int y, final int z) { - final Block thereID = world.getBlock(x, y, z); - final int thereMeta = world.getBlockMetadata(x, y, z); - } - - private static int getTickRateFor(final Block thereBlockID, final int meta, final Random rand) { - return 15; - } - - public static void unlockBlock(final World par1World, final int x, final int y, final int z) { - final Block thereBlockID = par1World.getBlock(x, y, z); - final int thereBlockMeta = par1World.getBlockMetadata(x, y, z); - if (thereBlockID == ModBlocks.blockGriefSaver || thereBlockMeta == 4) { - TowerDevice.changeToBlockMeta(par1World, x, y, z, 5); - par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.click", 0.3F, 0.6F); - } - } - - private boolean bUnbreakable; - - public TowerDevice() { - super(Material.wood); - this.setHardness(10.0F); - this.setResistance(35.0F); - this.setStepSound(Block.soundTypeWood); - this.setCreativeTab(AddToCreativeTab.tabMachines); - } - - @Override - public TileEntity createTileEntity(final World world, final int metadata) { - if (metadata == 0) { - Utils.LOG_INFO("I have been created. [Antigriefer]" + this.getLocalizedName()); - return new TileEntityReverter(); - } - return null; - } - - @Override - public int damageDropped(final int meta) { - return meta; - } - - @Override - public float getBlockHardness(final World world, final int x, final int y, final int z) { - final int meta = world.getBlockMetadata(x, y, z); - return super.getBlockHardness(world, x, y, z); - } - - @Override - public float getExplosionResistance(final Entity par1Entity, final World world, final int x, final int y, - final int z, final double explosionX, final double explosionY, final double explosionZ) { - final int meta = world.getBlockMetadata(x, y, z); - return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ); - } - - @Override - public IIcon getIcon(final int side, final int meta) { - return TowerDevice.TEX_ANTIBUILDER; - } - - @Override - public Item getItemDropped(final int meta, final Random par2Random, final int par3) { - switch (meta) { - case 0: - return null; - } - return Item.getItemFromBlock(this); - } - - @Override - public int getLightValue(final IBlockAccess world, final int x, final int y, final int z) { - final Block blockID = world.getBlock(x, y, z); - final int meta = world.getBlockMetadata(x, y, z); - if (blockID != this) { - return 0; - } - return 10; - } - - @Override - public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) { - par3List.add(new ItemStack(par1, 1, 9)); - } - - @Override - public boolean hasTileEntity(final int metadata) { - return metadata == 0; - } - - private boolean isInactiveTrapCharged(final World par1World, final int x, final int y, final int z) { - return false; - } - - private boolean isReactorReady(final World world, final int x, final int y, final int z) { - if (world.getBlock(x, y + 1, z) != Blocks.redstone_block || world.getBlock(x, y - 1, z) != Blocks.redstone_block - || world.getBlock(x + 1, y, z) != Blocks.redstone_block - || world.getBlock(x - 1, y, z) != Blocks.redstone_block - || world.getBlock(x, y, z + 1) != Blocks.redstone_block - || world.getBlock(x, y, z - 1) != Blocks.redstone_block) { - return false; - } - return true; - } - - private void letsBuild(final World par1World, final int x, final int y, final int z) { - - } - - public void loadNBTData(final NBTTagCompound aNBT) { - this.bUnbreakable = aNBT.getBoolean("bUnbreakable"); - } - - @Override - public boolean onBlockActivated(final World par1World, final int x, final int y, final int z, - final EntityPlayer par5EntityPlayer, final int par6, final float par7, final float par8, final float par9) { - final int meta = par1World.getBlockMetadata(x, y, z); - return false; - } - - @Override - public void onBlockAdded(final World par1World, final int x, final int y, final int z) { - final int meta = par1World.getBlockMetadata(x, y, z); - if (!par1World.isRemote) { - - } - } - - @Override - public void onNeighborBlockChange(final World par1World, final int x, final int y, final int z, - final Block myBlockID) { - final int meta = par1World.getBlockMetadata(x, y, z); - if (!par1World.isRemote) { - - } - } - - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(final World par1World, final int x, final int y, final int z, - final Random par5Random) { - final int meta = par1World.getBlockMetadata(x, y, z); - if (meta == 3 || meta == 1 || meta == 9) { - for (int i = 0; i < 1; i++) { - this.sparkle(par1World, x, y, z, par5Random); - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister par1IconRegister) { - TowerDevice.TEX_ANTIBUILDER = par1IconRegister.registerIcon(CORE.MODID + ":" + "blockAntiGrief"); - } - - public void saveNBTData(final NBTTagCompound aNBT) { - aNBT.setBoolean("bUnbreakable", this.bUnbreakable); - } - - public void sparkle(final World world, final int x, final int y, final int z, final Random rand) { - final double offset = 0.0625D; - for (int side = 0; side < 6; side++) { - double rx = x + rand.nextFloat(); - double ry = y + rand.nextFloat(); - double rz = z + rand.nextFloat(); - if (side == 0 && !world.getBlock(x, y + 1, z).isOpaqueCube()) { - ry = y + 1 + offset; - } - if (side == 1 && !world.getBlock(x, y - 1, z).isOpaqueCube()) { - ry = y + 0 - offset; - } - if (side == 2 && !world.getBlock(x, y, z + 1).isOpaqueCube()) { - rz = z + 1 + offset; - } - if (side == 3 && !world.getBlock(x, y, z - 1).isOpaqueCube()) { - rz = z + 0 - offset; - } - if (side == 4 && !world.getBlock(x + 1, y, z).isOpaqueCube()) { - rx = x + 1 + offset; - } - if (side == 5 && !world.getBlock(x - 1, y, z).isOpaqueCube()) { - rx = x + 0 - offset; - } - if (rx < x || rx > x + 1 || ry < 0.0D || ry > y + 1 || rz < z || rz > z + 1) { - world.spawnParticle("reddust", rx, ry, rz, 0.0D, 0.0D, 0.0D); - } - } - } - - public int tickRate() { - return 15; + private static IIcon TEX_ANTIBUILDER; + public static final int META_ANTIBUILDER = 9; + private boolean bUnbreakable; + + public TowerDevice() + { + super(Material.wood); + setHardness(10.0F); + setResistance(35.0F); + setStepSound(Block.soundTypeWood); + setCreativeTab(AddToCreativeTab.tabMachines); + } + + public int tickRate() + { + return 15; + } + + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setBoolean("bUnbreakable", bUnbreakable); } - @Override - public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random) { - if (!par1World.isRemote) { - final int meta = par1World.getBlockMetadata(x, y, z); - } + public void loadNBTData(NBTTagCompound aNBT) { + bUnbreakable = aNBT.getBoolean("bUnbreakable"); } + + public IIcon getIcon(int side, int meta) + { + return TEX_ANTIBUILDER; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + TEX_ANTIBUILDER = par1IconRegister.registerIcon(CORE.MODID + ":" + "blockAntiGrief"); + } + + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + par3List.add(new ItemStack(par1, 1, 9)); + } + + public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + int meta = par1World.getBlockMetadata(x, y, z); + return false; + } + + public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) + { + int meta = world.getBlockMetadata(x, y, z); + return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ); + } + + public float getBlockHardness(World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + return super.getBlockHardness(world, x, y, z); + } + + public static boolean areNearbyLockBlocks(World world, int x, int y, int z) + { + boolean locked = false; + for (int dx = x - 2; dx <= x + 2; dx++) { + for (int dy = y - 2; dy <= y + 2; dy++) { + for (int dz = z - 2; dz <= z + 2; dz++) { + if ((world.getBlock(dx, dy, dz) == blockGriefSaver) && (world.getBlockMetadata(dx, dy, dz) == 4)) { + locked = true; + } + } + } + } + return locked; + } + + public static void unlockBlock(World par1World, int x, int y, int z) + { + Block thereBlockID = par1World.getBlock(x, y, z); + int thereBlockMeta = par1World.getBlockMetadata(x, y, z); + if ((thereBlockID == blockGriefSaver) || (thereBlockMeta == 4)) + { + changeToBlockMeta(par1World, x, y, z, 5); + par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.click", 0.3F, 0.6F); + } + } + + private static void changeToBlockMeta(World par1World, int x, int y, int z, int meta) + { + Block thereBlockID = par1World.getBlock(x, y, z); + if ((thereBlockID == blockGriefSaver)) + { + par1World.setBlock(x, y, z, thereBlockID, meta, 3); + par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + par1World.notifyBlocksOfNeighborChange(x, y, z, thereBlockID); + } + } + + public void onBlockAdded(World par1World, int x, int y, int z) + { + int meta = par1World.getBlockMetadata(x, y, z); + if (!par1World.isRemote) { + + } + } + + public void onNeighborBlockChange(World par1World, int x, int y, int z, Block myBlockID) + { + int meta = par1World.getBlockMetadata(x, y, z); + if (!par1World.isRemote) + { + + } + } + + public void updateTick(World par1World, int x, int y, int z, Random par5Random) + { + if (!par1World.isRemote) + { + int meta = par1World.getBlockMetadata(x, y, z); + } + } + + private void letsBuild(World par1World, int x, int y, int z) + { + + } + + private boolean isInactiveTrapCharged(World par1World, int x, int y, int z) + { + return false; + } + + private boolean isReactorReady(World world, int x, int y, int z) + { + if ((world.getBlock(x, y + 1, z) != Blocks.redstone_block) || + (world.getBlock(x, y - 1, z) != Blocks.redstone_block) || + (world.getBlock(x + 1, y, z) != Blocks.redstone_block) || + (world.getBlock(x - 1, y, z) != Blocks.redstone_block) || + (world.getBlock(x, y, z + 1) != Blocks.redstone_block) || + (world.getBlock(x, y, z - 1) != Blocks.redstone_block)) { + return false; + } + return true; + } + + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World par1World, int x, int y, int z, Random par5Random) + { + int meta = par1World.getBlockMetadata(x, y, z); + if ((meta == 3) || (meta == 1) || (meta == 9)) { + for (int i = 0; i < 1; i++) { + sparkle(par1World, x, y, z, par5Random); + } + } + } + + public void sparkle(World world, int x, int y, int z, Random rand) + { + double offset = 0.0625D; + for (int side = 0; side < 6; side++) + { + double rx = x + rand.nextFloat(); + double ry = y + rand.nextFloat(); + double rz = z + rand.nextFloat(); + if ((side == 0) && (!world.getBlock(x, y + 1, z).isOpaqueCube())) { + ry = y + 1 + offset; + } + if ((side == 1) && (!world.getBlock(x, y - 1, z).isOpaqueCube())) { + ry = y + 0 - offset; + } + if ((side == 2) && (!world.getBlock(x, y, z + 1).isOpaqueCube())) { + rz = z + 1 + offset; + } + if ((side == 3) && (!world.getBlock(x, y, z - 1).isOpaqueCube())) { + rz = z + 0 - offset; + } + if ((side == 4) && (!world.getBlock(x + 1, y, z).isOpaqueCube())) { + rx = x + 1 + offset; + } + if ((side == 5) && (!world.getBlock(x - 1, y, z).isOpaqueCube())) { + rx = x + 0 - offset; + } + if ((rx < x) || (rx > x + 1) || (ry < 0.0D) || (ry > y + 1) || (rz < z) || (rz > z + 1)) { + world.spawnParticle("reddust", rx, ry, rz, 0.0D, 0.0D, 0.0D); + } + } + } + + public static void checkAndActivateVanishBlock(World world, int x, int y, int z) + { + Block thereID = world.getBlock(x, y, z); + int thereMeta = world.getBlockMetadata(x, y, z); + } + + public static void changeToActiveVanishBlock(World par1World, int x, int y, int z, int meta) + { + changeToBlockMeta(par1World, x, y, z, meta); + par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.pop", 0.3F, 0.6F); + + Block thereBlockID = par1World.getBlock(x, y, z); + par1World.scheduleBlockUpdate(x, y, z, thereBlockID, getTickRateFor(thereBlockID, meta, par1World.rand)); + } + + private static int getTickRateFor(Block thereBlockID, int meta, Random rand) + { + return 15; + } + + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + Block blockID = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + if (blockID != this) { + return 0; + } + return 10; + } + + public boolean hasTileEntity(int metadata) + { + return (metadata == 0); + } + + public TileEntity createTileEntity(World world, int metadata) + { + if (metadata == 0) { + Utils.LOG_INFO("I have been created. [Antigriefer]"+this.getLocalizedName()); + return new TileEntityReverter(); + } + return null; + } + + public Item getItemDropped(int meta, Random par2Random, int par3) + { + switch (meta) + { + case 0: + return null; + } + return Item.getItemFromBlock(this); + } + + public int damageDropped(int meta) + { + return meta; + } } diff --git a/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java b/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java index 768822dd6e..6096da7054 100644 --- a/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java +++ b/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java @@ -1,7 +1,5 @@ package gtPlusPlus.core.block.general.fluids; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import net.minecraft.block.material.Material; @@ -11,45 +9,43 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockFluidJackDaniels extends BlockFluidClassic { - @SideOnly(Side.CLIENT) - protected IIcon stillIcon; - @SideOnly(Side.CLIENT) - protected IIcon flowingIcon; - - public BlockFluidJackDaniels(final Fluid fluid, final Material material) { - super(fluid, material); - this.setCreativeTab(AddToCreativeTab.tabMisc); - } - - @Override - public boolean canDisplace(final IBlockAccess world, final int x, final int y, final int z) { - if (world.getBlock(x, y, z).getMaterial().isLiquid()) { - return false; - } - return super.canDisplace(world, x, y, z); - } - - @Override - public boolean displaceIfPossible(final World world, final int x, final int y, final int z) { - if (world.getBlock(x, y, z).getMaterial().isLiquid()) { - return false; - } - return super.displaceIfPossible(world, x, y, z); - } - - @Override - public IIcon getIcon(final int side, final int meta) { - return side == 0 || side == 1 ? this.stillIcon : this.flowingIcon; - } - - @SideOnly(Side.CLIENT) - @Override - public void registerBlockIcons(final IIconRegister register) { - this.stillIcon = register.registerIcon(CORE.MODID + ":fluids/fluid.jackdaniels"); - this.flowingIcon = register.registerIcon(CORE.MODID + ":fluids/fluid.jackdaniels"); - } - -} + @SideOnly(Side.CLIENT) + protected IIcon stillIcon; + @SideOnly(Side.CLIENT) + protected IIcon flowingIcon; + + public BlockFluidJackDaniels(Fluid fluid, Material material) { + super(fluid, material); + setCreativeTab(AddToCreativeTab.tabMisc); + } + + @Override + public IIcon getIcon(int side, int meta) { + return (side == 0 || side == 1)? stillIcon : flowingIcon; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister register) { + stillIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels"); + flowingIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels"); + } + + @Override + public boolean canDisplace(IBlockAccess world, int x, int y, int z) { + if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false; + return super.canDisplace(world, x, y, z); + } + + @Override + public boolean displaceIfPossible(World world, int x, int y, int z) { + if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false; + return super.displaceIfPossible(world, x, y, z); + } + +} diff --git a/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java b/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java index dbbc91c902..2832d4d0a4 100644 --- a/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java +++ b/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java @@ -1,33 +1,34 @@ package gtPlusPlus.core.block.machine; -import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.block.base.MetaBlock; +import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.lib.CORE; import net.minecraft.block.material.Material; import net.minecraft.world.IBlockAccess; public class BlockGtFrameBox extends MetaBlock { - private int[] colours; - private int totalColours; - - public BlockGtFrameBox(final String unlocalizedName, final Material material, final BlockTypes blockTypeENUM, - final boolean recolour, final int... colour) { + private int[] colours; + private int totalColours; + + public BlockGtFrameBox( + String unlocalizedName, Material material, + BlockTypes blockTypeENUM, boolean recolour, int... colour) { super(unlocalizedName, material, blockTypeENUM.getBlockSoundType()); - this.setBlockTextureName(CORE.MODID + ":" + "blockGtFrame"); - this.setHarvestLevel(blockTypeENUM.getHarvestTool(), 2); - if (recolour && colour != null && colour.length > 0) { - this.colours = colour; - this.totalColours = this.colours.length; - } + this.setBlockTextureName(CORE.MODID + ":" + "blockGtFrame"); + this.setHarvestLevel(blockTypeENUM.getHarvestTool(), 2); + if (recolour && (colour != null && colour.length > 0)){ + colours = colour; + totalColours = colours.length; + } } @Override - public int colorMultiplier(final IBlockAccess p_149720_1_, final int p_149720_2_, final int p_149720_3_, - final int p_149720_4_) { - for (final int i : this.colours) { - - } + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, + int p_149720_3_, int p_149720_4_) { + for (int i : colours){ + + } return super.colorMultiplier(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_); } diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java index e88c5c5b6b..4f426b99c9 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java @@ -1,11 +1,12 @@ package gtPlusPlus.core.block.machine; -import java.util.ArrayList; - import gtPlusPlus.GTplusplus; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityCharger; + +import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -16,67 +17,67 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import scala.util.Random; -public class Machine_Charger extends BlockContainer { - private static final String name = "Charging Machine"; - - private final Random rand = new Random(); - - public Machine_Charger(final String unlocalizedName) { - super(Material.iron); - // GameRegistry.registerBlock(this, unlocalizedName); - this.setBlockName(unlocalizedName); - this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName); - this.setCreativeTab(AddToCreativeTab.tabMachines); - } - - @Override - public void breakBlock(final World world, final int x, final int y, final int z, final Block block, - final int par6) { - if (world.isRemote) { - return; - } - - final ArrayList drops = new ArrayList(); - - final TileEntity teRaw = world.getTileEntity(x, y, z); - - if (teRaw != null && teRaw instanceof TileEntityCharger) { - final Tile