aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core/block
diff options
context:
space:
mode:
authorRaven Szewczyk <git@eigenraven.me>2024-05-24 19:50:35 +0100
committerRaven Szewczyk <git@eigenraven.me>2024-05-24 19:50:35 +0100
commit6d1b2216464d4dad449ac6fcfec476832224a55e (patch)
tree526a0c15f7056313c80e6c0386e025e9b3f61781 /src/main/java/gtPlusPlus/core/block
parentb5d35f40afa606ed1b07061dad82e0521a59c186 (diff)
downloadGT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.tar.gz
GT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.tar.bz2
GT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.zip
Merge addon sources
Diffstat (limited to 'src/main/java/gtPlusPlus/core/block')
-rw-r--r--src/main/java/gtPlusPlus/core/block/ModBlocks.java104
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BasicBlock.java70
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java322
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BlockBaseFluid.java102
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java245
-rw-r--r--src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java217
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java100
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java197
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/FluidTankInfinite.java141
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/HellFire.java535
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/LightGlass.java137
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/MiningExplosives.java193
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java161
-rw-r--r--src/main/java/gtPlusPlus/core/block/general/fluids/BlockFluidSludge.java68
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/CircuitProgrammer.java153
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/DecayablesChest.java186
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/FishTrap.java136
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_PestKiller.java137
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_PooCollector.java177
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java160
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java558
-rw-r--r--src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java157
22 files changed, 4256 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/core/block/ModBlocks.java b/src/main/java/gtPlusPlus/core/block/ModBlocks.java
new file mode 100644
index 0000000000..634a073b02
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/ModBlocks.java
@@ -0,0 +1,104 @@
+package gtPlusPlus.core.block;
+
+import net.minecraft.block.Block;
+import net.minecraftforge.fluids.Fluid;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.block.general.BlockCompressedObsidian;
+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.antigrief.BlockWitherProof;
+import gtPlusPlus.core.block.machine.CircuitProgrammer;
+import gtPlusPlus.core.block.machine.DecayablesChest;
+import gtPlusPlus.core.block.machine.FishTrap;
+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_SuperJukebox;
+import gtPlusPlus.core.block.machine.VolumetricFlaskSetter;
+import gtPlusPlus.core.fluids.FluidRegistryHandler;
+
+public final class ModBlocks {
+
+ public static Block blockCircuitProgrammer;
+ public static Block blockVolumetricFlaskSetter;
+
+ public static Block blockFishTrap;
+ public static Block blockDecayablesChest;
+
+ public static Block blockCasingsMisc;
+ public static Block blockCasings2Misc;
+ public static Block blockCasings3Misc;
+ public static Block blockCasings4Misc;
+ public static Block blockCasings5Misc;
+ public static Block blockCasings6Misc;
+ public static Block blockCasingsTieredGTPP;
+ public static Block blockSpecialMultiCasings;
+ public static Block blockSpecialMultiCasings2;
+ public static Block blockCustomMachineCasings;
+ public static Block blockCustomPipeGearCasings;
+
+ public static Block MatterFabricatorEffectBlock;
+
+ public static Fluid fluidSludge = new Fluid("fluid.sludge");
+ public static Block blockFluidSludge;
+
+ public static Block blockMiningExplosive;
+
+ public static Block blockHellfire;
+ public static Block blockInfiniteFLuidTank;
+ public static Block blockProjectTable;
+ public static Block blockWitherGuard;
+ public static Block blockCompressedObsidian;
+
+ public static Block blockPlayerDoorWooden;
+ public static Block blockPlayerDoorIron;
+ public static Block blockPlayerDoorCustom_Glass;
+ public static Block blockPlayerDoorCustom_Ice;
+ public static Block blockPlayerDoorCustom_Cactus;
+
+ public static Block blockCustomJukebox;
+
+ public static Block blockPooCollector;
+
+ public static Block blockPestKiller;
+
+ public static void init() {
+ Logger.INFO("Initializing Blocks.");
+
+ registerBlocks();
+ }
+
+ public static void registerBlocks() {
+
+ Logger.INFO("Registering Blocks.");
+ MatterFabricatorEffectBlock = new LightGlass(false);
+
+ // Fluids
+ FluidRegistryHandler.registerFluids();
+
+ // Workbench
+ blockFishTrap = new FishTrap();
+ blockInfiniteFLuidTank = new FluidTankInfinite();
+ blockMiningExplosive = new MiningExplosives();
+ blockHellfire = new HellFire();
+ blockProjectTable = new Machine_ProjectTable();
+ blockWitherGuard = new BlockWitherProof();
+ blockCompressedObsidian = new BlockCompressedObsidian();
+
+ blockCircuitProgrammer = new CircuitProgrammer();
+
+ blockDecayablesChest = new DecayablesChest();
+
+ blockCustomJukebox = new Machine_SuperJukebox();
+
+ blockPooCollector = new Machine_PooCollector();
+
+ blockPestKiller = new Machine_PestKiller();
+
+ blockVolumetricFlaskSetter = new VolumetricFlaskSetter();
+
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/base/BasicBlock.java b/src/main/java/gtPlusPlus/core/block/base/BasicBlock.java
new file mode 100644
index 0000000000..d39c194dfd
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/base/BasicBlock.java
@@ -0,0 +1,70 @@
+package gtPlusPlus.core.block.base;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.util.Utils;
+
+public class BasicBlock extends BlockContainer {
+
+ public BasicBlock(BlockTypes type, final String unlocalizedName, final Material material, final int harvestLevel) {
+ super(material);
+ this.setBlockName(Utils.sanitizeString(unlocalizedName));
+
+ if (type != BlockTypes.ORE && !unlocalizedName.toLowerCase()
+ .contains("ore")) {
+ this.setBlockTextureName(GTPlusPlus.ID + ":" + unlocalizedName);
+ }
+
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setResistance(6.0F);
+ this.setLightLevel(0.0F);
+ this.setHardness(1.0f * harvestLevel);
+ this.setHarvestLevel("pickaxe", harvestLevel);
+ this.setStepSound(soundTypeMetal);
+ }
+
+ public static enum BlockTypes {
+
+ STANDARD("blockBlock", "pickaxe", soundTypeMetal),
+ FRAME("blockFrameGt", "wrench", soundTypeMetal),
+ ORE("blockStone", "pickaxe", soundTypeStone);
+
+ private final String TEXTURE_NAME;
+ private final String HARVEST_TOOL;
+ private final SoundType soundOfBlock;
+
+ 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 this.TEXTURE_NAME;
+ }
+
+ public String getHarvestTool() {
+ return this.HARVEST_TOOL;
+ }
+
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
+ return null;
+ }
+
+ @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/base/BasicTileBlockWithTooltip.java b/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
new file mode 100644
index 0000000000..c39565ea41
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
@@ -0,0 +1,322 @@
+package gtPlusPlus.core.block.base;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import java.util.ArrayList;
+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.EnumCreatureType;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemBlock;
+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 appeng.core.CreativeTab;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.api.interfaces.ITileTooltip;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.api.objects.minecraft.CubicObject;
+import gtPlusPlus.api.objects.minecraft.SafeTexture;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.InventoryUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+
+public abstract class BasicTileBlockWithTooltip extends BlockContainer implements ITileTooltip {
+
+ /**
+ * Each mapped object holds the data for the six sides.
+ */
+ @SideOnly(Side.CLIENT)
+ private AutoMap<CubicObject<SafeTexture>> mSidedTextureArray;
+
+ /**
+ * Holds the data for the six sides, each side holds an array of data for each respective meta.
+ */
+ @SideOnly(Side.CLIENT)
+ private AutoMap<CubicObject<String>> mSidedTexturePathArray;
+
+ /**
+ * Does this block have any meta at all?
+ */
+ public final boolean hasMeta() {
+ return getMetaCount() > 0;
+ }
+
+ /**
+ * The amount of meta this block has.
+ */
+ public abstract int getMetaCount();
+
+ /**
+ * Does this {@link Block} require special {@link ItemBlock} handling?
+ *
+ * @return The {@link Class} that will be used for this {@link Block}.
+ */
+ public Class<? extends ItemBlock> getItemBlockClass() {
+ return ItemBlock.class;
+ }
+
+ /**
+ * A lazy way to declare the unlocal name for the block, makes boilerplating easy.
+ *
+ * @return The internal name for this block.
+ */
+ public abstract String getUnlocalBlockName();
+
+ /**
+ * Lazy Boilerplating.
+ *
+ * @return Block Hardness.
+ */
+ protected abstract float initBlockHardness();
+
+ /**
+ * Lazy Boilerplating.
+ *
+ * @return Block Resistance.
+ */
+ protected abstract float initBlockResistance();
+
+ /**
+ * Lazy Boilerplating.
+ *
+ * @return The {@link CreativeTab} this Block is shown on.
+ */
+ protected abstract CreativeTabs initCreativeTab();
+
+ /**
+ * The ID used by the {@link ITileTooltip} handler. Return -1 if you are not providing a custom {@link ItemBlock} in
+ * {@link #getItemBlockClass}().
+ */
+ @Override
+ public abstract int getTooltipID();
+
+ public BasicTileBlockWithTooltip(Material aBlockMat) {
+ super(aBlockMat);
+ // Use Abstract method values
+ this.setHardness(initBlockHardness());
+ this.setResistance(initBlockResistance());
+ this.setBlockName(getUnlocalBlockName());
+ this.setCreativeTab(initCreativeTab());
+ // Register the block last.
+ GameRegistry.registerBlock(this, getItemBlockClass(), getUnlocalBlockName());
+ Logger.INFO("Registered " + getTileEntityName() + ".");
+ if (Utils.isClient()) {
+ // Handle Textures
+ handleTextures();
+ }
+ }
+
+ /**
+ * The name of the Tile Entity.
+ */
+ protected abstract String getTileEntityName();
+
+ /**
+ * The String used for texture pathing.
+ *
+ * @return Sanitized {@link String}, containing no spaces or illegal characters.
+ */
+ private String getTileEntityNameForTexturePathing() {
+ return Utils.sanitizeString(getTileEntityName().replace(" ", ""));
+ }
+
+ /**
+ * An array of CubicObjects, one for each meta, else just a single cell array. Expected to be null regularly, as the
+ * default texture handling should suffice. Handy if re-using textures or using a non-standard structure for them.
+ * FULL texture path must be used, inclusive of the MODID and a colon.
+ */
+ public CubicObject<String>[] getCustomTextureDirectoryObject() {
+ return null;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final IIcon getIcon(final int ordinalSide, final int aMeta) {
+ return mSidedTextureArray.get(aMeta)
+ .get(ForgeDirection.getOrientation(ordinalSide))
+ .getIcon();
+ }
+
+ @Override
+ public IIcon getIcon(IBlockAccess aWorld, int aX, int aY, int aZ, int ordinalSide) {
+ return super.getIcon(aWorld, aX, aY, aZ, ordinalSide);
+ }
+
+ @SideOnly(Side.CLIENT)
+ private void handleTextures() {
+
+ Logger.INFO("[TeTexture] Building Texture Maps for " + getTileEntityName() + ".");
+
+ // Init on the Client side only, to prevent Field initialisers existing in the Server side bytecode.
+ mSidedTextureArray = new AutoMap<>();
+ mSidedTexturePathArray = new AutoMap<>();
+
+ // Store them in forge order
+ // DOWN, UP, NORTH, SOUTH, WEST, EAST
+
+ // Default Path Name, this will make us look inside 'miscutils\textures\blocks'
+ final String aPrefixTexPath = GTPlusPlus.ID + ":";
+ // Default Path Name, this will make us look in the subdirectory for this Tile Entity.
+ final String aTexPathMid = "TileEntities" + CORE.SEPERATOR
+ + getTileEntityNameForTexturePathing()
+ + CORE.SEPERATOR;
+ // Construct a full path
+ String aTexPathBuilt = aPrefixTexPath + aTexPathMid;
+ // File Name Suffixes, without meta tags
+ String aStringBot;
+ String aStringTop;
+ String aStringBack;
+ String aStringFront;
+ String aStringLeft;
+ String aStringRight;
+ // Do we provide a matrix of custom data to be used for texture processing instead?
+ if (getCustomTextureDirectoryObject() != null) {
+ // Get custom provided texture data.
+ CubicObject<String>[] aDataMap = getCustomTextureDirectoryObject();
+ Logger.INFO("[TeTexture] Found custom texture data, using this instead. Size: " + aDataMap.length);
+ // Map each meta string data to the main map.
+ for (int i = 0; i < aDataMap.length; i++) {
+ mSidedTexturePathArray.put(aDataMap[i]);
+ Logger.INFO("Mapped value for meta " + i + ".");
+ }
+ } else {
+ Logger.INFO("[TeTexture] Processing " + (1 + getMetaCount()) + " sets.");
+ // Iterate once for each meta
+ for (int i = 0; i < (1 + getMetaCount()); i++) {
+
+ // File Name Suffixes, without meta tags
+ aStringBot = "Bottom";
+ aStringTop = "Top";
+ aStringBack = "Back";
+ aStringFront = "Front";
+ aStringLeft = "Left";
+ aStringRight = "Right";
+
+ // Add tails if we have meta
+ if (hasMeta()) {
+ aStringBot = aStringBot + "_" + i;
+ aStringTop = aStringTop + "_" + i;
+ aStringBack = aStringBack + "_" + i;
+ aStringFront = aStringFront + "_" + i;
+ aStringLeft = aStringLeft + "_" + i;
+ aStringRight = aStringRight + "_" + i;
+ }
+ // Append the full path
+ aStringBot = aTexPathBuilt + aStringBot;
+ aStringTop = aTexPathBuilt + aStringTop;
+ aStringBack = aTexPathBuilt + aStringBack;
+ aStringFront = aTexPathBuilt + aStringFront;
+ aStringLeft = aTexPathBuilt + aStringLeft;
+ aStringRight = aTexPathBuilt + aStringRight;
+ // Convenience Blob
+ CubicObject<String> aMetaBlob = new CubicObject<>(
+ aStringBot,
+ aStringTop,
+ aStringBack,
+ aStringFront,
+ aStringLeft,
+ aStringRight);
+ mSidedTexturePathArray.put(aMetaBlob);
+ Logger.INFO("[TeTexture] Added Texture Path data to map for meta " + i);
+ }
+ }
+ Logger.INFO("[TeTexture] Map size for pathing: " + mSidedTexturePathArray.size());
+
+ // Iteration Index
+ int aIndex = 0;
+
+ // Iterate each CubicObject, holding the six texture paths for each meta.
+ for (CubicObject<String> aMetaBlob : mSidedTexturePathArray) {
+ // Make a Safe Texture for each side
+ SafeTexture aBottom = SafeTexture.register(aMetaBlob.DOWN);
+ SafeTexture aTop = SafeTexture.register(aMetaBlob.UP);
+ SafeTexture aBack = SafeTexture.register(aMetaBlob.NORTH);
+ SafeTexture aFont = SafeTexture.register(aMetaBlob.SOUTH);
+ SafeTexture aWest = SafeTexture.register(aMetaBlob.WEST);
+ SafeTexture aEast = SafeTexture.register(aMetaBlob.EAST);
+ // Store them in an Array
+ SafeTexture[] aInjectBlob = new SafeTexture[] { aBottom, aTop, aBack, aFont, aWest, aEast };
+ // Convenience Blob
+ CubicObject<SafeTexture> aMetaBlob2 = new CubicObject<>(aInjectBlob);
+ // Store this Blob into
+ mSidedTextureArray.put(aMetaBlob2);
+ Logger.INFO("[TeTexture] Added SafeTexture data to map for meta " + (aIndex++));
+ }
+ Logger.INFO("[TeTexture] Map size for registration: " + mSidedTextureArray.size());
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerBlockIcons(final IIconRegister aRegisterer) {}
+
+ @Override
+ public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_);
+
+ /**
+ * Called when {@link #breakBlock}() is called, but before {@link InventoryUtils#dropInventoryItems} and the super
+ * call.
+ */
+ public void onBlockBreak() {}
+
+ @Override
+ public final void breakBlock(final World world, final int x, final int y, final int z, final Block block,
+ final int number) {
+ onBlockBreak();
+ InventoryUtils.dropInventoryItems(world, x, y, z, block);
+ super.breakBlock(world, x, y, z, block, number);
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public final void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) {
+ if (hasMeta()) {
+ for (int i = 0; i < getMetaCount(); i++) {
+ aList.add(ItemUtils.simpleMetaStack(aItem, i, 1));
+ }
+ } else {
+ aList.add(ItemUtils.getSimpleStack(aItem));
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
+ final int z) {
+ return false;
+ }
+
+ /**
+ * Get the block's damage value (for use with pick block).
+ */
+ @Override
+ public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
+ return aWorld.getBlockMetadata(aX, aY, aZ);
+ }
+
+ @Override
+ public Item getItemDropped(int meta, Random rand, int p_149650_3_) {
+ return ItemUtils.getSimpleStack(this, 1)
+ .getItem();
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
+ ArrayList<ItemStack> drops = new ArrayList<>();
+ drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
+ return drops;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseFluid.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseFluid.java
new file mode 100644
index 0000000000..6772b71262
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseFluid.java
@@ -0,0 +1,102 @@
+package gtPlusPlus.core.block.base;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import java.util.Random;
+
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.BlockFluidClassic;
+import net.minecraftforge.fluids.Fluid;
+
+import cpw.mods.fml.client.FMLClientHandler;
+import cpw.mods.fml.common.Optional;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.Mods;
+import gtPlusPlus.core.client.renderer.particle.EntityDropParticleFX;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta;
+import gtPlusPlus.core.util.Utils;
+
+public class BlockBaseFluid extends BlockFluidClassic {
+
+ private final String name;
+ private final IIcon[] textureArray = new IIcon[6];
+
+ protected float particleRed = 1.0F;
+ protected float particleGreen = 1.0F;
+ protected float particleBlue = 1.0F;
+
+ public BlockBaseFluid(String materialName, Fluid fluid, Material material) {
+ super(fluid, material);
+ this.setLightOpacity(2);
+ this.name = Utils.sanitizeString(materialName);
+ this.setBlockName("fluid" + this.name);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ GameRegistry.registerBlock(this, ItemBlockMeta.class, "fluid" + this.name);
+ }
+
+ @Override
+ public boolean canCreatureSpawn(EnumCreatureType arg0, IBlockAccess arg1, int arg2, int arg3, int arg4) {
+ return false;
+ }
+
+ public boolean preInit() {
+ return true;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(int ordinalSide, int meta) {
+ return ordinalSide <= 1 ? this.textureArray[0] : this.textureArray[1];
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister icon) {
+ this.textureArray[0] = icon.registerIcon(GTPlusPlus.ID + ":" + "fluid/" + "Fluid_" + this.name + "_Still");
+ this.textureArray[1] = icon.registerIcon(GTPlusPlus.ID + ":" + "fluid/" + "Fluid_" + this.name + "_Flow");
+ }
+
+ @Override
+ @Optional.Method(modid = Mods.Names.C_O_F_H_CORE)
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(World arg0, int arg1, int arg2, int arg3, Random arg4) {
+ super.randomDisplayTick(arg0, arg1, arg2, arg3, arg4);
+ double arg5 = arg1 + arg4.nextFloat();
+ double arg7 = arg2 - 1.05D;
+ double arg9 = arg3 + arg4.nextFloat();
+ if (super.density < 0) {
+ arg7 = arg2 + 2.1D;
+ }
+
+ if (arg4.nextInt(20) == 0
+ && arg0.isSideSolid(
+ arg1,
+ arg2 + super.densityDir,
+ arg3,
+ super.densityDir == -1 ? ForgeDirection.UP : ForgeDirection.DOWN)
+ && !arg0.getBlock(arg1, arg2 + 2 * super.densityDir, arg3)
+ .getMaterial()
+ .blocksMovement()) {
+ EntityDropParticleFX arg11 = new EntityDropParticleFX(
+ arg0,
+ arg5,
+ arg7,
+ arg9,
+ this.particleRed,
+ this.particleGreen,
+ this.particleBlue,
+ super.densityDir);
+ FMLClientHandler.instance()
+ .getClient().effectRenderer.addEffect(arg11);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java
new file mode 100644
index 0000000000..b07c6d1529
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java
@@ -0,0 +1,245 @@
+package gtPlusPlus.core.block.base;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+import static gregtech.api.enums.Mods.GregTech;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.IBlockAccess;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockGtBlock;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+
+public class BlockBaseModular extends BasicBlock {
+
+ protected Material blockMaterial;
+
+ protected int blockColour;
+ public BlockTypes thisBlock;
+ protected String thisBlockMaterial;
+ protected String thisBlockMaterialTranslatedName;
+ protected final String thisBlockType;
+
+ private static final HashMap<String, Block> sBlockCache = new HashMap<>();
+
+ public static Block getMaterialBlock(Material aMaterial, BlockTypes aType) {
+ return sBlockCache.get(aMaterial.getUnlocalizedName() + "." + aType.name());
+ }
+
+ public BlockBaseModular(final Material material, final BlockTypes blockType) {
+ this(material, blockType, material.getRgbAsHex());
+ }
+
+ public BlockBaseModular(final Material material, final BlockTypes blockType, final int colour) {
+ this(
+ material.getUnlocalizedName(),
+ material.getLocalizedName(),
+ net.minecraft.block.material.Material.iron,
+ blockType,
+ colour,
+ Math.min(Math.max(material.vTier, 1), 6));
+ blockMaterial = material;
+ registerComponent();
+ sBlockCache.put(material.getUnlocalizedName() + "." + blockType.name(), this);
+ thisBlockMaterialTranslatedName = material.getTranslatedName();
+ GT_LanguageManager.addStringLocalization("gtplusplus." + getUnlocalizedName() + ".name", getProperName());
+ }
+
+ protected BlockBaseModular(final String unlocalizedName, final String blockMaterialString,
+ final net.minecraft.block.material.Material vanillaMaterial, final BlockTypes blockType, final int colour,
+ final int miningLevel) {
+ super(blockType, unlocalizedName, vanillaMaterial, miningLevel);
+ this.setHarvestLevel(blockType.getHarvestTool(), miningLevel);
+ this.setBlockTextureName(GTPlusPlus.ID + ":" + blockType.getTexture());
+ this.blockColour = colour;
+ this.thisBlock = blockType;
+ this.thisBlockMaterial = blockMaterialString;
+ this.thisBlockType = blockType.name()
+ .toUpperCase();
+ this.setBlockName(this.getUnlocalizedProperName());
+ int fx = getBlockTypeMeta();
+ GameRegistry.registerBlock(
+ this,
+ ItemBlockGtBlock.class,
+ Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
+ if (fx == 0) {
+ GT_OreDictUnificator
+ .registerOre("block" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
+ } else if (fx == 1) {
+ GT_OreDictUnificator
+ .registerOre("frameGt" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
+ } else if (fx == 2) {
+ GT_OreDictUnificator
+ .registerOre("frameGt" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
+ }
+ }
+
+ public static String unifyMaterialName(String rawMaterName) {
+ return rawMaterName.replace(" ", "")
+ .replace("-", "")
+ .replace("_", "");
+ }
+
+ public void registerComponent() {
+ Logger.MATERIALS("Attempting to register " + this.getUnlocalizedName() + ".");
+ if (this.blockMaterial == null) {
+ Logger.MATERIALS("Tried to register " + this.getUnlocalizedName() + " but the material was null.");
+ return;
+ }
+ String aName = blockMaterial.getUnlocalizedName();
+ // Register Component
+ Map<String, ItemStack> aMap = Material.mComponentMap.get(aName);
+ if (aMap == null) {
+ aMap = new HashMap<>();
+ }
+ int fx = getBlockTypeMeta();
+ String aKey = (fx == 0 ? OrePrefixes.block.name()
+ : (fx == 1 ? OrePrefixes.frameGt.name() : OrePrefixes.ore.name()));
+ ItemStack x = aMap.get(aKey);
+ if (x == null) {
+ aMap.put(aKey, ItemUtils.getSimpleStack(this));
+ Logger.MATERIALS("Registering a material component. Item: [" + aName + "] Map: [" + aKey + "]");
+ Material.mComponentMap.put(aName, aMap);
+ } else {
+ // Bad
+ Logger.MATERIALS("Tried to double register a material component.");
+ }
+ }
+
+ public int getBlockTypeMeta() {
+ if (this.thisBlockType.equals(
+ BlockTypes.STANDARD.name()
+ .toUpperCase())) {
+ return 0;
+ } else if (this.thisBlockType.equals(
+ BlockTypes.FRAME.name()
+ .toUpperCase())) {
+ return 1;
+ } else
+ if (this.thisBlockType.equals(
+ BlockTypes.ORE.name()
+ .toUpperCase())) {
+ return 2;
+ }
+ return 0;
+ }
+
+ /**
+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass() {
+ if (this.thisBlock == BlockTypes.FRAME) {
+ return 1;
+ }
+ return 0;
+ }
+
+ public String getProperName() {
+ String tempIngot = null;
+ if (this.thisBlock == BlockTypes.STANDARD) {
+ tempIngot = "Block of %material";
+ } else if (this.thisBlock == BlockTypes.FRAME) {
+ tempIngot = "%material Frame Box";
+ } else if (this.thisBlock == BlockTypes.ORE) {
+ tempIngot = "%material Ore [Old]";
+ }
+ return tempIngot;
+ }
+
+ public String getUnlocalizedProperName() {
+ return getProperName().replace("%s", "%temp")
+ .replace("%material", this.thisBlockMaterial)
+ .replace("%temp", "%s");
+ }
+
+ @Override
+ public String getLocalizedName() {
+ return GT_LanguageManager.getTranslation("gtplusplus." + getUnlocalizedName() + ".name")
+ .replace("%s", "%temp")
+ .replace("%material", this.thisBlockMaterialTranslatedName)
+ .replace("%temp", "%s");
+ }
+
+ @Override
+ public String getUnlocalizedName() {
+ return "block." + blockMaterial.getUnlocalizedName()
+ + "."
+ + this.thisBlock.name()
+ .toLowerCase();
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ public Material getMaterialEx() {
+ return this.blockMaterial;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iIcon) {
+ if (!CORE.ConfigSwitches.useGregtechTextures || this.blockMaterial == null
+ || this.thisBlock == BlockTypes.ORE) {
+ this.blockIcon = iIcon.registerIcon(GTPlusPlus.ID + ":" + this.thisBlock.getTexture());
+ }
+ String metType = "9j4852jyo3rjmh3owlhw9oe";
+ if (this.blockMaterial != null) {
+ TextureSet u = this.blockMaterial.getTextureSet();
+ if (u != null) {
+ metType = u.mSetName;
+ }
+ }
+ metType = (metType.equals("9j4852jyo3rjmh3owlhw9oe") ? "METALLIC" : metType);
+ int tier = blockMaterial != null ? this.blockMaterial.vTier : 0;
+ String aType = (this.thisBlock == BlockTypes.FRAME) ? "frameGt" : (tier <= 4 ? "block1" : "block5");
+ this.blockIcon = iIcon.registerIcon(GregTech.ID + ":" + "materialicons/" + metType + "/" + aType);
+ }
+
+ @Override
+ public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
+
+ if (this.blockColour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+
+ return this.blockColour;
+ }
+
+ @Override
+ public int getRenderColor(final int aMeta) {
+ if (this.blockColour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+
+ return this.blockColour;
+ }
+
+ @Override
+ public int getBlockColor() {
+ if (this.blockColour == 0) {
+ return MathUtils.generateSingularRandomHexValue();
+ }
+
+ return this.blockColour;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java
new file mode 100644
index 0000000000..1813090810
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java
@@ -0,0 +1,217 @@
+package gtPlusPlus.core.block.base;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Random;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.enchantment.EnchantmentHelper;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.FakePlayer;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import gregtech.GT_Mod;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.api.interfaces.ITexturedBlock;
+import gtPlusPlus.core.client.renderer.CustomOreBlockRenderer;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockOre;
+import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture;
+import gtPlusPlus.xmod.gregtech.api.objects.GTPP_RenderedTexture;
+
+public class BlockBaseOre extends BasicBlock implements ITexturedBlock {
+
+ private final Material blockMaterial;
+ protected static boolean shouldFortune = false;
+ protected static boolean shouldSilkTouch = false;
+
+ public BlockBaseOre(final Material material, final BlockTypes blockType) {
+ super(
+ blockType,
+ Utils.sanitizeString(material.getUnlocalizedName()),
+ net.minecraft.block.material.Material.rock,
+ Math.min(Math.max(material.vTier, 1), 6));
+ int aMaterialTierForMining = Math.min(Math.max(material.vTier, 1), 6);
+ this.blockMaterial = material;
+ this.setHardness(1.0f * aMaterialTierForMining);
+ this.setResistance(6.0F);
+ this.setLightLevel(0.0F);
+ this.setHarvestLevel("pickaxe", aMaterialTierForMining);
+ this.setStepSound(soundTypeStone);
+ this.setBlockName("Ore" + Utils.sanitizeString(Utils.sanitizeString(material.getUnlocalizedName())));
+ this.setBlockTextureName("stone");
+ try {
+ GameRegistry.registerBlock(
+ this,
+ ItemBlockOre.class,
+ Utils.sanitizeString("ore" + Utils.sanitizeString(this.blockMaterial.getLocalizedName())));
+ GT_OreDictUnificator.registerOre(
+ "ore" + Utils.sanitizeString(this.blockMaterial.getLocalizedName()),
+ ItemUtils.getSimpleStack(this));
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
+ final int z) {
+ return false;
+ }
+
+ public Material getMaterialEx() {
+ return this.blockMaterial;
+ }
+
+ @Override
+ public int getRenderType() {
+ try {
+ if (CustomOreBlockRenderer.INSTANCE != null) {
+ return CustomOreBlockRenderer.INSTANCE.mRenderID;
+ }
+ return super.getRenderType();
+ } catch (NullPointerException n) {
+ return 0;
+ }
+ }
+
+ @Override
+ public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int ordinalSide) {
+ return Blocks.stone.getIcon(0, 0);
+ }
+
+ @Override
+ public IIcon getIcon(int ordinalSide, int aMeta) {
+ return Blocks.stone.getIcon(0, 0);
+ }
+
+ /**
+ * GT Texture Handler
+ */
+
+ // .08 compat
+ public static IIconContainer[] hiddenTextureArray;
+
+ @Override
+ public ITexture[] getTexture(ForgeDirection side) {
+ return getTexture(null, side);
+ }
+
+ @Override
+ public ITexture[] getTexture(Block block, ForgeDirection side) {
+ if (this.blockMaterial != null) {
+ GTPP_RenderedTexture aIconSet = new GTPP_RenderedTexture(
+ blockMaterial.getTextureSet().mTextures[OrePrefixes.ore.mTextureIndex],
+ this.blockMaterial.getRGBA());
+ return new ITexture[] { new GTPP_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet };
+ }
+
+ if (hiddenTextureArray == null) {
+ try {
+ Field o = ReflectionUtils.getField(Textures.BlockIcons.class, "STONES");
+ if (o != null) {
+ hiddenTextureArray = (IIconContainer[]) o.get(Textures.BlockIcons.class);
+ }
+ if (hiddenTextureArray == null) {
+ hiddenTextureArray = new IIconContainer[6];
+ }
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ hiddenTextureArray = new IIconContainer[6];
+ }
+ }
+ return new ITexture[] { new GTPP_RenderedTexture(hiddenTextureArray[0], new short[] { 240, 240, 240, 0 }) };
+ }
+
+ @Override
+ public void registerBlockIcons(IIconRegister p_149651_1_) {}
+
+ @Override
+ public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) {
+ if (EnchantmentHelper.getSilkTouchModifier(player)) {
+ shouldSilkTouch = true;
+ super.harvestBlock(worldIn, player, x, y, z, meta);
+
+ if (shouldSilkTouch) {
+ shouldSilkTouch = false;
+ }
+ return;
+ }
+
+ if (!(player instanceof FakePlayer)) {
+ shouldFortune = true;
+ }
+ super.harvestBlock(worldIn, player, x, y, z, meta);
+ if (shouldFortune) {
+ shouldFortune = false;
+ }
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
+ ArrayList<ItemStack> drops = new ArrayList<>();
+ if (shouldSilkTouch) {
+ drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
+ } else {
+ switch (GT_Mod.gregtechproxy.oreDropSystem) {
+ case Item -> {
+ drops.add(
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken(
+ "oreRaw" + this.blockMaterial.getLocalizedName(),
+ 1));
+ }
+ case FortuneItem -> {
+ // if shouldFortune and isNatural then get fortune drops
+ // if not shouldFortune or not isNatural then get normal drops
+ // if not shouldFortune and isNatural then get normal drops
+ // if shouldFortune and not isNatural then get normal drops
+ if (shouldFortune && fortune > 0) {
+ int aMinAmount = 1;
+ // Max applicable fortune
+ if (fortune > 3) fortune = 3;
+ long amount = (long) new Random().nextInt(fortune) + aMinAmount;
+ for (int i = 0; i < amount; i++) {
+ drops.add(
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken(
+ "oreRaw" + this.blockMaterial.getLocalizedName(),
+ 1));
+ }
+ } else {
+ drops.add(
+ ItemUtils.getItemStackOfAmountFromOreDictNoBroken(
+ "oreRaw" + this.blockMaterial.getLocalizedName(),
+ 1));
+ }
+ }
+ case UnifiedBlock -> {
+ // Unified ore
+ drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
+ }
+ case PerDimBlock -> {
+ // Per Dimension ore
+ drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
+ }
+ case Block -> {
+ // Regular ore
+ drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
+ }
+ }
+ }
+ return drops;
+ }
+
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java b/src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java
new file mode 100644
index 0000000000..0c353cfbdd
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java
@@ -0,0 +1,100 @@
+package gtPlusPlus.core.block.general;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import net.minecraft.block.BlockObsidian;
+import net.minecraft.block.material.MapColor;
+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.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.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta;
+
+public class BlockCompressedObsidian extends BlockObsidian {
+
+ private final IIcon textureArray[] = new IIcon[11];
+
+ public BlockCompressedObsidian() {
+ this.setBlockName("blockCompressedObsidian");
+ this.setHardness(50.0F);
+ this.setResistance(2000.0F);
+ this.setStepSound(soundTypePiston);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockCompressedObsidian");
+ }
+
+ @Override
+ public MapColor getMapColor(final int meta) {
+ if (meta < 5) {
+ return MapColor.obsidianColor;
+ }
+ if (meta > 5) {
+ return MapColor.goldColor;
+ } else {
+ return MapColor.sandColor;
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iicon) {
+ this.textureArray[0] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian1");
+ this.textureArray[1] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian2");
+ this.textureArray[2] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian3");
+ this.textureArray[3] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian4");
+ this.textureArray[4] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian5");
+ this.textureArray[5] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian_invert");
+ this.textureArray[6] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "glowstone1");
+ this.textureArray[7] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "glowstone2");
+ this.textureArray[8] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "glowstone3");
+ this.textureArray[9] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "glowstone4");
+ this.textureArray[10] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "glowstone5");
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int ordinalSide, final int meta) {
+ return this.textureArray[meta];
+ }
+
+ @Override
+ public int damageDropped(final int damage) {
+ return damage;
+ }
+
+ @Override
+ public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
+ for (int i = 0; i < 11; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public Item getItemDropped(final int meta, final Random rand, final int fortune) {
+ return Item.getItemFromBlock(this);
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int metadata,
+ final int fortune) {
+ int m = metadata;
+ if (m == 5) {
+ m = 1;
+ }
+ return super.getDrops(world, x, y, z, m, fortune);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java
new file mode 100644
index 0000000000..dc6c92f065
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java
@@ -0,0 +1,197 @@
+package gtPlusPlus.core.block.general;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockAir;
+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.init.Blocks;
+import net.minecraft.nbt.NBTTagCompound;
+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.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.core.block.ModBlocks;
+
+public class BlockSuperLight extends BlockContainer {
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
+
+ public BlockSuperLight() {
+ super(Material.circuits);
+ this.setBlockName("blockSuperLight");
+ this.setCreativeTab(CreativeTabs.tabRedstone);
+ GameRegistry.registerBlock(this, "blockSuperLight");
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int ordinalSide, final int meta) {
+ return this.blockIcon;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlBigBlue");
+ }
+
+ /**
+ * Returns a new instance of a block's tile entity class. Called on placing the block.
+ */
+ @Override
+ public TileEntity createNewTileEntity(World aWorld, int p_149915_2_) {
+ return new TileEntitySuperLight();
+ }
+
+ public static class TileEntitySuperLight extends TileEntity {
+
+ private long mCreated;
+
+ private long mLastUpdateTick = 0;
+
+ private int[][][][] aLitBlocks = new int[50][10][50][1];
+
+ private boolean mPowered = false;
+
+ public TileEntitySuperLight() {
+ mCreated = System.currentTimeMillis();
+ Logger.INFO("Created Super-Lamp");
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound aNBT) {
+ super.readFromNBT(aNBT);
+ mCreated = aNBT.getLong("mCreated");
+ mPowered = aNBT.getBoolean("mPowered");
+ NBTTagCompound aLightingData = aNBT.getCompoundTag("lighting");
+ for (int x = 0; x < 50; x++) {
+ for (int y = 0; y < 10; y++) {
+ for (int z = 0; z < 50; z++) {
+ int aData = aLightingData.getInteger("[" + x + "][" + y + "][" + z + "]");
+ aLitBlocks[x][y][z][0] = aData;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound aNBT) {
+ super.writeToNBT(aNBT);
+ aNBT.setLong("mCreated", mCreated);
+ aNBT.setBoolean("mPowered", mPowered);
+ NBTTagCompound aLightingData = new NBTTagCompound();
+ for (int x = 0; x < 50; x++) {
+ for (int y = 0; y < 10; y++) {
+ for (int z = 0; z < 50; z++) {
+ int aFlag = aLitBlocks[x][y][z][0];
+ aLightingData.setInteger("[" + x + "][" + y + "][" + z + "]", aFlag);
+ }
+ }
+ }
+ aNBT.setTag("lighting", aLightingData);
+ }
+
+ @Override
+ public void updateEntity() {
+ super.updateEntity();
+
+ if (this.worldObj.isRemote) {
+ return;
+ }
+
+ try {
+ if (mLastUpdateTick == 0 || (System.currentTimeMillis() - mLastUpdateTick) >= 30000) {
+ boolean powered = (this.worldObj
+ .isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord));
+ boolean aLastState = mPowered;
+ // Logger.INFO("Powered: "+powered);
+ mPowered = powered;
+ if (mPowered != aLastState) {
+ updateLighting(powered);
+ }
+ }
+ } catch (Throwable ignored) {}
+ }
+
+ @Override
+ public void markDirty() {
+ super.markDirty();
+ }
+
+ @Override
+ public boolean canUpdate() {
+ return super.canUpdate();
+ }
+
+ public void updateLighting(boolean enable) {
+
+ mLastUpdateTick = System.currentTimeMillis();
+
+ aLitBlocks = new int[50][10][50][1];
+ int aLitCounter = 0;
+ AutoMap<BlockPos> aBlocksToUpdate = new AutoMap<>();
+ Logger.INFO("Trying to relight area.");
+
+ BlockPos aStartIterationPoint = new BlockPos(
+ this.xCoord - 24,
+ this.yCoord - 4,
+ this.zCoord - 24,
+ this.worldObj);
+ for (int x = 0; x < 50; x++) {
+ for (int y = 0; y < 10; y++) {
+ for (int z = 0; z < 50; z++) {
+ int xOff = aStartIterationPoint.xPos + x;
+ int yOff = aStartIterationPoint.yPos + y;
+ int zOff = aStartIterationPoint.zPos + z;
+ Block aBlockGet = this.worldObj.getBlock(xOff, yOff, zOff);
+ if (aBlockGet != null) {
+ if (aBlockGet instanceof BlockAir) {
+
+ int aLight = aBlockGet.getLightValue();
+
+ // Don't Need to relight anything.
+ if ((enable && aLight > 0) || (!enable && aLight == 0)) {
+ continue;
+ }
+ // Turning Lights on
+ else if (enable && aLight == 0) {
+ aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj));
+ this.worldObj
+ .setBlock(xOff, yOff, zOff, ModBlocks.MatterFabricatorEffectBlock, 0, 3);
+ aLitCounter++;
+ }
+ // Turning Lights off
+ else if (!enable && aLight > 0) {
+ aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj));
+ if (aBlockGet instanceof LightGlass) {
+ Logger.INFO("Dimmed air.");
+ this.worldObj.setBlock(xOff, yOff, zOff, Blocks.air, 0, 3);
+ }
+ }
+ aLitBlocks[x][y][z][0] = enable ? 15 : 0;
+ } else {
+ aLitBlocks[x][y][z][0] = -1;
+ }
+ } else {
+ aLitBlocks[x][y][z][0] = -1;
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/FluidTankInfinite.java b/src/main/java/gtPlusPlus/core/block/general/FluidTankInfinite.java
new file mode 100644
index 0000000000..41a581394b
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/general/FluidTankInfinite.java
@@ -0,0 +1,141 @@
+package gtPlusPlus.core.block.general;
+
+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.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.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidContainerItem;
+import net.minecraftforge.fluids.ItemFluidContainer;
+
+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.tileentities.general.TileEntityInfiniteFluid;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+
+public class FluidTankInfinite extends BlockContainer {
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
+
+ public FluidTankInfinite() {
+ super(Material.iron);
+ this.setBlockName("blockInfiniteFluidTank");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, "blockInfiniteFluidTank");
+ }
+
+ /**
+ * 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/" + "Generic_Creative_Texture");
+ this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "Generic_Creative_Texture");
+ this.textureBottom = p_149651_1_
+ .registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "Generic_Creative_Texture");
+ this.textureFront = p_149651_1_
+ .registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "Generic_Creative_Texture");
+ }
+
+ /**
+ * 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;
+ } else {
+ TileEntityInfiniteFluid tank = (TileEntityInfiniteFluid) world.getTileEntity(x, y, z);
+ if (tank != null) {
+ Item handItem;
+ try {
+ handItem = player.getHeldItem()
+ .getItem();
+ } catch (Throwable t) {
+ handItem = null;
+ }
+ if (handItem != null
+ && (handItem instanceof IFluidContainerItem || handItem instanceof ItemFluidContainer
+ || FluidContainerRegistry.isFilledContainer(player.getHeldItem()))) {
+ if (tank.tank.getFluid() == null) {
+ try {
+ if (!FluidContainerRegistry.isFilledContainer(player.getHeldItem())) {
+ ItemStack handItemStack = player.getHeldItem();
+ IFluidContainerItem container = (IFluidContainerItem) handItem;
+ FluidStack containerFluid = container.getFluid(handItemStack);
+ container.drain(handItemStack, container.getFluid(handItemStack).amount, true);
+ tank.tank.setFluid(containerFluid);
+ } else {
+ ItemStack handItemStack = player.getHeldItem();
+ FluidContainerRegistry.drainFluidContainer(handItemStack);
+ FluidStack containerFluid = FluidContainerRegistry.getFluidForFilledItem(handItemStack);
+ ItemStack emptyContainer = FluidContainerRegistry.drainFluidContainer(handItemStack);
+ player.setItemInUse(emptyContainer, 0);
+
+ tank.tank.setFluid(containerFluid);
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+ if (tank.tank.getFluid() != null) {
+ PlayerUtils.messagePlayer(
+ player,
+ "This tank contains " + tank.tank.getFluidAmount()
+ + "L of "
+ + tank.tank.getFluid()
+ .getLocalizedName());
+ }
+ }
+ }
+ 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 TileEntityInfiniteFluid();
+ }
+
+ @Override
+ public void onBlockAdded(World world, int x, int y, int z) {
+ super.onBlockAdded(world, x, y, z);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/HellFire.java b/src/main/java/gtPlusPlus/core/block/general/HellFire.java
new file mode 100644
index 0000000000..4e8d94328d
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/general/HellFire.java
@@ -0,0 +1,535 @@
+package gtPlusPlus.core.block.general;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+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.IdentityHashMap;
+import java.util.Map.Entry;
+import java.util.Random;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockFire;
+import net.minecraft.block.material.MapColor;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.init.Blocks;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import com.google.common.collect.Maps;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.objects.XSTR;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.util.math.MathUtils;
+
+public class HellFire extends BlockFire {
+
+ private final int[] field_149849_a = new int[Short.MAX_VALUE];
+
+ private final int[] field_149848_b = new int[Short.MAX_VALUE];
+
+ @SideOnly(Side.CLIENT)
+ private IIcon[] IIconArray;
+
+ public HellFire() {
+ this.setTickRandomly(true);
+ this.setLightLevel(1F);
+ this.setLightOpacity(0);
+ // this.setBlockTextureName(GTPlusPlus.ID + "hellfire/blockHellFire");
+ this.setBlockName("blockHellFire");
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ GameRegistry.registerBlock(this, "blockHellFire");
+ this.enableBrutalFire();
+ }
+
+ private void enableBrutalFire() {
+ for (final Object o : Block.blockRegistry.getKeys()) {
+
+ try {
+
+ final String name = (String) o;
+ final Block b = Block.getBlockFromName(name);
+ if (b != Blocks.air) {
+ final int spread = Blocks.fire.getEncouragement(b);
+ final int flamm = Blocks.fire.getFlammability(b);
+ if (flamm > 0 && spread > 0) {
+ this.setFireInfo(b, spread * 4, flamm * 4);
+ }
+ }
+
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ // Special Case madness
+ this.setFireInfo(Blocks.brown_mushroom_block, 20, 100);
+ this.setFireInfo(Blocks.red_mushroom_block, 20, 100);
+ this.setFireInfo(Blocks.grass, 20, 100);
+ this.setFireInfo(Blocks.mycelium, 20, 100);
+ }
+
+ /**
+ * How many world ticks before ticking
+ */
+ @Override
+ public int tickRate(final World world) {
+ return 5;
+ }
+
+ /**
+ * Ticks the block if it's been scheduled
+ */
+ @Override
+ public void updateTick(final World world, final int x, final int y, final int z, Random random) {
+
+ random = new XSTR();
+
+ if (world.getGameRules()
+ .getGameRuleBooleanValue("doFireTick")) {
+ final boolean flag = world.getBlock(x, y - 1, z)
+ .isFireSource(world, x, y - 1, z, UP);
+
+ if (!this.canPlaceBlockAt(world, x, y, z)) {
+ world.setBlockToAir(x, y, z);
+ }
+
+ if (!flag && world.isRaining()
+ && (world.canLightningStrikeAt(x, y, z) || world.canLightningStrikeAt(x - 1, y, z)
+ || world.canLightningStrikeAt(x + 1, y, z)
+ || world.canLightningStrikeAt(x, y, z - 1)
+ || world.canLightningStrikeAt(x, y, z + 1))) {
+
+ if (MathUtils.randInt(0, 100) >= 90) {
+ world.setBlockToAir(x, y, z);
+ }
+ } else {
+ final int blockMeta = world.getBlockMetadata(x, y, z);
+
+ if (blockMeta < 15) {
+ world.setBlockMetadataWithNotify(x, y, z, blockMeta + (random.nextInt(3) / 2), 4);
+ }
+
+ world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + random.nextInt(10));
+
+ if (!flag && !this.canNeighborBurn(world, x, y, z)) {
+ if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) || (blockMeta > 3)) {
+ world.setBlockToAir(x, y, z);
+ }
+ } else if (!flag && !this.canCatchFire(world, x, y - 1, z, UP)
+ && (blockMeta == 15)
+ && (random.nextInt(4) == 0)) {
+ world.setBlockToAir(x, y, z);
+ } else {
+ final boolean flag1 = world.isBlockHighHumidity(x, y, z);
+ byte b0 = 0;
+
+ if (flag1) {
+ b0 = -50;
+ }
+
+ this.tryCatchFire(world, x + 1, y, z, 300 + b0, random, blockMeta, WEST);
+ this.tryCatchFire(world, x - 1, y, z, 300 + b0, random, blockMeta, EAST);
+ this.tryCatchFire(world, x, y - 1, z, 250 + b0, random, blockMeta, UP);
+ this.tryCatchFire(world, x, y + 1, z, 250 + b0, random, blockMeta, DOWN);
+ this.tryCatchFire(world, x, y, z - 1, 300 + b0, random, blockMeta, SOUTH);
+ this.tryCatchFire(world, x, y, z + 1, 300 + b0, random, blockMeta, NORTH);
+
+ for (int i1 = x - 1; i1 <= (x + 1); ++i1) {
+ for (int j1 = z - 1; j1 <= (z + 1); ++j1) {
+ for (int k1 = y - 1; k1 <= (y + 4); ++k1) {
+ if ((i1 != x) || (k1 != y) || (j1 != z)) {
+ int l1 = 100;
+
+ if (k1 > (y + 1)) {
+ l1 += (k1 - (y + 1)) * 100;
+ }
+
+ final int neighbourFireChance = this
+ .getChanceOfNeighborsEncouragingFire(world, i1, k1, j1);
+
+ if (neighbourFireChance > 0) {
+ int j2 = (neighbourFireChance + 40
+ + (world.difficultySetting.getDifficultyId() * 14)) / (blockMeta + 30);
+
+ if (flag1) {
+ j2 /= 2;
+ }
+
+ if ((j2 > 0) && (random.nextInt(l1) <= j2)
+ && (!world.isRaining() || !world.canLightningStrikeAt(i1, k1, j1))
+ && !world.canLightningStrikeAt(i1 - 1, k1, z)
+ && !world.canLightningStrikeAt(i1 + 1, k1, j1)
+ && !world.canLightningStrikeAt(i1, k1, j1 - 1)
+ && !world.canLightningStrikeAt(i1, k1, j1 + 1)) {
+ int k2 = blockMeta + (random.nextInt(5) / 4);
+
+ if (k2 > 15) {
+ k2 = 15;
+ }
+
+ world.setBlock(i1, k1, j1, this, k2, 3);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void tryCatchFire(final World world, final int p_149841_2_, final int p_149841_3_, final int p_149841_4_,
+ final int p_149841_5_, final Random p_149841_6_, final int p_149841_7_, final ForgeDirection face) {
+ final int j1 = world.getBlock(p_149841_2_, p_149841_3_, p_149841_4_)
+ .getFlammability(world, p_149841_2_, p_149841_3_, p_149841_4_, face);
+
+ if (p_149841_6_.nextInt(p_149841_5_) < j1) {
+ final boolean flag = world.getBlock(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.tnt;
+
+ if ((p_149841_6_.nextInt(p_149841_7_ + 10) < 5)
+ && !world.canLightningStrikeAt(p_149841_2_, p_149841_3_, p_149841_4_)) {
+ int k1 = p_149841_7_ + (p_149841_6_.nextInt(5) / 4);
+
+ if (k1 > 15) {
+ k1 = 15;
+ }
+
+ world.setBlock(p_149841_2_, p_149841_3_, p_149841_4_, this, k1, 3);
+ } else {
+ world.setBlockToAir(p_149841_2_, p_149841_3_, p_149841_4_);
+ }
+
+ if (flag) {
+ Blocks.tnt.onBlockDestroyedByPlayer(world, p_149841_2_, p_149841_3_, p_149841_4_, 1);
+ }
+ }
+ }
+
+ /**
+ * Returns true if at least one block next to this one can burn.
+ */
+ private boolean canNeighborBurn(final World world, final int x, final int y, final int z) {
+ return this.canCatchFire(world, x + 1, y, z, WEST) || this.canCatchFire(world, x - 1, y, z, EAST)
+ || this.canCatchFire(world, x, y - 1, z, UP)
+ || this.canCatchFire(world, x, y + 1, z, DOWN)
+ || this.canCatchFire(world, x, y, z - 1, SOUTH)
+ || this.canCatchFire(world, x, y, z + 1, NORTH);
+ }
+
+ /**
+ * Gets the highest chance of a neighbor block encouraging this block to catch fire
+ */
+ private int getChanceOfNeighborsEncouragingFire(final World world, final int x, final int y, final int z) {
+ final byte b0 = 0;
+
+ if (!world.isAirBlock(x, y, z)) {
+ return 0;
+ } else {
+ int l = b0;
+ l = this.getChanceToEncourageFire(world, x + 1, y, z, l, WEST);
+ l = this.getChanceToEncourageFire(world, x - 1, y, z, l, EAST);
+ l = this.getChanceToEncourageFire(world, x, y - 1, z, l, UP);
+ l = this.getChanceToEncourageFire(world, x, y + 1, z, l, DOWN);
+ l = this.getChanceToEncourageFire(world, x, y, z - 1, l, SOUTH);
+ l = this.getChanceToEncourageFire(world, x, y, z + 1, l, NORTH);
+ return l;
+ }
+ }
+
+ /**
+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
+ */
+ @Override
+ public boolean canPlaceBlockAt(final World worldObj, final int x, final int y, final int z) {
+ return World.doesBlockHaveSolidTopSurface(worldObj, x, y - 1, z) || this.canNeighborBurn(worldObj, x, y, z);
+ }
+
+ /**
+ * 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(final World worldObj, final int x, final int y, final int z,
+ final Block blockObj) {
+ if (!World.doesBlockHaveSolidTopSurface(worldObj, x, y - 1, z) && !this.canNeighborBurn(worldObj, x, y, z)) {
+ worldObj.setBlockToAir(x, y, z);
+ }
+ }
+
+ /**
+ * Called whenever the block is added into the world. Args: world, x, y, z
+ */
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ if ((world.provider.dimensionId > 0) || !Blocks.portal.func_150000_e(world, x, y, z)) {
+ if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && !this.canNeighborBurn(world, x, y, z)) {
+ world.setBlockToAir(x, y, z);
+ } else {
+ world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + world.rand.nextInt(10));
+ }
+ }
+ }
+
+ // Burn
+ @Override
+ public void onEntityWalking(final World world, final int i, final int j, final int k, final Entity entity) {
+ entity.setFire(10);
+ }
+
+ @Override
+ public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y,
+ final int z) {
+ return false;
+ }
+
+ // Burn
+ @Override
+ public void onEntityCollidedWithBlock(final World world, final int i, final int j, final int k,
+ final Entity entity) {
+ entity.setFire(10);
+ }
+
+ /**
+ * A randomly called display update to be able to add particles or other items for display
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(final World world, final int x, final int y, final int z, Random randomObj) {
+
+ randomObj = new XSTR();
+
+ if (randomObj.nextInt(24) == 0) {
+ world.playSound(
+ x + 0.5F,
+ y + 0.5F,
+ z + 0.5F,
+ "fire.fire",
+ 1.0F + randomObj.nextFloat(),
+ (randomObj.nextFloat() * 0.7F) + 0.3F,
+ false);
+ }
+
+ int l;
+ float f;
+ float f1;
+ float f2;
+
+ if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)
+ && !Blocks.fire.canCatchFire(world, x, y - 1, z, UP)) {
+ if (Blocks.fire.canCatchFire(world, x - 1, y, z, EAST)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + (randomObj.nextFloat() * 0.1F);
+ f1 = y + randomObj.nextFloat();
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x + 1, y, z, WEST)) {
+ for (l = 0; l < 2; ++l) {
+ f = (x + 1) - (randomObj.nextFloat() * 0.1F);
+ f1 = y + randomObj.nextFloat();
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x, y, z - 1, SOUTH)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = y + randomObj.nextFloat();
+ f2 = z + (randomObj.nextFloat() * 0.1F);
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x, y, z + 1, NORTH)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = y + randomObj.nextFloat();
+ f2 = (z + 1) - (randomObj.nextFloat() * 0.1F);
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x, y + 1, z, DOWN)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = (y + 1) - (randomObj.nextFloat() * 0.1F);
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ } else {
+ for (l = 0; l < 5; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = y + (randomObj.nextFloat() * 0.5F) + 0.5F;
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("witchMagic", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ world.spawnParticle("largesmoke", f, f1 + 0.5F, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister IIconRegister) {
+ this.IIconArray = new IIcon[] {
+ IIconRegister.registerIcon(GTPlusPlus.ID + ":" + "hellfire/" + "blockHellFire" + "_layer_0"),
+ IIconRegister.registerIcon(GTPlusPlus.ID + ":" + "hellfire/" + "blockHellFire" + "_layer_1") };
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getFireIcon(final int p_149840_1_) {
+ return this.IIconArray[p_149840_1_];
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int ordinalSide, final int meta) {
+ return this.IIconArray[0];
+ }
+
+ @Override
+ public MapColor getMapColor(final int p_149728_1_) {
+ return MapColor.snowColor;
+ }
+
+ /*
+ * ================================= Forge Start ======================================
+ */
+ private static class FireInfo {
+
+ private int encouragement = 0;
+ private int flammibility = 0;
+ }
+
+ private final IdentityHashMap<Block, FireInfo> blockInfo = Maps.newIdentityHashMap();
+
+ @Override
+ public void setFireInfo(final Block block, final int encouragement, final int flammibility) {
+ try {
+ if (block == Blocks.air) {
+ throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
+ }
+ final int id = Block.getIdFromBlock(block);
+ if (id >= 4096 || id >= field_149849_a.length || id >= field_149848_b.length) {
+ return;
+ }
+ this.field_149849_a[id] = encouragement;
+ this.field_149848_b[id] = flammibility;
+
+ final FireInfo info = this.getInfo(block, true);
+ info.encouragement = encouragement;
+ info.flammibility = flammibility;
+ } catch (Throwable t) {}
+ }
+
+ private FireInfo getInfo(final Block block, final boolean garentee) {
+ FireInfo ret = this.blockInfo.get(block);
+ if ((ret == null) && garentee) {
+ ret = new FireInfo();
+ this.blockInfo.put(block, ret);
+ }
+ return ret;
+ }
+
+ @Override
+ public void rebuildFireInfo() {
+ for (int x = 0; x < 4096; x++) {
+ // If we care.. we could detect changes in here and make sure we
+ // keep them, however
+ // it's my thinking that anyone who hacks into the private variables
+ // should DIAF and we don't care about them.
+ this.field_149849_a[x] = 0;
+ this.field_149848_b[x] = 0;
+ }
+
+ for (final Entry<Block, FireInfo> e : this.blockInfo.entrySet()) {
+ final int id = Block.getIdFromBlock(e.getKey());
+ if ((id >= 0) && (id < 4096)) {
+ this.field_149849_a[id] = e.getValue().encouragement;
+ this.field_149848_b[id] = e.getValue().flammibility;
+ }
+ }
+ }
+
+ @Override
+ public int getFlammability(final Block block) {
+ final int id = Block.getIdFromBlock(block);
+ return (id >= 0) && (id < 4096) ? this.field_149848_b[id] : 0;
+ }
+
+ @Override
+ public int getEncouragement(final Block block) {
+ final int id = Block.getIdFromBlock(block);
+ return (id >= 0) && (id < 4096) ? this.field_149849_a[id] : 0;
+ }
+
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ * @param world The current world
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param face The side the fire is coming from
+ * @return True if the face can catch fire.
+ */
+ @Override
+ public boolean canCatchFire(final IBlockAccess world, final int x, final int y, final int z,
+ final ForgeDirection face) {
+ return world.getBlock(x, y, z)
+ .isFlammable(world, x, y, z, face);
+ }
+
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ * @param world The current world
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param oldChance The previous maximum chance.
+ * @param face The side the fire is coming from
+ * @return The chance of the block catching fire, or oldChance if it is higher
+ */
+ @Override
+ public int getChanceToEncourageFire(final IBlockAccess world, final int x, final int y, final int z,
+ final int oldChance, final ForgeDirection face) {
+ final int newChance = world.getBlock(x, y, z)
+ .getFireSpreadSpeed(world, x, y, z, face);
+ return (newChance > oldChance ? newChance : oldChance);
+ }
+ /*
+ * ================================= Forge Start ======================================
+ */
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/LightGlass.java b/src/main/java/gtPlusPlus/core/block/general/LightGlass.java
new file mode 100644
index 0000000000..b6facce45f
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/general/LightGlass.java
@@ -0,0 +1,137 @@
+package gtPlusPlus.core.block.general;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+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;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+
+/*
+ * public class LightGlass extends BlockBreakable {
+ */
+public class LightGlass extends BlockAir {
+
+ 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 LightGlass(final boolean bool) {
+ super();
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setBlockName("blockMFEffect");
+ this.setLightLevel(12F);
+ setHardness(0.1F);
+ setBlockTextureName(GTPlusPlus.ID + ":" + "blockMFEffect");
+ setStepSound(Block.soundTypeGlass);
+ GameRegistry.registerBlock(this, "blockMFEffect");
+
+ API.hideItem(new ItemStack(this));
+ }
+
+ /**
+ * Returns the quantity of items to drop on block destruction.
+ */
+ @Override
+ public int quantityDropped(final Random rand) {
+ return 0;
+ }
+
+ /**
+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass() {
+ return 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;
+ }
+
+ /**
+ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops.
+ */
+ @Override
+ protected boolean canSilkHarvest() {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iIcon) {
+ this.blockIcon = iIcon.registerIcon(GTPlusPlus.ID + ":" + "blockMFEffect");
+ }
+
+ @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;
+ }
+
+ /**
+ * A randomly called display update to be able to add particles or other items for display
+ */
+ @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");
+
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/MiningExplosives.java b/src/main/java/gtPlusPlus/core/block/general/MiningExplosives.java
new file mode 100644
index 0000000000..7579907e9d
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/general/MiningExplosives.java
@@ -0,0 +1,193 @@
+package gtPlusPlus.core.block.general;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import java.util.Random;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockTNT;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.init.Items;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.Explosion;
+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.entity.EntityPrimedMiningExplosive;
+
+public class MiningExplosives extends BlockTNT {
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
+
+ public MiningExplosives() {
+ this.setBlockName("blockMiningExplosives");
+ GameRegistry.registerBlock(this, "blockMiningExplosives");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int ordinalSide, final int meta) {
+ return ordinalSide == 0 ? this.textureBottom : (ordinalSide == 1 ? this.textureTop : this.blockIcon);
+ }
+
+ /**
+ * Called whenever the block is added into the world. Args: world, x, y, z
+ */
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ super.onBlockAdded(world, x, y, z);
+
+ if (world.isBlockIndirectlyGettingPowered(x, y, z)) {
+ this.onBlockDestroyedByPlayer(world, x, y, z, 1);
+ world.setBlockToAir(x, y, z);
+ }
+ }
+
+ /**
+ * 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(final World world, final int x, final int y, final int z,
+ final Block neighbourblock) {
+ if (world.isBlockIndirectlyGettingPowered(x, y, z)) {
+ this.onBlockDestroyedByPlayer(world, x, y, z, 1);
+ world.setBlockToAir(x, y, z);
+ }
+ }
+
+ /**
+ * Returns the quantity of items to drop on block destruction.
+ */
+ @Override
+ public int quantityDropped(final Random random) {
+ return 1;
+ }
+
+ /**
+ * Called upon the block being destroyed by an explosion
+ */
+ @Override
+ public void onBlockDestroyedByExplosion(final World world, final int x, final int y, final int z,
+ final Explosion bang) {
+ if (!world.isRemote) {
+ final EntityPrimedMiningExplosive EntityPrimedMiningExplosive = new EntityPrimedMiningExplosive(
+ world,
+ x + 0.5F,
+ y + 0.5F,
+ z + 0.5F,
+ bang.getExplosivePlacedBy());
+ EntityPrimedMiningExplosive.fuse = world.rand.nextInt(EntityPrimedMiningExplosive.fuse / 4)
+ + (EntityPrimedMiningExplosive.fuse / 8);
+ world.spawnEntityInWorld(EntityPrimedMiningExplosive);
+ }
+ }
+
+ /**
+ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData
+ */
+ @Override
+ public void onBlockDestroyedByPlayer(final World world, final int x, final int y, final int z, final int meta) {
+ this.func_150114_a(world, x, y, z, meta, (EntityLivingBase) null);
+ }
+
+ // TODO Spawns Primed TNT?
+ @Override
+ public void func_150114_a(final World world, final int p_150114_2_, final int p_150114_3_, final int p_150114_4_,
+ final int p_150114_5_, final EntityLivingBase entityLiving) {
+ if (!world.isRemote) {
+ if ((p_150114_5_ & 1) == 1) {
+ final EntityPrimedMiningExplosive EntityPrimedMiningExplosive = new EntityPrimedMiningExplosive(
+ world,
+ p_150114_2_ + 0.5F,
+ p_150114_3_ + 0.5F,
+ p_150114_4_ + 0.5F,
+ entityLiving);
+ world.spawnEntityInWorld(EntityPrimedMiningExplosive);
+ world.playSoundAtEntity(EntityPrimedMiningExplosive, "game.tnt.primed", 1.0F, 1.0F);
+ }
+ }
+ }
+
+ /**
+ * 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 clickingPlayer, final int p_149727_6_, final float p_149727_7_, final float p_149727_8_,
+ final float p_149727_9_) {
+ if ((clickingPlayer.getCurrentEquippedItem() != null) && (clickingPlayer.getCurrentEquippedItem()
+ .getItem() == Items.flint_and_steel)) {
+ this.func_150114_a(world, x, y, z, 1, clickingPlayer);
+ world.setBlockToAir(x, y, z);
+ clickingPlayer.getCurrentEquippedItem()
+ .damageItem(1, clickingPlayer);
+ return true;
+ } else {
+ return super.onBlockActivated(
+ world,
+ x,
+ y,
+ z,
+ clickingPlayer,
+ p_149727_6_,
+ p_149727_7_,
+ p_149727_8_,
+ p_149727_9_);
+ }
+ }
+
+ /**
+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
+ */
+ @Override
+ public void onEntityCollidedWithBlock(final World world, final int x, final int y, final int z,
+ final Entity entityTriggering) {
+ if ((entityTriggering instanceof final EntityArrow entityarrow) && !world.isRemote) {
+
+ if (entityarrow.isBurning()) {
+ this.func_150114_a(
+ world,
+ x,
+ y,
+ z,
+ 1,
+ entityarrow.shootingEntity instanceof EntityLivingBase
+ ? (EntityLivingBase) entityarrow.shootingEntity
+ : null);
+ world.setBlockToAir(x, y, z);
+ }
+ }
+ }
+
+ /**
+ * Return whether this block can drop from an explosion.
+ */
+ @Override
+ public boolean canDropFromExplosion(final Explosion bang) {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister iconRegister) {
+ this.blockIcon = iconRegister.registerIcon(GTPlusPlus.ID + ":" + "chrono/" + "MetalSheet2");
+ this.textureTop = iconRegister.registerIcon(GTPlusPlus.ID + ":" + "chrono/" + "MetalFunnel");
+ this.textureBottom = iconRegister.registerIcon(GTPlusPlus.ID + ":" + "chrono/" + "MetalPanel");
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java b/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java
new file mode 100644
index 0000000000..7e64f19bf3
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java
@@ -0,0 +1,161 @@
+package gtPlusPlus.core.block.general.antigrief;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+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.boss.EntityDragon;
+import net.minecraft.entity.boss.EntityWither;
+import net.minecraft.entity.boss.IBossDisplayData;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+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.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.util.Utils;
+
+public class BlockWitherProof extends Block {
+
+ public BlockWitherProof() {
+ super(Material.redstoneLight);
+ this.setBlockName(Utils.sanitizeString("blockBlackGate"));
+ this.setBlockTextureName(GTPlusPlus.ID + ":" + "blockFrameGt");
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setHardness(-1F);
+ this.setResistance(5000.0F);
+ this.setHarvestLevel("pickaxe", 3);
+ this.setStepSound(soundTypeMetal);
+ GameRegistry.registerBlock(this, Utils.sanitizeString("blockBlackGate"));
+ }
+
+ @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) {
+ if ((entity == null) || !entity.isEntityAlive()) {
+ return false;
+ }
+ if ((entity instanceof EntityWither) || (entity instanceof EntityDragon)
+ || (entity instanceof IBossDisplayData)) {
+ return false;
+ } else {
+ return super.canEntityDestroy(world, x, y, z, entity);
+ }
+ }
+
+ // 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 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_);
+ }
+
+ @Override
+ public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World p_149737_2_, int p_149737_3_,
+ int p_149737_4_, int p_149737_5_) {
+ if (aPlayer != null && aPlayer instanceof EntityPlayerMP) {
+ return 1f;
+ }
+ return -1f;
+ }
+
+ @Override
+ public float getExplosionResistance(Entity p_149638_1_) {
+ return Float.MAX_VALUE;
+ }
+
+ @Override
+ public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_,
+ EntityPlayer p_149699_5_) {
+ super.onBlockClicked(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_, p_149699_5_);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
+ if ((entity == null) || !entity.isEntityAlive()) {
+ return;
+ }
+ if ((entity instanceof EntityWither) || (entity instanceof EntityDragon)
+ || (entity instanceof IBossDisplayData)) {
+ return;
+ } else {
+ super.onEntityCollidedWithBlock(world, x, y, z, entity);
+ }
+ }
+
+ @Override
+ public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_,
+ int p_149636_5_, int p_149636_6_) {
+ super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
+ }
+
+ @Override
+ public boolean canHarvestBlock(EntityPlayer player, int meta) {
+ if (player != null && player instanceof EntityPlayerMP) {
+ return true;
+ }
+ return super.canHarvestBlock(player, meta);
+ }
+
+ @Override
+ public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX,
+ double explosionY, double explosionZ) {
+ return Float.MAX_VALUE;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/general/fluids/BlockFluidSludge.java b/src/main/java/gtPlusPlus/core/block/general/fluids/BlockFluidSludge.java
new file mode 100644
index 0000000000..200f85d31d
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/general/fluids/BlockFluidSludge.java
@@ -0,0 +1,68 @@
+package gtPlusPlus.core.block.general.fluids;
+
+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.util.IIcon;
+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;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+
+public class BlockFluidSludge extends BlockFluidClassic {
+
+ @SideOnly(Side.CLIENT)
+ protected IIcon stillIcon;
+
+ @SideOnly(Side.CLIENT)
+ protected IIcon flowingIcon;
+
+ public BlockFluidSludge(final Fluid fluid, final Material material) {
+ super(fluid, material);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ }
+
+ @Override
+ public IIcon getIcon(final int ordinalSide, final int meta) {
+ return ((ordinalSide == 0) || (ordinalSide == 1)) ? this.stillIcon : this.flowingIcon;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(final IIconRegister register) {
+ this.stillIcon = register.registerIcon(GTPlusPlus.ID + ":fluids/fluid.jackdaniels");
+ this.flowingIcon = register.registerIcon(GTPlusPlus.ID + ":fluids/fluid.jackdaniels");
+ }
+
+ @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 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/CircuitProgrammer.java b/src/main/java/gtPlusPlus/core/block/machine/CircuitProgrammer.java
new file mode 100644
index 0000000000..f6cd34aec1
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/machine/CircuitProgrammer.java
@@ -0,0 +1,153 @@
+package gtPlusPlus.core.block.machine;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+
+import gregtech.common.items.GT_MetaGenerated_Tool_01;
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.api.objects.minecraft.CubicObject;
+import gtPlusPlus.core.block.base.BasicTileBlockWithTooltip;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.handler.GuiHandler;
+import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+
+public class CircuitProgrammer extends BasicTileBlockWithTooltip {
+
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 4;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ public CircuitProgrammer() {
+ super(Material.iron);
+ }
+
+ /**
+ * 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;
+ } 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 TileEntityCircuitProgrammer tile = (TileEntityCircuitProgrammer) world.getTileEntity(x, y, z);
+ if (tile != null) {
+ mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z);
+ }
+ }
+ } catch (final Throwable t) {}
+
+ if (!mDidScrewDriver) {
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityCircuitProgrammer)) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI8, world, x, y, z);
+ return true;
+ }
+ } else {
+ 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 TileEntityCircuitProgrammer();
+ }
+
+ @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 onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity,
+ final ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityCircuitProgrammer) 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 getMetaCount() {
+ return 0;
+ }
+
+ @Override
+ public String getUnlocalBlockName() {
+ return "blockCircuitProgrammer";
+ }
+
+ @Override
+ protected float initBlockHardness() {
+ return 5f;
+ }
+
+ @Override
+ protected float initBlockResistance() {
+ return 1f;
+ }
+
+ @Override
+ protected CreativeTabs initCreativeTab() {
+ return AddToCreativeTab.tabMachines;
+ }
+
+ @Override
+ protected String getTileEntityName() {
+ return "Circuit Programmer";
+ }
+
+ @Override
+ public CubicObject<String>[] getCustomTextureDirectoryObject() {
+ String[] aTexData = new String[] { GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_METAL_PANEL_G",
+ GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_TECH_PANEL_B",
+ GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
+ GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
+ GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I",
+ GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_METAL_PANEL_I" };
+ CubicObject<String>[] aTextureData = new CubicObject[] { new CubicObject<>(aTexData) };
+ return aTextureData;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/DecayablesChest.java b/src/main/java/gtPlusPlus/core/block/machine/DecayablesChest.java
new file mode 100644
index 0000000000..c333e7a5ca
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/machine/DecayablesChest.java
@@ -0,0 +1,186 @@
+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.client.renderer.RenderDecayChest;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.handler.GuiHandler;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile;
+import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest;
+import gtPlusPlus.core.util.minecraft.InventoryUtils;
+
+public class DecayablesChest 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 = 5;
+
+ public final int field_149956_a = 0;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ public DecayablesChest() {
+ super(Material.iron);
+ this.setBlockName("blockDecayablesChest");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setHardness(5f);
+ this.setResistance(1f);
+ GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockDecayablesChest");
+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
+ }
+
+ /**
+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
+ */
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ /**
+ * 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
+ @SideOnly(Side.CLIENT)
+ public int getRenderType() {
+ try {
+ if (RenderDecayChest.INSTANCE != null) {
+ return RenderDecayChest.INSTANCE.mRenderID;
+ }
+ return super.getRenderType();
+ } catch (NullPointerException n) {
+ return 0;
+ }
+ }
+
+ /**
+ * Updates the blocks bounds based on its current state. Args: world, x, y, z
+ */
+ @Override
+ public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_,
+ int p_149719_4_) {
+ if (p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ - 1) == this) {
+ this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F);
+ } else if (p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ + 1) == this) {
+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F);
+ } else if (p_149719_1_.getBlock(p_149719_2_ - 1, p_149719_3_, p_149719_4_) == this) {
+ this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
+ } else if (p_149719_1_.getBlock(p_149719_2_ + 1, p_149719_3_, p_149719_4_) == this) {
+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F);
+ } else {
+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
+ }
+ }
+
+ /**
+ * 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 : this.textureFront);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "DecayablesChest_top");
+ this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "DecayablesChest_top");
+ this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "DecayablesChest_side");
+ this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "DecayablesChest_bottom");
+ }
+
+ /**
+ * 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 TileEntityDecayablesChest)) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI13, world, x, y, z);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 1;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityDecayablesChest();
+ }
+
+ @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()) {
+ ((TileEntityDecayablesChest) 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/FishTrap.java b/src/main/java/gtPlusPlus/core/block/machine/FishTrap.java
new file mode 100644
index 0000000000..0ec1ac629a
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/machine/FishTrap.java
@@ -0,0 +1,136 @@
+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.item.base.itemblock.ItemBlockBasicTile;
+import gtPlusPlus.core.tileentities.general.TileEntityFishTrap;
+import gtPlusPlus.core.util.minecraft.InventoryUtils;
+
+public class FishTrap 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 = 0;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ public FishTrap() {
+ super(Material.iron);
+ this.setBlockName("blockFishTrap");
+ this.setHardness(5f);
+ this.setResistance(1f);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockFishTrap");
+ }
+
+ /**
+ * 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/" + "fishtrap");
+ this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "fishtrap");
+ this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "fishtrap");
+ this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "fishtrap");
+ }
+
+ /**
+ * 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 TileEntityFishTrap)) {
+ player.openGui(GTplusplus.instance, 5, world, x, y, z);
+ 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 TileEntityFishTrap();
+ }
+
+ @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()) {
+ ((TileEntityFishTrap) 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/Machine_PestKiller.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_PestKiller.java
new file mode 100644
index 0000000000..bf98a22500
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_PestKiller.java
@@ -0,0 +1,137 @@
+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.machines.TileEntityPestKiller;
+import gtPlusPlus.core.util.minecraft.InventoryUtils;
+
+public class Machine_PestKiller 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 = 6;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ public Machine_PestKiller() {
+ super(Material.wood);
+ this.setBlockName("blockPestKiller");
+ this.setHardness(5f);
+ this.setResistance(1f);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockPestKiller");
+ }
+
+ /**
+ * 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 : this.textureFront);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_
+ .registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "MACHINE_CASING_FARM_MANAGER_STRUCTURAL");
+ this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "MACHINE_PESTKILLER_TOP");
+ this.textureBottom = p_149651_1_.registerIcon("planks_acacia");
+ this.textureFront = p_149651_1_
+ .registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "MACHINE_CASING_FARM_MANAGER_STRUCTURAL");
+ }
+
+ /**
+ * 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 TileEntityPestKiller)) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI15, world, x, y, z);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 0;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityPestKiller();
+ }
+
+ @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()) {
+ ((TileEntityPestKiller) 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/Machine_PooCollector.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_PooCollector.java
new file mode 100644
index 0000000000..4f1b679fcf
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_PooCollector.java
@@ -0,0 +1,177 @@
+package gtPlusPlus.core.block.machine;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import java.util.List;
+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.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+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 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.ItemBlockMeta;
+import gtPlusPlus.core.tileentities.machines.TileEntityAdvPooCollector;
+import gtPlusPlus.core.tileentities.machines.TileEntityBaseFluidCollector;
+import gtPlusPlus.core.tileentities.machines.TileEntityPooCollector;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+
+public class Machine_PooCollector extends BlockContainer {
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop2;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureSide;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon textureSide2;
+
+ public Machine_PooCollector() {
+ super(Material.iron);
+ this.setHardness(5f);
+ this.setResistance(1f);
+ this.setBlockName("blockPooCollector");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockPooCollector");
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int ordinalSide, final int aMeta) {
+ if (aMeta <= 7) {
+ blockIcon = textureSide;
+ return ordinalSide <= 1 ? this.textureTop : this.textureSide;
+ } else {
+ blockIcon = textureSide2;
+ return ordinalSide <= 1 ? this.textureTop2 : this.textureSide2;
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "sewer_top");
+ this.textureTop2 = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "sewer_adv_top");
+ this.textureSide = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "sewer_sides");
+ this.textureSide2 = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "sewer_adv_sides");
+ }
+
+ /**
+ * 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;
+ } else {
+ TileEntityBaseFluidCollector tank = (TileEntityBaseFluidCollector) world.getTileEntity(x, y, z);
+ if (tank != null) {
+ Item handItem;
+ try {
+ handItem = player.getHeldItem()
+ .getItem();
+ } catch (Throwable t) {
+ handItem = null;
+ }
+
+ // Fluid container code
+ /*
+ * if (handItem != null && (handItem instanceof IFluidContainerItem || handItem instanceof
+ * ItemFluidContainer || FluidContainerRegistry.isFilledContainer(player.getHeldItem()))) { if
+ * (tank.tank.getFluid() == null) { try { if
+ * (!FluidContainerRegistry.isFilledContainer(player.getHeldItem())) { ItemStack handItemStack =
+ * player.getHeldItem(); IFluidContainerItem container = (IFluidContainerItem) handItem; FluidStack
+ * containerFluid = container.getFluid(handItemStack); container.drain(handItemStack,
+ * container.getFluid(handItemStack).amount, true); tank.tank.setFluid(containerFluid); } else {
+ * ItemStack handItemStack = player.getHeldItem();
+ * FluidContainerRegistry.drainFluidContainer(handItemStack); FluidStack containerFluid =
+ * FluidContainerRegistry.getFluidForFilledItem(handItemStack); ItemStack emptyContainer =
+ * FluidContainerRegistry.drainFluidContainer(handItemStack); player.setItemInUse(emptyContainer, 0);
+ * tank.tank.setFluid(containerFluid); } } catch (Throwable t) { t.printStackTrace(); } } }
+ */
+
+ if (!tank.mInventory.isEmpty()) {
+ PlayerUtils.messagePlayer(player, "Inventory contains:");
+ PlayerUtils.messagePlayer(player, ItemUtils.getArrayStackNames(tank.mInventory.getRealInventory()));
+ } else {
+ PlayerUtils.messagePlayer(player, "No solids collected yet.");
+ }
+ if (tank.tank.getFluid() != null) {
+ PlayerUtils.messagePlayer(
+ player,
+ "Tank contains " + tank.tank.getFluidAmount()
+ + "L of "
+ + tank.tank.getFluid()
+ .getLocalizedName());
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 0;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return super.isOpaqueCube();
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int aMeta) {
+ return aMeta <= 7 ? new TileEntityPooCollector() : new TileEntityAdvPooCollector();
+ }
+
+ @Override
+ public void onBlockAdded(World world, int x, int y, int z) {
+ super.onBlockAdded(world, x, y, z);
+ }
+
+ @Override
+ public int getBlockColor() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int damageDropped(final int damage) {
+ return damage;
+ }
+
+ @Override
+ public Item getItemDropped(final int meta, final Random rand, final int fortune) {
+ return Item.getItemFromBlock(this);
+ }
+
+ @Override
+ public int getRenderColor(int aMeta) {
+ return super.getRenderColor(aMeta);
+ }
+
+ @Override
+ public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) {
+ aList.add(new ItemStack(aItem, 1, 0));
+ aList.add(new ItemStack(aItem, 1, 8));
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java
new file mode 100644
index 0000000000..4f0d0d7d60
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java
@@ -0,0 +1,160 @@
+package gtPlusPlus.core.block.machine;
+
+import static gregtech.api.enums.Mods.BuildCraftCore;
+import static gregtech.api.enums.Mods.EnderIO;
+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.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.Optional;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.Mods;
+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.TileEntityProjectTable;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import ic2.core.item.tool.ItemToolWrench;
+
+@Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = Mods.Names.ENDER_I_O)
+public class Machine_ProjectTable 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 = 3;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ public Machine_ProjectTable() {
+ super(Material.iron);
+ this.setBlockName("blockProjectBench");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockProjectBench");
+ }
+
+ /**
+ * 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/" + "machine_top");
+ this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "cover_crafting");
+ this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "machine_top");
+ this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "machine_top");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player,
+ final int side, final float lx, final float ly, final float lz) {
+
+ ItemStack heldItem = null;
+ if (world.isRemote) {
+ heldItem = PlayerUtils.getItemStackInPlayersHand();
+ }
+
+ boolean holdingWrench = false;
+
+ if (heldItem != null) {
+ holdingWrench = isWrench(heldItem);
+ }
+
+ if (world.isRemote) {
+ return true;
+ }
+
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if (te instanceof TileEntityProjectTable) {
+ if (!holdingWrench) {
+ player.openGui(GTplusplus.instance, 0, world, x, y, z);
+ return true;
+ }
+ Logger.INFO("Holding a Wrench, doing wrench things instead.");
+ }
+ return false;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityProjectTable();
+ }
+
+ public static boolean isWrench(final ItemStack item) {
+ if (item.getItem() instanceof ItemToolWrench) {
+ return true;
+ }
+ if (BuildCraftCore.isModLoaded()) {
+ return checkBuildcraftWrench(item);
+ }
+ if (EnderIO.isModLoaded()) {
+ return checkEnderIOWrench(item);
+ }
+ return false;
+ }
+
+ private static boolean checkEnderIOWrench(final ItemStack item) {
+ if (ReflectionUtils.doesClassExist("crazypants.enderio.api.tool.ITool")) {
+ Class<?> wrenchClass;
+ wrenchClass = ReflectionUtils.getClass("crazypants.enderio.api.tool.ITool");
+ if (wrenchClass.isInstance(item.getItem())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static boolean checkBuildcraftWrench(final ItemStack item) {
+ if (ReflectionUtils.doesClassExist("buildcraft.api.tools.IToolWrench")) {
+ Class<?> wrenchClass;
+ wrenchClass = ReflectionUtils.getClass("buildcraft.api.tools.IToolWrench");
+ if (wrenchClass.isInstance(item.getItem())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @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_SuperJukebox.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java
new file mode 100644
index 0000000000..470fa98a9b
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java
@@ -0,0 +1,558 @@
+package gtPlusPlus.core.block.machine;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockJukebox;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.ISidedInventory;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemRecord;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+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 gregtech.api.util.GT_Utility;
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.handler.GuiHandler;
+import gtPlusPlus.core.inventories.Inventory_SuperJukebox;
+import gtPlusPlus.core.util.math.MathUtils;
+
+public class Machine_SuperJukebox extends BlockJukebox {
+
+ @SideOnly(Side.CLIENT)
+ private IIcon mIcon;
+
+ public Machine_SuperJukebox() {
+ this.setBlockName("blockSuperJukebox");
+ this.setCreativeTab(CreativeTabs.tabRedstone);
+ setHardness(2.0F);
+ setResistance(10.0F);
+ setStepSound(soundTypePiston);
+ setBlockTextureName("jukebox");
+ GameRegistry.registerBlock(this, "blockSuperJukebox");
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(int ordinalSide, int aMeta) {
+ return ordinalSide == 1 ? this.mIcon : this.blockIcon;
+ }
+
+ /**
+ * 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 TileEntitySuperJukebox)) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI14, world, x, y, z);
+ return true;
+ }
+ return false;
+
+ /*
+ * if (aWorld.getBlockMetadata(aX, aY, aZ) == 0) { return false; } else { this.func_149925_e(aWorld, aX, aY,
+ * aZ); return true; }
+ */
+ }
+
+ /**
+ * Set the record in the {@link SuperJukebox} {@link TileEntity}.
+ */
+ @Override
+ public final void func_149926_b(World aWorld, int aX, int aY, int aZ, ItemStack aStackToSet) {
+ setRecordInJukeBox(aWorld, aX, aY, aZ, aStackToSet);
+ }
+
+ public void setRecordInJukeBox(World aWorld, int aX, int aY, int aZ, ItemStack aStackToSet) {
+ if (!aWorld.isRemote) {
+ TileEntitySuperJukebox tileentityjukebox = (TileEntitySuperJukebox) aWorld.getTileEntity(aX, aY, aZ);
+ if (tileentityjukebox != null && aStackToSet.getItem() instanceof ItemRecord) {
+ tileentityjukebox.setCurrentRecord(aStackToSet.copy());
+ // aWorld.setBlockMetadataWithNotify(aX, aY, aZ, 1, 2);
+ }
+ }
+ }
+
+ /**
+ * Function to handle playing of records.
+ */
+ @Override
+ public final void func_149925_e(World aWorld, int aX, int aY, int aZ) {
+ playJukeboxRecord(aWorld, aX, aY, aZ);
+ }
+
+ public void playJukeboxRecord(World aWorld, int aX, int aY, int aZ) {
+ if (!aWorld.isRemote) {
+ TileEntitySuperJukebox tileentityjukebox = (TileEntitySuperJukebox) aWorld.getTileEntity(aX, aY, aZ);
+
+ if (tileentityjukebox != null) {
+ ItemStack itemstack = tileentityjukebox.func_145856_a();
+
+ if (itemstack != null) {
+
+ aWorld.playAuxSFX(1005, aX, aY, aZ, Item.getIdFromItem(itemstack.getItem()));
+ /*
+ * float f = 0.7F; double d0 = (double) (aWorld.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
+ * double d1 = (double) (aWorld.rand.nextFloat() * f) + (double) (1.0F - f) * 0.2D + 0.6D; double d2
+ * = (double) (aWorld.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; ItemStack itemstack1 =
+ * itemstack.copy(); EntityItem entityitem = new EntityItem(aWorld, (double) aX + d0, (double) aY +
+ * d1, (double) aZ + d2, itemstack1); entityitem.delayBeforeCanPickup = 10;
+ * aWorld.spawnEntityInWorld(entityitem);
+ */
+ }
+ }
+ }
+ }
+
+ @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_) {
+ this.func_149925_e(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_);
+ super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
+ }
+
+ /**
+ * Drops the block items with a specified chance of dropping the specified items
+ */
+ @Override
+ public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_,
+ int p_149690_5_, float p_149690_6_, int p_149690_7_) {
+ if (!p_149690_1_.isRemote) {
+ super.dropBlockAsItemWithChance(
+ p_149690_1_,
+ p_149690_2_,
+ p_149690_3_,
+ p_149690_4_,
+ p_149690_5_,
+ p_149690_6_,
+ 0);
+ }
+ }
+
+ /**
+ * Returns a new instance of a block's tile entity class. Called on placing the block.
+ */
+ @Override
+ public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
+ return new TileEntitySuperJukebox();
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(IIconRegister p_149651_1_) {
+ this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side");
+ this.mIcon = p_149651_1_.registerIcon(this.getTextureName() + "_top");
+ }
+
+ public static class TileEntitySuperJukebox extends TileEntityJukebox implements ISidedInventory {
+
+ /** The number of players currently using this chest */
+ public int numPlayersUsing;
+
+ private ItemStack mCurrentlyPlayingStack;
+ private final Inventory_SuperJukebox inventoryContents;
+ private String customName;
+
+ /*
+ * Important Data
+ */
+
+ public int a_TEST_INT_VAR_1;
+ public int a_TEST_INT_VAR_2;
+ public int a_TEST_INT_VAR_3;
+ public int a_TEST_INT_VAR_4;
+
+ public boolean mIsPlaying = false;
+ public boolean mIsLooping = false;
+ public boolean a_TEST_BOOL_VAR_3;
+ public boolean a_TEST_BOOL_VAR_4;
+
+ public TileEntitySuperJukebox() {
+ this.inventoryContents = new Inventory_SuperJukebox();
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound aNBT) {
+ super.readFromNBT(aNBT);
+
+ if (aNBT.hasKey("RecordItem", 10)) {
+ this.func_145857_a(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("RecordItem")));
+ } else if (aNBT.getInteger("Record") > 0) {
+ this.func_145857_a(new ItemStack(Item.getItemById(aNBT.getInteger("Record")), 1, 0));
+ }
+
+ this.inventoryContents.readFromNBT(aNBT.getCompoundTag("ContentsChest"));
+ if (aNBT.hasKey("CustomName", 8)) {
+ this.setCustomName(aNBT.getString("CustomName"));
+ }
+
+ mIsPlaying = aNBT.getBoolean("mIsPlaying");
+ mIsLooping = aNBT.getBoolean("mIsLooping");
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound aNBT) {
+ super.writeToNBT(aNBT);
+
+ if (this.getCurrentRecord() != null) {
+ aNBT.setTag(
+ "RecordItem",
+ this.func_145856_a()
+ .writeToNBT(new NBTTagCompound()));
+ aNBT.setInteger(
+ "Record",
+ Item.getIdFromItem(
+ this.func_145856_a()
+ .getItem()));
+ }
+
+ final NBTTagCompound chestData = new NBTTagCompound();
+ this.inventoryContents.writeToNBT(chestData);
+ aNBT.setTag("ContentsChest", chestData);
+ if (this.hasCustomInventoryName()) {
+ aNBT.setString("CustomName", this.getCustomName());
+ }
+
+ aNBT.setBoolean("mIsPlaying", mIsPlaying);
+ aNBT.setBoolean("mIsLooping", mIsLooping);
+ }
+
+ /**
+ * Called to get the internal stack
+ */
+ @Override
+ public ItemStack func_145856_a() {
+ return this.mCurrentlyPlayingStack;
+ }
+
+ /**
+ * Called to get the internal stack, wraps vanilla function {@link func_145856_a}.
+ */
+ public ItemStack getCurrentRecord() {
+ return func_145856_a();
+ }
+
+ /**
+ * Called to set the internal stack
+ */
+ @Override
+ public void func_145857_a(ItemStack p_145857_1_) {
+ this.mCurrentlyPlayingStack = p_145857_1_;
+ this.markDirty();
+ }
+
+ /**
+ * Called to set the internal stack, wraps vanilla function {@link func_145857_a}.
+ */
+ public void setCurrentRecord(ItemStack aStack) {
+ func_145857_a(aStack);
+ this.markDirty();
+ }
+
+ public Inventory_SuperJukebox getInventory() {
+ return this.inventoryContents;
+ }
+
+ public boolean playRecord(ItemStack aRecord) {
+
+ return false;
+ }
+
+ public boolean stopRecord() {
+ return openDiscDrive();
+ }
+
+ public void setLoopState(boolean isShufflingForever) {}
+
+ // Play button pressed
+ public boolean jukeboxLogicUpdate() {
+
+ if (this.worldObj.isRemote) {
+ return true;
+ }
+
+ Logger.INFO("a");
+ if (this.mIsPlaying || this.mIsLooping) {
+ return selectRecordToPlayFromInventoryAndSetViaVanillaHandler();
+ } else {
+ return stopRecord();
+ }
+ }
+
+ // Determine which record to play
+ public boolean selectRecordToPlayFromInventoryAndSetViaVanillaHandler() {
+ AutoMap<ItemStack> mValidRecords = new AutoMap<>();
+ for (ItemStack g : this.getInventory()
+ .getInventory()) {
+ if (g != null) {
+ if (g.getItem() instanceof ItemRecord) {
+ mValidRecords.put(g);
+ }
+ }
+ }
+
+ Logger.INFO("b1");
+ // Select First Record
+ ItemStack aRecordToPlay;
+ if (mValidRecords.size() == 0) {
+ Logger.INFO("bX");
+ return false;
+ } else {
+ aRecordToPlay = mValidRecords.get(!mIsLooping ? 0 : MathUtils.randInt(0, (mValidRecords.size() - 1)));
+ }
+ Logger.INFO("b2 - " + aRecordToPlay.getDisplayName());
+
+ int aSlotCounter = 0;
+ for (ItemStack g : this.getInventory()
+ .getInventory()) {
+ if (g != null && aSlotCounter <= 17) {
+ Logger.INFO("b3 - " + g.getDisplayName());
+ if (GT_Utility.areStacksEqual(g, aRecordToPlay, true)) {
+ IInventory aThisInv = this.getInventory();
+ if (aThisInv.getStackInSlot(20) != null) {
+ openDiscDrive();
+ }
+
+ GT_Utility.moveStackFromSlotAToSlotB(
+ aThisInv,
+ aThisInv,
+ aSlotCounter,
+ 20,
+ (byte) 1,
+ (byte) 1,
+ (byte) 1,
+ (byte) 1);
+ setCurrentRecord(aThisInv.getStackInSlot(20));
+
+ World aWorld = this.worldObj;
+ int aX = this.xCoord;
+ int aY = this.yCoord;
+ int aZ = this.zCoord;
+ if (!aWorld.isRemote) {
+ aRecordToPlay = this.func_145856_a();
+ if (aRecordToPlay != null) {
+ aWorld.playAuxSFX(1005, aX, aY, aZ, Item.getIdFromItem(aRecordToPlay.getItem()));
+ this.markDirty();
+ return true;
+ }
+ }
+
+ Logger.INFO("b++");
+ this.markDirty();
+ return false;
+ }
+ }
+ aSlotCounter++;
+ }
+
+ Logger.INFO("b4");
+ this.markDirty();
+ return false;
+ }
+
+ public boolean genericMethodThree(Object a1, Object a2, Object a3, Object a4) {
+ return false;
+ }
+
+ public void vanillaStopJukebox() {
+ World aWorld = this.worldObj;
+ int aX = this.xCoord;
+ int aY = this.yCoord;
+ int aZ = this.zCoord;
+ if (!aWorld.isRemote) {
+ TileEntitySuperJukebox tileentityjukebox = (TileEntitySuperJukebox) aWorld.getTileEntity(aX, aY, aZ);
+ if (tileentityjukebox != null) {
+ ItemStack aRecordToPlay = tileentityjukebox.func_145856_a();
+ if (aRecordToPlay != null) {
+ aWorld.playAuxSFX(1005, aX, aY, aZ, 0);
+ aWorld.playRecord((String) null, aX, aY, aZ);
+ tileentityjukebox.func_145857_a((ItemStack) null);
+ this.markDirty();
+ }
+ }
+ }
+ }
+
+ public boolean openDiscDrive() {
+ int aSlotCounter = 17;
+
+ ItemStack g;
+
+ for (int i = 17; i >= 0; i--) {
+ g = this.getInventory()
+ .getInventory()[i];
+ if (g == null && aSlotCounter >= 0) {
+ IInventory aThisInv = this.getInventory();
+ GT_Utility
+ .moveStackFromSlotAToSlotB(aThisInv, aThisInv, 20, i, (byte) 1, (byte) 1, (byte) 1, (byte) 1);
+ vanillaStopJukebox();
+ Logger.INFO("b++");
+ this.markDirty();
+ return true;
+ }
+ }
+
+ /*
+ * for (ItemStack g : this.getInventory().getInventory()) { if (g == null && aSlotCounter >= 0) { IInventory
+ * aThisInv = this.getInventory(); GT_Utility.moveStackFromSlotAToSlotB(aThisInv, aThisInv, 20,
+ * aSlotCounter, (byte) 1, (byte) 1, (byte) 1, (byte) 1); vanillaStopJukebox(); Logger.INFO("b++"); return
+ * true; } aSlotCounter--; }
+ */
+ this.markDirty();
+ return false;
+ }
+
+ 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 int getSizeInventory() {
+ return this.getInventory()
+ .getSizeInventory() - 3;
+ }
+
+ @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 1;
+ }
+
+ @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++;
+ }
+ 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--;
+ }
+ 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) {
+ if (slot >= 18) {
+ return false;
+ }
+ return this.getInventory()
+ .isItemValidForSlot(slot, itemstack);
+ }
+
+ private static final int[] SIDED_SLOTS = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17 };
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ return SIDED_SLOTS;
+ }
+
+ @Override
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
+ if (p_102007_1_ >= 18) {
+ return false;
+ }
+ return this.getInventory()
+ .isItemValidForSlot(p_102007_1_, p_102007_2_);
+ }
+
+ @Override
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
+ if (p_102008_1_ >= 18) {
+ return false;
+ }
+ return this.getInventory()
+ .isItemValidForSlot(p_102008_1_, 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.SuperJukebox";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return (this.customName != null) && !this.customName.equals("");
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java
new file mode 100644
index 0000000000..1bca4a5c5f
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/block/machine/VolumetricFlaskSetter.java
@@ -0,0 +1,157 @@
+package gtPlusPlus.core.block.machine;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+
+import gregtech.common.items.GT_MetaGenerated_Tool_01;
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.api.objects.minecraft.CubicObject;
+import gtPlusPlus.core.block.base.BasicTileBlockWithTooltip;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.handler.GuiHandler;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile;
+import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+
+public class VolumetricFlaskSetter extends BasicTileBlockWithTooltip {
+
+ /**
+ * Determines which tooltip is displayed within the itemblock.
+ */
+ private final int mTooltipID = 8;
+
+ @Override
+ public int getTooltipID() {
+ return this.mTooltipID;
+ }
+
+ @Override
+ public Class<? extends ItemBlock> getItemBlockClass() {
+ return ItemBlockBasicTile.class;
+ }
+
+ public VolumetricFlaskSetter() {
+ super(Material.iron);
+ }
+
+ /**
+ * 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;
+ } 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 TileEntityVolumetricFlaskSetter tile = (TileEntityVolumetricFlaskSetter) world
+ .getTileEntity(x, y, z);
+ if (tile != null) {
+ mDidScrewDriver = tile.onScrewdriverRightClick((byte) side, player, x, y, z);
+ }
+ }
+ } catch (final Throwable t) {}
+
+ if (!mDidScrewDriver) {
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityVolumetricFlaskSetter aTile)) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI18, world, x, y, z);
+ // new Packet_VolumetricFlaskGui2(aTile, aTile.getCustomValue());
+ return true;
+ }
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int getRenderBlockPass() {
+ return 0;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
+ return new TileEntityVolumetricFlaskSetter();
+ }
+
+ @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 onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity,
+ final ItemStack stack) {
+ if (stack.hasDisplayName()) {
+ ((TileEntityVolumetricFlaskSetter) 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 getMetaCount() {
+ return 0;
+ }
+
+ @Override
+ public String getUnlocalBlockName() {
+ return "blockVolumetricFlaskSetter";
+ }
+
+ @Override
+ protected float initBlockHardness() {
+ return 5f;
+ }
+
+ @Override
+ protected float initBlockResistance() {
+ return 1f;
+ }
+
+ @Override
+ protected CreativeTabs initCreativeTab() {
+ return AddToCreativeTab.tabMachines;
+ }
+
+ @Override
+ protected String getTileEntityName() {
+ return "Volumetric Flask Configurator";
+ }
+
+ @Override
+ public CubicObject<String>[] getCustomTextureDirectoryObject() {
+ String[] aTexData = new String[] { GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_METAL_PANEL_A",
+ GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_TECH_PANEL_C",
+ GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
+ GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
+ GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H",
+ GTPlusPlus.ID + ":" + "metro/" + "TEXTURE_METAL_PANEL_H" };
+ CubicObject<String>[] aTextureData = new CubicObject[] { new CubicObject<>(aTexData) };
+ return aTextureData;
+ }
+}