diff --git a/dependencies.gradle b/dependencies.gradle index 91e7d8fc0d..8cd48f764c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ dependencies { api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.158:dev') - api("com.github.GTNewHorizons:bartworks:0.7.30:dev") + api("com.github.GTNewHorizons:bartworks:0.7.41:dev") implementation('curse.maven:cofh-core-69162:2388751') // https://www.curseforge.com/minecraft/mc-mods/advancedsolarpanels diff --git a/src/main/java/gtPlusPlus/GTplusplus.java b/src/main/java/gtPlusPlus/GTplusplus.java index a326a3d050..9d4e041bbb 100644 --- a/src/main/java/gtPlusPlus/GTplusplus.java +++ b/src/main/java/gtPlusPlus/GTplusplus.java @@ -46,11 +46,8 @@ import gtPlusPlus.core.handler.MobMentality; import gtPlusPlus.core.handler.PacketHandler; import gtPlusPlus.core.handler.Recipes.RegistrationHandler; -import gtPlusPlus.core.handler.events.BlockEventHandler; import gtPlusPlus.core.handler.events.LoginEventHandler; import gtPlusPlus.core.handler.events.MissingMappingsEvent; -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.item.general.ItemGiantEgg; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; @@ -138,7 +135,6 @@ public final synchronized void setPhaseActive(boolean aIsPhaseActive) { public static void loadTextures() { Logger.INFO("Loading some textures on the client."); // Tools - Logger.WARNING("Processing texture: " + TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile().getResourcePath()); Logger.WARNING("Processing texture: " + TexturesGtTools.ANGLE_GRINDER.getTextureFile().getResourcePath()); Logger.WARNING("Processing texture: " + TexturesGtTools.ELECTRIC_SNIPS.getTextureFile().getResourcePath()); Logger.WARNING("Processing texture: " + TexturesGtTools.ELECTRIC_LIGHTER.getTextureFile().getResourcePath()); @@ -214,9 +210,6 @@ public void postInit(final FMLPostInitializationEvent event) { Meta_GT_Proxy.postInit(); Core_Manager.postInit(); - ItemGiantEgg.postInit(ModItems.itemBigEgg); - BlockEventHandler.init(); - Logger.INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Logger.INFO( "| Recipes succesfully Loaded: " + RegistrationHandler.recipesSuccess diff --git a/src/main/java/gtPlusPlus/core/block/ModBlocks.java b/src/main/java/gtPlusPlus/core/block/ModBlocks.java index 9957ae3f92..5058ac51cd 100644 --- a/src/main/java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/main/java/gtPlusPlus/core/block/ModBlocks.java @@ -1,37 +1,24 @@ package gtPlusPlus.core.block; import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraftforge.fluids.Fluid; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.general.BlockCompressedObsidian; -import gtPlusPlus.core.block.general.BlockNet; -import gtPlusPlus.core.block.general.BlockTankXpConverter; -import gtPlusPlus.core.block.general.FirePit; import gtPlusPlus.core.block.general.FluidTankInfinite; import gtPlusPlus.core.block.general.HellFire; import gtPlusPlus.core.block.general.LightGlass; import gtPlusPlus.core.block.general.MiningExplosives; -import gtPlusPlus.core.block.general.PlayerDoors; import gtPlusPlus.core.block.general.antigrief.BlockWitherProof; -import gtPlusPlus.core.block.general.redstone.BlockGenericRedstoneDetector; -import gtPlusPlus.core.block.general.redstone.BlockGenericRedstoneTest; import gtPlusPlus.core.block.machine.CircuitProgrammer; import gtPlusPlus.core.block.machine.DecayablesChest; -import gtPlusPlus.core.block.machine.EggBox; import gtPlusPlus.core.block.machine.FishTrap; -import gtPlusPlus.core.block.machine.HeliumGenerator; -import gtPlusPlus.core.block.machine.Machine_ModularityTable; import gtPlusPlus.core.block.machine.Machine_PestKiller; import gtPlusPlus.core.block.machine.Machine_PooCollector; import gtPlusPlus.core.block.machine.Machine_ProjectTable; import gtPlusPlus.core.block.machine.Machine_RoundRobinator; import gtPlusPlus.core.block.machine.Machine_SuperJukebox; -import gtPlusPlus.core.block.machine.Machine_TradeTable; import gtPlusPlus.core.block.machine.VolumetricFlaskSetter; -import gtPlusPlus.core.block.machine.bedrock.Mining_Head_Fake; -import gtPlusPlus.core.block.machine.bedrock.Mining_Pipe_Fake; import gtPlusPlus.core.fluids.FluidRegistryHandler; public final class ModBlocks { @@ -39,18 +26,9 @@ public final class ModBlocks { public static Block blockRoundRobinator; public static Block blockCircuitProgrammer; public static Block blockVolumetricFlaskSetter; - public static Block blockFakeMiningPipe; - public static Block blockFakeMiningHead; public static Block blockFishTrap; public static Block blockDecayablesChest; - public static Block blockEggBox; - - // Blocks - // public static Block blockBloodSteel; - // public static Block blockStaballoy; - // WIP TODO public static Block blockToolBuilder; - public static Block blockGriefSaver; public static Block blockCasingsMisc; public static Block blockCasings2Misc; @@ -64,32 +42,18 @@ public final class ModBlocks { public static Block blockCustomMachineCasings; public static Block blockCustomPipeGearCasings; - public static Block blockMetaTileEntity; - public static Block blockHeliumGenerator; - public static Block blockNHG; - public static Block blockCharger; - public static Block MatterFabricatorEffectBlock; public static Fluid fluidSludge = new Fluid("fluid.sludge"); public static Block blockFluidSludge; - public static Block blockFirePit; - - public static Block blockOreFluorite; - public static Block blockMiningExplosive; public static Block blockHellfire; public static Block blockInfiniteFLuidTank; public static Block blockProjectTable; - public static Block blockTradeTable; - public static Block blockModularTable; - public static Block blockWitherGuard; - public static Block blockXpConverter; public static Block blockCompressedObsidian; - public static Block blockNet; public static Block blockPlayerDoorWooden; public static Block blockPlayerDoorIron; @@ -97,8 +61,6 @@ public final class ModBlocks { public static Block blockPlayerDoorCustom_Ice; public static Block blockPlayerDoorCustom_Cactus; - public static Block blockCustomMobSpawner; - public static Block blockCustomSuperLight; public static Block blockCustomJukebox; public static Block blockPooCollector; @@ -120,41 +82,18 @@ public static void registerBlocks() { FluidRegistryHandler.registerFluids(); // Workbench - blockHeliumGenerator = new HeliumGenerator(); - blockFirePit = new FirePit(); blockFishTrap = new FishTrap(); blockInfiniteFLuidTank = new FluidTankInfinite(); blockMiningExplosive = new MiningExplosives(); blockHellfire = new HellFire(); blockProjectTable = new Machine_ProjectTable(); - blockTradeTable = new Machine_TradeTable(); - blockModularTable = new Machine_ModularityTable(); blockWitherGuard = new BlockWitherProof(); - blockXpConverter = new BlockTankXpConverter(); blockCompressedObsidian = new BlockCompressedObsidian(); - blockNet = new BlockNet(); - - blockFakeMiningPipe = new Mining_Pipe_Fake(); - blockFakeMiningHead = new Mining_Head_Fake(); blockCircuitProgrammer = new CircuitProgrammer(); blockDecayablesChest = new DecayablesChest(); - blockEggBox = new EggBox(); - - blockPlayerDoorWooden = new PlayerDoors(Material.wood, "door_wood", true); - blockPlayerDoorIron = new PlayerDoors(Material.iron, "door_iron", true); - blockPlayerDoorCustom_Glass = new PlayerDoors(Material.glass, "door_glass", false); - blockPlayerDoorCustom_Ice = new PlayerDoors(Material.ice, "door_ice", false); - blockPlayerDoorCustom_Cactus = new PlayerDoors( - Material.cactus, - "door_cactus", - false, - 0.6f, - Block.soundTypeGrass, - "Cactus"); - - // blockCustomSuperLight = new BlockSuperLight(); + blockCustomJukebox = new Machine_SuperJukebox(); blockPooCollector = new Machine_PooCollector(); @@ -165,7 +104,5 @@ public static void registerBlocks() { blockVolumetricFlaskSetter = new VolumetricFlaskSetter(); - new BlockGenericRedstoneDetector(); - new BlockGenericRedstoneTest(); } } diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockNet.java b/src/main/java/gtPlusPlus/core/block/general/BlockNet.java deleted file mode 100644 index c462021374..0000000000 --- a/src/main/java/gtPlusPlus/core/block/general/BlockNet.java +++ /dev/null @@ -1,37 +0,0 @@ -package gtPlusPlus.core.block.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.Random; - -import net.minecraft.block.BlockWeb; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.item.ModItems; - -public class BlockNet extends BlockWeb { - - public BlockNet() { - this.setCreativeTab(AddToCreativeTab.tabBlock); - this.setLightOpacity(1); - this.setHardness(4.0F); - this.setBlockName("blockNet"); - GameRegistry.registerBlock(this, "blockNet"); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister iIcon) { - this.blockIcon = iIcon.registerIcon(GTPlusPlus.ID + ":" + "net"); - } - - @Override - public Item getItemDropped(final int p_149650_1_, final Random p_149650_2_, final int p_149650_3_) { - return ModItems.itemRope; - } -} diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java index a9c309d5c7..f62fc50a69 100644 --- a/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java +++ b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java @@ -179,7 +179,6 @@ public void updateLighting(boolean enable) { else if (enable && aLight == 0) { aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj)); if (aBlockGet instanceof BlockAir) { - Logger.INFO("Lit air."); this.worldObj.setBlock( xOff, yOff, @@ -188,7 +187,6 @@ else if (enable && aLight == 0) { 0, 3); } - // aBlockGet.setLightLevel(15); aLitCounter++; } // Turning Lights off diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java b/src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java deleted file mode 100644 index 57b70c1927..0000000000 --- a/src/main/java/gtPlusPlus/core/block/general/BlockTankXpConverter.java +++ /dev/null @@ -1,156 +0,0 @@ -package gtPlusPlus.core.block.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.Random; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.item.base.itemblock.ItemBlockEntityBase; - -public class BlockTankXpConverter extends BlockContainer { - - @SideOnly(Side.CLIENT) - private IIcon textureTop; - - @SideOnly(Side.CLIENT) - private IIcon textureBottom; - - @SideOnly(Side.CLIENT) - private IIcon textureFront; - - public BlockTankXpConverter() { - super(Material.iron); - this.setBlockName("blockTankXpConverter"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, ItemBlockEntityBase.class, "blockTankXpConverter"); - this.generateRainbowMap(); - if (!this.getTickRandomly()) { - this.setTickRandomly(true); - } - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final int ordinalSide, final int meta) { - return ordinalSide == 1 ? this.textureTop - : (ordinalSide == 0 ? this.textureBottom - : ((ordinalSide != 2) && (ordinalSide != 4) ? this.blockIcon : this.textureFront)); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_) { - this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlGray"); - this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlGray"); - this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlGray"); - this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlGray"); - } - - /** - * Called upon block activation (right click on the block.) - */ - @Override - public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, - final int side, final float lx, final float ly, final float lz) { - - return true; - - /* - * if (world.isRemote) { return true; } else { boolean mDidScrewDriver = false; // Check For Screwdriver try { - * final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName()); final - * Item mHandItem = mHandStack.getItem(); if (((mHandItem instanceof GT_MetaGenerated_Tool_01) && - * ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) { final - * TileEntityXpConverter tile = (TileEntityXpConverter) world.getTileEntity(x, y, z); if (tile != null) { - * mDidScrewDriver = true; tile.onScrewdriverRightClick((byte) side, player, x, y, z); } } } catch (final - * Throwable t) { mDidScrewDriver = false; } if (!mDidScrewDriver) { try { final TileEntityXpConverter tile = - * (TileEntityXpConverter) world.getTileEntity(x, y, z); if (tile != null) { tile.onRightClick((byte) side, - * player, x, y, z); } } catch (final Throwable t) { } final TileEntityXpConverter tank = - * (TileEntityXpConverter) world.getTileEntity(x, y, z); if (tank != null) { if (tank.tankEssence.getFluid() != - * null) { PlayerUtils.messagePlayer(player, "This tank contains " + tank.tankEssence.getFluidAmount() + "L of " - * + tank.tankEssence.getFluid().getLocalizedName()); } if (tank.tankLiquidXp.getFluid() != null) { - * PlayerUtils.messagePlayer(player, "This tank contains " + tank.tankLiquidXp.getFluidAmount() + "L of " + - * tank.tankLiquidXp.getFluid().getLocalizedName()); } if ((tank.tankEssence.getFluid() != null) && - * (tank.tankLiquidXp.getFluid() != null)) { PlayerUtils.messagePlayer(player, "This is worth " + - * EnchantingUtils.getLevelForLiquid(tank.tankLiquidXp.getFluidAmount()) + " levels."); } } } } return true; - */ } - - @Override - public int getRenderBlockPass() { - return 1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - // return new TileEntityXpConverter(); - return null; - } - - @Override - public void onBlockAdded(final World world, final int x, final int y, final int z) { - super.onBlockAdded(world, x, y, z); - } - - @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, - final int z) { - return false; - } - - private final boolean generateRainbowMap() { - return true; - } - - @Override - public int getBlockColor() { - return super.getBlockColor(); - } - - @Override - public int colorMultiplier(final IBlockAccess p_149720_1_, final int p_149720_2_, final int p_149720_3_, - final int p_149720_4_) { - return super.colorMultiplier(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_); - } - - @Override - public void updateTick(final World world, final int x, final int y, final int z, final Random rand) { - // this.mRainbowTick++; - super.updateTick(world, x, y, z, rand); - } - - @Override - public void randomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) { - // this.mRainbowTick++; - super.randomDisplayTick(world, x, y, z, rand); - } - - @Override - public int tickRate(final World p_149738_1_) { - return 20; - } - - @Override - public int getLightValue() { - return 6; - } -} diff --git a/src/main/java/gtPlusPlus/core/block/general/FirePit.java b/src/main/java/gtPlusPlus/core/block/general/FirePit.java deleted file mode 100644 index 4b4390bc78..0000000000 --- a/src/main/java/gtPlusPlus/core/block/general/FirePit.java +++ /dev/null @@ -1,238 +0,0 @@ -package gtPlusPlus.core.block.general; - -import static net.minecraftforge.common.util.ForgeDirection.DOWN; -import static net.minecraftforge.common.util.ForgeDirection.EAST; -import static net.minecraftforge.common.util.ForgeDirection.NORTH; -import static net.minecraftforge.common.util.ForgeDirection.SOUTH; -import static net.minecraftforge.common.util.ForgeDirection.UP; -import static net.minecraftforge.common.util.ForgeDirection.WEST; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.block.base.BasicBlock; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.tileentities.general.TileEntityFirepit; - -public class FirePit extends BasicBlock { - - private static IIcon[] TEXTURE; - public static final int META_ANTIBUILDER = 2; - private int meta; - - public FirePit() { - super("blockFirePit", Material.wood); - this.setBlockName("blockFirePit"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - this.setHardness(10.0F); - this.setResistance(35.0F); - this.setStepSound(Block.soundTypeWood); - GameRegistry.registerBlock(this, "blockFirePit"); - } - - @Override - public int tickRate(final World aParWorld) { - return 30; - } - - @Override - public TileEntity createNewTileEntity(final World world, final int i) { - return new TileEntityFirepit(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister par1IconRegister) { - TEXTURE = new IIcon[] { par1IconRegister.registerIcon(this.getTextureName() + "_layer_0"), - par1IconRegister.registerIcon(this.getTextureName() + "_layer_1") }; - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) { - par3List.add(new ItemStack(par1, 1, 2)); - } - - @Override - public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random) { - if (!par1World.isRemote) { - // Sets meta. - this.meta = par1World.getBlockMetadata(x, y, z); - // If Raining, Put out. - if (par1World.isRaining() - && (par1World.canLightningStrikeAt(x, y, z) || par1World.canLightningStrikeAt(x - 1, y, z) - || par1World.canLightningStrikeAt(x + 1, y, z) - || par1World.canLightningStrikeAt(x, y, z - 1) - || par1World.canLightningStrikeAt(x, y, z + 1))) { - // Fire goes out - par1World.setBlockMetadataWithNotify(x, y, z, 1, 4); - } - if (isNeighborBurning(par1World, x, y, z)) { - // Fire can ignite from a nearby flame source. - par1World.setBlockMetadataWithNotify(x, y, z, 2, 4); - } - } - } - - @Override - public Item getItemDropped(final int meta, final Random par2Random, final int par3) { - switch (meta) { - case 0: - return null; - default: - break; - } - return Item.getItemFromBlock(this); - } - - @Override - public int damageDropped(final int meta) { - return meta; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public int getRenderType() { - return -1; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 1; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /* - * @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aParWorld, int x, int y, int z){ return - * null; } - */ - - @Override - protected boolean canSilkHarvest() { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(final World p_149734_1_, final int p_149734_2_, final int p_149734_3_, - final int p_149734_4_, final Random p_149734_5_) { - int l; - float f; - float f1; - float f2; - if (this.meta == 2) { - if (p_149734_5_.nextInt(24) == 0) { - p_149734_1_.playSound( - p_149734_2_ + 0.5F, - p_149734_3_ + 0.5F, - p_149734_4_ + 0.5F, - "fire.fire", - 1.0F + p_149734_5_.nextFloat(), - (p_149734_5_.nextFloat() * 0.7F) + 0.3F, - false); - } - } - if (this.meta == 2) { - if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) - && !Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)) { - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)) { - for (l = 0; l < 2; ++l) { - f = p_149734_2_ + (p_149734_5_.nextFloat() * 0.1F); - f1 = p_149734_3_ + p_149734_5_.nextFloat(); - f2 = p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); - } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)) { - for (l = 0; l < 2; ++l) { - f = p_149734_2_ + 1 - (p_149734_5_.nextFloat() * 0.1F); - f1 = p_149734_3_ + p_149734_5_.nextFloat(); - f2 = p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); - } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)) { - for (l = 0; l < 2; ++l) { - f = p_149734_2_ + p_149734_5_.nextFloat(); - f1 = p_149734_3_ + p_149734_5_.nextFloat(); - f2 = p_149734_4_ + (p_149734_5_.nextFloat() * 0.1F); - p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); - } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)) { - for (l = 0; l < 2; ++l) { - f = p_149734_2_ + p_149734_5_.nextFloat(); - f1 = p_149734_3_ + p_149734_5_.nextFloat(); - f2 = p_149734_4_ + 1 - (p_149734_5_.nextFloat() * 0.1F); - p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); - } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)) { - for (l = 0; l < 2; ++l) { - f = p_149734_2_ + p_149734_5_.nextFloat(); - f1 = p_149734_3_ + 1 - (p_149734_5_.nextFloat() * 0.1F); - f2 = p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); - } - } - } else { - if (this.meta == 2) { - for (l = 0; l < 3; ++l) { - f = p_149734_2_ + p_149734_5_.nextFloat(); - f1 = p_149734_3_ + (p_149734_5_.nextFloat() * 0.5F) + 0.5F; - f2 = p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); - } - } - } - } - } - - @SideOnly(Side.CLIENT) - public static IIcon getFireIcon(final int p_149840_1_) { - return FirePit.TEXTURE[p_149840_1_]; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final int ordinalSide, final int meta) { - return FirePit.TEXTURE[0]; - } - - private static boolean isNeighborBurning(final World world, final int x, final int y, final int z) { - return canCatchFire(world, x + 1, y, z, WEST) || canCatchFire(world, x - 1, y, z, EAST) - || canCatchFire(world, x, y - 1, z, UP) - || canCatchFire(world, x, y + 1, z, DOWN) - || canCatchFire(world, x, y, z - 1, SOUTH) - || canCatchFire(world, x, y, z + 1, NORTH); - } - - public static boolean canCatchFire(final World world, final int x, final int y, final int z, - final ForgeDirection face) { - return world.getBlock(x, y, z).isFireSource(world, x, y, z, face); - } -} diff --git a/src/main/java/gtPlusPlus/core/block/general/LightGlass.java b/src/main/java/gtPlusPlus/core/block/general/LightGlass.java index 4bc120678f..64b2455e41 100644 --- a/src/main/java/gtPlusPlus/core/block/general/LightGlass.java +++ b/src/main/java/gtPlusPlus/core/block/general/LightGlass.java @@ -7,9 +7,11 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockAir; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import codechicken.nei.api.API; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -28,7 +30,6 @@ public class LightGlass extends BlockAir { private int hex; public LightGlass(final boolean bool) { - // super("blockMFEffect", Material.air, bool); super(); this.setCreativeTab(AddToCreativeTab.tabBlock); this.setBlockName("blockMFEffect"); @@ -38,9 +39,7 @@ public LightGlass(final boolean bool) { setStepSound(Block.soundTypeGlass); GameRegistry.registerBlock(this, "blockMFEffect"); - /* - * this.setLightOpacity(0); this.setTickRandomly(true); this.setResistance(1); - */ + API.hideItem(new ItemStack(this)); } /** diff --git a/src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java b/src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java deleted file mode 100644 index d5cd3ef2fa..0000000000 --- a/src/main/java/gtPlusPlus/core/block/general/PlayerDoors.java +++ /dev/null @@ -1,485 +0,0 @@ -package gtPlusPlus.core.block.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.HashMap; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockDoor; -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.IconFlipped; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.item.base.itemblock.ItemBlockDoor; -import gtPlusPlus.core.tileentities.general.TileEntityPlayerDoorBase; -import gtPlusPlus.core.util.Utils; - -public class PlayerDoors extends BlockDoor implements ITileEntityProvider { - - @SideOnly(Side.CLIENT) - private IIcon[] aTextureUpper; - - @SideOnly(Side.CLIENT) - private IIcon[] aTextureLower; - - private static final HashMap mDoorMap = new HashMap(); - - public PlayerDoors(Material aMaterial, String aTextureName, boolean vanillaType) { - this(aMaterial, aTextureName, vanillaType, 0f, null, null); - } - - public PlayerDoors(Material aMaterial, String aTextureName, boolean vanillaType, float aHardness, - SoundType aStepSound, String aBlockExtensionName) { - super(aMaterial); - this.disableStats(); - this.isBlockContainer = true; - if (mDoorMap.get(aMaterial) == null) { - mDoorMap.put(aMaterial, this); - } - float f = 0.5F; - float f1 = 1.0F; - this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); - - this.setBlockName("playerDoor_" + aTextureName); - if (aMaterial == Material.wood) { - setHardness(3.0F); - setStepSound(soundTypeWood); - setBlockName("playerDoor" + "Wood"); - this.setHarvestLevel("axe", 1); - } else if (aMaterial == Material.iron) { - setHardness(5.0F); - setStepSound(Block.soundTypeMetal); - setBlockName("playerDoor" + "Iron"); - this.setHarvestLevel("pickaxe", 1); - - } else if (aMaterial == Material.glass) { - setHardness(0.1F); - setStepSound(Block.soundTypeGlass); - setBlockName("playerDoor" + "Glass"); - this.setHarvestLevel("pickaxe", 1); - - } else if (aMaterial == Material.ice) { - setHardness(0.5F); - setStepSound(Block.soundTypeSnow); - setBlockName("playerDoor" + "Ice"); - this.setHarvestLevel("pickaxe", 1); - } else { - setHardness(aHardness); - setStepSound(aStepSound); - setBlockName("playerDoor" + aBlockExtensionName); - this.setHarvestLevel("axe", 1); - } - this.setBlockTextureName(vanillaType ? aTextureName : GTPlusPlus.ID + ":" + aTextureName); - GameRegistry.registerBlock(this, ItemBlockDoor.class, Utils.sanitizeString(this.getUnlocalizedName())); - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int ordinalSide, int meta) { - return this.aTextureLower[0]; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(IBlockAccess aAccess, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { - if (p_149673_5_ != 1 && p_149673_5_ != 0) { - int i1 = this.getState(aAccess, p_149673_2_, p_149673_3_, p_149673_4_); - int j1 = i1 & 3; - boolean flag = (i1 & 4) != 0; - boolean flag1 = false; - boolean flag2 = (i1 & 8) != 0; - - if (flag) { - if (j1 == 0 && p_149673_5_ == 2) { - flag1 = !flag1; - } else if (j1 == 1 && p_149673_5_ == 5) { - flag1 = !flag1; - } else if (j1 == 2 && p_149673_5_ == 3) { - flag1 = !flag1; - } else if (j1 == 3 && p_149673_5_ == 4) { - flag1 = !flag1; - } - } else { - if (j1 == 0 && p_149673_5_ == 5) { - flag1 = !flag1; - } else if (j1 == 1 && p_149673_5_ == 3) { - flag1 = !flag1; - } else if (j1 == 2 && p_149673_5_ == 4) { - flag1 = !flag1; - } else if (j1 == 3 && p_149673_5_ == 2) { - flag1 = !flag1; - } - - if ((i1 & 16) != 0) { - flag1 = !flag1; - } - } - - return flag2 ? this.aTextureUpper[flag1 ? 1 : 0] : this.aTextureLower[flag1 ? 1 : 0]; - } else { - return this.aTextureLower[0]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister p_149651_1_) { - this.aTextureUpper = new IIcon[2]; - this.aTextureLower = new IIcon[2]; - this.aTextureUpper[0] = p_149651_1_.registerIcon(this.getTextureName() + "_upper"); - this.aTextureLower[0] = p_149651_1_.registerIcon(this.getTextureName() + "_lower"); - this.aTextureUpper[1] = new IconFlipped(this.aTextureUpper[0], true, false); - this.aTextureLower[1] = new IconFlipped(this.aTextureLower[0], true, false); - } - - @Override - public boolean getBlocksMovement(IBlockAccess aAccess, int aX, int aY, int aZ) { - int l = this.getState(aAccess, aX, aY, aZ); - return (l & 4) != 0; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 7; - } - - /** - * Returns the bounding box of the wired rectangular prism to render. - */ - @Override - @SideOnly(Side.CLIENT) - public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - this.setBlockBoundsBasedOnState(aWorld, aX, aY, aZ); - return super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { - this.setBlockBoundsBasedOnState(aWorld, aX, aY, aZ); - return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess aAccess, int aX, int aY, int aZ) { - this.setBounds(this.getState(aAccess, aX, aY, aZ)); - } - - @Override - public int func_150013_e(IBlockAccess p_150013_1_, int p_150013_2_, int p_150013_3_, int p_150013_4_) { - return this.getState(p_150013_1_, p_150013_2_, p_150013_3_, p_150013_4_) & 3; - } - - @Override - public boolean func_150015_f(IBlockAccess p_150015_1_, int p_150015_2_, int p_150015_3_, int p_150015_4_) { - return (this.getState(p_150015_1_, p_150015_2_, p_150015_3_, p_150015_4_) & 4) != 0; - } - - private void setBounds(int aState) { - float f = 0.1875F; - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F); - int j = aState & 3; - boolean flag = (aState & 4) != 0; - boolean flag1 = (aState & 16) != 0; - - if (j == 0) { - if (flag) { - if (!flag1) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); - } else { - this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); - } - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); - } - } else if (j == 1) { - if (flag) { - if (!flag1) { - this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); - } - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); - } - } else if (j == 2) { - if (flag) { - if (!flag1) { - this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); - } - } else { - this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - } else if (j == 3) { - if (flag) { - if (!flag1) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); - } else { - this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - } else { - this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); - } - } - } - - /** - * Called upon block activation (right click on the block.) - */ - @Override - public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int p_149727_6_, - float p_149727_7_, float p_149727_8_, float p_149727_9_) { - if (this.blockMaterial == Material.iron) { - return false; // Allow items to interact with the door - } else { - int i1 = this.getState(aWorld, aX, aY, aZ); - int j1 = i1 & 7; - j1 ^= 4; - - if ((i1 & 8) == 0) { - aWorld.setBlockMetadataWithNotify(aX, aY, aZ, j1, 2); - aWorld.markBlockRangeForRenderUpdate(aX, aY, aZ, aX, aY, aZ); - } else { - aWorld.setBlockMetadataWithNotify(aX, aY - 1, aZ, j1, 2); - aWorld.markBlockRangeForRenderUpdate(aX, aY - 1, aZ, aX, aY, aZ); - } - - aWorld.playAuxSFXAtEntity(aPlayer, 1003, aX, aY, aZ, 0); - return true; - } - } - - @Override - public void func_150014_a(World aWorld, int aX, int aY, int aZ, boolean aFlag) { - int l = this.getState(aWorld, aX, aY, aZ); - boolean flag1 = (l & 4) != 0; - - if (flag1 != aFlag) { - int i1 = l & 7; - i1 ^= 4; - - if ((l & 8) == 0) { - aWorld.setBlockMetadataWithNotify(aX, aY, aZ, i1, 2); - aWorld.markBlockRangeForRenderUpdate(aX, aY, aZ, aX, aY, aZ); - } else { - aWorld.setBlockMetadataWithNotify(aX, aY - 1, aZ, i1, 2); - aWorld.markBlockRangeForRenderUpdate(aX, aY - 1, aZ, aX, aY, aZ); - } - - aWorld.playAuxSFXAtEntity((EntityPlayer) null, 1003, aX, aY, aZ, 0); - } - } - - /** - * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are - * their own) Args: x, y, z, neighbor Block - */ - @Override - public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aNeighbour) { - int l = aWorld.getBlockMetadata(aX, aY, aZ); - - if ((l & 8) == 0) { - boolean flag = false; - - if (aWorld.getBlock(aX, aY + 1, aZ) != this) { - aWorld.setBlockToAir(aX, aY, aZ); - flag = true; - } - - if (!World.doesBlockHaveSolidTopSurface(aWorld, aX, aY - 1, aZ)) { - aWorld.setBlockToAir(aX, aY, aZ); - flag = true; - - if (aWorld.getBlock(aX, aY + 1, aZ) == this) { - aWorld.setBlockToAir(aX, aY + 1, aZ); - } - } - - if (flag) { - if (!aWorld.isRemote) { - this.dropBlockAsItem(aWorld, aX, aY, aZ, l, 0); - } - } else { - boolean flag1 = aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ) - || aWorld.isBlockIndirectlyGettingPowered(aX, aY + 1, aZ); - - if ((flag1 || aNeighbour.canProvidePower()) && aNeighbour != this) { - this.func_150014_a(aWorld, aX, aY, aZ, flag1); - } - } - } else { - if (aWorld.getBlock(aX, aY - 1, aZ) != this) { - aWorld.setBlockToAir(aX, aY, aZ); - } - - if (aNeighbour != this) { - this.onNeighborBlockChange(aWorld, aX, aY - 1, aZ, aNeighbour); - } - } - } - - @Override - public Item getItemDropped(int p_149650_1_, Random aRand, int p_149650_3_) { - if ((p_149650_1_ & 8) != 0) { - return null; - } else { - Block b = mDoorMap.get(this.blockMaterial); - if (b != null) { - return Item.getItemFromBlock(b); - } - } - return null; - } - - /** - * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, - * x, y, z, startVec, endVec - */ - @Override - public MovingObjectPosition collisionRayTrace(World p_149731_1_, int p_149731_2_, int p_149731_3_, int p_149731_4_, - Vec3 p_149731_5_, Vec3 p_149731_6_) { - this.setBlockBoundsBasedOnState(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_); - return super.collisionRayTrace(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_, p_149731_5_, p_149731_6_); - } - - /** - * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z - */ - @Override - public boolean canPlaceBlockAt(World aWorld, int aX, int aY, int aZ) { - boolean aHeight = (aY < aWorld.getHeight() - 1); - boolean aSolidTopSurface = World.doesBlockHaveSolidTopSurface(aWorld, aX, aY - 1, aZ); - - boolean aCanPlace = aWorld.getBlock(aX, aY, aZ).isReplaceable(aWorld, aX, aY, aZ); - boolean aCanPlace2 = aWorld.getBlock(aX, aY, aZ).isReplaceable(aWorld, aX, aY + 1, aZ); - - // Logger.INFO(""+aY+"/"+aWorld.getHeight()+" | Trying to place door. Good - // height? "+aHeight+" | Solid top surface? "+aSolidTopSurface+" | Can Place? - // "+aCanPlace+"|"+aCanPlace2); - - return aHeight && aSolidTopSurface && aCanPlace && aCanPlace2; - } - - /** - * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility - * and stop pistons - */ - @Override - public int getMobilityFlag() { - return 1; - } - - public int getState(IBlockAccess aAccess, int aX, int aY, int aZ) { - int l = aAccess.getBlockMetadata(aX, aY, aZ); - boolean flag = (l & 8) != 0; - int i1; - int j1; - - if (flag) { - i1 = aAccess.getBlockMetadata(aX, aY - 1, aZ); - j1 = l; - } else { - i1 = l; - j1 = aAccess.getBlockMetadata(aX, aY + 1, aZ); - } - - boolean flag1 = (j1 & 1) != 0; - return i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0); - } - - /** - * Gets an item for the block being called on. Args: world, x, y, z - */ - @Override - @SideOnly(Side.CLIENT) - public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { - Block b = mDoorMap.get(this.blockMaterial); - if (b != null) { - return Item.getItemFromBlock(b); - } - // return this.blockMaterial == Material.iron ? Items.iron_door : - // Items.wooden_door; - return null; - } - - /** - * Called when the block is attempted to be harvested - */ - @Override - public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, - EntityPlayer p_149681_6_) { - if (p_149681_6_.capabilities.isCreativeMode && (p_149681_5_ & 8) != 0 - && p_149681_1_.getBlock(p_149681_2_, p_149681_3_ - 1, p_149681_4_) == this) { - p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_ - 1, p_149681_4_); - } - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { - super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); - } - - @Override - public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, - int p_149749_6_) { - super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); - p_149749_1_.removeTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); - } - - @Override - public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, - int p_149696_5_, int p_149696_6_) { - super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); - TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); - return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false; - } - - @Override - public TileEntity createNewTileEntity(World world, int metadata) { - return new TileEntityPlayerDoorBase(this, metadata); - } - - @Override - public TileEntity createTileEntity(World world, int metadata) { - return new TileEntityPlayerDoorBase(this, metadata); - } -} diff --git a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java deleted file mode 100644 index 2d2a407057..0000000000 --- a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstone.java +++ /dev/null @@ -1,366 +0,0 @@ -package gtPlusPlus.core.block.general.redstone; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta; -import gtPlusPlus.core.tileentities.general.redstone.TileEntityRedstoneHandler; -import gtPlusPlus.core.util.minecraft.InventoryUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; - -public abstract class BlockGenericRedstone extends BlockContainer { - - public BlockGenericRedstone(String aUnlocalizedSuffix, String aDisplayName) { - super(Material.redstoneLight); - this.setBlockName("blockGenericRedstone." + aUnlocalizedSuffix); - this.setHardness(3f); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockGenericRedstone." + aUnlocalizedSuffix); - } - - private final HashMap> mTextures = new HashMap>(); - - /** - * A map of the textures used for this blocks. The key is the meta, then each internal map holds textures tied to - * each forge direction. Do not use unknown direction. - * - * @return - */ - public HashMap> getTextureArray() { - return mTextures; - } - - public abstract void generateTextureArray(final IIconRegister iicon); - - @Override - @SideOnly(Side.CLIENT) - public final void registerBlockIcons(final IIconRegister iicon) { - generateTextureArray(iicon); - this.blockIcon = iicon.registerIcon("redstone_block"); - } - - /** - * Called upon block activation (right click on the block.) - */ - @Override - public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, - final int side, final float lx, final float ly, final float lz) { - - if (world.isRemote) { - return true; - } - - boolean mDidTool = false; - // Check For Tools - try { - final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName()); - final Item mHandItem = mHandStack.getItem(); - if (ItemUtils.isItemGregtechTool(mHandStack)) { - - Logger.INFO("Found Tool in players hand!"); - - final TileEntityRedstoneHandler tile = (TileEntityRedstoneHandler) world.getTileEntity(x, y, z); - if (tile != null) { - if (tile.isScrewdriverable()) { - if (ItemUtils.isToolScrewdriver(mHandStack)) { - mDidTool = tile.onScrewdriverRMB(); - PlayerUtils.messagePlayer( - player, - "Adjusted Light level by 0.0625f. " + tile.getLightBrightness()); - } - } - if (tile.isMalletable()) { - if (ItemUtils.isToolMallet(mHandStack)) { - mDidTool = tile.onMalletRMB(); - PlayerUtils.messagePlayer(player, "Light Mode active: " + mDidTool); - } - } - if (tile.isWrenchable()) { - if (ItemUtils.isToolWrench(mHandStack)) { - mDidTool = tile.onWrenchRMB(); - } - } - } - } - } catch (final Throwable t) {} - if (mDidTool) { - return true; - } - - return false; - } - - @Override - public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) { - - boolean mDidTool = false; - // Check For Tools - try { - final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(aWorld, aPlayer.getDisplayName()); - final Item mHandItem = mHandStack.getItem(); - if (mHandItem instanceof GT_MetaGenerated_Tool_01) { - - final TileEntityRedstoneHandler tile = (TileEntityRedstoneHandler) aWorld.getTileEntity(aX, aY, aZ); - if (tile != null) { - if (tile.isScrewdriverable()) { - if (ItemUtils.isToolScrewdriver(mHandStack)) { - mDidTool = tile.onScrewdriverLMB(); - } - } - if (tile.isMalletable()) { - if (ItemUtils.isToolMallet(mHandStack)) { - mDidTool = tile.onMalletLMB(); - } - } - if (tile.isWrenchable()) { - if (ItemUtils.isToolWrench(mHandStack)) { - mDidTool = tile.onWrenchLMB(); - } - } - } - } - } catch (Throwable t) {} - - if (!mDidTool && !aPlayer.capabilities.isCreativeMode) { - super.onBlockClicked(aWorld, aX, aY, aZ, aPlayer); - } else { - return; - } - } - - @Override - public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_); - - @Override - public void breakBlock(final World world, final int x, final int y, final int z, final Block block, - final int number) { - InventoryUtils.dropInventoryItems(world, x, y, z, block); - super.breakBlock(world, x, y, z, block, number); - } - - @Override - public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, - final ItemStack stack) { - if (stack.hasDisplayName()) { - ((TileEntityRedstoneHandler) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName()); - } - } - - @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, - final int z) { - return false; - } - - @Override - public int getLightValue() { - return super.getLightValue(); - } - - @Override - public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, - float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { - // TODO Auto-generated method stub - return super.onBlockPlaced( - p_149660_1_, - p_149660_2_, - p_149660_3_, - p_149660_4_, - p_149660_5_, - p_149660_6_, - p_149660_7_, - p_149660_8_, - p_149660_9_); - } - - @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { - TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z); - if (aThis != null) { - return aThis.isProvidingWeakPower(world, x, y, z, side); - } - return 0; - } - - @Override - public boolean canProvidePower() { - return false; - } - - @Override - public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) { - TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z); - if (aThis != null) { - return aThis.isProvidingStrongPower(world, x, y, z, side); - } - return 0; - } - - @Override - public boolean hasComparatorInputOverride() { - // TODO Auto-generated method stub - return super.hasComparatorInputOverride(); - } - - @Override - public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, - int p_149736_5_) { - // TODO Auto-generated method stub - return super.getComparatorInputOverride(p_149736_1_, p_149736_2_, p_149736_3_, p_149736_4_, p_149736_5_); - } - - @Override - public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) { - TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z); - if (aThis != null) { - return aThis.canConnectRedstone(world, x, y, z, side); - } - return false; - } - - @Override - public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) { - TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z); - if (aThis != null) { - return aThis.shouldCheckWeakPower(world, x, y, z, side); - } - return isNormalCube(); - } - - @Override - public boolean getWeakChanges(IBlockAccess world, int x, int y, int z) { - TileEntityRedstoneHandler aThis = getTileEntity(world, x, y, z); - if (aThis != null) { - return aThis.getWeakChanges(world, x, y, z); - } - return false; - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public abstract IIcon getIcon(final int ordinalSide, final int meta); - - @Override - public int damageDropped(final int damage) { - return damage; - } - - @Override - public abstract void getSubBlocks(final Item item, final CreativeTabs tab, final List list); - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { - TileEntityRedstoneHandler aThis = getTileEntity(aWorld, aX, aY, aZ); - - if (!aWorld.isRemote) { - if (aThis.hasUpdatedRecently() && !aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) { - aWorld.scheduleBlockUpdate(aX, aY, aZ, this, 4); - } else if (!aThis.hasUpdatedRecently() && aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) { - aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 2); - } - } - } - - /** - * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are - * their own) Args: x, y, z, neighbor Block - */ - @Override - public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) { - - TileEntityRedstoneHandler aThis = getTileEntity(aWorld, aX, aY, aZ); - - if (!aWorld.isRemote) { - if (aThis.hasUpdatedRecently() && !aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) { - aWorld.scheduleBlockUpdate(aX, aY, aZ, this, 4); - } else if (!aThis.hasUpdatedRecently() && aWorld.isBlockIndirectlyGettingPowered(aX, aY, aZ)) { - aWorld.setBlock(aX, aY, aZ, Blocks.lit_redstone_lamp, 0, 2); - } - } - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World aWorld, int aX, int aY, int aZ, Random p_149674_5_) { - TileEntityRedstoneHandler aTile = getTileEntity(aWorld, aX, aY, aZ); - // Client side handling - if (aTile != null) { - this.setLightLevel(aTile.getLightBrightness()); - } - // Only continue on server - if (aWorld.isRemote) { - return; - } - if (aTile != null) { - if (aTile.isGettingIndirectlyPowered()) {} - } - } - - public TileEntityRedstoneHandler getTileEntity(IBlockAccess world, int aX, int aY, int aZ) { - TileEntity aTemp = world.getTileEntity(aX, aY, aZ); - if (aTemp != null) { - if (aTemp instanceof TileEntityRedstoneHandler) { - TileEntityRedstoneHandler g = (TileEntityRedstoneHandler) aTemp; - if (g != null) { - return g; - } - } - } - return null; - } - - /** - * Gets an item for the block being called on. Args: world, x, y, z - */ - @SideOnly(Side.CLIENT) - @Override - public abstract Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_); - - /** - * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage - * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. - */ - @Override - protected abstract ItemStack createStackedBlock(int p_149644_1_); - - @Override - public abstract ArrayList getDrops(final World world, final int x, final int y, final int z, - final int metadata, final int fortune); - - @Override - public abstract Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_); -} diff --git a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java deleted file mode 100644 index 8652a45c04..0000000000 --- a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneDetector.java +++ /dev/null @@ -1,142 +0,0 @@ -package gtPlusPlus.core.block.general.redstone; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Random; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import gtPlusPlus.core.tileentities.general.redstone.TileEntityRedstoneHandler; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class BlockGenericRedstoneDetector extends BlockGenericRedstone { - - public BlockGenericRedstoneDetector() { - super("detector", "Redstone Detector"); - setTickRandomly(true); - } - - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileEntityRedstoneDetector(); - } - - public class TileEntityRedstoneDetector extends TileEntityRedstoneHandler { - - public TileEntityRedstoneDetector() { - super(0); - } - - @Override - protected Class getTileEntityClass() { - return this.getClass(); - } - - @Override - protected String getTileEntityNameForRegistration() { - return "TileEntityRedstoneDetector"; - } - } - - @Override - public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List aList) { - aList.add(ItemUtils.getSimpleStack(this)); - } - - @Override - public void updateTick(World aWorld, int aX, int aY, int aZ, Random aRand) { - super.updateTick(aWorld, aX, aY, aZ, aRand); - } - - @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { - // TODO Auto-generated method stub - return ItemUtils.getSimpleStack(this).getItem(); - } - - @Override - public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { - // TODO Auto-generated method stub - return ItemUtils.getSimpleStack(this).getItem(); - } - - @Override - protected ItemStack createStackedBlock(int p_149644_1_) { - return ItemUtils.simpleMetaStack(this, p_149644_1_, 1); - } - - @Override - public void generateTextureArray(final IIconRegister iicon) { - HashMap> aTextures = new HashMap>(); - - // New Block for Each Meta - int aMeta = 0; - { - HashMap aTempMap = new HashMap(); - aTempMap.put( - ForgeDirection.UP, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTempMap.put( - ForgeDirection.DOWN, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTempMap.put( - ForgeDirection.NORTH, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTempMap.put( - ForgeDirection.SOUTH, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTempMap.put( - ForgeDirection.EAST, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTempMap.put( - ForgeDirection.WEST, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTextures.put(aMeta++, aTempMap); - } - } - - @Override - public IIcon getIcon(int ordinalSide, int meta) { - HashMap aTemp = getTextureArray().get(meta); - if (aTemp != null) { - IIcon aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide)); - if (aSide != null) { - return aSide; - } else { - // Smart calculate missing sides - if (ordinalSide <= 1) { - for (int ss = 0; ss < 2; ss++) { - aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide)); - if (aSide != null) { - return aSide; - } - } - } - for (int ss = 2; ss < 6; ss++) { - aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide)); - if (aSide != null) { - return aSide; - } - } - } - } - return blockIcon; - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList aDrops = new ArrayList(); - aDrops.add(ItemUtils.getSimpleStack(this)); - return aDrops; - } -} diff --git a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java b/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java deleted file mode 100644 index 16f8ceef8e..0000000000 --- a/src/main/java/gtPlusPlus/core/block/general/redstone/BlockGenericRedstoneTest.java +++ /dev/null @@ -1,211 +0,0 @@ -package gtPlusPlus.core.block.general.redstone; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Random; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.tileentities.general.redstone.TileEntityRedstoneHandler; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.world.explosions.ExplosionHandler; - -public class BlockGenericRedstoneTest extends BlockGenericRedstone { - - public BlockGenericRedstoneTest() { - super("test", "Redstone Test"); - setTickRandomly(true); - } - - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileEntityRedstoneTest(); - } - - public class TileEntityRedstoneTest extends TileEntityRedstoneHandler { - - public TileEntityRedstoneTest() { - super(2); - } - - @Override - public boolean isScrewdriverable() { - return true; - } - - @Override - public boolean onScrewdriverLMB() { - return super.onScrewdriverLMB(); - } - - @Override - public boolean onScrewdriverRMB() { - if (this.mLightValue + 0.0625f <= 1) { - this.mLightValue += 0.0625f; - } else { - this.mLightValue = 0; - } - this.markForUpdate(); - return true; - } - - @Override - public boolean isMalletable() { - return true; - } - - @Override - public boolean onMalletLMB() { - return super.onMalletLMB(); - } - - @Override - public boolean onMalletRMB() { - this.mLightMode = Utils.invertBoolean(mLightMode); - this.markForUpdate(); - return mLightMode; - } - - @Override - public boolean isWrenchable() { - return true; - } - - @Override - public boolean onWrenchLMB() { - return super.onWrenchLMB(); - } - - @Override - public boolean onWrenchRMB() { - Logger.INFO("Found Wrench"); - ExplosionHandler explode = new ExplosionHandler(); - explode.createExplosion(this.worldObj, null, this.xCoord, this.yCoord, this.zCoord, 1f, false, true); - return true; - } - - @Override - protected Class getTileEntityClass() { - return this.getClass(); - } - - @Override - protected String getTileEntityNameForRegistration() { - return "TileEntityRedstoneTest"; - } - - @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { - return super.isProvidingWeakPower(world, x, y, z, side); - } - - @Override - public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) { - return super.isProvidingStrongPower(world, x, y, z, side); - } - } - - @SuppressWarnings("unchecked") - @Override - public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List aList) { - aList.add(ItemUtils.getSimpleStack(this)); - } - - @Override - public void updateTick(World aWorld, int aX, int aY, int aZ, Random aRand) { - super.updateTick(aWorld, aX, aY, aZ, aRand); - } - - @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { - return ItemUtils.getSimpleStack(this).getItem(); - } - - @Override - public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { - return ItemUtils.getSimpleStack(this).getItem(); - } - - @Override - protected ItemStack createStackedBlock(int p_149644_1_) { - return ItemUtils.simpleMetaStack(this, p_149644_1_, 1); - } - - @Override - public void generateTextureArray(final IIconRegister iicon) { - HashMap> aTextures = new HashMap>(); - - // New Block for Each Meta - int aMeta = 0; - { - HashMap aTempMap = new HashMap(); - aTempMap.put( - ForgeDirection.UP, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTempMap.put( - ForgeDirection.DOWN, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTempMap.put( - ForgeDirection.NORTH, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTempMap.put( - ForgeDirection.SOUTH, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTempMap.put( - ForgeDirection.EAST, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTempMap.put( - ForgeDirection.WEST, - iicon.registerIcon(GTPlusPlus.ID + ":" + "redstone/redstone_meter/" + "top")); - aTextures.put(aMeta++, aTempMap); - } - } - - @Override - public IIcon getIcon(int ordinalSide, int meta) { - HashMap aTemp = getTextureArray().get(meta); - if (aTemp != null) { - IIcon aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide)); - if (aSide != null) { - return aSide; - } else { - // Smart calculate missing sides - if (ordinalSide <= 1) { - for (int ss = 0; ss < 2; ss++) { - aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide)); - if (aSide != null) { - return aSide; - } - } - } - for (int ss = 2; ss < 6; ss++) { - aSide = aTemp.get(ForgeDirection.getOrientation(ordinalSide)); - if (aSide != null) { - return aSide; - } - } - } - } - return blockIcon; - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList aDrops = new ArrayList(); - aDrops.add(ItemUtils.getSimpleStack(this)); - return aDrops; - } -} diff --git a/src/main/java/gtPlusPlus/core/block/machine/EggBox.java b/src/main/java/gtPlusPlus/core/block/machine/EggBox.java deleted file mode 100644 index 90d74c5d37..0000000000 --- a/src/main/java/gtPlusPlus/core/block/machine/EggBox.java +++ /dev/null @@ -1,149 +0,0 @@ -package gtPlusPlus.core.block.machine; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.handler.GuiHandler; -import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile; -import gtPlusPlus.core.tileentities.general.TileEntityEggBox; -import gtPlusPlus.core.util.minecraft.InventoryUtils; - -public class EggBox extends BlockContainer implements ITileTooltip { - - @SideOnly(Side.CLIENT) - private IIcon textureTop; - - @SideOnly(Side.CLIENT) - private IIcon textureBottom; - - @SideOnly(Side.CLIENT) - private IIcon textureFront; - - /** - * Determines which tooltip is displayed within the itemblock. - */ - private final int mTooltipID = 7; - - public final int field_149956_a = 0; - - @Override - public int getTooltipID() { - return this.mTooltipID; - } - - public EggBox() { - super(Material.wood); - this.setBlockName("blockEggBox"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - this.setHardness(5f); - this.setResistance(1f); - GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockEggBox"); - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return true; - } - - /** - * The type of render function that is called for this block - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderType() { - return super.getRenderType(); - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final int ordinalSide, final int meta) { - return ordinalSide == 1 ? this.textureTop : this.textureFront; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_) { - this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "EggBox_top"); - this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "EggBox_top"); - this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "EggBox_side"); - this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "EggBox_side"); - } - - /** - * Called upon block activation (right click on the block.) - */ - @Override - public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, - final int side, final float lx, final float ly, final float lz) { - if (world.isRemote) { - return true; - } - - final TileEntity te = world.getTileEntity(x, y, z); - if ((te != null) && (te instanceof TileEntityEggBox)) { - player.openGui(GTplusplus.instance, GuiHandler.GUI17, world, x, y, z); - return true; - } - return false; - } - - @Override - public int getRenderBlockPass() { - return 0; - } - - @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - return new TileEntityEggBox(); - } - - @Override - public void onBlockAdded(final World world, final int x, final int y, final int z) { - super.onBlockAdded(world, x, y, z); - } - - @Override - public void breakBlock(final World world, final int x, final int y, final int z, final Block block, - final int number) { - InventoryUtils.dropInventoryItems(world, x, y, z, block); - super.breakBlock(world, x, y, z, block, number); - } - - @Override - public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase entity, - final ItemStack stack) { - if (stack.hasDisplayName()) { - ((TileEntityEggBox) world.getTileEntity(x, y, z)).setCustomName(stack.getDisplayName()); - } - } - - @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, - final int z) { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java b/src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java deleted file mode 100644 index a89de43744..0000000000 --- a/src/main/java/gtPlusPlus/core/block/machine/HeliumGenerator.java +++ /dev/null @@ -1,90 +0,0 @@ -package gtPlusPlus.core.block.machine; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator; - -public class HeliumGenerator extends BlockContainer { - - @SideOnly(Side.CLIENT) - private IIcon textureTop; - - @SideOnly(Side.CLIENT) - private IIcon textureBottom; - - @SideOnly(Side.CLIENT) - private IIcon textureFront; - - public HeliumGenerator() { - super(Material.wood); - this.setBlockName("blockHeliumGenerator"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, "blockHeliumGenerator"); - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final int ordinalSide, final int meta) { - return ordinalSide == 1 ? this.textureTop - : (ordinalSide == 0 ? this.textureBottom - : ((ordinalSide != 2) && (ordinalSide != 4) ? this.blockIcon : this.textureFront)); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_) { - this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "Chrono/" + "CyberPanel"); - this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "Chrono/" + "CyberPanel"); - this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "Chrono/" + "CyberPanel"); - this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "Chrono/" + "CyberPanel"); - } - - /** - * Called upon block activation (right click on the block.) - */ - @Override - public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, - final int side, final float lx, final float ly, final float lz) { - if (world.isRemote) { - return true; - } - - final TileEntity te = world.getTileEntity(x, y, z); - if ((te != null) && (te instanceof TileEntityHeliumGenerator)) { // TODO - player.openGui(GTplusplus.instance, 1, world, x, y, z); // TODO - return true; - } - return false; - } - - @Override - public int getRenderBlockPass() { - return 1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - return new TileEntityHeliumGenerator(); - } -} diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java deleted file mode 100644 index 8c388f1408..0000000000 --- a/src/main/java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java +++ /dev/null @@ -1,101 +0,0 @@ -package gtPlusPlus.core.block.machine; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.item.base.itemblock.ItemBlockBasicTile; -import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; - -public class Machine_ModularityTable extends BlockContainer implements ITileTooltip { - - @SideOnly(Side.CLIENT) - private IIcon textureTop; - - @SideOnly(Side.CLIENT) - private IIcon textureBottom; - - @SideOnly(Side.CLIENT) - private IIcon textureFront; - - /** - * Determines which tooltip is displayed within the itemblock. - */ - private final int mTooltipID = 1; - - @Override - public int getTooltipID() { - return this.mTooltipID; - } - - public Machine_ModularityTable() { - super(Material.iron); - this.setBlockName("blockModularity"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, ItemBlockBasicTile.class, "blockModularity"); - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final int ordinalSide, final int meta) { - return ordinalSide == 1 ? this.textureTop - : (ordinalSide == 0 ? this.textureBottom - : ((ordinalSide != 2) && (ordinalSide != 4) ? this.blockIcon : this.textureFront)); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_) { - this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "ModularTable_side"); - this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "ModularTable_top"); - this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "ModularTable_output"); - this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "ModularTable_side"); - } - - /** - * Called upon block activation (right click on the block.) - */ - @Override - public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, - final int side, final float lx, final float ly, final float lz) { - if (world.isRemote) { - return true; - } - final TileEntity te = world.getTileEntity(x, y, z); - if ((te != null) && (te instanceof TileEntityModularityTable)) { - player.openGui(GTplusplus.instance, 1, world, x, y, z); - Logger.INFO("Player opened GUI"); - return true; - } - return false; - } - - @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - return new TileEntityModularityTable(); - } - - @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, - final int z) { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java deleted file mode 100644 index c299cff6cb..0000000000 --- a/src/main/java/gtPlusPlus/core/block/machine/Machine_TradeTable.java +++ /dev/null @@ -1,87 +0,0 @@ -package gtPlusPlus.core.block.machine; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.block.base.BlockBaseNBT; -import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; - -public class Machine_TradeTable extends BlockBaseNBT implements ITileTooltip { - - @SideOnly(Side.CLIENT) - private IIcon textureTop; - - @SideOnly(Side.CLIENT) - private IIcon textureBottom; - - @SideOnly(Side.CLIENT) - private IIcon textureFront; - - /** - * Determines which tooltip is displayed within the itemblock. - */ - private final int mTooltipID = 2; - - @Override - public int getTooltipID() { - return this.mTooltipID; - } - - public Machine_TradeTable() { - super(Material.leaves, "blockTradeBench", "Trade-o-Mat"); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_) { - this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlYellow"); - this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "workbench_top"); - this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlYellow"); - this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "SwirlYellow"); - } - - /** - * Called upon block activation (right click on the block.) - */ - @Override - public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, - final int side, final float lx, final float ly, final float lz) { - if (world.isRemote) { - return true; - } - - final TileEntity te = world.getTileEntity(x, y, z); - if ((te != null) && (te instanceof TileEntityTradeTable)) { - // Utils.LOG_INFO("Clicked on TE - ok"); - player.openGui(GTplusplus.instance, 6, world, x, y, z); - return true; - } else { - Logger.INFO("Bad TE"); - } - return false; - } - - @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - return new TileEntityTradeTable(); - } - - @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, - final int z) { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java b/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java deleted file mode 100644 index 61465a59c1..0000000000 --- a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Head_Fake.java +++ /dev/null @@ -1,173 +0,0 @@ -package gtPlusPlus.core.block.machine.bedrock; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.DamageSource; -import net.minecraft.world.Explosion; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.EntityUtils; - -public class Mining_Head_Fake extends Block { - - public Mining_Head_Fake() { - super(Material.lava); - this.setBlockName(Utils.sanitizeString("blockMiningHeadFake")); - this.setBlockTextureName(GTPlusPlus.ID + ":" + "blockFrameGt"); - this.setCreativeTab(AddToCreativeTab.tabBlock); - this.setHardness(-1F); - this.setResistance(50000.0F); - this.setHarvestLevel("pickaxe", 10); - this.setStepSound(soundTypeMetal); - // LanguageRegistry.addName(this, "Wither Cage"); - GameRegistry.registerBlock(this, Utils.sanitizeString("blockMiningHeadFake")); - } - - public String GetProperName() { - return "Hardened Mining Head"; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister iIcon) { - this.blockIcon = iIcon.registerIcon(GTPlusPlus.ID + ":" + "blockFrameGt"); - } - - @Override - public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion) { - // prevent from being destroyed by wither and nukes. - } - - @Override - public void onBlockDestroyedByExplosion(final World p_149723_1_, final int p_149723_2_, final int p_149723_3_, - final int p_149723_4_, final Explosion p_149723_5_) {} - - @Override - public boolean canDropFromExplosion(final Explosion p_149659_1_) { - return false; - } - - @Override - public boolean canEntityDestroy(final IBlockAccess world, final int x, final int y, final int z, - final Entity entity) { - return false; - } - - // Colour Handling - private static final int mWitherColour = Utils.rgbtoHexValue(175, 64, 32); - - @Override - public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) { - return mWitherColour; - } - - @Override - public int getRenderColor(final int aMeta) { - return mWitherColour; - } - - @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, - final int z) { - return false; - } - - @Override - public boolean isCollidable() { - return true; - } - - @Override - public void randomDisplayTick(World world, int posX, int posY, int posZ, Random rand) { - generateVoidParticlesAroundBlockPos(new BlockPos(posX, posY, posZ, world), 2); - super.randomDisplayTick(world, posX, posY, posZ, rand); - } - - @Override - public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, - Entity ent) { - EntityUtils.doDamage(ent, DamageSource.outOfWorld, 20); - EntityUtils.setEntityOnFire(ent, 100); - super.onEntityCollidedWithBlock(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, ent); - } - - @Override - protected boolean canSilkHarvest() { - return false; - } - - @Override - public boolean canHarvestBlock(EntityPlayer player, int meta) { - return false; - } - - public static void generateVoidParticlesAroundBlockPos(BlockPos Pos, int range) { - for (BlockPos G : Pos.getSurroundingBlocks()) { - int i1 = G.xPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range); - int j1 = G.yPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range); - int k1 = G.zPos + MathUtils.randInt(0, range) - MathUtils.randInt(0, range); - - Block block = Pos.world.getBlock(i1, j1, k1); - - if (block.getMaterial() == Material.air) { - - // lava - if (Pos.yPos <= 7) { - Pos.world.spawnParticle( - "portal", - (double) ((float) i1 + CORE.RANDOM.nextFloat()), - (double) ((float) j1 + CORE.RANDOM.nextFloat()), - (double) ((float) k1 + CORE.RANDOM.nextFloat()), - 0.0D, - 0.0D, - 0.0D); - Pos.world.spawnParticle( - "lava", - (double) ((float) i1 + CORE.RANDOM.nextFloat()), - (double) ((float) j1 + CORE.RANDOM.nextFloat()), - (double) ((float) k1 + CORE.RANDOM.nextFloat()), - 0.0D, - 0.0D, - 0.0D); - } else { - Pos.world.spawnParticle( - "portal", - (double) ((float) i1 + CORE.RANDOM.nextFloat()), - (double) ((float) j1 + CORE.RANDOM.nextFloat()), - (double) ((float) k1 + CORE.RANDOM.nextFloat()), - 0.0D, - 0.0D, - 0.0D); - } - } - } - } -} diff --git a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java b/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java deleted file mode 100644 index 29067dd2c1..0000000000 --- a/src/main/java/gtPlusPlus/core/block/machine/bedrock/Mining_Pipe_Fake.java +++ /dev/null @@ -1,131 +0,0 @@ -package gtPlusPlus.core.block.machine.bedrock; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.DamageSource; -import net.minecraft.world.Explosion; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.EntityUtils; - -public class Mining_Pipe_Fake extends Block { - - public Mining_Pipe_Fake() { - super(Material.cactus); - this.setBlockName(Utils.sanitizeString("blockMiningPipeFake")); - this.setBlockTextureName(GTPlusPlus.ID + ":" + "blockFrameGt"); - this.setCreativeTab(AddToCreativeTab.tabBlock); - this.setHardness(-1F); - this.setResistance(50000.0F); - this.setHarvestLevel("pickaxe", 8); - this.setStepSound(soundTypeMetal); - // LanguageRegistry.addName(this, "Wither Cage"); - GameRegistry.registerBlock(this, Utils.sanitizeString("blockMiningPipeFake")); - } - - public String GetProperName() { - return "Hardened Mining Pipe"; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister iIcon) { - this.blockIcon = iIcon.registerIcon(GTPlusPlus.ID + ":" + "blockFrameGt"); - } - - @Override - public void onBlockExploded(final World world, final int x, final int y, final int z, final Explosion explosion) { - // prevent from being destroyed by wither and nukes. - } - - @Override - public void onBlockDestroyedByExplosion(final World p_149723_1_, final int p_149723_2_, final int p_149723_3_, - final int p_149723_4_, final Explosion p_149723_5_) {} - - @Override - public boolean canDropFromExplosion(final Explosion p_149659_1_) { - return false; - } - - @Override - public boolean canEntityDestroy(final IBlockAccess world, final int x, final int y, final int z, - final Entity entity) { - return false; - } - - // Colour Handling - private static final int mWitherColour = Utils.rgbtoHexValue(32, 32, 32); - - @Override - public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) { - return mWitherColour; - } - - @Override - public int getRenderColor(final int aMeta) { - return mWitherColour; - } - - @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, - final int z) { - return false; - } - - @Override - public boolean isCollidable() { - return true; - } - - @Override - public void randomDisplayTick(World world, int posX, int posY, int posZ, Random rand) { - Mining_Head_Fake.generateVoidParticlesAroundBlockPos(new BlockPos(posX, posY, posZ, world), 2); - super.randomDisplayTick(world, posX, posY, posZ, rand); - } - - @Override - public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, - Entity ent) { - if (MathUtils.randInt(0, 100) < 5) { - EntityUtils.doDamage(ent, DamageSource.outOfWorld, 1); - } - super.onEntityCollidedWithBlock(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, ent); - } - - @Override - protected boolean canSilkHarvest() { - return false; - } - - @Override - public boolean canHarvestBlock(EntityPlayer player, int meta) { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java b/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java deleted file mode 100644 index b61027a6f5..0000000000 --- a/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java +++ /dev/null @@ -1,115 +0,0 @@ -package gtPlusPlus.core.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.entity.monster.EntityBatKing; - -@SideOnly(Side.CLIENT) -public class ModelBatKing extends ModelBase { - - private ModelRenderer batHead; - /** The body box of the bat model. */ - private ModelRenderer batBody; - /** The inner right wing box of the bat model. */ - private ModelRenderer batRightWing; - /** The inner left wing box of the bat model. */ - private ModelRenderer batLeftWing; - /** The outer right wing box of the bat model. */ - private ModelRenderer batOuterRightWing; - /** The outer left wing box of the bat model. */ - private ModelRenderer batOuterLeftWing; - - public ModelBatKing() { - this.textureWidth = 64; - this.textureHeight = 64; - - this.batHead = new ModelRenderer(this, 0, 0); - this.batHead.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6); - ModelRenderer modelrenderer = new ModelRenderer(this, 24, 0); - modelrenderer.addBox(-4.0F, -6.0F, -2.0F, 3, 4, 1); - this.batHead.addChild(modelrenderer); - ModelRenderer modelrenderer1 = new ModelRenderer(this, 24, 0); - modelrenderer1.mirror = true; - modelrenderer1.addBox(1.0F, -6.0F, -2.0F, 3, 4, 1); - this.batHead.addChild(modelrenderer1); - this.batBody = new ModelRenderer(this, 0, 16); - this.batBody.addBox(-3.0F, 4.0F, -3.0F, 6, 12, 6); - this.batBody.setTextureOffset(0, 34).addBox(-5.0F, 16.0F, 0.0F, 10, 6, 1); - this.batRightWing = new ModelRenderer(this, 42, 0); - this.batRightWing.addBox(-12.0F, 1.0F, 1.5F, 10, 16, 1); - this.batOuterRightWing = new ModelRenderer(this, 24, 16); - this.batOuterRightWing.setRotationPoint(-12.0F, 1.0F, 1.5F); - this.batOuterRightWing.addBox(-8.0F, 1.0F, 0.0F, 8, 12, 1); - this.batLeftWing = new ModelRenderer(this, 42, 0); - this.batLeftWing.mirror = true; - this.batLeftWing.addBox(2.0F, 1.0F, 1.5F, 10, 16, 1); - this.batOuterLeftWing = new ModelRenderer(this, 24, 16); - this.batOuterLeftWing.mirror = true; - this.batOuterLeftWing.setRotationPoint(12.0F, 1.0F, 1.5F); - this.batOuterLeftWing.addBox(0.0F, 1.0F, 0.0F, 8, 12, 1); - this.batBody.addChild(this.batRightWing); - this.batBody.addChild(this.batLeftWing); - this.batRightWing.addChild(this.batOuterRightWing); - this.batLeftWing.addChild(this.batOuterLeftWing); - } - - /** - * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and - * it seems a good match for a bats size - */ - public int getBatSize() { - return 72; - } - - /** - * Sets the models various rotation angles then renders the model. - */ - @Override - public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, - float p_78088_6_, float p_78088_7_) { - EntityBatKing entitybat = (EntityBatKing) p_78088_1_; - float f6; - - if (entitybat.getIsBatHanging()) { - f6 = (180F / (float) Math.PI); - this.batHead.rotateAngleX = p_78088_6_ / (180F / (float) Math.PI); - this.batHead.rotateAngleY = (float) Math.PI - p_78088_5_ / (180F / (float) Math.PI); - this.batHead.rotateAngleZ = (float) Math.PI; - this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F); - this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F); - this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F); - this.batBody.rotateAngleX = (float) Math.PI; - this.batRightWing.rotateAngleX = -0.15707964F; - this.batRightWing.rotateAngleY = -((float) Math.PI * 2F / 5F); - this.batOuterRightWing.rotateAngleY = -1.7278761F; - this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX; - this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; - this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY; - } else { - f6 = (180F / (float) Math.PI); - this.batHead.rotateAngleX = p_78088_6_ / (180F / (float) Math.PI); - this.batHead.rotateAngleY = p_78088_5_ / (180F / (float) Math.PI); - this.batHead.rotateAngleZ = 0.0F; - this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F); - this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F); - this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F); - this.batBody.rotateAngleX = ((float) Math.PI / 4F) + MathHelper.cos(p_78088_4_ * 0.1F) * 0.15F; - this.batBody.rotateAngleY = 0.0F; - this.batRightWing.rotateAngleY = MathHelper.cos(p_78088_4_ * 1.3F) * (float) Math.PI * 0.25F; - this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; - this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F; - this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F; - } - - GL11.glScalef(4, 4, 4); - this.batHead.render(p_78088_7_); - this.batBody.render(p_78088_7_); - } -} diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java b/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java deleted file mode 100644 index 14ee51a35e..0000000000 --- a/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java +++ /dev/null @@ -1,111 +0,0 @@ -package gtPlusPlus.core.client.model; - -import net.minecraft.client.model.ModelChicken; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ModelGiantChicken extends ModelChicken { - - public ModelGiantChicken() { - byte b0 = 16; - this.head = new ModelRenderer(this, 0, 0); - this.head.addBox(-2.0F, -6.0F, -2.0F, 4, 6, 3, 0.0F); - this.head.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F); - this.bill = new ModelRenderer(this, 14, 0); - this.bill.addBox(-2.0F, -4.0F, -4.0F, 4, 2, 2, 0.0F); - this.bill.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F); - this.chin = new ModelRenderer(this, 14, 4); - this.chin.addBox(-1.0F, -2.0F, -3.0F, 2, 2, 2, 0.0F); - this.chin.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F); - this.body = new ModelRenderer(this, 0, 9); - this.body.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F); - this.body.setRotationPoint(0.0F, (float) b0, 0.0F); - this.rightLeg = new ModelRenderer(this, 26, 0); - this.rightLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); - this.rightLeg.setRotationPoint(-2.0F, (float) (3 + b0), 1.0F); - this.leftLeg = new ModelRenderer(this, 26, 0); - this.leftLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); - this.leftLeg.setRotationPoint(1.0F, (float) (3 + b0), 1.0F); - this.rightWing = new ModelRenderer(this, 24, 13); - this.rightWing.addBox(0.0F, 0.0F, -3.0F, 1, 4, 6); - this.rightWing.setRotationPoint(-4.0F, (float) (-3 + b0), 0.0F); - this.leftWing = new ModelRenderer(this, 24, 13); - this.leftWing.addBox(-1.0F, 0.0F, -3.0F, 1, 4, 6); - this.leftWing.setRotationPoint(4.0F, (float) (-3 + b0), 0.0F); - } - - /** - * Sets the models various rotation angles then renders the model. - */ - @Override - public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, - float p_78088_6_, float p_78088_7_) { - this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); - - if (this.isChild) { - float f6 = 1.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 0F, 0F); - this.head.render(p_78088_7_); - this.bill.render(p_78088_7_); - this.chin.render(p_78088_7_); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F * f6, 1.0F * f6, 1.0F * f6); - GL11.glTranslatef(0.0F, 0F, 0.0F); - this.body.render(p_78088_7_); - this.rightLeg.render(p_78088_7_); - this.leftLeg.render(p_78088_7_); - this.rightWing.render(p_78088_7_); - this.leftWing.render(p_78088_7_); - GL11.glPopMatrix(); - // super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_); - } else { - float f6 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.0F * f6, 1.0F * f6, 1.0F * f6); - GL11.glTranslatef(0.0F, -0.85F, 0F); - this.head.render(p_78088_7_); - this.bill.render(p_78088_7_); - this.chin.render(p_78088_7_); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F * f6, 1.0F * f6, 1.0F * f6); - GL11.glTranslatef(0.0F, -0.75F, 0.0F); - this.body.render(p_78088_7_); - this.rightLeg.render(p_78088_7_); - this.leftLeg.render(p_78088_7_); - this.rightWing.render(p_78088_7_); - this.leftWing.render(p_78088_7_); - GL11.glPopMatrix(); - } - } - - /** - * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms - * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how - * "far" arms and legs can swing at most. - */ - @Override - public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, - float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { - this.head.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI); - this.head.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI); - this.bill.rotateAngleX = this.head.rotateAngleX; - this.bill.rotateAngleY = this.head.rotateAngleY; - this.chin.rotateAngleX = this.head.rotateAngleX; - this.chin.rotateAngleY = this.head.rotateAngleY; - this.body.rotateAngleX = ((float) Math.PI / 2F); - this.rightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; - this.leftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float) Math.PI) * 1.4F * p_78087_2_; - this.rightWing.rotateAngleZ = p_78087_3_; - this.leftWing.rotateAngleZ = -p_78087_3_; - } -} diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java deleted file mode 100644 index 24cb3f1459..0000000000 --- a/src/main/java/gtPlusPlus/core/client/renderer/RenderBatKing.java +++ /dev/null @@ -1,152 +0,0 @@ -package gtPlusPlus.core.client.renderer; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.client.renderer.entity.RenderLiving; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.client.model.ModelBatKing; -import gtPlusPlus.core.entity.monster.EntityBatKing; - -@SideOnly(Side.CLIENT) -public class RenderBatKing extends RenderLiving { - - private static final ResourceLocation batTextures = new ResourceLocation( - GTPlusPlus.ID + ":" + "textures/entity/batKing.png"); - - /** - * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and - * it seems a good match for a bats size - */ - private int renderedBatSize; - - public RenderBatKing() { - super(new ModelBatKing(), 0.7F); - this.renderedBatSize = (((ModelBatKing) this.mainModel).getBatSize()); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render= INV_START) { - // place in custom inventory - if (!this.mergeItemStack(itemstack1, 0, INV_START, false)) { - return null; - } - } - - /** - * Implementation number 2: Shift-click items between action bar and inventory - */ - // item is in player's inventory, but not in action bar - if ((index >= INV_START) && (index < HOTBAR_START)) { - // place in action bar - if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END + 1, false)) { - return null; - } - } - // item in action bar - place in player inventory - else if ((index >= HOTBAR_START) && (index < (HOTBAR_END + 1))) { - if (!this.mergeItemStack(itemstack1, INV_START, INV_END + 1, false)) { - return null; - } - } - } - - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - - return itemstack; - } - - /** - * You should override this method to prevent the player from moving the stack that opened the inventory, otherwise - * if the player moves it, the inventory will not be able to save properly - */ - @Override - public ItemStack slotClick(final int slot, final int button, final int flag, final EntityPlayer player) { - // this will prevent the player from interacting with the item that opened the inventory: - if ((slot >= 0) && (this.getSlot(slot) != null) && (this.getSlot(slot).getStack() == player.getHeldItem())) { - return null; - } - - // Keybind for moving from hotbar slot to hovered slot, make we don't move the currently held backpack. - if (flag == 2 && button >= 0 && button < 9) { - int hotbarIndex = HOTBAR_START + button; - Slot hotbarSlot = getSlot(hotbarIndex); - if (hotbarSlot instanceof SlotBlockedInv) { - return null; - } - } - - return super.slotClick(slot, button, flag, player); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/Container_EggBox.java b/src/main/java/gtPlusPlus/core/container/Container_EggBox.java deleted file mode 100644 index 17a72135ec..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_EggBox.java +++ /dev/null @@ -1,133 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.inventories.Inventory_EggBox; -import gtPlusPlus.core.tileentities.general.TileEntityEggBox; - -public class Container_EggBox extends Container { - - protected TileEntityEggBox tile_entity; - public final Inventory_EggBox inventoryChest; - - private final World worldObj; - private final int posX; - private final int posY; - private final int posZ; - - public static int StorageSlotNumber = 15; // Number of slots in storage area - public static int InventorySlotNumber = 36; // Inventory Slots (Inventory - // and Hotbar) - public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All - // slots - - private final int[] slotStorage = new int[15]; - - public Container_EggBox(final InventoryPlayer inventory, final TileEntityEggBox te) { - this.tile_entity = te; - this.inventoryChest = te.getInventory(); - te.openInventory(); - - int var6; - int var7; - this.worldObj = te.getWorldObj(); - this.posX = te.xCoord; - this.posY = te.yCoord; - this.posZ = te.zCoord; - - int o = 0; - - // Storage Side - for (var6 = 0; var6 < 3; var6++) { - for (var7 = 0; var7 < 5; var7++) { - this.slotStorage[o] = o; - this.addSlotToContainer(new Slot(this.inventoryChest, o++, 44 + (var7 * 18), 15 + (var6 * 18))); - } - } - - // Player Inventory - for (var6 = 0; var6 < 3; ++var6) { - for (var7 = 0; var7 < 9; ++var7) { - this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18))); - } - } - - // Player Hotbar - for (var6 = 0; var6 < 9; ++var6) { - this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142)); - } - } - - @Override - public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, - final EntityPlayer aPlayer) { - - if (!aPlayer.worldObj.isRemote) { - if ((aSlotIndex == 999) || (aSlotIndex == -999)) { - // Utils.LOG_WARNING("??? - "+aSlotIndex); - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void onContainerClosed(final EntityPlayer par1EntityPlayer) { - super.onContainerClosed(par1EntityPlayer); - tile_entity.closeInventory(); - } - - @Override - public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { - if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockEggBox) { - return false; - } - - return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; - } - - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) { - ItemStack var3 = null; - final Slot var4 = (Slot) this.inventorySlots.get(par2); - - if ((var4 != null) && var4.getHasStack()) { - final ItemStack var5 = var4.getStack(); - var3 = var5.copy(); - - /* - * if (par2 == 0) { if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) { return null; - * } var4.onSlotChange(var5, var3); } else if (par2 >= InOutputSlotNumber && par2 < InventoryOutSlotNumber) - * { if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else - * if (par2 >= InventoryOutSlotNumber && par2 < FullSlotNumber) { if (!this.mergeItemStack(var5, - * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if - * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false)) { return null; } - */ - - if (var5.stackSize == 0) { - var4.putStack((ItemStack) null); - } else { - var4.onSlotChanged(); - } - - if (var5.stackSize == var3.stackSize) { - return null; - } - - var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; - } - - // Can merge Slot - @Override - public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) { - return super.func_94530_a(p_94530_1_, p_94530_2_); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/Container_Grindle.java b/src/main/java/gtPlusPlus/core/container/Container_Grindle.java deleted file mode 100644 index f49d840819..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_Grindle.java +++ /dev/null @@ -1,137 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import gtPlusPlus.core.inventories.BaseInventoryGrindle; -import gtPlusPlus.core.slots.SlotDataStick; - -public class Container_Grindle extends Container { - - /** - * The Item Inventory for this Container, only needed if you want to reference isUseableByPlayer - */ - public final BaseInventoryGrindle inventory; - - /** - * Using these will make transferStackInSlot easier to understand and implement INV_START is the index of the first - * slot in the Player's Inventory, so our BaseInventoryBackpack's number of slots (e.g. 5 slots is array indices - * 0-4, so start at 5) Notice how we don't have to remember how many slots we made? We can just use - * BaseInventoryBackpack.INV_SIZE and if we ever change it, the Container updates automatically. - */ - private static final int INV_START = BaseInventoryGrindle.INV_SIZE, INV_END = INV_START + 0, HOTBAR_START = INV_END, - HOTBAR_END = HOTBAR_START + 8; - - public Container_Grindle(final EntityPlayer par1Player, final InventoryPlayer inventoryPlayer, - final BaseInventoryGrindle inventoryItem) { - this.inventory = inventoryItem; - - int i; - - // Actual Scan Slot - this.addSlotToContainer(new SlotDataStick(this.inventory, 0, 152, 5)); - - for (i = 1; i < BaseInventoryGrindle.INV_SIZE; ++i) { - this.addSlotToContainer(new SlotDataStick(this.inventory, i, 153, 30 + (18 * i))); - } - - // PLAYER ACTION BAR - uses default locations for standard action bar texture - // file - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + (i * 18), 142)); - } - } - - @Override - public boolean canInteractWith(final EntityPlayer entityplayer) { - return this.inventory.isUseableByPlayer(entityplayer); - } - - /** - * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. - */ - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int index) { - ItemStack itemstack = null; - final Slot slot = (Slot) this.inventorySlots.get(index); - - if ((slot != null) && slot.getHasStack()) { - final ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - - // If item is in our custom Inventory or armor slot - if (index < INV_START) { - // try to place in player inventory / action bar - if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END + 1, true)) { - return null; - } - - slot.onSlotChange(itemstack1, itemstack); - } - // Item is in inventory / hotbar, try to place in custom inventory or armor - // slots - else { - /* - * If your inventory only stores certain instances of Items, you can implement shift-clicking to your - * inventory like this: // Check that the item is the right type if (itemstack1.getItem() instanceof - * ItemCustom) { // Try to merge into your custom inventory slots // We use - * 'BaseInventoryBackpack.INV_SIZE' instead of INV_START just in case // you also add armor or other - * custom slots if (!this.mergeItemStack(itemstack1, 0, BaseInventoryBackpack.INV_SIZE, false)) { return - * null; } } // If you added armor slots, check them here as well: // Item being shift-clicked is armor - * - try to put in armor slot if (itemstack1.getItem() instanceof ItemArmor) { int type = ((ItemArmor) - * itemstack1.getItem()).armorType; if (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START - * + type + 1, false)) { return null; } } Otherwise, you have basically 2 choices: 1. shift-clicking - * between player inventory and custom inventory 2. shift-clicking between action bar and inventory Be - * sure to choose only ONE of the following implementations!!! - */ - /** - * Implementation number 1: Shift-click into your custom inventory - */ - /* - * if (index >= INV_START) { // place in custom inventory if (!this.mergeItemStack(itemstack1, 0, - * INV_START, false)) { return null; } } - */ - /** - * Implementation number 2: Shift-click items between action bar and inventory - */ - /* - * // item is in player's inventory, but not in action bar if ((index >= INV_START) && (index < - * HOTBAR_START)) { // place in action bar if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END - * + 1, false)) { return null; } } // item in action bar - place in player inventory else if ((index >= - * HOTBAR_START) && (index < (HOTBAR_END + 1))) { if (!this.mergeItemStack(itemstack1, INV_START, - * INV_END + 1, false)) { return null; } } - */ } - - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - - return itemstack; - } - - /** - * You should override this method to prevent the player from moving the stack that opened the inventory, otherwise - * if the player moves it, the inventory will not be able to save properly - */ - @Override - public ItemStack slotClick(final int slot, final int button, final int flag, final EntityPlayer player) { - // this will prevent the player from interacting with the item that opened the - // inventory: - if ((slot >= 0) && (this.getSlot(slot) != null) && (this.getSlot(slot).getStack() == player.getHeldItem())) { - return null; - } - return super.slotClick(slot, button, flag, player); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java b/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java deleted file mode 100644 index 1ab23ed315..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_HeliumGenerator.java +++ /dev/null @@ -1,152 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.inventories.InventoryHeliumGenerator; -import gtPlusPlus.core.slots.SlotFuelRod; -import gtPlusPlus.core.slots.SlotNoInput; -import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator; - -public class Container_HeliumGenerator extends Container { - - protected TileEntityHeliumGenerator tile_entity; - public final InventoryHeliumGenerator inventoryChest; - - private final World worldObj; - private final int posX; - private final int posY; - private final int posZ; - - public static int StorageSlotNumber = 19; // Number of slots in storage area - public static int InventorySlotNumber = 36; // Inventory Slots (Inventory and Hotbar) - public static int FullSlotNumber = InventorySlotNumber + StorageSlotNumber; // All slots - - // 0 Is output, 1-18 are input. - private final int[] slotStorage = new int[19]; - - public Container_HeliumGenerator(final InventoryPlayer inventory, final TileEntityHeliumGenerator te) { - this.tile_entity = te; - this.inventoryChest = te.getInventory(); - - int var6; - int var7; - this.worldObj = te.getWorldObj(); - this.posX = te.xCoord; - this.posY = te.yCoord; - this.posZ = te.zCoord; - - int o = 0; - - // Output - this.addSlotToContainer(new SlotNoInput(this.inventoryChest, 0, 80, 53)); - this.slotStorage[o] = o; - o++; - - // Side A - for (var6 = 0; var6 < 3; ++var6) { - for (var7 = 0; var7 < 3; ++var7) { - Logger.INFO("Adding slots at var:" + (o) + " x:" + (8 + var7 * 18) + " y:" + (9 + var6 * 18)); - this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 8 + (var7 * 18), 18 + (var6 * 18))); - this.slotStorage[o] = o; - o++; - } - } - - // Side B - for (var6 = 0; var6 < 3; ++var6) { - for (var7 = 0; var7 < 3; ++var7) { - Logger.INFO("Adding slots at var:" + (o) + " x:" + (90 + 8 + (var7 * 18)) + " y:" + (9 + var6 * 18)); - this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 116 + (var7 * 18), 18 + (var6 * 18))); - this.slotStorage[o] = o; - o++; - } - } - - o = 0; - - // Player Inventory - for (var6 = 0; var6 < 3; ++var6) { - for (var7 = 0; var7 < 9; ++var7) { - this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18))); - } - } - - // Player Hotbar - for (var6 = 0; var6 < 9; ++var6) { - this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142)); - } - } - - @Override - public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, - final EntityPlayer aPlayer) { - - if (!aPlayer.worldObj.isRemote) { - if ((aSlotIndex == 999) || (aSlotIndex == -999)) { - // Utils.LOG_WARNING("??? - "+aSlotIndex); - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void onContainerClosed(final EntityPlayer par1EntityPlayer) { - super.onContainerClosed(par1EntityPlayer); - } - - @Override - public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { - if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockHeliumGenerator) { - return false; - } - - return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; - } - - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) { - ItemStack var3 = null; - final Slot var4 = (Slot) this.inventorySlots.get(par2); - - if ((var4 != null) && var4.getHasStack()) { - final ItemStack var5 = var4.getStack(); - var3 = var5.copy(); - - /* - * if (par2 == 0) { if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) { return null; - * } var4.onSlotChange(var5, var3); } else if (par2 >= InOutputSlotNumber && par2 < InventoryOutSlotNumber) - * { if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else - * if (par2 >= InventoryOutSlotNumber && par2 < FullSlotNumber) { if (!this.mergeItemStack(var5, - * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if - * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false)) { return null; } - */ - - if (var5.stackSize == 0) { - var4.putStack((ItemStack) null); - } else { - var4.onSlotChanged(); - } - - if (var5.stackSize == var3.stackSize) { - return null; - } - - var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; - } - - // Can merge Slot - @Override - public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) { - return super.func_94530_a(p_94530_1_, p_94530_2_); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java b/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java deleted file mode 100644 index 3a615675b5..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_ModularityTable.java +++ /dev/null @@ -1,193 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.inventories.modulartable.InventoryModularMain; -import gtPlusPlus.core.inventories.modulartable.InventoryModularOutput; -import gtPlusPlus.core.slots.SlotModularBauble; -import gtPlusPlus.core.slots.SlotModularBaubleUpgrades; -import gtPlusPlus.core.slots.SlotNoInput; -import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; - -public class Container_ModularityTable extends Container { - - /** The crafting matrix inventory (3x3). */ - protected TileEntityModularityTable tile_entity; - - public final InventoryModularMain inventoryGrid; - public final InventoryModularOutput inventoryOutputs; - public int mRecipeTime; - - private final World worldObj; - private final int posX; - private final int posY; - private final int posZ; - - private final int[] slotOutputs = new int[3]; - private final int[] slotGrid = new int[9]; - - public Container_ModularityTable(final InventoryPlayer inventory, final TileEntityModularityTable tile) { - this.tile_entity = tile; - this.inventoryGrid = tile.inventoryGrid; - this.inventoryOutputs = tile.inventoryOutputs; - this.tile_entity.setContainer(this); - this.mRecipeTime = this.tile_entity.getRecipeTime(); - Logger.INFO("Container: " + this.mRecipeTime); - - int var6; - int var7; - this.worldObj = tile.getWorldObj(); - this.posX = tile.xCoord; - this.posY = tile.yCoord; - this.posZ = tile.zCoord; - - int nextFreeSlot = 0; - - // Output slots - this.addSlotToContainer(new SlotModularBauble(this.inventoryOutputs, 0, 26 + (18 * 6), 8)); - this.addSlotToContainer(new SlotModularBaubleUpgrades(this.inventoryOutputs, 1, 26 + (18 * 5), 8)); - this.addSlotToContainer(new SlotNoInput(this.inventoryOutputs, 2, 26 + (18 * 6), 44)); - - int o = 0; - - // Storage Side - for (var6 = 0; var6 < 3; ++var6) { - for (var7 = 0; var7 < 3; ++var7) { - // Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 * - // 18)); - this.addSlotToContainer( - new SlotModularBaubleUpgrades( - this.inventoryGrid, - nextFreeSlot, - 8 + 18 + (var7 * 18), - 17 + (var6 * 18))); - this.slotGrid[o] = nextFreeSlot; - nextFreeSlot++; - o++; - } - } - - // Player Inventory - for (var6 = 0; var6 < 3; ++var6) { - for (var7 = 0; var7 < 9; ++var7) { - this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18))); - } - } - - // Player Hotbar - for (var6 = 0; var6 < 9; ++var6) { - this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142)); - } - - // this.onCraftMatrixChanged(this.craftMatrix); - - } - - /** - * Callback for when the crafting matrix is changed. - */ - /* - * public void onCraftMatrixChanged(IInventory p_75130_1_) { this.craftResult.setInventorySlotContents(0, - * CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); } - */ - - /** - * Called when the container is closed. - */ - @Override - public void onContainerClosed(EntityPlayer p_75134_1_) { - super.onContainerClosed(p_75134_1_); - if (!this.worldObj.isRemote) { - /* - * for (int i = 0; i < 9; ++i){ ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if - * (itemstack != null){ p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false); } } - */ - } - } - - public TileEntityModularityTable getTileentityViaContainer() { - if (this.tile_entity != null) { - return this.tile_entity; - } - return null; - } - - @Override - public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, - final EntityPlayer aPlayer) { - - if (!aPlayer.worldObj.isRemote) { - if ((aSlotIndex == 999) || (aSlotIndex == -999)) { - // Utils.LOG_WARNING("??? - "+aSlotIndex); - } - - if (aSlotIndex == 0) { - Logger.INFO("Player Clicked on the bauble slot"); - // TODO - } else if (aSlotIndex == 1) { - Logger.INFO("Player Clicked on the upgrade slot"); - // TODO - } else if (aSlotIndex == 2) { - Logger.INFO("Player Clicked on the output slot"); - // TODO - } else { - for (final int x : this.slotGrid) { - if (aSlotIndex == x) { - Logger.INFO("Player Clicked slot " + aSlotIndex + " in the crafting Grid"); - } - } - } - } - // Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid"); - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { - if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockModularTable) { - return false; - } - - return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; - } - - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) { - - return null; - - /* - * ItemStack var3 = null; final Slot var4 = (Slot)this.inventorySlots.get(par2); if ((var4 != null) && - * var4.getHasStack()) { final ItemStack var5 = var4.getStack(); var3 = var5.copy(); if (par2 == 0) { if - * (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) { return null; } - * var4.onSlotChange(var5, var3); } else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber)) { - * if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else if - * ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber)) { if (!this.mergeItemStack(var5, - * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if (!this.mergeItemStack(var5, - * InOutputSlotNumber, FullSlotNumber, false)) { return null; } if (var5.stackSize == 0) { - * var4.putStack((ItemStack)null); } else { var4.onSlotChanged(); } if (var5.stackSize == var3.stackSize) { - * return null; } var4.onPickupFromSlot(par1EntityPlayer, var5); } return var3; - */ - } - - // Can merge Slot - /* - * public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_){ return p_94530_2_.inventory != - * this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_); } - */ - - /* - * public ItemStack getOutputContent(){ ItemStack output = this.craftResult.getStackInSlot(0); if (output != null){ - * return output; } return null; } public ItemStack[] getInputComponents(){ ItemStack inputs[] = new ItemStack[9]; - * for (int r=0;r= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber)) { - * if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) { return null; } } else if - * ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber)) { if (!this.mergeItemStack(var5, - * InOutputSlotNumber, InventoryOutSlotNumber, false)) { return null; } } else if (!this.mergeItemStack(var5, - * InOutputSlotNumber, FullSlotNumber, false)) { return null; } if (var5.stackSize == 0) { - * var4.putStack((ItemStack)null); } else { var4.onSlotChanged(); } if (var5.stackSize == var3.stackSize) { - * return null; } var4.onPickupFromSlot(par1EntityPlayer, var5); } return var3; - */ - } - - public ItemStack getOutputContent() { - ItemStack output = this.inventoryOutputs.getStackInSlot(0); - if (output != null) { - return output; - } - return null; - } - - public ItemStack[] getInputComponents() { - ItemStack inputs[] = new ItemStack[9]; - for (int r = 0; r < this.inventoryChest.getSizeInventory(); r++) { - ItemStack temp = this.inventoryChest.getStackInSlot(r); - inputs[r] = temp; - } - return inputs; - } -} diff --git a/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java b/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java deleted file mode 100644 index 9bd740a5a2..0000000000 --- a/src/main/java/gtPlusPlus/core/container/box/LunchBoxContainer.java +++ /dev/null @@ -1,21 +0,0 @@ -package gtPlusPlus.core.container.box; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; - -import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase; -import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory; -import gtPlusPlus.core.slots.SlotLunchBox; - -public class LunchBoxContainer extends ContainerBoxBase { - - public LunchBoxContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, - CustomBoxInventory CustomBoxInventory) { - super( - par1Player, - inventoryPlayer, - CustomBoxInventory, - SlotLunchBox.class, - gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java b/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java deleted file mode 100644 index 3158631610..0000000000 --- a/src/main/java/gtPlusPlus/core/container/box/MagicBagContainer.java +++ /dev/null @@ -1,21 +0,0 @@ -package gtPlusPlus.core.container.box; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; - -import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase; -import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory; -import gtPlusPlus.core.slots.SlotMagicToolBag; - -public class MagicBagContainer extends ContainerBoxBase { - - public MagicBagContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, - CustomBoxInventory CustomBoxInventory) { - super( - par1Player, - inventoryPlayer, - CustomBoxInventory, - SlotMagicToolBag.class, - gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS); - } -} diff --git a/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java b/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java deleted file mode 100644 index 6af27082fa..0000000000 --- a/src/main/java/gtPlusPlus/core/container/box/ToolBoxContainer.java +++ /dev/null @@ -1,17 +0,0 @@ -package gtPlusPlus.core.container.box; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; - -import gtPlusPlus.core.item.tool.misc.box.ContainerBoxBase; -import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory; -import gtPlusPlus.core.item.tool.misc.box.UniversalToolBox; -import gtPlusPlus.core.slots.SlotToolBox; - -public class ToolBoxContainer extends ContainerBoxBase { - - public ToolBoxContainer(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, - CustomBoxInventory CustomBoxInventory) { - super(par1Player, inventoryPlayer, CustomBoxInventory, SlotToolBox.class, UniversalToolBox.SLOTS); - } -} diff --git a/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java index 1254d9bdff..4be3605ff1 100644 --- a/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java +++ b/src/main/java/gtPlusPlus/core/entity/InternalEntityRegistry.java @@ -3,8 +3,6 @@ import cpw.mods.fml.common.registry.EntityRegistry; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.entity.monster.EntityBatKing; -import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion; @@ -109,28 +107,5 @@ public static void registerEntities() { 20, true); - /** - * Globals, which generate spawn eggs. (Currently required for Giant chicken spawning) - */ - EntityRegistry.registerModEntity( - EntityGiantChickenBase.class, - "bigChickenFriendly", - mEntityID++, - GTplusplus.instance, - 64, - 20, - true); - ItemCustomSpawnEgg.registerEntityForSpawnEgg( - 2, - "bigChickenFriendly", - Utils.rgbtoHexValue(255, 0, 0), - Utils.rgbtoHexValue(175, 175, 175)); - EntityRegistry - .registerModEntity(EntityBatKing.class, "batKing", mEntityID++, GTplusplus.instance, 64, 20, true); - ItemCustomSpawnEgg.registerEntityForSpawnEgg( - 3, - "batKing", - Utils.rgbtoHexValue(175, 175, 0), - Utils.rgbtoHexValue(0, 175, 175)); } } diff --git a/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java b/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java deleted file mode 100644 index 1cfb2154b1..0000000000 --- a/src/main/java/gtPlusPlus/core/entity/ai/batking/EntityAIBatKingAttack.java +++ /dev/null @@ -1,419 +0,0 @@ -package gtPlusPlus.core.entity.ai.batking; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.entity.monster.EntityBatKing; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.EntityUtils; - -public class EntityAIBatKingAttack extends EntityAIBase { - - private final Ranged mRangedAI; - private final Melee mMeleeAI; - private boolean mIsMelee = false; - - /** The Bat King in control of this AI. */ - private final EntityBatKing mAttackingEntity; - - /** The PathEntity of our entity. */ - private PathEntity mEntityPathEntity; - - /** The current target of Bat King in control of this AI. */ - private EntityLivingBase mEntityTarget; - - private final Class mClassTarget; - - public EntityAIBatKingAttack(EntityBatKing aAttacker, Class aClassTarget, double aMovementSpeed, int someInt, - int aMaxRangedAttackTime, float someFloat, boolean aLongMemory) { - mRangedAI = new Ranged(this, aMovementSpeed, someInt, 5, someFloat); - mMeleeAI = new Melee(this, aClassTarget, aMovementSpeed, aLongMemory); - mAttackingEntity = aAttacker; - mClassTarget = aClassTarget; - } - - @Override - public boolean shouldExecute() { - determineCombatStyle(); - EntityLivingBase entitylivingbase = this.mAttackingEntity.getAttackTarget(); - if (entitylivingbase == null) { - this.mEntityTarget = null; - return false; - } else if (!entitylivingbase.isEntityAlive()) { - return false; - } else if (this.mClassTarget != null && !this.mClassTarget.isAssignableFrom(entitylivingbase.getClass())) { - return false; - } else { - if (this.mIsMelee) { - return this.mMeleeAI.shouldExecute(); - } else { - this.mEntityTarget = entitylivingbase; - this.mEntityPathEntity = this.mAttackingEntity.getNavigator().getPathToEntityLiving(entitylivingbase); - return mRangedAI != null && mMeleeAI != null && hasValidTarget(); - } - } - } - - public EntityBatKing getBatKing() { - return this.mAttackingEntity; - } - - public IRangedAttackMob getBatKingAsIRangedAttackMob() { - return this.mAttackingEntity; - } - - public boolean hasValidTarget() { - return this.mEntityTarget != null; - } - - public EntityLivingBase getTarget() { - return mEntityTarget; - } - - @Override - public boolean continueExecuting() { - determineCombatStyle(); - if (mIsMelee) { - return mMeleeAI.continueExecuting(); - } else { - return mRangedAI.continueExecuting(); - } - } - - @Override - public boolean isInterruptible() { - if (mIsMelee) { - - } else { - - } - return super.isInterruptible(); - } - - @Override - public void startExecuting() { - determineCombatStyle(); - if (mIsMelee) { - mMeleeAI.startExecuting(); - } else { - mRangedAI.startExecuting(); - } - } - - @Override - public void resetTask() { - determineCombatStyle(); - if (mIsMelee) { - mMeleeAI.resetTask(); - } else { - mRangedAI.resetTask(); - } - } - - @Override - public void updateTask() { - determineCombatStyle(); - if (mIsMelee) { - mMeleeAI.updateTask(); - } else { - mRangedAI.updateTask(); - } - } - - private final void determineCombatStyle() { - boolean aisMeleeNow = this.mIsMelee; - if (this.mEntityTarget != null && EntityUtils.getDistance(getBatKing(), mEntityTarget) < 4) { - this.mIsMelee = true; - } else { - this.mIsMelee = false; - } - if (aisMeleeNow != this.mIsMelee) { - Logger.INFO( - "Bat King changed combat style from " + (aisMeleeNow ? "Melee" : "Ranged") - + " to " - + (this.mIsMelee ? "Melee" : "Ranged")); - } - } - - private class Ranged { - - private final EntityAIBatKingAttack parentAI; - - /** - * A decrementing tick that spawns a ranged attack once this value reaches 0. It is then set back to the - * maxRangedAttackTime. - */ - private int rangedAttackTime; - - private double entityMoveSpeed; - private int mCooldownTime; - private int field_96561_g; - /** - * The maximum time the AI has to wait before performing another ranged attack. - */ - private int maxRangedAttackTime; - - private float field_96562_i; - private float field_82642_h; // Max range - - public Ranged(EntityAIBatKingAttack aParent, double aMovementSpeed, int someInt, int aMaxRangedAttackTime, - float someFloat) { - this.rangedAttackTime = -1; - this.parentAI = aParent; - this.entityMoveSpeed = aMovementSpeed; - this.field_96561_g = someInt; - this.maxRangedAttackTime = aMaxRangedAttackTime; - this.field_96562_i = someFloat; - this.field_82642_h = someFloat * someFloat * 8; - parentAI.setMutexBits(3); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - parentAI.getBatKing().getNavigator().setPath(parentAI.mEntityPathEntity, this.entityMoveSpeed); - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return parentAI.shouldExecute() || !parentAI.getBatKing().getNavigator().noPath(); - } - - /** - * Resets the task - */ - public void resetTask() { - parentAI.mEntityTarget = null; - this.mCooldownTime = 0; - this.rangedAttackTime = -1; - } - - /** - * Updates the task - */ - public void updateTask() { - - if (MathUtils.randInt(0, 100) == 0) { - maxRangedAttackTime = MathUtils.balance(maxRangedAttackTime, 20, 40); - } - - double d0 = parentAI.getBatKing().getDistanceSq( - parentAI.mEntityTarget.posX, - parentAI.mEntityTarget.boundingBox.minY, - parentAI.mEntityTarget.posZ); - boolean flag = parentAI.getBatKing().getEntitySenses().canSee(parentAI.mEntityTarget); - - if (flag) { - ++this.mCooldownTime; - } else { - this.mCooldownTime = 0; - } - - if (d0 <= (double) this.field_82642_h && this.mCooldownTime >= 20) { - parentAI.getBatKing().getNavigator().clearPathEntity(); - } else { - if (parentAI.getBatKing().getNavigator() - .tryMoveToEntityLiving(parentAI.mEntityTarget, this.entityMoveSpeed)) { - Logger.INFO("Doing Ranged Ai Task."); - } else { - Logger.INFO("Not Doing Ranged Ai Task."); - } - } - - parentAI.getBatKing().getLookHelper().setLookPositionWithEntity(parentAI.mEntityTarget, 30.0F, 30.0F); - float f; - Logger.INFO("Ranged AI - " + rangedAttackTime); - - if (--this.rangedAttackTime == 0) { - if (d0 > (double) this.field_82642_h || !flag) { - Logger.INFO( - "Stopping ranged attack. " + flag - + "|" - + (d0 > (double) this.field_82642_h) - + "|" - + d0 - + "|" - + (double) this.field_82642_h); - return; - } - - f = MathHelper.sqrt_double(d0) / this.field_96562_i; - float f1 = f; - - if (f < 0.1F) { - f1 = 0.1F; - } - - if (f1 > 1.0F) { - f1 = 1.0F; - } - Logger.INFO("Trying to do a ranged attack."); - parentAI.getBatKingAsIRangedAttackMob().attackEntityWithRangedAttack(parentAI.mEntityTarget, f1); - this.rangedAttackTime = MathHelper.floor_float( - f * (float) (this.maxRangedAttackTime - this.field_96561_g) + (float) this.field_96561_g); - } else if (this.rangedAttackTime < 0) { - f = MathHelper.sqrt_double(d0) / this.field_96562_i; - this.rangedAttackTime = MathHelper.floor_float( - f * (float) (this.maxRangedAttackTime - this.field_96561_g) + (float) this.field_96561_g); - } - } - } - - private class Melee { - - private final EntityAIBatKingAttack parentAI; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - /** The speed with which the mob will approach the target */ - double speedTowardsTarget; - /** - * When true, the mob will continue chasing its target, even if it can't find a path to them right now. - */ - boolean longMemory; - - Class classTarget; - private int field_75445_i; - private double field_151497_i; - private double field_151495_j; - private double field_151496_k; - - private int failedPathFindingPenalty; - - public Melee(EntityAIBatKingAttack aParent, Class aClassTarget, double aMoveToTargetSpeed, - boolean aLongMemory) { - this.parentAI = aParent; - this.classTarget = aClassTarget; - this.speedTowardsTarget = aMoveToTargetSpeed; - this.longMemory = aLongMemory; - parentAI.setMutexBits(3); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (!parentAI.hasValidTarget()) { - return false; - } - EntityLivingBase entitylivingbase = parentAI.getTarget(); - - if (entitylivingbase == null) { - return false; - } else if (!entitylivingbase.isEntityAlive()) { - return false; - } else if (this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass())) { - return false; - } else { - if (--this.field_75445_i <= 0) { - parentAI.mEntityPathEntity = parentAI.mAttackingEntity.getNavigator() - .getPathToEntityLiving(entitylivingbase); - this.field_75445_i = 4 + parentAI.mAttackingEntity.getRNG().nextInt(7); - return parentAI.mEntityPathEntity != null; - } else { - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase entitylivingbase = parentAI.mAttackingEntity.getAttackTarget(); - return entitylivingbase == null ? false - : (!entitylivingbase.isEntityAlive() ? false - : (!this.longMemory ? !parentAI.mAttackingEntity.getNavigator().noPath() - : parentAI.mAttackingEntity.isWithinHomeDistance( - MathHelper.floor_double(entitylivingbase.posX), - MathHelper.floor_double(entitylivingbase.posY), - MathHelper.floor_double(entitylivingbase.posZ)))); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - parentAI.mAttackingEntity.getNavigator().setPath(parentAI.mEntityPathEntity, this.speedTowardsTarget); - this.field_75445_i = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - parentAI.mAttackingEntity.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - public void updateTask() { - EntityLivingBase entitylivingbase = parentAI.mAttackingEntity.getAttackTarget(); - parentAI.mAttackingEntity.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F); - double d0 = parentAI.mAttackingEntity - .getDistanceSq(entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ); - double d1 = (double) (parentAI.mAttackingEntity.width * 2.0F * parentAI.mAttackingEntity.width * 2.0F - + entitylivingbase.width); - --this.field_75445_i; - - if ((this.longMemory || parentAI.mAttackingEntity.getEntitySenses().canSee(entitylivingbase)) - && this.field_75445_i <= 0 - && (this.field_151497_i == 0.0D && this.field_151495_j == 0.0D && this.field_151496_k == 0.0D - || entitylivingbase - .getDistanceSq(this.field_151497_i, this.field_151495_j, this.field_151496_k) - >= 1.0D - || parentAI.mAttackingEntity.getRNG().nextFloat() < 0.05F)) { - this.field_151497_i = entitylivingbase.posX; - this.field_151495_j = entitylivingbase.boundingBox.minY; - this.field_151496_k = entitylivingbase.posZ; - this.field_75445_i = failedPathFindingPenalty + 4 + parentAI.mAttackingEntity.getRNG().nextInt(7); - - if (parentAI.mAttackingEntity.getNavigator().getPath() != null) { - PathPoint finalPathPoint = parentAI.mAttackingEntity.getNavigator().getPath().getFinalPathPoint(); - if (finalPathPoint != null && entitylivingbase - .getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) { - failedPathFindingPenalty = 0; - } else { - failedPathFindingPenalty += 10; - } - } else { - failedPathFindingPenalty += 10; - } - - if (d0 > 1024.0D) { - this.field_75445_i += 10; - } else if (d0 > 256.0D) { - this.field_75445_i += 5; - } - - if (!parentAI.mAttackingEntity.getNavigator() - .tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget)) { - this.field_75445_i += 15; - } - } - - this.attackTick = Math.max(this.attackTick - 1, 0); - - if (d0 <= d1 && this.attackTick <= 20) { - this.attackTick = 20; - - if (parentAI.mAttackingEntity.getHeldItem() != null) { - parentAI.mAttackingEntity.swingItem(); - } - - parentAI.mAttackingEntity.attackEntityAsMob(entitylivingbase); - } - } - } -} diff --git a/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java b/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java deleted file mode 100644 index d100d3571b..0000000000 --- a/src/main/java/gtPlusPlus/core/entity/item/ItemEntityGiantEgg.java +++ /dev/null @@ -1,117 +0,0 @@ -package gtPlusPlus.core.entity.item; - -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.NBTUtils; - -public class ItemEntityGiantEgg extends EntityItem { - - /** - * The maximum age of this Chicken Egg. The item will try hatch once this is reached. - */ - public int mEggAge = 10000; - - public int mEggSize = -1; - - public ItemEntityGiantEgg(World aWorld) { - super(aWorld); - } - - public ItemEntityGiantEgg(World aWorld, double aX, double aY, double aZ) { - super(aWorld, aX, aY, aZ); - } - - public ItemEntityGiantEgg(World aWorld, double aX, double aY, double aZ, ItemStack aStack) { - super(aWorld, aX, aY, aZ, aStack); - } - - private boolean spawnGiantChicken() { - try { - EntityGiantChickenBase entitychicken = new EntityGiantChickenBase(this.worldObj); - entitychicken.setGrowingAge(-MathUtils.randInt(20000, 40000)); - entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); - return this.worldObj.spawnEntityInWorld(entitychicken); - } catch (Throwable t) { - return false; - } - } - - // These eggs also do not combine. - @Override - public boolean combineItems(EntityItem p_70289_1_) { - return false; - } - - @Override - public void writeEntityToNBT(NBTTagCompound aNBT) { - super.writeEntityToNBT(aNBT); - aNBT.setInteger("mEggAge", mEggAge); - aNBT.setInteger("mTicksExisted", this.age); - } - - @Override - public void readEntityFromNBT(NBTTagCompound aNBT) { - super.readEntityFromNBT(aNBT); - mEggAge = aNBT.getInteger("mEggAge"); - } - - // They're fireproof - @Override - public void setFire(int p_70015_1_) {} - - @Override - public boolean isBurning() { - return false; - } - - @Override - public void onEntityUpdate() { - super.onEntityUpdate(); - Logger.INFO("1"); - // Large eggs don't despawn, because they will try hatch first. - if (this.lifespan != Integer.MAX_VALUE - 1) { - this.lifespan = Integer.MAX_VALUE - 1; - } - - if (this.getEntityItem() != null) { - ItemStack g = this.getEntityItem(); - NBTUtils.setInteger(g, "mTicksExisted", this.age); - NBTUtils.setInteger(g, "lifespan", this.lifespan); - NBTUtils.setBoolean(g, "playerHeld", false); - this.setEntityItemStack(g); - Logger.INFO("Writing age to NBT of stored stack item."); - } else { - ItemStack g = ItemUtils.getSimpleStack(ModItems.itemBigEgg); - NBTUtils.setInteger(g, "mTicksExisted", this.age); - NBTUtils.setInteger(g, "lifespan", this.lifespan); - NBTUtils.setBoolean(g, "playerHeld", false); - this.setEntityItemStack(g); - Logger.INFO("Writing age to NBT of new stack item."); - } - - if (this.age >= 1000) { - // Cache the value for efficiency - if (mEggSize == -1) mEggSize = (this.getEntityItem() != null - ? (this.getEntityItem().hasTagCompound() - ? (this.getEntityItem().getTagCompound().hasKey("size") - ? this.getEntityItem().getTagCompound().getInteger("size") - : 1) - : 1) - : 1); - if (MathUtils.randInt(100 * mEggSize, 1000) >= MathUtils.randInt(950, 1000)) { - // Spawn Chicken - if (spawnGiantChicken()) { - this.kill(); - } - } - } - } -} diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java b/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java deleted file mode 100644 index 1c786a20b8..0000000000 --- a/src/main/java/gtPlusPlus/core/entity/monster/EntityBatKing.java +++ /dev/null @@ -1,760 +0,0 @@ -package gtPlusPlus.core.entity.monster; - -import java.lang.reflect.Field; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackOnCollide; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAINearestAttackableTarget; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.RandomPositionGenerator; -import net.minecraft.entity.monster.EntityMob; -import net.minecraft.entity.passive.EntityBat; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.EnumDifficulty; -import net.minecraft.world.World; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.core.entity.ai.batking.EntityAIBatKingAttack; -import gtPlusPlus.core.entity.projectile.EntityThrowableBomb; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.EntityUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; - -public class EntityBatKing extends EntityMob implements IRangedAttackMob { - - public int courseChangeCooldown; - public double waypointX; - public double waypointY; - public double waypointZ; - private Entity targetedEntity; - private int aggroCooldown; - public int prevAttackCounter; - public int attackCounter; - private int explosionStrength = 1; - - private EntityAIBatKingAttack aiAttack = new EntityAIBatKingAttack(this, null, 1.0D, 20, 60, 15.0F, true); - private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide( - this, - EntityPlayer.class, - 1.2D, - false); - - public EntityBatKing(World p_i1680_1_) { - super(p_i1680_1_); - this.setSize(2.5F, 1.5F); - - this.setIsBatHanging(false); - this.isImmuneToFire = true; - this.experienceValue = 1000; - - this.tasks.addTask(3, this.aiAttack); - // this.tasks.addTask(4, this.aiAttackOnCollide); - // this.tasks.addTask(4, new EntityAIRestrictSun(this)); - // this.tasks.addTask(5, new EntityAIFleeSun(this, 1.0D)); - this.tasks.addTask(4, new EntityAIWander(this, 1.0D)); - // this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - // this.tasks.addTask(6, new EntityAILookIdle(this)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); - // this.targetTasks.addTask(2, this.aiAttack); - this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); - this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityBat.class, 0, false)); - } - - @Override - protected void entityInit() { - super.entityInit(); - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - /** - * Gets the pitch of living sounds in living entities. - */ - @Override - protected float getSoundPitch() { - return super.getSoundPitch() * 0.15F; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - int aRand = MathUtils.randInt(0, 10); - if (aRand < 6) { - return null; - } else if (aRand <= 8) { - return "mob.bat.idle"; - } else { - return "mob.blaze.breathe"; - } - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return "mob.blaze.hit"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return "mob.bat.death"; - } - - /** - * Returns true if this entity should push and be pushed by other entities when colliding. - */ - @Override - public boolean canBePushed() { - return true; - } - - @Override - protected void collideWithEntity(Entity aEntity) { - if (aEntity != null) { - if (aEntity instanceof EntityPlayer) { - EntityUtils.doDamage(aEntity, DamageSource.magic, (int) (((EntityPlayer) aEntity).getHealth() / 20)); - } - } - } - - @Override - protected void collideWithNearbyEntities() {} - - @Override - protected void applyEntityAttributes() { - - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.maxHealth); - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.knockbackResistance); - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.movementSpeed); - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange); - - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(250.0D); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1D); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(120.0D); - } - - public boolean getIsBatHanging() { - return false; - } - - public void setIsBatHanging(boolean p_82236_1_) { - generateParticles(this); - generateParticles(this); - generateParticles(this); - for (int i = 0; i < 32; ++i) { - // - String particleName = "lava"; - if (MathUtils.randInt(0, 3) <= 2) { - particleName = "crit"; - } - this.worldObj.spawnParticle( - particleName, - this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width, - this.posY + this.rand.nextDouble() * (double) this.height, - this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, - 0.0D, - 0.0D, - 0.0D); - } - } - - /** - * Returns true if the newer Entity AI code should be run - */ - @Override - protected boolean isAIEnabled() { - return true; - } - - /** - * Called to update the entity's position/logic. - */ - @Override - public void onUpdate() { - super.onUpdate(); - generateParticles(this); - - if (!this.worldObj.isRemote && (this.targetedEntity == null || this.aggroCooldown-- <= 0)) { - this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); - - if (this.targetedEntity != null) { - this.aggroCooldown = 30; - if (aiAttack.hasValidTarget()) { - this.setAttackTarget(aiAttack.getTarget()); - } else { - Logger.INFO("No valid target."); - if (ReflectionUtils.doesFieldExist(aiAttack.getClass(), "mEntityTarget")) { - Logger.INFO("Found field."); - } else { - Logger.INFO("Did not find field."); - } - Field target = ReflectionUtils.getField(EntityAIBatKingAttack.class, "mEntityTarget"); - if (target != null) { - ReflectionUtils.setField(aiAttack, target, this.targetedEntity); - Logger.INFO("Set target."); - } else { - Logger.INFO("Could not set via reflection."); - } - } - } else { - Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this, 32, 20); - if (vec3 != null) { - double xPosition = vec3.xCoord; - double yPosition = vec3.yCoord; - double zPosition = vec3.zCoord; - this.getNavigator().tryMoveToXYZ(xPosition, yPosition, zPosition, 3); - } - } - } - } - - private static void generateParticles(EntityBatKing aKing) { - for (int i = 0; i < 20; ++i) { - // - if (MathUtils.randInt(0, 50) <= 1) { - String particleName = "smoke"; - if (MathUtils.randInt(0, 3) <= 2) { - particleName = "largesmoke"; - } - aKing.worldObj.spawnParticle( - particleName, - aKing.posX + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width, - aKing.posY + aKing.rand.nextDouble() * (double) aKing.height, - aKing.posZ + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width, - 0.0D, - 0.0D, - 0.0D); - } - if (MathUtils.randInt(0, 100) <= 1) { - String particleName = "smoke"; - int test2 = MathUtils.randInt(0, 3); - if (test2 == 2) { - particleName = "dripLava"; - } else if (test2 == 3) { - particleName = "portal"; - } - aKing.worldObj.spawnParticle( - particleName, - aKing.posX + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width, - aKing.posY + aKing.rand.nextDouble() * (double) aKing.height, - aKing.posZ + (aKing.rand.nextDouble() - 0.5D) * (double) aKing.width, - 0.0D, - 0.0D, - 0.0D); - } - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - private boolean isFlying() { - if (this.onGround) { - return false; - } - return true; - } - - private boolean hasAir() { - BlockPos p = EntityUtils.findBlockPosUnderEntity(this); - int y = p.yPos; - int yOriginal = p.yPos; - - for (int u = 0; u < 5; u++) { - if (u > 50 || y <= 0) { - break; - } - if (!this.worldObj.isAirBlock(p.xPos, y, p.zPos)) { - break; - } - y--; - } - if (yOriginal != y) { - for (int i = 0; i < y; y++) { - this.jump(); - } - return true; - } - return false; - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - /** - * Return whether this entity should NOT trigger a pressure plate or a tripwire. - */ - @Override - public boolean doesEntityNotTriggerPressurePlate() { - return true; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { - if (this.isEntityInvulnerable()) { - return false; - } else { - if (!this.worldObj.isRemote && this.getIsBatHanging()) { - this.setIsBatHanging(false); - } - - return super.attackEntityFrom(p_70097_1_, p_70097_2_); - } - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound p_70037_1_) { - super.readEntityFromNBT(p_70037_1_); - if (p_70037_1_.hasKey("ExplosionPower", 99)) { - this.explosionStrength = p_70037_1_.getInteger("ExplosionPower"); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound p_70014_1_) { - super.writeEntityToNBT(p_70014_1_); - p_70014_1_.setInteger("ExplosionPower", this.explosionStrength); - } - - /** - * Attack the specified entity using a ranged attack. - */ - @Override - public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { - Logger.INFO("Trying to do ranged attack 1 |" + (this.targetedEntity != null) + "|"); - - if (!this.isFlying() || !this.isAirBorne) { - // this.hasAir(); - /* - * for (int i=0;i<3;i++) { this.jump(); } - */ - } - - double d4 = 64.0D; - if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4 * 8) { - Logger.INFO("Trying to do ranged attack 2"); - double d5 = this.targetedEntity.posX - this.posX; - double d6 = this.targetedEntity.boundingBox.minY + (double) (this.targetedEntity.height / 2.0F) - - (this.posY + (double) (this.height / 2.0F)); - double d7 = this.targetedEntity.posZ - this.posZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI; - - ++this.attackCounter; - - if (this.canEntityBeSeen(this.targetedEntity)) { - Logger.INFO("Trying to do ranged attack 3a | " + attackCounter); - - if (this.attackCounter >= 2) { - Logger.INFO("Trying to do ranged attack 3a1"); - - this.worldObj.playAuxSFXAtEntity( - (EntityPlayer) null, - 1008, - (int) this.posX, - (int) this.posY, - (int) this.posZ, - 0); - setIsBatHanging(true); - - EntityThrowableBomb entitylargefireball = new EntityThrowableBomb( - this.worldObj, - this /* d5, d6, d7 */); - // entitylargefireball.field_92057_e = this.explosionStrength; - // entitylargefireball.accelerationX *= 2; - // entitylargefireball.accelerationY *= 2; - // entitylargefireball.accelerationZ *= 2; - double d8 = 4.0D; - Vec3 vec3 = this.getLook(1.0F); - entitylargefireball.posX = this.posX + vec3.xCoord * d8; - entitylargefireball.posY = this.posY + (double) (this.height / 2.0F) + 0.5D; - entitylargefireball.posZ = this.posZ + vec3.zCoord * d8; - this.worldObj.spawnEntityInWorld(entitylargefireball); - - for (int u = 0; u < MathUtils.randInt(2, 10); u++) { - if (this.attackCounter > 0) { - Logger.INFO("Trying to do ranged attack 5a"); - --this.attackCounter; - EntityArrow entityarrow = new EntityArrow( - this.worldObj, - this, - p_82196_1_, - MathUtils.randFloat(1f, 3f), - (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4)); - int i = MathUtils.randInt(0, 4); - int j = MathUtils.randInt(0, 3); - int k = MathUtils.randInt(0, 3); - entityarrow.setDamage( - (double) (p_82196_2_ * 2.0F) + this.rand.nextGaussian() * 0.25D - + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() - * 0.11F)); - - boolean boostAttack = MathUtils.randInt(0, 100) <= 21; - if (boostAttack) { - if (i > 0) { - entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D); - } - - if (j > 0) { - entityarrow.setKnockbackStrength(j); - } - if (k > 0) { - entityarrow.setFire(50 * k); - } - } - - this.playSound("mob.skeleton.say", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); - this.worldObj.spawnEntityInWorld(entityarrow); - Logger.INFO("Trying to do ranged attack 5a done"); - } - } - - this.attackCounter = 0; - } - } else if (this.attackCounter > 0) { - Logger.INFO("Trying to do ranged attack 3b"); - --this.attackCounter; - } - } else { - Logger.INFO("Trying to do ranged attack 4a"); - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F - / (float) Math.PI; - - if (this.attackCounter > 0) { - Logger.INFO("Trying to do ranged attack 5a"); - --this.attackCounter; - EntityArrow entityarrow = new EntityArrow( - this.worldObj, - this, - p_82196_1_, - 1.6F, - (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4)); - int i = MathUtils.randInt(0, 4); - int j = MathUtils.randInt(0, 3); - int k = MathUtils.randInt(0, 3); - entityarrow.setDamage( - (double) (p_82196_2_ * 2.0F) + this.rand.nextGaussian() * 0.25D - + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F)); - - boolean boostAttack = MathUtils.randInt(0, 100) <= 21; - if (boostAttack) { - if (i > 0) { - entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D); - } - - if (j > 0) { - entityarrow.setKnockbackStrength(j); - } - if (k > 0) { - entityarrow.setFire(50 * k); - } - } - - this.playSound("mob.skeleton.say", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); - this.worldObj.spawnEntityInWorld(entityarrow); - Logger.INFO("Trying to do ranged attack 5a done"); - } - } - } - - /** - * Returns the volume for the sounds this mob makes. - */ - @Override - protected float getSoundVolume() { - return 10.0F; - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - return super.getCanSpawnHere() && this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL; - } - - /** - * Will return how many at most can spawn in a chunk at once. - */ - @Override - public int getMaxSpawnedInChunk() { - return 1; - } - - @Override - protected Item getDropItem() { - return Items.gunpowder; - } - - /** - * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param - * par2 - Level of Looting used to kill this mob. - */ - @Override - protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { - int j = this.rand.nextInt(2) + this.rand.nextInt(1 + p_70628_2_); - int k; - - for (k = 0; k < j; ++k) { - this.dropItem(Items.ghast_tear, 1); - } - - j = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_); - - for (k = 0; k < j; ++k) { - this.dropItem(Items.gunpowder, 1); - } - } - - @Override - protected void updateEntityActionState() { - if (!this.worldObj.isRemote && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) { - this.setDead(); - } - - this.despawnEntity(); - this.prevAttackCounter = this.attackCounter; - double d0 = this.waypointX - this.posX; - double d1 = this.waypointY - this.posY; - double d2 = this.waypointZ - this.posZ; - double d3 = d0 * d0 + d1 * d1 + d2 * d2; - - if (d3 < 1.0D || d3 > 3600.0D) { - this.waypointX = this.posX + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); - this.waypointY = this.posY + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); - this.waypointZ = this.posZ + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); - } - - if (this.courseChangeCooldown-- <= 0) { - this.courseChangeCooldown += this.rand.nextInt(5) + 2; - d3 = (double) MathHelper.sqrt_double(d3); - - if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, d3)) { - this.motionX += d0 / d3 * 0.1D; - this.motionY += d1 / d3 * 0.1D; - this.motionZ += d2 / d3 * 0.1D; - } else { - this.waypointX = this.posX; - this.waypointY = this.posY; - this.waypointZ = this.posZ; - } - } - - if (this.targetedEntity != null && this.targetedEntity.isDead) { - this.targetedEntity = null; - } - - if (this.targetedEntity == null || this.aggroCooldown-- <= 0) { - this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); - - if (this.targetedEntity != null) { - this.aggroCooldown = 20; - } - } - - double d4 = 64.0D; - - if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4) { - double d5 = this.targetedEntity.posX - this.posX; - double d6 = this.targetedEntity.boundingBox.minY + (double) (this.targetedEntity.height / 2.0F) - - (this.posY + (double) (this.height / 2.0F)); - double d7 = this.targetedEntity.posZ - this.posZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(d5, d7)) * 180.0F / (float) Math.PI; - - if (this.canEntityBeSeen(this.targetedEntity)) { - if (this.attackCounter == 10) { - this.worldObj.playAuxSFXAtEntity( - (EntityPlayer) null, - 1007, - (int) this.posX, - (int) this.posY, - (int) this.posZ, - 0); - } - - ++this.attackCounter; - - if (this.attackCounter == 20) { - this.worldObj.playAuxSFXAtEntity( - (EntityPlayer) null, - 1008, - (int) this.posX, - (int) this.posY, - (int) this.posZ, - 0); - EntityLargeFireball entitylargefireball = new EntityLargeFireball(this.worldObj, this, d5, d6, d7); - entitylargefireball.field_92057_e = this.explosionStrength; - double d8 = 4.0D; - Vec3 vec3 = this.getLook(1.0F); - entitylargefireball.posX = this.posX + vec3.xCoord * d8; - entitylargefireball.posY = this.posY + (double) (this.height / 2.0F) + 0.5D; - entitylargefireball.posZ = this.posZ + vec3.zCoord * d8; - this.worldObj.spawnEntityInWorld(entitylargefireball); - this.attackCounter = -40; - } - } else if (this.attackCounter > 0) { - --this.attackCounter; - } - } else { - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F - / (float) Math.PI; - - if (this.attackCounter > 0) { - --this.attackCounter; - } - } - - if (!this.worldObj.isRemote) { - byte b1 = this.dataWatcher.getWatchableObjectByte(16); - byte b0 = (byte) (this.attackCounter > 10 ? 1 : 0); - - if (b1 != b0) { - this.dataWatcher.updateObject(16, Byte.valueOf(b0)); - } - } - } - - /** - * True if the ghast has an unobstructed line of travel to the waypoint. - */ - private boolean isCourseTraversable(double p_70790_1_, double p_70790_3_, double p_70790_5_, double p_70790_7_) { - double d4 = (this.waypointX - this.posX) / p_70790_7_; - double d5 = (this.waypointY - this.posY) / p_70790_7_; - double d6 = (this.waypointZ - this.posZ) / p_70790_7_; - AxisAlignedBB axisalignedbb = this.boundingBox.copy(); - - for (int i = 1; (double) i < p_70790_7_; ++i) { - axisalignedbb.offset(d4, d5, d6); - - /* - * if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty()) { return false; } - */ - } - - return true; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float p_70069_1_) {} - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double p_70064_1_, boolean p_70064_3_) {} - - /** - * Moves the entity based on the specified heading. Args: strafe, forward - */ - @Override - public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) { - if (this.isInWater()) { - this.moveFlying(p_70612_1_, p_70612_2_, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } else if (this.handleLavaMovement()) { - this.moveFlying(p_70612_1_, p_70612_2_, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } else { - float f2 = 0.91F; - - if (this.onGround) { - f2 = this.worldObj.getBlock( - MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, - MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; - } - - float f3 = 0.16277136F / (f2 * f2 * f2); - this.moveFlying(p_70612_1_, p_70612_2_, this.onGround ? 0.1F * f3 : 0.02F); - f2 = 0.91F; - - if (this.onGround) { - f2 = this.worldObj.getBlock( - MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, - MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double) f2; - this.motionY *= (double) f2; - this.motionZ *= (double) f2; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double d1 = this.posX - this.prevPosX; - double d0 = this.posZ - this.prevPosZ; - float f4 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F; - - if (f4 > 1.0F) { - f4 = 1.0F; - } - - this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwingAmount; - } - - /** - * returns true if this entity is by a ladder, false otherwise - */ - @Override - public boolean isOnLadder() { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java b/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java deleted file mode 100644 index 45bbcab4c8..0000000000 --- a/src/main/java/gtPlusPlus/core/entity/monster/EntityGiantChickenBase.java +++ /dev/null @@ -1,314 +0,0 @@ -package gtPlusPlus.core.entity.monster; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityAgeable; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIEatGrass; -import net.minecraft.entity.ai.EntityAIFollowParent; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIMate; -import net.minecraft.entity.ai.EntityAIPanic; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAITempt; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.effect.EntityLightningBolt; -import net.minecraft.entity.passive.EntityChicken; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeHooks; - -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.item.general.ItemGemShards; -import gtPlusPlus.core.util.math.MathUtils; - -public class EntityGiantChickenBase extends EntityChicken { - - /** The time until the next egg is spawned. */ - public int timeUntilNextBigEgg; - - public EntityGiantChickenBase(World aWorld) { - super(aWorld); - this.setSize(0.6F, 1.4F); // Double - this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; - this.timeUntilNextBigEgg = this.rand.nextInt(16000) + 4000; - this.tasks.addTask(0, new EntityAISwimming(this)); - this.tasks.addTask(1, new EntityAIPanic(this, 1.4D)); - this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); - this.tasks.addTask(3, new EntityAITempt(this, 1.0D, ModItems.itemGemShards, false)); - this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); - this.tasks.addTask(4, new EntityAIEatGrass(this)); - this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); - this.tasks.addTask(5, new EntityAILookIdle(this)); - this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - } - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D); - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - this.field_70888_h = this.field_70886_e; - this.field_70884_g = this.destPos; - this.destPos = (float) ((double) this.destPos + (double) (this.onGround ? -1 : 4) * 0.3D); - - if (this.destPos < 0.0F) { - this.destPos = 0.0F; - } - - if (this.destPos > 1.0F) { - this.destPos = 1.0F; - } - - if (!this.onGround && this.field_70889_i < 1.0F) { - this.field_70889_i = 1.0F; - } - - this.field_70889_i = (float) ((double) this.field_70889_i * 0.9D); - - if (!this.onGround && this.motionY < 0.0D) { - this.motionY *= 0.6D; - } - - if (MathUtils.randInt(0, 10000) <= 5) { - jump(); - } - - this.field_70886_e += this.field_70889_i * 2.0F; - - if (!this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) { - this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - this.dropItem(Items.egg, 1); - this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; - } - if (!this.worldObj.isRemote && !this.isChild() && --this.timeUntilNextEgg <= 0) { - this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - this.dropItem(ModItems.itemBigEgg, MathUtils.randInt(1, 4)); - this.timeUntilNextBigEgg = this.rand.nextInt(16000) + 4000; - } - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float p_70069_1_) { - - if (MathUtils.randInt(0, 10) <= 5) { - jump(); - } - } - - @Override - protected Item getDropItem() { - return ModItems.itemBigEgg; - } - - /** - * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param - * par2 - Level of Looting used to kill this mob. - */ - @Override - protected void dropFewItems(boolean recentHit, int lootLevel) { - int j = this.rand.nextInt(3) + this.rand.nextInt(1 + lootLevel); - - for (int k = 0; k < j; ++k) { - this.dropItem(Items.feather, 1); - } - - // Large Egg Chance - for (int k = 0; k < j * 2; ++k) { - this.dropItem( - ModItems.itemBigEgg, - MathUtils.getRandomFromArray(new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2 })); - } - - // Chicken Corpses Dropped - int mBodies = MathUtils.getRandomFromArray( - new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, - 4, 4, 4, 5, 5, 6 }); - if (this.isBurning()) { - this.dropItem(Items.cooked_chicken, mBodies); - } else { - this.dropItem(Items.chicken, mBodies); - } - } - - @Override - public EntityGiantChickenBase createChild(EntityAgeable p_90011_1_) { - return new EntityGiantChickenBase(this.worldObj); - } - - /** - * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on - * the animal type) - */ - @Override - public boolean isBreedingItem(ItemStack aStack) { - return aStack != null && aStack.getItem() instanceof ItemGemShards; - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound aNBT) { - super.readEntityFromNBT(aNBT); - timeUntilNextBigEgg = aNBT.getInteger("timeUntilNextBigEgg"); - } - - /** - * Get the experience points the entity currently has. - */ - @Override - protected int getExperiencePoints(EntityPlayer p_70693_1_) { - return this.isChickenJockey() ? 20 : super.getExperiencePoints(p_70693_1_); - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound aNBT) { - super.writeEntityToNBT(aNBT); - aNBT.setInteger("timeUntilNextBigEgg", timeUntilNextBigEgg); - } - - /** - * Determines if an entity can be despawned, used on idle far away entities - */ - @Override - protected boolean canDespawn() { - return this.isChickenJockey() && this.riddenByEntity == null; - } - - @Override - public void updateRiderPosition() { - super.updateRiderPosition(); - float f = MathHelper.sin(this.renderYawOffset * (float) Math.PI / 180.0F); - float f1 = MathHelper.cos(this.renderYawOffset * (float) Math.PI / 180.0F); - float f2 = 0.1F; - float f3 = 0.0F; - this.riddenByEntity.setPosition( - this.posX + (double) (f2 * f), - this.posY + (double) (this.height * 0.5F) + this.riddenByEntity.getYOffset() + (double) f3, - this.posZ - (double) (f2 * f1)); - - if (this.riddenByEntity instanceof EntityLivingBase) { - ((EntityLivingBase) this.riddenByEntity).renderYawOffset = this.renderYawOffset; - } - } - - public boolean isChickenJockey() { - return func_152116_bZ(); - } - - public void setIsChickenJockey(boolean isJockey) { - func_152117_i(isJockey); - } - - @Override - protected Entity findPlayerToAttack() { - // TODO Auto-generated method stub - return super.findPlayerToAttack(); - } - - @Override - public boolean interact(EntityPlayer p_70085_1_) { - // TODO Auto-generated method stub - return super.interact(p_70085_1_); - } - - @Override - public void setHomeArea(int p_110171_1_, int p_110171_2_, int p_110171_3_, int p_110171_4_) { - // TODO Auto-generated method stub - super.setHomeArea(p_110171_1_, p_110171_2_, p_110171_3_, p_110171_4_); - } - - @Override - public ChunkCoordinates getHomePosition() { - // TODO Auto-generated method stub - return super.getHomePosition(); - } - - @Override - public void detachHome() { - // TODO Auto-generated method stub - super.detachHome(); - } - - @Override - public boolean hasHome() { - // TODO Auto-generated method stub - return super.hasHome(); - } - - @Override - public void eatGrassBonus() { - if (this.isChild()) { - this.addGrowth(60); - } - } - - @Override - public float getRenderSizeModifier() { - return 1.0f; - } - - @Override - protected void jump() { - this.motionY = 0.68999998688697815D; - this.motionY += 0.068999998688697815D; - if (this.isPotionActive(Potion.jump)) { - this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.5F); - } - - if (this.isSprinting()) { - float f = this.rotationYaw * 0.017453292F; - this.motionX -= (double) (MathHelper.sin(f) * 0.2F); - this.motionZ += (double) (MathHelper.cos(f) * 0.2F); - } - - this.isAirBorne = true; - - if (MathUtils.randInt(0, 10) < 10) { - jump(); - } - - ForgeHooks.onLivingJump(this); - } - - @Override - public void onStruckByLightning(EntityLightningBolt p_70077_1_) { - this.spawnExplosionParticle(); - this.spawnExplosionParticle(); - this.spawnExplosionParticle(); - this.spawnExplosionParticle(); - this.spawnExplosionParticle(); - this.spawnExplosionParticle(); - this.spawnExplosionParticle(); - super.onStruckByLightning(p_70077_1_); - } - - @Override - public boolean shouldDismountInWater(Entity rider) { - return true; - } -} diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java index cea480fda8..3f5e755626 100644 --- a/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java +++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntityLightningAttack.java @@ -14,11 +14,6 @@ public class EntityLightningAttack extends EntityWitherSkull { - public EntityLightningAttack(World p_i1793_1_) { - super(p_i1793_1_); - this.setSize(0.3125F, 0.3125F); - } - public EntityLightningAttack(World p_i1794_1_, EntityLivingBase p_i1794_2_, double p_i1794_3_, double p_i1794_5_, double p_i1794_7_) { super(p_i1794_1_, p_i1794_2_, p_i1794_3_, p_i1794_5_, p_i1794_7_); diff --git a/src/main/java/gtPlusPlus/core/fluids/FluidFactory.java b/src/main/java/gtPlusPlus/core/fluids/FluidFactory.java deleted file mode 100644 index 121c217130..0000000000 --- a/src/main/java/gtPlusPlus/core/fluids/FluidFactory.java +++ /dev/null @@ -1,206 +0,0 @@ -package gtPlusPlus.core.fluids; - -import java.util.LinkedHashMap; -import java.util.Map; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.event.entity.player.FillBucketEvent; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; - -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.registry.GameRegistry; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.GTplusplus.INIT_PHASE; -import gtPlusPlus.api.objects.GregtechException; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.core.item.base.itemblock.FluidItemBlock; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class FluidFactory { - - public static final Map mNameToFluidMap = new LinkedHashMap(); - public static final Map mNameToBucketMap = new LinkedHashMap(); - public static final Map mNameToBlockMap = new LinkedHashMap(); - public static final Map mNameToMetaMap = new LinkedHashMap(); - - public static final Map mFluidToNameMap = new LinkedHashMap(); - public static final Map mFluidToBucketMap = new LinkedHashMap(); - public static final Map mFluidToBlockMap = new LinkedHashMap(); - public static final Map mFluidToMetaMap = new LinkedHashMap(); - - public static final Map mBucketToFluidMap = new LinkedHashMap(); - public static final Map mBucketToNameMap = new LinkedHashMap(); - public static final Map mBucketToBlockMap = new LinkedHashMap(); - public static final Map mBucketToMetaMap = new LinkedHashMap(); - - public static final Map mBlockToNameMap = new LinkedHashMap(); - public static final Map mBlockToFluidMap = new LinkedHashMap(); - public static final Map mBlockToBucketMap = new LinkedHashMap(); - public static final Map mBlockToMetaMap = new LinkedHashMap(); - - public static final Map mMetaToNameMap = new LinkedHashMap(); - public static final Map mMetaToFluidMap = new LinkedHashMap(); - public static final Map mMetaToBucketMap = new LinkedHashMap(); - public static final Map mMetaToBlockMap = new LinkedHashMap(); - - // Special Colour Handling - public static final Map mMetaToColourMap = new LinkedHashMap(); - - public static Item mGenericBucket; - private static FluidPackage mErrorFluid; - private static AutoMap mGeneratedFluids = new AutoMap(); - - public static void preInit() {} - - public static void init() { - mGenericBucket = new ItemGenericFluidBucket(Blocks.air); - GameRegistry.registerItem(mGenericBucket, "gtpp.bucket.generic"); - for (FluidPackage y : mGeneratedFluids) { - if (!y.valid()) { - continue; - } - GameRegistry.registerBlock(y.mBlock, FluidItemBlock.class, "gtpp_" + y.mName); - FluidContainerRegistry.registerFluidContainer(y.get(), y.mBucket, new ItemStack(Items.bucket)); - } - Utils.registerEvent(BucketHandler.INSTANCE); - } - - public static void postInit() {} - - /** - * Generates a 'Water' type fluid. - * - * @param aID - The Fluid ID (Must be unique) - * @param aUnlocalName - Unlocalized Fluid Name - * @param aRGB - a {@link Short[]} containing the RGB of the FluidPackage. - * @return - A fully constructed & registered {@linkplain FluidPackage} - */ - public static FluidPackage generate(int aID, String aUnlocalName, short[] aRGB) { - return generate(aID, aUnlocalName, Short.MIN_VALUE, Short.MIN_VALUE, Short.MIN_VALUE, Short.MIN_VALUE, aRGB); - } - - /** - * Generate a {@link FluidPackage} from the data provided. This FluidPackage is automatically registered and handled - * internally. Pass in {@link Short}.MIN_VALUE for any of the Fluid Fields (Besides ID, Name or RGB) and it will - * default to water values. - * - * @param aID - The Fluid ID (Must be unique) - * @param aUnlocalName - Unlocalized Fluid Name - * @param luminosity - How bright is the fluid. - * @param density - completely arbitrary; negative density indicates that the fluid is lighter than air. - * Default value is approximately the real-life density of water in kg/m^3. - * @param temp - completely arbitrary; higher temperature indicates that the fluid is hotter than air. - * Default value is approximately the real-life room temperature of water in degrees Kelvin - * @param viscosity - completely arbitrary; negative values are not permissible. Default value is approximately - * the real-life density of water in m/s^2 (x10^-3). * Higher viscosity means that a fluid flows - * more slowly, like molasses. Lower viscosity means that a fluid flows more quickly, like - * helium. - * @param aRGB - a {@link Short[]} containing the RGB of the FluidPackage. - * @return - A fully constructed & registered {@linkplain FluidPackage} - */ - public static FluidPackage generate(int aID, String aUnlocalName, int luminosity, int density, int temp, - int viscosity, short[] aRGB) { - - FluidPackage aFluidToGenerate = null; - - // Check Load Phase for some Safety, only allow this to be called in Pre-Init. - if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.PRE_INIT) { - try { - throw new GregtechException("Cannot generate Fluid Packages outside of Pre-Init!"); - } catch (GregtechException e) { - e.printStackTrace(); - CORE.crash("Cannot generate Fluid Packages outside of Pre-Init!"); - } - } - - Fluid aGenFluid = fluid(aUnlocalName, luminosity, density, temp, viscosity, aRGB); - Block aGenBlock = block(aGenFluid, aRGB); - ItemStack aGenBucket = bucket(aID); - - aFluidToGenerate = new FluidPackage(aID, aUnlocalName, aGenFluid, aGenBucket, aGenBlock); - - if (aFluidToGenerate != null && aFluidToGenerate.valid()) { - FluidRegistry.registerFluid(aFluidToGenerate.get()); - mGeneratedFluids.put(aFluidToGenerate); - } else { - // Handle Bad generation - if (mErrorFluid == null) { - mErrorFluid = new FluidPackage( - 0, - "", - FluidUtils.getWater(1).getFluid(), - ItemUtils.getSimpleStack(Items.water_bucket), - Blocks.water); - } - return mErrorFluid; - } - - return aFluidToGenerate; - } - - private static Fluid fluid(String aUnlocalName, int luminosity, int density, int temp, int viscosity, - short[] aRGB) { - return new FactoryFluid(aUnlocalName, luminosity, density, temp, viscosity, aRGB); - } - - private static ItemStack bucket(int aID) { - return ItemGenericFluidBucket.registerFluidForBucket(aID); - } - - private static Block block(Fluid aFluidForBlock, short[] aRGB) { - if (aFluidForBlock != null) { - FluidRegistry.registerFluid(aFluidForBlock); - return new BlockFluidBase(aFluidForBlock, aRGB); - } - return Blocks.dirt; - } - - /** - * Copyright © SpaceToad, 2011 http://www.mod-buildcraft.com BuildCraft is distributed under the terms of the - * Minecraft Mod Public License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - * - * Modified version of the BC BucketHandler, except using ItemStacks > Items (Why?) - * - * @author Alkalus - */ - public static class BucketHandler { - - public static BucketHandler INSTANCE = new BucketHandler(); - - private BucketHandler() {} - - @SubscribeEvent - public void onBucketFill(FillBucketEvent event) { - ItemStack result = fillCustomBucket(event.world, event.target); - if (result == null) { - return; - } - event.result = result; - event.setResult(Result.ALLOW); - } - - private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) { - Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ); - ItemStack bucket = mBlockToBucketMap.get(block); - if (bucket != null && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) { - world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ); - return ItemUtils.getSimpleStack(bucket, 1); - } else { - return null; - } - } - } -} diff --git a/src/main/java/gtPlusPlus/core/fluids/FluidPackage.java b/src/main/java/gtPlusPlus/core/fluids/FluidPackage.java deleted file mode 100644 index 10e54d794d..0000000000 --- a/src/main/java/gtPlusPlus/core/fluids/FluidPackage.java +++ /dev/null @@ -1,80 +0,0 @@ -package gtPlusPlus.core.fluids; - -import static gtPlusPlus.core.fluids.FluidFactory.mBlockToBucketMap; -import static gtPlusPlus.core.fluids.FluidFactory.mBlockToFluidMap; -import static gtPlusPlus.core.fluids.FluidFactory.mBlockToMetaMap; -import static gtPlusPlus.core.fluids.FluidFactory.mBlockToNameMap; -import static gtPlusPlus.core.fluids.FluidFactory.mBucketToBlockMap; -import static gtPlusPlus.core.fluids.FluidFactory.mBucketToFluidMap; -import static gtPlusPlus.core.fluids.FluidFactory.mBucketToMetaMap; -import static gtPlusPlus.core.fluids.FluidFactory.mBucketToNameMap; -import static gtPlusPlus.core.fluids.FluidFactory.mFluidToBlockMap; -import static gtPlusPlus.core.fluids.FluidFactory.mFluidToBucketMap; -import static gtPlusPlus.core.fluids.FluidFactory.mFluidToMetaMap; -import static gtPlusPlus.core.fluids.FluidFactory.mFluidToNameMap; -import static gtPlusPlus.core.fluids.FluidFactory.mMetaToBlockMap; -import static gtPlusPlus.core.fluids.FluidFactory.mMetaToBucketMap; -import static gtPlusPlus.core.fluids.FluidFactory.mMetaToColourMap; -import static gtPlusPlus.core.fluids.FluidFactory.mMetaToFluidMap; -import static gtPlusPlus.core.fluids.FluidFactory.mMetaToNameMap; -import static gtPlusPlus.core.fluids.FluidFactory.mNameToBlockMap; -import static gtPlusPlus.core.fluids.FluidFactory.mNameToBucketMap; -import static gtPlusPlus.core.fluids.FluidFactory.mNameToFluidMap; -import static gtPlusPlus.core.fluids.FluidFactory.mNameToMetaMap; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; - -public class FluidPackage { - - public final int mID; - public final String mName; - private final Fluid mFluid; - public final ItemStack mBucket; - public final Block mBlock; - - public FluidPackage(int aID, String aName, Fluid aFluid, ItemStack aBucket, Block aBlock) { - - mNameToFluidMap.put(aName, aFluid); - mNameToBucketMap.put(aName, aBucket); - mNameToBlockMap.put(aName, aBlock); - mNameToMetaMap.put(aName, aID); - - mFluidToNameMap.put(aFluid, aName); - mFluidToBucketMap.put(aFluid, aBucket); - mFluidToBlockMap.put(aFluid, aBlock); - mFluidToMetaMap.put(aFluid, aID); - - mBucketToFluidMap.put(aBucket, aFluid); - mBucketToNameMap.put(aBucket, aName); - mBucketToBlockMap.put(aBucket, aBlock); - mBucketToMetaMap.put(aBucket, aID); - - mBlockToNameMap.put(aBlock, aName); - mBlockToFluidMap.put(aBlock, aFluid); - mBlockToBucketMap.put(aBlock, aBucket); - mBlockToMetaMap.put(aBlock, aID); - - mMetaToNameMap.put(aID, aName); - mMetaToFluidMap.put(aID, aFluid); - mMetaToBucketMap.put(aID, aBucket); - mMetaToBlockMap.put(aID, aBlock); - - mMetaToColourMap.put(aID, aFluid.getColor()); - - mID = aID; - mName = aName; - mFluid = aFluid; - mBucket = aBucket; - mBlock = aBlock; - } - - public Fluid get() { - return mFluid; - } - - public boolean valid() { - return mName != null && mName.length() > 0 && mFluid != null && mBucket != null && mBlock != null; - } -} diff --git a/src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java b/src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java deleted file mode 100644 index 46e56d3f1d..0000000000 --- a/src/main/java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java +++ /dev/null @@ -1,325 +0,0 @@ -package gtPlusPlus.core.fluids; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBucket; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.player.FillBucketEvent; - -import cpw.mods.fml.common.eventhandler.Event; -import gtPlusPlus.api.objects.GregtechException; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class ItemGenericFluidBucket extends ItemBucket { - - private static IIcon mBaseBucketTexture; - private static IIcon mOverlayBucketTexture; - private static AutoMap mInternalFluidCache = new AutoMap(); - - public ItemGenericFluidBucket(Block aFluid) { - super(aFluid); - this.setContainerItem(Items.bucket); - this.maxStackSize = 1; - mInternalFluidCache.put(aFluid); - } - - public static ItemStack registerFluidForBucket(int aID) { - - if (FluidFactory.mMetaToBucketMap.containsKey(aID)) { - try { - // noinspection deprecation - throw new GregtechException( - aID + " is already registered! Unable to register fluid: " - + FluidFactory.mMetaToFluidMap.get(aID).getLocalizedName()); - } catch (GregtechException e) { - e.printStackTrace(); - // noinspection deprecation - CORE.crash( - aID + " is already registered! Unable to register fluid: " - + FluidFactory.mMetaToFluidMap.get(aID).getLocalizedName()); - } - } - mInternalFluidCache.put(FluidFactory.mMetaToBlockMap.get(aID)); - return ItemUtils.simpleMetaStack(FluidFactory.mGenericBucket, aID, 1); - } - - Map mIconCache = new LinkedHashMap(); - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - @Override - public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { - - Block isFull = FluidFactory.mMetaToBlockMap.get(aStack.getItemDamage()); - - boolean flag = isFull == Blocks.air; - MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(aWorld, aPlayer, flag); - - if (movingobjectposition == null || isFull == null) { - return aStack; - } else { - FillBucketEvent event = new FillBucketEvent(aPlayer, aStack, aWorld, movingobjectposition); - if (MinecraftForge.EVENT_BUS.post(event)) { - return aStack; - } - - if (event.getResult() == Event.Result.ALLOW) { - if (aPlayer.capabilities.isCreativeMode) { - return aStack; - } - - if (--aStack.stackSize <= 0) { - return event.result; - } - - if (!aPlayer.inventory.addItemStackToInventory(event.result)) { - aPlayer.dropPlayerItemWithRandomChoice(event.result, false); - } - - return aStack; - } - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - int i = movingobjectposition.blockX; - int j = movingobjectposition.blockY; - int k = movingobjectposition.blockZ; - - if (!aWorld.canMineBlock(aPlayer, i, j, k)) { - return aStack; - } - - if (flag) { - if (!aPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, aStack)) { - return aStack; - } - - Material material = aWorld.getBlock(i, j, k).getMaterial(); - int l = aWorld.getBlockMetadata(i, j, k); - - if (material == Material.water && l == 0) { - aWorld.setBlockToAir(i, j, k); - return this.func_150910_a(aStack, aPlayer, Items.water_bucket); - } - - if (material == Material.lava && l == 0) { - aWorld.setBlockToAir(i, j, k); - return this.func_150910_a(aStack, aPlayer, Items.lava_bucket); - } - } else { - if (isFull == Blocks.air) { - return new ItemStack(Items.bucket); - } - - if (movingobjectposition.sideHit == 0) { - --j; - } - - if (movingobjectposition.sideHit == 1) { - ++j; - } - - if (movingobjectposition.sideHit == 2) { - --k; - } - - if (movingobjectposition.sideHit == 3) { - ++k; - } - - if (movingobjectposition.sideHit == 4) { - --i; - } - - if (movingobjectposition.sideHit == 5) { - ++i; - } - - if (!aPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, aStack)) { - return aStack; - } - - if (this.tryPlaceContainedLiquid(isFull, aWorld, i, j, k) && !aPlayer.capabilities.isCreativeMode) { - return new ItemStack(Items.bucket); - } - } - } - - return aStack; - } - } - - private ItemStack func_150910_a(ItemStack p_150910_1_, EntityPlayer p_150910_2_, Item p_150910_3_) { - if (p_150910_2_.capabilities.isCreativeMode) { - return p_150910_1_; - } else if (--p_150910_1_.stackSize <= 0) { - return new ItemStack(p_150910_3_); - } else { - if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_))) { - p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false); - } - - return p_150910_1_; - } - } - - /** - * Attempts to place the liquid contained inside the bucket. - */ - public boolean tryPlaceContainedLiquid(Block isFull, World aWorld, int aX, int aY, int aZ) { - if (isFull == Blocks.air) { - return false; - } else { - Material material = aWorld.getBlock(aX, aY, aZ).getMaterial(); - boolean flag = !material.isSolid(); - - if (!aWorld.isAirBlock(aX, aY, aZ) && !flag) { - return false; - } else { - - if (!aWorld.isRemote && flag && !material.isLiquid()) { - aWorld.func_147480_a(aX, aY, aZ, true); - } - - aWorld.setBlock(aX, aY, aZ, isFull, 0, 3); - - return true; - } - } - } - - @Override - public IIcon getIconFromDamage(int aMeta) { - IIcon aTemp = mIconCache.get(aMeta); - return aTemp != null ? aTemp : super.getIconFromDamage(aMeta); - } - - @Override - public boolean getHasSubtypes() { - return mInternalFluidCache.size() > 0; - } - - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - list.add(new ItemStack(item, 1, 0)); - for (Block f : mInternalFluidCache) { - Integer aMeta; - if (f != null) { - aMeta = FluidFactory.mBlockToMetaMap.get(f); - if (aMeta != null) { - list.add(new ItemStack(item, 1, aMeta)); - } - } - } - } - - @Override - public int getMaxDamage() { - return 512; - } - - @Override - public boolean isDamageable() { - return false; - } - - @Override - public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { - // TODO Auto-generated method stub - super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_); - } - - @Override - public int getItemEnchantability() { - return 0; - } - - @Override - public boolean isRepairable() { - return false; - } - - @Override - public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - if (stack != null && renderPass == 1) { - return mOverlayBucketTexture; - } else { - return mBaseBucketTexture; - } - /* - * IIcon aTemp = mIconCache.get(stack.getItemDamage()); return aTemp != null ? aTemp : super.getIcon(stack, - * renderPass, player, usingItem, useRemaining); - */ - } - - @Override - public boolean isBookEnchantable(ItemStack stack, ItemStack book) { - return false; - } - - @Override - public int getMaxDamage(ItemStack stack) { - return 512; - } - - @Override - public boolean isDamaged(ItemStack stack) { - return false; - } - - @Override - public int getItemEnchantability(ItemStack stack) { - return 0; - } - - @Override - public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) { - if (pass == 1) { - return mOverlayBucketTexture; - } else { - return mBaseBucketTexture; - } - } - - @Override - public void registerIcons(final IIconRegister i) { - mBaseBucketTexture = i.registerIcon("bucket_empty"); - mOverlayBucketTexture = i.registerIcon(GTPlusPlus.ID + ":bucket.generic.overlay"); - } - - @Override - public boolean tryPlaceContainedLiquid(World p_77875_1_, int p_77875_2_, int p_77875_3_, int p_77875_4_) { - return tryPlaceContainedLiquid(Blocks.air, p_77875_1_, p_77875_2_, p_77875_3_, p_77875_4_); - } - - @Override - public int getColorFromItemStack(ItemStack aStack, int aPass) { - if (aPass == 0) { - return super.getColorFromItemStack(aStack, aPass); - } else { - return FluidFactory.mMetaToColourMap.get(aStack.getItemDamage()); - } - } - - @Override - public boolean requiresMultipleRenderPasses() { - return true; - } -} diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java b/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java deleted file mode 100644 index ad5ec7deaa..0000000000 --- a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java +++ /dev/null @@ -1,125 +0,0 @@ -package gtPlusPlus.core.gui.item; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import gtPlusPlus.core.container.Container_BackpackBase; -import gtPlusPlus.core.inventories.BaseInventoryBackpack; - -public class GuiBaseBackpack extends GuiContainer { - - /** - * x and y size of the inventory window in pixels. Defined as float, passed as int These are used for drawing the - * player model. - */ - private float xSize_lo; - - private float ySize_lo; - - /** The FontRenderer used by GuiScreen */ - protected FontRenderer fontRenderer; - - /** - * ResourceLocation takes 2 parameters: ModId, path to texture at the location: "src/minecraft/assets/modid/" - * - * I have provided a sample texture file that works with this tutorial. Download it from - * Forge_Tutorials/textures/gui/ - */ - private static final ResourceLocation iconLocation = new ResourceLocation( - GTPlusPlus.ID, - "textures/gui/itemBackpack.png"); - - /** The inventory to render on screen */ - private final BaseInventoryBackpack inventory; - - public GuiBaseBackpack(final Container_BackpackBase containerItem) { - super(containerItem); - this.inventory = containerItem.inventory; - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(final int par1, final int par2, final float par3) { - super.drawScreen(par1, par2, par3); - this.xSize_lo = par1; - this.ySize_lo = par2; - } - - /** - * Draw the foreground layer for the GuiContainer (everything in front of the items) - */ - @Override - protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { - final String s = this.inventory.hasCustomInventoryName() ? this.inventory.getInventoryName() - : this.inventory.getInventoryName(); - // this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 0, 4210752); - // this.fontRenderer.drawString(I18n.translate("container.inventory"), 26, this.ySize - 96 + 4, 4210752); - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(iconLocation); - final int k = (this.width - this.xSize) / 2; - final int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - final int i1; - drawPlayerModel(k + 51, l + 75, 30, k + 51 - this.xSize_lo, (l + 75) - 50 - this.ySize_lo, this.mc.thePlayer); - } - - /** - * This renders the player model in standard inventory position (in later versions of Minecraft / Forge, you can - * simply call GuiInventory.drawEntityOnScreen directly instead of copying this code) - */ - public static void drawPlayerModel(final int x, final int y, final int scale, final float yaw, final float pitch, - final EntityLivingBase entity) { - GL11.glEnable(GL11.GL_COLOR_MATERIAL); - GL11.glPushMatrix(); - GL11.glTranslatef(x, y, 50.0F); - GL11.glScalef(-scale, scale, scale); - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); - final float f2 = entity.renderYawOffset; - final float f3 = entity.rotationYaw; - final float f4 = entity.rotationPitch; - final float f5 = entity.prevRotationYawHead; - final float f6 = entity.rotationYawHead; - GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); - RenderHelper.enableStandardItemLighting(); - GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-((float) Math.atan(pitch / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F); - entity.renderYawOffset = (float) Math.atan(yaw / 40.0F) * 20.0F; - entity.rotationYaw = (float) Math.atan(yaw / 40.0F) * 40.0F; - entity.rotationPitch = -((float) Math.atan(pitch / 40.0F)) * 20.0F; - entity.rotationYawHead = entity.rotationYaw; - entity.prevRotationYawHead = entity.rotationYaw; - GL11.glTranslatef(0.0F, entity.yOffset, 0.0F); - RenderManager.instance.playerViewY = 180.0F; - RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); - entity.renderYawOffset = f2; - entity.rotationYaw = f3; - entity.rotationPitch = f4; - entity.prevRotationYawHead = f5; - entity.rotationYawHead = f6; - GL11.glPopMatrix(); - RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); - GL11.glDisable(GL11.GL_TEXTURE_2D); - OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); - } -} diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java b/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java deleted file mode 100644 index 3b51810e3a..0000000000 --- a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java +++ /dev/null @@ -1,589 +0,0 @@ -package gtPlusPlus.core.gui.item; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.LinkedHashSet; -import java.util.Set; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreenBook; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.resources.I18n; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.core.container.Container_Grindle; -import gtPlusPlus.core.inventories.BaseInventoryGrindle; -import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; - -public class GuiBaseGrindle extends GuiContainer { - - /** The FontRenderer used by GuiScreen */ - protected FontRenderer fontRenderer; - - private GrindleGuiButton mButtonNextPage; - private GrindleGuiButton mButtonPreviousPage; - private String[][] mPageDataArray; - private short mCurrentPage = 0; - - private static final ResourceLocation iconLocation = new ResourceLocation( - GTPlusPlus.ID, - "textures/gui/itemGrindle.png"); - - /** The inventory to render on screen */ - private final BaseInventoryGrindle inventory; - - public GuiBaseGrindle(final Container_Grindle containerItem) { - super(containerItem); - this.inventory = containerItem.inventory; - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(final int par1, final int par2, final float par3) { - super.drawScreen(par1, par2, par3); - this.updateButtons(); - } - - /** - * Draw the foreground layer for the GuiContainer (everything in front of the items) - */ - @Override - protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { - - try { - - // Title - this.fontRendererObj.drawStringWithShadow( - I18n.format("Gregtech Information Transponder", new Object[0]), - 0, - -12, - Utils.rgbtoHexValue(255, 255, 255)); - ItemStack aStack = this.inventory.getStackInSlot(0); - - if (aStack != null) { - - GrindleData aDataCurrent = new GrindleData(aStack); - - if (aDataCurrent.mValid) { - - // Debug NBT Information - // NBTUtils.tryIterateNBTData(aStack); - - this.fontRendererObj - .drawString(I18n.format(aDataCurrent.mTitle), 10, 8, Utils.rgbtoHexValue(125, 255, 125)); - - int tTier = aDataCurrent.mExtraInformation; - if (tTier >= 0) { - // Draw the GUI - // List prospection - this.fontRendererObj.drawString( - I18n.format(aDataCurrent.mTierDim + " | Page: " + this.mCurrentPage, new Object[0]), - 10, - 18, - Utils.rgbtoHexValue(125, 255, 125)); - // Divider - this.fontRendererObj.drawString( - I18n.format("-------------------", new Object[0]), - 10, - 23, - Utils.rgbtoHexValue(125, 125, 255)); - // Pos data - this.fontRendererObj.drawString( - I18n.format(aDataCurrent.mPosInfo, new Object[0]), - 10, - 29, - Utils.rgbtoHexValue(125, 125, 255)); - // Divider - this.fontRendererObj.drawString( - I18n.format("-------------------", new Object[0]), - 10, - 35, - Utils.rgbtoHexValue(125, 125, 255)); - int aLastYUsed = 41; - - int posOuter = 0; - int posInner = 0; - - mPageDataArray = new String[MathUtils - .roundToClosestInt(Math.ceil(aDataCurrent.mListData.size() / 9.00))][9]; - for (String e : aDataCurrent.mListData) { - if (e != null) { - mPageDataArray[posInner][posOuter] = e; - if (posOuter < 8) { - posOuter++; - } else { - posOuter = 0; - posInner++; - } - } else { - continue; - } - } - - String[] aCurrentPage = mPageDataArray[this.mCurrentPage]; - - if (aCurrentPage != null) { - // Logger.INFO("valid Current page " + this.mCurrentPage); - if (aCurrentPage.length > 0) { - for (int i = 0; i < aCurrentPage.length; i++) { - if ((aLastYUsed + 9) <= (68 + 56)) { - String aCP = aCurrentPage[i]; - // Logger.INFO("Printing "+aCP); - if (aCP != null && aCP.length() > 0) { - if (!aCP.toLowerCase().contains("empty") - && !aCP.toLowerCase().contains("null")) { - this.fontRendererObj.drawString( - I18n.format(aCP), - 10, - aLastYUsed, - Utils.rgbtoHexValue(125, 255, 125)); - aLastYUsed += 9; - } - } - } - } - } - } - - } - - // Non-Prospecting Data - else { - // Draw the GUI - // List prospection - this.fontRendererObj.drawString( - I18n.format(aDataCurrent.mTierDim, new Object[0]), - 10, - 18, - Utils.rgbtoHexValue(125, 255, 125)); - // Divider - this.fontRendererObj.drawString( - I18n.format("-------------------", new Object[0]), - 10, - 23, - Utils.rgbtoHexValue(125, 125, 255)); - // Pos data - this.fontRendererObj.drawString( - I18n.format(aDataCurrent.mPosInfo, new Object[0]), - 10, - 29, - Utils.rgbtoHexValue(125, 125, 255)); - // Divider - this.fontRendererObj.drawString( - I18n.format("-------------------", new Object[0]), - 10, - 35, - Utils.rgbtoHexValue(125, 125, 255)); - int aLastYUsed = 41; - /* - * for (int i=0;i= 0) { - if (this.mPageDataArray != null) { - if (this.mCurrentPage < (this.mPageDataArray.length - 1)) { - this.mButtonNextPage.visible = true; - } else { - this.mButtonNextPage.visible = false; - } - } else { - this.mButtonNextPage.visible = false; - } - } - if (this.mCurrentPage > 0) { - this.mButtonPreviousPage.visible = true; - } else { - this.mButtonPreviousPage.visible = false; - } - } - - /** - * Scrolling Related - */ - @Override - protected void actionPerformed(GuiButton aButton) { - if (aButton.enabled && aButton.visible) { - if (aButton.id == 1) { - if (this.mCurrentPage < this.mPageDataArray.length - 1) { - ++this.mCurrentPage; - } - } else if (aButton.id == 2) { - if (this.mCurrentPage > 0) { - --this.mCurrentPage; - } - } - this.updateButtons(); - } - } - - /** - * Handles mouse input. - */ - @Override - public void handleMouseInput() { - super.handleMouseInput(); - int i = Mouse.getEventDWheel(); - /* - * if (i != 0) { this.currentScroll = (float) ((double) this.currentScroll - (double) i / (double) j); if - * (this.currentScroll < 0.0F) { this.currentScroll = 0.0F; } if (this.currentScroll > 1.0F) { - * this.currentScroll = 1.0F; } this.scrollTo(this.currentScroll); } - */ - } - - /** - * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is - * mouseMove, which==0 or which==1 is mouseUp - */ - @Override - protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) { - /* - * if (p_146286_3_ == 0) { int l = p_146286_1_ - this.guiLeft; int i1 = p_146286_2_ - this.guiTop; - * CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; int j1 = acreativetabs.length; for (int k1 = 0; - * k1 < j1; ++k1) { CreativeTabs creativetabs = acreativetabs[k1]; if (creativetabs != null && - * this.func_147049_a(creativetabs, l, i1)) { this.setCurrentCreativeTab(creativetabs); return; } } } - */ - - super.mouseMovedOrUp(p_146286_1_, p_146286_2_, p_146286_3_); - } - - /** - * Allows Mouseover Tooltips - */ - @Override - protected void renderToolTip(ItemStack aStack, int p_146285_2_, int p_146285_3_) { - super.renderToolTip(aStack, p_146285_2_, p_146285_3_); - } - - /** - * Custom Buttons - */ - @SideOnly(Side.CLIENT) - static class GrindleGuiButton extends GuiButton { - - public static final ResourceLocation mBookTexture; - - static { - ResourceLocation r; - try { - r = (ResourceLocation) ReflectionUtils.getField(GuiScreenBook.class, "bookGuiTextures").get(null); - - } catch (IllegalArgumentException | IllegalAccessException e) { - r = new ResourceLocation("textures/gui/book.png"); - } - mBookTexture = r; - } - - private final boolean aPageForward; - - public GrindleGuiButton(int aID, int aX, int aY, boolean aForwards) { - this(aID, aX, aY, 20, 12, aForwards); - } - - public GrindleGuiButton(int aID, int aX, int aY, int aWidth, int aHeight, boolean aForwards) { - super(aID, aX, aY, aWidth, aHeight, ""); - this.aPageForward = aForwards; - } - - /** - * Draws this button to the screen. - */ - @Override - public void drawButton(Minecraft aGame, int aX, int aY) { - if (this.visible) { - boolean flag = aX >= this.xPosition && aY >= this.yPosition - && aX < this.xPosition + this.width - && aY < this.yPosition + this.height; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - aGame.getTextureManager().bindTexture(iconLocation); - int k = 0; - int l = 192; - - if (flag) { - k += 23; - } - - if (!this.aPageForward) { - l += 13; - } - - this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 22, 12); - } - } - } - - public static class GrindleData { - - public static enum GrindleMode { - - PROSPECTING(0), - ELEMENT(1); - - private final int aModeID; - - private GrindleMode(final int aMode) { - this.aModeID = aMode; - } - - public int getMode() { - return this.aModeID; - } - } - - final boolean mValid; - final ItemStack mStack; - final String mTitle, mPosInfo, mTierDim; - final AutoMap mListData; - final GrindleMode mMode; - final int mExtraInformation; - - public GrindleData(ItemStack iStack) { - - if (iStack == null) { - mValid = false; - mStack = null; - mTitle = null; - mListData = null; - mMode = null; - mExtraInformation = 0; - this.mTierDim = ""; - this.mPosInfo = ""; - } else { - - this.mStack = iStack; - - int aType = -1; - boolean isProspecting = false; - - // If Input stack is a Data stick/Orb, set a valid type. - if (GT_Utility.areStacksEqual(iStack, CI.getDataStick(), true)) { - aType = 0; - } else if (GT_Utility.areStacksEqual(iStack, CI.getDataOrb(), true)) { - aType = 1; - } - - NBTTagCompound tNBT = iStack.getTagCompound(); - if (tNBT == null) { - tNBT = new NBTTagCompound(); - } - - mTitle = tNBT.hasKey("title") ? tNBT.getString("title") - : (aType == 0 ? "Empty Data Stick" : (aType == 1 ? "Empty Data Orb" : "Unknown Item")); - if (mTitle.toLowerCase().contains("raw prospection data")) { - isProspecting = true; - } - - byte tTier = -1; - if (isProspecting) { - if (!tNBT.hasKey("prospection_tier") && tNBT.hasKey("prospection")) { - tTier = 0; - } else if (tNBT.hasKey("prospection_tier") && !tNBT.hasKey("prospection")) { - tTier = tNBT.getByte("prospection_tier"); - } - } - - mExtraInformation = isProspecting ? tTier : -1; - - if (tTier >= 0) { - String xPos, yPos, zPos, aDim; - String aPositionString, aInfoString; - Set aOreTypes = new LinkedHashSet(); - Set aOilTypes = new LinkedHashSet(); - - // Set variables that are shared between prospection types. - if (tTier == 0) { - String tData = tNBT.getString("prospection"); - String[] tDataArray = tData.split(","); - xPos = tDataArray[0]; - yPos = tDataArray[1]; - zPos = tDataArray[2]; - aDim = tDataArray[3]; - aOilTypes.add("Oil Type: " + tDataArray[5]); - aOilTypes.add("--------------------"); - aOreTypes.add("Ore Types: "); - for (int i = 6; tDataArray.length > i; i++) { - aOreTypes.add("-" + tDataArray[i]); - } - } else { - String tPos = tNBT.getString("prospection_pos"); - String[] tPosData = tPos.split(" "); - xPos = tPosData[1]; - yPos = tPosData[3]; - zPos = tPosData[5]; - aDim = tPosData[7]; - // Oil - String tOil = tNBT.getString("prospection_oils"); - String[] tOilData = tOil.split("\\|"); - if (tOilData.length > 0) { - aOilTypes.add("Oil Types:"); - for (String s : tOilData) { - if (s != null) { - aOilTypes.add(s); - } - } - aOilTypes.add("--------------------"); - } - - // Near - String tOresNear = tNBT.getString("prospection_near"); - String[] tOresNearData = tOresNear.split("\\|"); - // Middle - String tOresMid = tNBT.getString("prospection_middle"); - String[] tOresMidData = tOresMid.split("\\|"); - // Far - String tOresFar = tNBT.getString("prospection_far"); - String[] tOresFarData = tOresFar.split("\\|"); - - if ((tOresNearData.length + tOresMidData.length + tOresFarData.length) > 0) { - aOreTypes.add("Ore Types:"); - if (tOresNearData.length > 0) { - for (String s : tOresNearData) { - if (s != null) { - aOreTypes.add("-" + s + " - Near"); - } - } - } - if (tOresMidData.length > 0) { - for (String s : tOresMidData) { - if (s != null) { - aOreTypes.add("-" + s + " - Mid"); - } - } - } - if (tOresFarData.length > 0) { - for (String s : tOresFarData) { - if (s != null) { - aOreTypes.add("-" + s + " - Far"); - } - } - } - } - } - - mListData = new AutoMap(); - if (aOilTypes.size() > 0) { - for (String aOils : aOilTypes) { - if (aOils != null && aOils.length() > 0) { - mListData.put(aOils); - } - } - } - - if (aOreTypes.size() > 0) { - for (String aOres : aOreTypes) { - if (aOres != null && aOres.length() > 0) { - mListData.put(aOres); - } - } - } - - // Set Types - mMode = GrindleMode.PROSPECTING; - this.mTierDim = (aInfoString = "Tier: " + tTier + " | Dim: " + aDim); - this.mPosInfo = (aPositionString = "X:" + xPos + ", Y:" + yPos + ", Z:" + zPos); - this.mValid = true; - } - - // Non-Prospectic Data - else { - mValid = true; - mListData = null; - mMode = GrindleMode.ELEMENT; - this.mTierDim = "PLACEHOLDER"; - this.mPosInfo = "PLACEHOLDER"; - } - } - } - } -} diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java b/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java deleted file mode 100644 index 01bf98d9bf..0000000000 --- a/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java +++ /dev/null @@ -1,513 +0,0 @@ -package gtPlusPlus.core.gui.item; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.resources.I18n; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagString; -import net.minecraft.network.PacketBuffer; -import net.minecraft.network.play.client.C17PacketCustomPayload; -import net.minecraft.util.ChatAllowedCharacters; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.container.Container_Grindle; -import gtPlusPlus.core.inventories.BaseInventoryGrindle; -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.minecraft.NBTUtils; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; - -@SideOnly(Side.CLIENT) -public class GuiScreenGrindle extends GuiContainer { - - private static final Logger logger = LogManager.getLogger(); - private static final ResourceLocation bookGuiTextures = new ResourceLocation("textures/gui/book.png"); - /** The player editing the book */ - private final EntityPlayer editingPlayer; - - private final ItemStack bookObj; - /** Whether the book is signed or can still be edited */ - private final boolean bookIsUnsigned; - - private boolean field_146481_r; - private boolean field_146480_s; - /** Update ticks since the gui was opened */ - private int updateCount; - - private final int bookImageWidth = 192; - private final int bookImageHeight = 192; - private int bookTotalPages = 1; - private int currPage; - private NBTTagList bookPages; - private String bookTitle = ""; - private GuiScreenGrindle.NextPageButton buttonNextPage; - private GuiScreenGrindle.NextPageButton buttonPreviousPage; - private GuiButton buttonDone; - /** The GuiButton to sign this book. */ - private GuiButton buttonSign; - - private GuiButton buttonFinalize; - private GuiButton buttonCancel; - - // Texture - private static final ResourceLocation iconLocation = new ResourceLocation( - GTPlusPlus.ID, - "textures/gui/itemGrindle.png"); - - /** The inventory to render on screen */ - private final BaseInventoryGrindle inventory; - - public GuiScreenGrindle(final Container_Grindle containerItem, final EntityPlayer player) { - super(containerItem); - this.inventory = containerItem.inventory; - this.editingPlayer = player; - this.bookObj = this.inventory.getStackInSlot(0); - this.bookIsUnsigned = (this.bookObj == null ? true : false); - - if (this.bookObj != null) { - if (this.bookObj.hasTagCompound()) { - final NBTTagCompound nbttagcompound = this.bookObj.getTagCompound(); - this.bookPages = nbttagcompound.getTagList("pages", 8); - - if (this.bookPages != null) { - this.bookPages = (NBTTagList) this.bookPages.copy(); - this.bookTotalPages = this.bookPages.tagCount(); - - if (this.bookTotalPages < 1) { - this.bookTotalPages = 1; - } - } - } - - if ((this.bookPages == null) && this.bookIsUnsigned) { - this.bookPages = new NBTTagList(); - this.bookPages.appendTag(new NBTTagString("")); - this.bookTotalPages = 1; - } - } - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - super.updateScreen(); - ++this.updateCount; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - @SuppressWarnings("unchecked") - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - - if (this.bookIsUnsigned) { - this.buttonList.add( - this.buttonSign = new GuiButton( - 3, - (this.width / 2) - 100, - 4 + this.bookImageHeight, - 98, - 20, - I18n.format("book.signButton", new Object[0]))); - this.buttonList.add( - this.buttonDone = new GuiButton( - 0, - (this.width / 2) + 2, - this.bookImageHeight - 4, - 98, - 20, - I18n.format("gui.close", new Object[0]))); - this.buttonList.add( - this.buttonFinalize = new GuiButton( - 5, - (this.width / 2) - 100, - 4 + this.bookImageHeight, - 98, - 20, - I18n.format("book.finalizeButton", new Object[0]))); - this.buttonList.add( - this.buttonCancel = new GuiButton( - 4, - (this.width / 2) + 2, - 4 + this.bookImageHeight, - 98, - 20, - I18n.format("gui.cancel", new Object[0]))); - } else { - this.buttonList.add( - this.buttonDone = new GuiButton( - 0, - (this.width / 2) - 100, - this.bookImageHeight + 100, - 200, - 20, - I18n.format("gui.done", new Object[0]))); - } - - final int i = (this.width - this.bookImageWidth) / 2; - final byte b0 = 2; - this.buttonList.add(this.buttonNextPage = new GuiScreenGrindle.NextPageButton(1, i + 120, b0 + 154, true)); - this.buttonList.add(this.buttonPreviousPage = new GuiScreenGrindle.NextPageButton(2, i + 38, b0 + 154, false)); - this.updateButtons(); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - - private void updateButtons() { - this.buttonNextPage.visible = !this.field_146480_s - && ((this.currPage < (this.bookTotalPages - 1)) || this.bookIsUnsigned); - this.buttonPreviousPage.visible = !this.field_146480_s && (this.currPage > 0); - this.buttonDone.visible = !this.bookIsUnsigned || !this.field_146480_s; - - if (this.bookIsUnsigned) { - this.buttonSign.visible = !this.field_146480_s; - this.buttonCancel.visible = this.field_146480_s; - this.buttonFinalize.visible = this.field_146480_s; - this.buttonFinalize.enabled = this.bookTitle.trim().length() > 0; - } - } - - private void sendBookToServer(final boolean p_146462_1_) { - if (this.bookIsUnsigned && this.field_146481_r) { - if (this.bookPages != null) { - String s; - - while (this.bookPages.tagCount() > 1) { - s = this.bookPages.getStringTagAt(this.bookPages.tagCount() - 1); - - if (s.length() != 0) { - break; - } - - this.bookPages.removeTag(this.bookPages.tagCount() - 1); - } - - if (this.bookObj.hasTagCompound()) { - final NBTTagCompound nbttagcompound = this.bookObj.getTagCompound(); - nbttagcompound.setTag("pages", this.bookPages); - } else { - this.bookObj.setTagInfo("pages", this.bookPages); - } - - s = "MC|BEdit"; - - if (p_146462_1_) { - s = "MC|BSign"; - this.bookObj.setTagInfo("author", new NBTTagString(this.editingPlayer.getCommandSenderName())); - this.bookObj.setTagInfo("title", new NBTTagString(this.bookTitle.trim())); - this.bookObj.func_150996_a(ModItems.itemGrindleTablet); - } - - final ByteBuf bytebuf = Unpooled.buffer(); - - try { - (new PacketBuffer(bytebuf)).writeItemStackToBuffer(this.bookObj); - this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(s, bytebuf)); - } catch (final Exception exception) { - logger.error("Couldn\'t send book info", exception); - } finally { - bytebuf.release(); - } - } - } - } - - @Override - protected void actionPerformed(final GuiButton button) { - if (button.enabled) { - if (button.id == 0) { - this.mc.displayGuiScreen((GuiScreen) null); - this.sendBookToServer(false); - } else if ((button.id == 3) && this.bookIsUnsigned) { - this.field_146480_s = true; - } else if (button.id == 1) { - if (this.currPage < (this.bookTotalPages - 1)) { - ++this.currPage; - } else if (this.bookIsUnsigned) { - this.addNewPage(); - - if (this.currPage < (this.bookTotalPages - 1)) { - ++this.currPage; - } - } - } else if (button.id == 2) { - if (this.currPage > 0) { - --this.currPage; - } - } else if ((button.id == 5) && this.field_146480_s) { - this.sendBookToServer(true); - this.mc.displayGuiScreen((GuiScreen) null); - } else if ((button.id == 4) && this.field_146480_s) { - this.field_146480_s = false; - } - - this.updateButtons(); - } - } - - private void addNewPage() { - if ((this.bookPages != null) && (this.bookPages.tagCount() < 50)) { - this.bookPages.appendTag(new NBTTagString("")); - ++this.bookTotalPages; - this.field_146481_r = true; - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(final char p_73869_1_, final int p_73869_2_) { - super.keyTyped(p_73869_1_, p_73869_2_); - - if (this.bookIsUnsigned) { - if (this.field_146480_s) { - this.func_146460_c(p_73869_1_, p_73869_2_); - } else { - this.keyTypedInBook(p_73869_1_, p_73869_2_); - } - } - } - - /** - * Processes keystrokes when editing the text of a book - */ - private void keyTypedInBook(final char p_146463_1_, final int p_146463_2_) { - switch (p_146463_1_) { - case 22: - this.func_146459_b(GuiScreen.getClipboardString()); - return; - default: - switch (p_146463_2_) { - case 14: - final String s = this.func_146456_p(); - - if (s.length() > 0) { - this.func_146457_a(s.substring(0, s.length() - 1)); - } - - return; - case 28: - case 156: - this.func_146459_b("\n"); - return; - default: - if (ChatAllowedCharacters.isAllowedCharacter(p_146463_1_)) { - this.func_146459_b(Character.toString(p_146463_1_)); - } - } - } - } - - private void func_146460_c(final char p_146460_1_, final int p_146460_2_) { - switch (p_146460_2_) { - case 14: - if (!this.bookTitle.isEmpty()) { - this.bookTitle = this.bookTitle.substring(0, this.bookTitle.length() - 1); - this.updateButtons(); - } - - return; - case 28: - case 156: - if (!this.bookTitle.isEmpty()) { - this.sendBookToServer(true); - this.mc.displayGuiScreen((GuiScreen) null); - } - - return; - default: - if ((this.bookTitle.length() < 16) && ChatAllowedCharacters.isAllowedCharacter(p_146460_1_)) { - this.bookTitle = this.bookTitle + Character.toString(p_146460_1_); - this.updateButtons(); - this.field_146481_r = true; - } - } - } - - private String func_146456_p() { - return (this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount()) - ? this.bookPages.getStringTagAt(this.currPage) - : ""; - } - - private void func_146457_a(final String p_146457_1_) { - if ((this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())) { - this.bookPages.func_150304_a(this.currPage, new NBTTagString(p_146457_1_)); - this.field_146481_r = true; - } - } - - private void func_146459_b(final String p_146459_1_) { - final String s1 = this.func_146456_p(); - final String s2 = s1 + p_146459_1_; - final int i = this.fontRendererObj.splitStringWidth(s2 + "" + EnumChatFormatting.BLACK + "_", 118); - - if ((i <= 118) && (s2.length() < 256)) { - this.func_146457_a(s2); - } - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(final int p_73863_1_, final int p_73863_2_, final float p_73863_3_) { - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(iconLocation); - final int k = (this.width - this.xSize) / 2; - final int l2 = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l2, 0, 0, this.xSize, this.ySize); - - // GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - // this.mc.getTextureManager().bindTexture(iconLocation); - // final int k = (this.width - this.bookImageWidth) / 2; - // this.drawTexturedModalRect(k, b0, 0, 0, this.bookImageWidth, - // this.bookImageHeight); - - String s; - String s1; - int l; - final byte b0 = 2; - - if (this.inventory.getStackInSlot(0) != null) { - this.fontRendererObj.drawString( - I18n.format("" + NBTUtils.getBookTitle(this.inventory.getStackInSlot(0)), new Object[0]), - 10, - 8, - Utils.rgbtoHexValue(125, 255, 125)); - } - - if (this.field_146480_s) { - s = this.bookTitle; - - if (this.bookIsUnsigned) { - if (((this.updateCount / 6) % 2) == 0) { - s = s + "" + EnumChatFormatting.BLACK + "_"; - } else { - s = s + "" + EnumChatFormatting.GRAY + "_"; - } - } - - s1 = I18n.format("book.editTitle", new Object[0]); - l = this.fontRendererObj.getStringWidth(s1); - this.fontRendererObj.drawString(s1, k + 36 + ((116 - l) / 2), b0 + 16 + 16, 0); - final int i1 = this.fontRendererObj.getStringWidth(s); - this.fontRendererObj.drawString(s, k + 36 + ((116 - i1) / 2), b0 + 48, 0); - final String s2 = I18n.format("book.byAuthor", new Object[] { this.editingPlayer.getCommandSenderName() }); - final int j1 = this.fontRendererObj.getStringWidth(s2); - this.fontRendererObj - .drawString(EnumChatFormatting.DARK_GRAY + s2, k + 36 + ((116 - j1) / 2), b0 + 48 + 10, 0); - final String s3 = I18n.format("book.finalizeWarning", new Object[0]); - this.fontRendererObj.drawSplitString(s3, k + 36, b0 + 80, 116, 0); - } else { - s = I18n.format( - "book.pageIndicator", - new Object[] { Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages) }); - s1 = ""; - - if ((this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())) { - s1 = this.bookPages.getStringTagAt(this.currPage); - } - - if (this.bookIsUnsigned) { - if (this.fontRendererObj.getBidiFlag()) { - s1 = s1 + "_"; - } else if (((this.updateCount / 6) % 2) == 0) { - s1 = s1 + "" + EnumChatFormatting.BLACK + "_"; - } else { - s1 = s1 + "" + EnumChatFormatting.GRAY + "_"; - } - } - - l = this.fontRendererObj.getStringWidth(s); - this.fontRendererObj.drawString(s, ((k - l) + this.bookImageWidth) - 44, b0 + 16, 0); - // this.fontRendererObj.drawString(s, k+36, b0 + 16, 0); - this.fontRendererObj.drawSplitString(s1, k + 36, b0 + 16 + 16, 116, 0); - // this.fontRendererObj.drawSplitString(s1, k, b0 + 16 + 16, 116, 0); - } - - super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); - } - - @SideOnly(Side.CLIENT) - static class NextPageButton extends GuiButton { - - private final boolean field_146151_o; - - public NextPageButton(final int p_i1079_1_, final int p_i1079_2_, final int p_i1079_3_, - final boolean p_i1079_4_) { - super(p_i1079_1_, p_i1079_2_, p_i1079_3_, 23, 13, ""); - this.field_146151_o = p_i1079_4_; - } - - /** - * Draws this button to the screen. - */ - @Override - public void drawButton(final Minecraft p_146112_1_, final int p_146112_2_, final int p_146112_3_) { - if (this.visible) { - final boolean flag = (p_146112_2_ >= this.xPosition) && (p_146112_3_ >= this.yPosition) - && (p_146112_2_ < (this.xPosition + this.width)) - && (p_146112_3_ < (this.yPosition + this.height)); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - p_146112_1_.getTextureManager().bindTexture(GuiScreenGrindle.bookGuiTextures); - int k = 0; - int l = 192; - - if (flag) { - k += 23; - } - - if (!this.field_146151_o) { - l += 13; - } - - this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 23, 13); - } - } - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(iconLocation); - final int k = (this.width - this.xSize) / 2; - final int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - final int i1; - // drawPlayerModel(k + 51, l + 75, 30, k + 51 - this.xSize_lo, (l + 75) - // - 50 - this.ySize_lo, this.mc.thePlayer); - } -} diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java deleted file mode 100644 index 20f87bf31e..0000000000 --- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java +++ /dev/null @@ -1,57 +0,0 @@ -package gtPlusPlus.core.gui.machine; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.resources.I18n; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.container.Container_EggBox; -import gtPlusPlus.core.tileentities.general.TileEntityEggBox; - -@SideOnly(Side.CLIENT) -public class GUI_EggBox extends GuiContainer { - - private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation( - GTPlusPlus.ID, - "textures/gui/FishTrap.png"); - - public GUI_EggBox(final InventoryPlayer player_inventory, final TileEntityEggBox te) { - super(new Container_EggBox(player_inventory, te)); - } - - @Override - protected void drawGuiContainerForegroundLayer(final int i, final int j) { - // this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752); - this.fontRendererObj - .drawString(I18n.format("container.EggBox", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) { - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - this.mc.renderEngine.bindTexture(craftingTableGuiTextures); - final int x = (this.width - this.xSize) / 2; - final int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } - - // This method is called when the Gui is first called! - @Override - public void initGui() { - // You have to add this line for the Gui to function properly! - super.initGui(); - - // The parameters of GuiButton are(id, x, y, width, height, text); - // this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X")); - // this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y")); - // NOTE: the id always has to be different or else it might get called twice or never! - - // Add any other buttons here too! - } -} diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java deleted file mode 100644 index 4f050250df..0000000000 --- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java +++ /dev/null @@ -1,40 +0,0 @@ -package gtPlusPlus.core.gui.machine; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.container.Container_HeliumGenerator; -import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator; - -@SideOnly(Side.CLIENT) -public class GUI_HeliumGenerator extends GuiContainer { - - private static final ResourceLocation guiTexture = new ResourceLocation( - GTPlusPlus.ID, - "textures/gui/helium_collector_gui.png"); - - public GUI_HeliumGenerator(final InventoryPlayer player_inventory, final TileEntityHeliumGenerator te) { - super(new Container_HeliumGenerator(player_inventory, te)); - } - - @Override - protected void drawGuiContainerForegroundLayer(final int i, final int j) { - // this.fontRendererObj.drawString(I18n.format("", new Object[0]), 28, 6, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) { - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - this.mc.renderEngine.bindTexture(guiTexture); - final int x = (this.width - this.xSize) / 2; - final int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } -} diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java deleted file mode 100644 index 4ddb7105f2..0000000000 --- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java +++ /dev/null @@ -1,79 +0,0 @@ -package gtPlusPlus.core.gui.machine; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.resources.I18n; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.container.Container_ModularityTable; -import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; - -@SideOnly(Side.CLIENT) -public class GUI_ModularityTable extends GuiContainer { - - private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation( - GTPlusPlus.ID, - "textures/gui/ModularityTable.png"); - private Container_ModularityTable mThisContainer; - private TileEntityModularityTable mThisTile; - private int mRecipeTime = -1; - - public GUI_ModularityTable(final InventoryPlayer player_inventory, final TileEntityModularityTable tile) { - super(new Container_ModularityTable(player_inventory, tile)); - this.mThisContainer = tile.getContainer(); - this.mThisTile = tile; - if (this.mThisTile.getRecipeTime() > -1) { - this.mRecipeTime = this.mThisTile.getRecipeTime(); - } - } - - @Override - protected void drawGuiContainerForegroundLayer(final int i, final int j) { - if (this.mThisTile.getRecipeTime() > -1) { - this.mRecipeTime = this.mThisTile.getRecipeTime(); - } - // Utils.LOG_INFO("Container: "+this.mRecipeTime); - this.fontRendererObj.drawString(I18n.format("Modularity Table", new Object[0]), 8, 6, 4210752); - if (mRecipeTime > -1) { - this.fontRendererObj.drawString(I18n.format("Time", new Object[0]), 84, 42, 4210752); - this.fontRendererObj.drawString(I18n.format("Remaining", new Object[0]), 84, 50, 4210752); - this.fontRendererObj - .drawString(I18n.format("" + this.mRecipeTime + " Ticks", new Object[0]), 84, 58, 4210752); - } - this.fontRendererObj - .drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) { - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - this.mc.renderEngine.bindTexture(craftingTableGuiTextures); - final int x = (this.width - this.xSize) / 2; - final int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } - - // This method is called when the Gui is first called! - @Override - public void initGui() { - // You have to add this line for the Gui to function properly! - super.initGui(); - - // The parameters of GuiButton are(id, x, y, width, height, text); - // this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X")); - // this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y")); - // NOTE: the id always has to be different or else it might get called twice or never! - - // Add any other buttons here too! - } - - @Override - protected void actionPerformed(final GuiButton B) {} -} diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java deleted file mode 100644 index 32ae7fa222..0000000000 --- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java +++ /dev/null @@ -1,53 +0,0 @@ -package gtPlusPlus.core.gui.machine; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.resources.I18n; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.container.Container_TradeTable; -import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; - -@SideOnly(Side.CLIENT) -public class GUI_TradeTable extends GuiContainer { - - TileEntityTradeTable mThisTable; - String mOwnerName; - - private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation( - GTPlusPlus.ID, - "textures/gui/ProjectTable.png"); - - public GUI_TradeTable(final InventoryPlayer player_inventory, final TileEntityTradeTable te, - final String mOwnerName) { - super(new Container_TradeTable(player_inventory, te)); - if (te.isServerSide()) { - mThisTable = te; - this.mOwnerName = mOwnerName; - Logger.INFO("Set valid TE in GUI"); - } - } - - @Override - protected void drawGuiContainerForegroundLayer(final int i, final int j) { - this.fontRendererObj.drawString(I18n.format("Owner - " + this.mOwnerName, new Object[0]), 28, 66, 4210752); - // this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, - // 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) { - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - this.mc.renderEngine.bindTexture(craftingTableGuiTextures); - final int x = (this.width - this.xSize) / 2; - final int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } -} diff --git a/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java b/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java index 489d26fa96..74f7287ca3 100644 --- a/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java @@ -28,7 +28,6 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; public class AchievementHandler { @@ -60,17 +59,6 @@ public AchievementHandler() { "", true); - // Useful Info - boolean cores = CORE.ConfigSwitches.requireControlCores; - if (cores || GregtechMeta_MultiBlockBase.DEBUG_DISABLE_CORES_TEMPORARILY) { - this.registerAchievement( - "hatch.control", - -2, - -2, - GregtechItemList.Hatch_Control_Core.get(1), - aBaseAchievementName, - false); - } this.registerAchievement( "hatch.dynamo.buffered", 2, @@ -84,7 +72,7 @@ public AchievementHandler() { -4, -2, GregtechItemList.Industrial_AlloyBlastSmelter.get(1), - cores ? "hatch.control" : aBaseAchievementName, + aBaseAchievementName, true); // Material Advancement diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 8e9a1ca330..5b7d1de7fb 100644 --- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -1,6 +1,5 @@ package gtPlusPlus.core.handler; -import static gregtech.api.enums.Mods.EnderIO; import static gregtech.api.enums.Mods.ExtraUtilities; import static gregtech.api.enums.Mods.OpenBlocks; import static gregtech.api.enums.Mods.PamsHarvestCraft; @@ -20,7 +19,6 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.ItemPackage; -import gtPlusPlus.core.common.compat.COMPAT_EnderIO; import gtPlusPlus.core.common.compat.COMPAT_ExtraUtils; import gtPlusPlus.core.common.compat.COMPAT_HarvestCraft; import gtPlusPlus.core.common.compat.COMPAT_IC2; @@ -29,7 +27,6 @@ import gtPlusPlus.core.common.compat.COMPAT_Witchery; import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler; import gtPlusPlus.core.handler.Recipes.RegistrationHandler; -import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.recipe.RECIPES_GREGTECH; @@ -37,8 +34,6 @@ import gtPlusPlus.core.recipe.ShapedRecipeObject; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaGarbageCollector; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_FluidCanning; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling; import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_ChemicalSkips; @@ -93,7 +88,6 @@ import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechQuantumForceTransformer; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRTG; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRocketFuelGenerator; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSafeBlock; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSemiFluidgenerators; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSimpleWasher; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarGenerators; @@ -119,9 +113,6 @@ public static void registerMyModsOreDictEntries() { Logger.INFO("Registering Materials with OreDict."); // In-house - // tools - GT_OreDictUnificator.registerOre("craftingToolSandHammer", new ItemStack(ModItems.itemSandstoneHammer)); - for (int i = 1; i <= 10; i++) { GT_OreDictUnificator.registerOre( "bufferCore_" + GT_Values.VN[i - 1], @@ -130,13 +121,6 @@ public static void registerMyModsOreDictEntries() { } public static void registerGregtechMachines() { - // Debug - GregtechItemList.Garbage_Collector_Debug_Machine.set( - new GregtechMetaGarbageCollector( - "garbagecollector.01.tier.single", - "JVM Garbage Collector", - "Useful for debugging or smoother performance on local servers").getStackForm(1L)); - // Free IDs /* * --- 859 to 868 --- 911 to 940 @@ -148,7 +132,6 @@ public static void registerGregtechMachines() { GregtechLFTR.run(); GregtechNuclearSaltProcessingPlant.run(); GregtechSteamCondenser.run(); - GregtechSafeBlock.run(); GregtechIndustrialCentrifuge.run(); GregtechIndustrialCokeOven.run(); GregtechIndustrialPlatePress.run(); @@ -210,9 +193,6 @@ public static void registerGregtechMachines() { // InterMod public static void intermodOreDictionarySupport() { - if (EnderIO.isModLoaded()) { - COMPAT_EnderIO.OreDict(); - } if (OpenBlocks.isModLoaded()) { COMPAT_OpenBlocks.OreDict(); } diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java index d51acebcac..f511e3e6ae 100644 --- a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java +++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java @@ -12,8 +12,6 @@ import gtPlusPlus.xmod.ic2.HANDLER_IC2; import gtPlusPlus.xmod.ob.HANDLER_OpenBlocks; import gtPlusPlus.xmod.railcraft.HANDLER_Railcraft; -import gtPlusPlus.xmod.sc2.HANDLER_SC2; -import gtPlusPlus.xmod.sol.HANDLER_SpiceOfLife; import gtPlusPlus.xmod.thaumcraft.HANDLER_Thaumcraft; import gtPlusPlus.xmod.thermalfoundation.HANDLER_TF; import gtPlusPlus.xmod.tinkers.HANDLER_Tinkers; @@ -26,10 +24,8 @@ public static void preInit(FMLPreInitializationEvent preinit) { HANDLER_FR.preInit(); HANDLER_IC2.preInit(); HANDLER_BiomesOPlenty.preInit(); - HANDLER_SC2.preInit(); HANDLER_CropsPlusPlus.preInit(preinit); HANDLER_Railcraft.preInit(); - HANDLER_SpiceOfLife.preInit(); } public static void init(FMLInitializationEvent init) { diff --git a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java index 04ad22178b..e0b9e71c2d 100644 --- a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java @@ -10,86 +10,43 @@ import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox; -import gtPlusPlus.core.container.Container_BackpackBase; -import gtPlusPlus.core.container.Container_CircuitProgrammer; -import gtPlusPlus.core.container.Container_DecayablesChest; -import gtPlusPlus.core.container.Container_EggBox; -import gtPlusPlus.core.container.Container_FishTrap; -import gtPlusPlus.core.container.Container_Grindle; -import gtPlusPlus.core.container.Container_ModularityTable; -import gtPlusPlus.core.container.Container_PestKiller; -import gtPlusPlus.core.container.Container_ProjectTable; -import gtPlusPlus.core.container.Container_RoundRobinator; -import gtPlusPlus.core.container.Container_SuperJukebox; -import gtPlusPlus.core.container.Container_TradeTable; -import gtPlusPlus.core.container.Container_VolumetricFlaskSetter; -import gtPlusPlus.core.container.box.LunchBoxContainer; -import gtPlusPlus.core.container.box.MagicBagContainer; -import gtPlusPlus.core.container.box.ToolBoxContainer; +import gtPlusPlus.core.container.*; import gtPlusPlus.core.gui.beta.Gui_ID_Registry; import gtPlusPlus.core.gui.beta.MU_GuiId; -import gtPlusPlus.core.gui.item.GuiBaseBackpack; -import gtPlusPlus.core.gui.item.GuiBaseGrindle; -import gtPlusPlus.core.gui.item.box.LunchBoxGui; -import gtPlusPlus.core.gui.item.box.MagicBagGui; -import gtPlusPlus.core.gui.item.box.ToolBoxGui; -import gtPlusPlus.core.gui.machine.GUI_CircuitProgrammer; -import gtPlusPlus.core.gui.machine.GUI_DecayablesChest; -import gtPlusPlus.core.gui.machine.GUI_EggBox; -import gtPlusPlus.core.gui.machine.GUI_FishTrap; -import gtPlusPlus.core.gui.machine.GUI_ModularityTable; -import gtPlusPlus.core.gui.machine.GUI_PestKiller; -import gtPlusPlus.core.gui.machine.GUI_ProjectTable; -import gtPlusPlus.core.gui.machine.GUI_RoundRobinator; -import gtPlusPlus.core.gui.machine.GUI_SuperJukebox; -import gtPlusPlus.core.gui.machine.GUI_TradeTable; -import gtPlusPlus.core.gui.machine.GUI_VolumetricFlaskSetter; +import gtPlusPlus.core.gui.machine.*; import gtPlusPlus.core.interfaces.IGuiManager; -import gtPlusPlus.core.inventories.BaseInventoryBackpack; -import gtPlusPlus.core.inventories.BaseInventoryGrindle; -import gtPlusPlus.core.inventories.box.LunchBoxInventory; -import gtPlusPlus.core.inventories.box.MagicBagInventory; -import gtPlusPlus.core.inventories.box.ToolBoxInventory; -import gtPlusPlus.core.tileentities.base.TileEntityBase; import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer; import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest; -import gtPlusPlus.core.tileentities.general.TileEntityEggBox; import gtPlusPlus.core.tileentities.general.TileEntityFishTrap; import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter; -import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller; import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable; import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; -import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; public class GuiHandler implements IGuiHandler { public static final int GUI1 = 0; // Project Table - public static final int GUI2 = 1; // Helium Generator - public static final int GUI3 = 2; // BackpackHandler + public static final int GUI2 = 1; // None + public static final int GUI3 = 2; // None public static final int GUI4 = 3; // Workbench public static final int GUI5 = 4; // Workbench Adv public static final int GUI6 = 5; // Fish trap - public static final int GUI7 = 6; // Trade table + public static final int GUI7 = 6; // None public static final int GUI8 = 7; // Circuit Programmer - public static final int GUI9 = 8; // Grindle - public static final int GUI10 = 9; // Universal Toolbox - public static final int GUI11 = 10; // Auto Lunchbox - public static final int GUI12 = 11; // Bag for Magic Tools + public static final int GUI9 = 8; // None + public static final int GUI10 = 9; // None + public static final int GUI11 = 10; // None + public static final int GUI12 = 11; // None public static final int GUI13 = 12; // Decayables Chest public static final int GUI14 = 13; // Super Jukebox public static final int GUI15 = 14; // Pest Killer public static final int GUI16 = 15; // Round-Robinator - public static final int GUI17 = 16; // Egg Box + public static final int GUI17 = 16; // None public static final int GUI18 = 17; // Volumetric Flask Setter public static void init() { - Logger.INFO("Registering GUIs."); NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new GuiHandler()); - // Register GuiHandler - // NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new - // GuiHandler()); } @Override // ContainerModTileEntity @@ -100,29 +57,15 @@ public Object getServerGuiElement(final int ID, final EntityPlayer player, final if (te != null) { if (ID == GUI1) { return new Container_ProjectTable(player.inventory, (TileEntityProjectTable) te); - } else if (ID == GUI2) { - return new Container_ModularityTable(player.inventory, (TileEntityModularityTable) te); - } - } - - if (ID == GUI3) { - // Use the player's held item to create the inventory - return new Container_BackpackBase( - player, - player.inventory, - new BaseInventoryBackpack(player.getHeldItem())); + } else if (ID == GUI2) {} } if (te != null) { - if (ID == GUI4) { - // return new Container_Workbench(player.inventory, (TileEntityWorkbench) te); - } else if (ID == GUI5) { + if (ID == GUI5) { Logger.INFO("sad"); // return new Container_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te); } else if (ID == GUI6) { return new Container_FishTrap(player.inventory, (TileEntityFishTrap) te); - } else if (ID == GUI7) { - return new Container_TradeTable(player.inventory, (TileEntityTradeTable) te); } else if (ID == GUI8) { return new Container_CircuitProgrammer(player.inventory, (TileEntityCircuitProgrammer) te); } else if (ID == GUI13) { @@ -133,27 +76,11 @@ public Object getServerGuiElement(final int ID, final EntityPlayer player, final return new Container_PestKiller(player.inventory, (TileEntityPestKiller) te); } else if (ID == GUI16) { return new Container_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te); - } else if (ID == GUI17) { - return new Container_EggBox(player.inventory, (TileEntityEggBox) te); } else if (ID == GUI18) { return new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te); } } - if (ID == GUI9) { - return new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem())); - } - // Tool, lunch, magic - if (ID == GUI10) { - return new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem())); - } - if (ID == GUI11) { - return new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem())); - } - if (ID == GUI12) { - return new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem())); - } - return null; } @@ -175,34 +102,12 @@ public Object getClientGuiElement(final int ID, final EntityPlayer player, final if (te != null) { if (ID == GUI1) { return new GUI_ProjectTable(player.inventory, (TileEntityProjectTable) te); - } else if (ID == GUI2) { - return new GUI_ModularityTable(player.inventory, (TileEntityModularityTable) te); } } - if (ID == GUI3) { - // We have to cast the new container as our custom class - // and pass in currently held item for the inventory - return new GuiBaseBackpack( - new Container_BackpackBase( - player, - player.inventory, - new BaseInventoryBackpack(player.getHeldItem()))); - } - if (te != null) { - if (ID == GUI4) { - // return new GUI_Workbench(player.inventory, (TileEntityWorkbench) te); - } else if (ID == GUI5) { - Logger.INFO("sad"); - // return new GUI_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te); - } else if (ID == GUI6) { + if (ID == GUI6) { return new GUI_FishTrap(player.inventory, (TileEntityFishTrap) te); - } else if (ID == GUI7) { - return new GUI_TradeTable( - player.inventory, - (TileEntityTradeTable) te, - ((TileEntityBase) te).getOwner()); } else if (ID == GUI8) { return new GUI_CircuitProgrammer(player.inventory, (TileEntityCircuitProgrammer) te); } else if (ID == GUI13) { @@ -213,33 +118,12 @@ public Object getClientGuiElement(final int ID, final EntityPlayer player, final return new GUI_PestKiller(player.inventory, (TileEntityPestKiller) te); } else if (ID == GUI16) { return new GUI_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te); - } else if (ID == GUI17) { - return new GUI_EggBox(player.inventory, (TileEntityEggBox) te); } else if (ID == GUI18) { return new GUI_VolumetricFlaskSetter( new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te)); } } - if (ID == GUI9) { - return new GuiBaseGrindle( - new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem()))); - } - - // Tool, lunch, magic - if (ID == GUI10) { - return new ToolBoxGui( - new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem()))); - } - if (ID == GUI11) { - return new LunchBoxGui( - new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem()))); - } - if (ID == GUI12) { - return new MagicBagGui( - new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem()))); - } - return null; } @@ -265,12 +149,4 @@ private static int encodeGuiData(final IGuiManager guiHandler, final short data) return (data << 16) | guiId.getId(); } - private static MU_GuiId decodeGuiID(final int guiData) { - final int guiId = guiData & 0xFF; - return Gui_ID_Registry.getGuiId(guiId); - } - - private static short decodeGuiData(final int guiId) { - return (short) (guiId >> 16); - } } diff --git a/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java b/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java index 12acc8b4d3..005ebba204 100644 --- a/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java @@ -5,7 +5,6 @@ import gtPlusPlus.core.recipe.RECIPES_General; import gtPlusPlus.core.recipe.RECIPES_MachineComponents; import gtPlusPlus.core.recipe.RECIPES_Machines; -import gtPlusPlus.core.recipe.RECIPES_Tools; import gtPlusPlus.core.recipe.RECIPE_Batteries; public class RegistrationHandler { @@ -18,7 +17,6 @@ public static void run() { } private static final void init() { - RECIPES_Tools.loadRecipes(); RECIPES_General.loadRecipes(); RECIPES_Machines.loadRecipes(); RECIPES_MachineComponents.loadRecipes(); diff --git a/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java deleted file mode 100644 index e2ea5746a1..0000000000 --- a/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java +++ /dev/null @@ -1,211 +0,0 @@ -package gtPlusPlus.core.handler.events; - -import static gregtech.api.enums.Mods.Thaumcraft; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropDrainedShard; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropFluoriteOre; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.living.LivingDropsEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.world.BlockEvent; -import net.minecraftforge.oredict.OreDictionary; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.material.nuclear.FLUORIDES; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; - -public class BlockEventHandler { - - public static ArrayList oreLimestone; - public static ArrayList blockLimestone; - public static ItemStack fluoriteOre; - - public static void init() { - // Set Variables for Fluorite Block handling - Logger.INFO("Setting some Variables for the block break event handler."); - BlockEventHandler.oreLimestone = OreDictionary.getOres("oreLimestone"); - BlockEventHandler.blockLimestone = OreDictionary.getOres("limestone"); - BlockEventHandler.fluoriteOre = FLUORIDES.FLUORITE.getOre(1); - } - - @SubscribeEvent - public void onBlockLeftClicked(final PlayerInteractEvent event) { - /* - * if (event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return; ItemStack heldItem = - * event.entityPlayer.getHeldItem(); Block block = event.world.getBlock(event.x, event.y, event.z); // If the - * block clicked was Stone, the player was holding an Iron Pickaxe and a random integer from 0 (inclusive) to 2 - * (exclusive) is 0 (50% chance) if (block == Blocks.stone && heldItem != null && heldItem.getItem() == - * Items.iron_pickaxe && random.nextInt(2) == 0) { ForgeDirection direction = - * ForgeDirection.getOrientation(event.face); // Convert the numeric face to a ForgeDirection int fireX = - * event.x + direction.offsetX, fireY = event.y + direction.offsetY, fireZ = event.z + direction.offsetZ; // - * Offset the block's coordinates according to the direction if (event.world.isAirBlock(fireX, fireY, fireZ)) { - * // If the block at the new coordinates is Air event.world.setBlock(fireX, fireY, fireZ, Blocks.fire); // - * Replace it with Fire event.useBlock = Event.Result.DENY; // Prevent the Fire from being extinguished (also - * prevents Block#onBlockClicked from being called) } } - */ - } - - @SubscribeEvent - public void onEntityDrop(final LivingDropsEvent event) { - /* - * if (event.entityLiving instanceof EntityPig && event.source instanceof EntityDamageSource) { // getEntity - * will return the Entity that caused the damage,even for indirect damage sources like arrows/fireballs // - * (where it will return the Entity that shot the projectile rather than the projectile itself) Entity - * sourceEntity = event.source.getEntity(); ItemStack heldItem = sourceEntity instanceof EntityLiving ? - * ((EntityLiving) sourceEntity).getHeldItem() : sourceEntity instanceof EntityPlayer ? ((EntityPlayer) - * sourceEntity).getHeldItem() : null; if (heldItem != null && heldItem.getItem() == Items.iron_pickaxe) { - * System.out.println("EntityPig drops event"); event.drops.clear(); event.entityLiving.dropItem(Items.diamond, - * 64); } } - */ - } - - @SubscribeEvent - public void onBlockBreak(final BlockEvent.BreakEvent event) {} - - // Used to handle Thaumcraft Shards when TC is not installed. - @SubscribeEvent - public void harvestDrops(final BlockEvent.HarvestDropsEvent event) { - try { - - if (event != null && event.harvester != null && event.harvester.worldObj != null) { - if (!event.harvester.worldObj.isRemote) { - - EntityPlayer p = event.harvester; - - if (PlayerUtils.isRealPlayer(p)) { - // Spawns Fluorite from Lime Stone - if (chanceToDropFluoriteOre != 0) { - if (!oreLimestone.isEmpty() || !blockLimestone.isEmpty()) { - - ArrayList mBlockTypes = new ArrayList(); - if (!oreLimestone.isEmpty()) { - for (int i = 0; i < oreLimestone.size(); i++) { - if (ItemUtils.getModId(oreLimestone.get(i)) != null - && !ItemUtils.getModId(oreLimestone.get(i)).toLowerCase() - .contains("biomesoplenty")) { - if (!mBlockTypes - .contains(Block.getBlockFromItem(oreLimestone.get(i).getItem()))) { - mBlockTypes.add(Block.getBlockFromItem(oreLimestone.get(i).getItem())); - } - } - } - } - if (!blockLimestone.isEmpty()) { - for (int i = 0; i < blockLimestone.size(); i++) { - if (ItemUtils.getModId(blockLimestone.get(i)) != null - && !ItemUtils.getModId(blockLimestone.get(i)).toLowerCase() - .contains("biomesoplenty")) { - if (!mBlockTypes.contains( - Block.getBlockFromItem(blockLimestone.get(i).getItem()))) { - mBlockTypes - .add(Block.getBlockFromItem(blockLimestone.get(i).getItem())); - } - } - } - } - - Logger.WARNING("Found Limestone in OreDict."); - if (!mBlockTypes.isEmpty()) { - Logger.WARNING("1a | " + event.block.getUnlocalizedName()); - for (final Block temp : mBlockTypes) { - Logger.WARNING("2a - " + temp.getUnlocalizedName()); - if (event.block == temp) { - Logger.WARNING("3a - found " + temp.getUnlocalizedName()); - if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1) { - Logger.WARNING("4a"); - event.drops.clear(); - event.drops.add(fluoriteOre.copy()); - } - } - } - } - } - - if (event.block.getUnlocalizedName().toLowerCase().contains("limestone")) { - Logger.WARNING("1c"); - if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1) { - Logger.WARNING("2c"); - event.drops.clear(); - event.drops.add(fluoriteOre.copy()); - } - } - - if (event.block == Blocks.sandstone) { - if (MathUtils.randInt(1, chanceToDropFluoriteOre * 20) == 1) { - event.drops.clear(); - event.drops.add(fluoriteOre.copy()); - } - } - } - } - - // Do things that can occur for fake players and real players - - // Spawn Dull Shards (Can spawn from Tree Logs, Grass or Stone. Stone going to - // be the most common source.) - if (((event.block == Blocks.stone) || (event.block == Blocks.sandstone) - || (event.block == Blocks.log) - || (event.block == Blocks.log2) - || (event.block == Blocks.grass)) && !Thaumcraft.isModLoaded() - && (chanceToDropDrainedShard != 0)) { - // small chance for one to spawn per stone mined. 1 per 3 stacks~ - if (MathUtils.randInt(1, chanceToDropDrainedShard) == 1) { - // Let's sort out a lucky charm for the player. - final int FancyChance = MathUtils.randInt(1, 4); - if (MathUtils.randInt(1, 100) < 90) { - event.drops.add(new ItemStack(ModItems.shardDull)); - } - // Make a Fire Shard - else if (FancyChance == 1) { - event.drops.add(new ItemStack(ModItems.shardIgnis)); - } - // Make a Water Shard. - else if (FancyChance == 2) { - event.drops.add(new ItemStack(ModItems.shardAqua)); - } - // Make an Earth Shard. - else if (FancyChance == 3) { - event.drops.add(new ItemStack(ModItems.shardTerra)); - } - // Make an Air Shard. - else if (FancyChance == 4) { - event.drops.add(new ItemStack(ModItems.shardAer)); - } - } else { - Logger.WARNING("invalid chance"); - } - } - } - } - } catch (Throwable r) { - Logger.INFO("Block Event Handler Failed. Please Report this to Alkalus."); - r.printStackTrace(); - } - } - - @SubscribeEvent - public void logsHarvest(final BlockEvent.HarvestDropsEvent event) { - /* - * if (event.block instanceof BlockLog) { // - * http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/ - * modification-development/2444501-harvestdropevent-changing-drops-of-vanilla- blocks // - * Utils.sendServerMessage("Logs! Harvester: %s Drops: %s", event.harvester != null ? - * event.harvester.getCommandSenderName() : "", - * event.drops.stream().map(ItemStack.toString()).collect(Collectors. joining(", "))); if (event.harvester != - * null) { ItemStack heldItem = event.harvester.getHeldItem(); if (heldItem == null || - * heldItem.getItem().getHarvestLevel(heldItem, "axe") < 1) { event.drops.clear(); - * Utils.sendServerMessage("Harvester had wrong tool, clearing drops"); } else { - * Utils.sendServerMessage("Harvester had correct tool, not clearing drops"); } } else { event.drops.clear(); - * Utils.sendServerMessage("No harvester, clearing drops"); } } - */ - } -} diff --git a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java index 6aa9fde2a8..867a2538f3 100644 --- a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java @@ -1,100 +1,15 @@ package gtPlusPlus.core.handler.events; -import net.minecraft.block.Block; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import advsolar.common.AdvancedSolarPanel; import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gregtech.api.enums.Mods; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.GTplusplus.INIT_PHASE; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; public class GeneralTooltipEventHandler { - ItemStack[] mGregtechTurbines = new ItemStack[6]; - String mTurbine; - String mExtra; - - @SubscribeEvent - public void onItemTooltip(ItemTooltipEvent event) { - - if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.STARTED - && GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.SERVER_START) { - return; - } - if (event.itemStack == null) { - return; - } - if (CORE.ConfigSwitches.chanceToDropFluoriteOre > 0) { - if (BlockEventHandler.blockLimestone != null && !BlockEventHandler.blockLimestone.isEmpty()) { - for (ItemStack h : BlockEventHandler.blockLimestone) { - if (h != null && Block.getBlockFromItem(h.getItem()) - == Block.getBlockFromItem(event.itemStack.getItem())) { - if (ItemUtils.getModId(h) != null - && !ItemUtils.getModId(h).toLowerCase().contains("biomesoplenty")) { - event.toolTip.add("May contain Fluorite Ore"); - } - } - } - } - if (BlockEventHandler.oreLimestone != null && !BlockEventHandler.oreLimestone.isEmpty()) { - for (ItemStack h : BlockEventHandler.oreLimestone) { - if (h != null && Block.getBlockFromItem(h.getItem()) - == Block.getBlockFromItem(event.itemStack.getItem())) { - if (ItemUtils.getModId(h) != null - && !ItemUtils.getModId(h).toLowerCase().contains("biomesoplenty")) { - event.toolTip.add("May contain Fluorite Ore"); - } - } - } - } - } - - // Material Collector Tooltips - if (ModBlocks.blockPooCollector != null - && Block.getBlockFromItem(event.itemStack.getItem()) == ModBlocks.blockPooCollector) { - // Normal - if (event.itemStack.getItemDamage() == 0) { - event.toolTip.add("Used to collect animal waste"); - event.toolTip.add("Collects in a 5x4x5 area starting at Y+1"); - event.toolTip.add("Use Hoppers/Pipes to empty"); - event.toolTip.add(EnumChatFormatting.GOLD + "Capacity: " + EnumChatFormatting.AQUA + "8000L"); - } - // Advanced - else { - event.toolTip.add("Used to collect waste (Works on more than animals)"); - event.toolTip.add("Significantly faster than the simple version"); - event.toolTip.add("Collects in a 5x4x5 area starting at Y+1"); - event.toolTip.add("Use Hoppers/Pipes to empty"); - event.toolTip.add(EnumChatFormatting.GOLD + "Capacity: " + EnumChatFormatting.AQUA + "128000L"); - } - } - - // Custom Flasks - - if (GregtechItemList.VOLUMETRIC_FLASK_8k.hasBeenSet() - && event.itemStack.getItem() == GregtechItemList.VOLUMETRIC_FLASK_8k.getItem()) { - event.toolTip.add("Max Capacity: " + MathUtils.formatNumbers(8000) + "L"); - } - if (GregtechItemList.VOLUMETRIC_FLASK_32k.hasBeenSet() - && event.itemStack.getItem() == GregtechItemList.VOLUMETRIC_FLASK_32k.getItem()) { - event.toolTip.add("Max Capacity: " + MathUtils.formatNumbers(32000) + "L"); - } - - if (Mods.AdvancedSolarPanel.isModLoaded()) { - molecularTransformer(event); - } - } - @Optional.Method(modid = Mods.Names.ADVANCED_SOLAR_PANEL) public static void molecularTransformer(ItemTooltipEvent event) { if (event.itemStack.getItem() == Item.getItemFromBlock(AdvancedSolarPanel.blockMolecularTransformer)) { diff --git a/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java index dbcd3be01b..05dc46b2b2 100644 --- a/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java @@ -1,77 +1,11 @@ package gtPlusPlus.core.handler.events; -import java.util.List; -import java.util.UUID; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.ChunkPosition; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.world.BlockEvent.BreakEvent; -import net.minecraftforge.event.world.ExplosionEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.metatileentity.BaseMetaTileEntity; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines.GregtechMetaSafeBlockBase; public class PickaxeBlockBreakEventHandler { - @SubscribeEvent - public void onBreakBlock(final BreakEvent event) { - try { - final TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); - if (entity != null) { - if (entity instanceof BaseMetaTileEntity) { - final EntityPlayer playerInternal = event.getPlayer(); - final IMetaTileEntity X = ((BaseMetaTileEntity) entity).getMetaTileEntity(); - if (X instanceof GregtechMetaSafeBlockBase) { - final UUID ownerUUID = ((GregtechMetaSafeBlockBase) X).ownerUUID; - final UUID accessorUUID = playerInternal.getUniqueID(); - if (((GregtechMetaSafeBlockBase) X).bUnbreakable) { - if (accessorUUID == ownerUUID) { - PlayerUtils.messagePlayer( - playerInternal, - "Since you own this block, it has been destroyed."); - } else { - PlayerUtils.messagePlayer( - playerInternal, - "Since you do not own this block, it has not been destroyed."); - event.setCanceled(true); - } - } - } - } - } - } catch (final NullPointerException e) { - // System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: "+e.getCause()); - } - } - - @SubscribeEvent - public void onExplode(ExplosionEvent.Detonate event) { - try { - @SuppressWarnings("unchecked") - List pos = event.explosion.affectedBlockPositions; - for (int i = 0; i < pos.size(); i++) { - ChunkPosition blockpos = (ChunkPosition) pos.get(i); - TileEntity entity = event.world - .getTileEntity(blockpos.chunkPosX, blockpos.chunkPosY, blockpos.chunkPosZ); - if (entity != null) { - if (entity instanceof BaseMetaTileEntity) { - final IMetaTileEntity X = ((BaseMetaTileEntity) entity).getMetaTileEntity(); - if (X instanceof GregtechMetaSafeBlockBase) { - pos.remove(i); - } - } - } - } - } catch (final NullPointerException e) { - - } - } - @SubscribeEvent public void onPlayerInteraction(final PlayerInteractEvent aEvent) { if ((aEvent.entityPlayer != null) && (aEvent.entityPlayer.worldObj != null) diff --git a/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java deleted file mode 100644 index 86736fe14b..0000000000 --- a/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -package gtPlusPlus.core.handler.events; - -import java.lang.reflect.Field; - -import net.minecraftforge.event.entity.living.ZombieEvent; - -import org.apache.commons.lang3.reflect.FieldUtils; - -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gtPlusPlus.api.objects.Logger; - -public class ZombieBackupSpawnEventHandler { - - /** - * - * Do we really need this pathetic mechanic to exist when it doesn't work properly at all? - * - */ - @SubscribeEvent(priority = EventPriority.HIGHEST) - public void onZombieReinforcement(final ZombieEvent.SummonAidEvent event) { - try { - try { - Field mChance = FieldUtils.getDeclaredField(this.getClass(), "summonChance", true); - FieldUtils.removeFinalModifier(mChance, true); - mChance.set(this, 0); - } catch (Throwable t) {} - if (event.attacker != null) { - // SegmentHelper.getInstance().trackUser(event.attacker.getUniqueID().toString(), "Zombie Backup"); - } - Logger.WARNING("[Zombie] ZombieEvent.SummonAidEvent."); - event.setResult(Result.DENY); - } catch (Throwable t) {} - } - - @SubscribeEvent(priority = EventPriority.HIGHEST) - public void onZombieReinforcement(final ZombieEvent event) { - try { - Logger.WARNING("[Zombie] ZombieEvent."); - if (event.entity != null) { - Logger.WARNING("Event Entity: " + event.entity.getCommandSenderName()); - } - event.setResult(Result.DENY); - } catch (Throwable t) { - - } - } -} diff --git a/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java b/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java deleted file mode 100644 index e53ce25e3c..0000000000 --- a/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java +++ /dev/null @@ -1,118 +0,0 @@ -// Date: 20/12/2016 5:51:14 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package gtPlusPlus.core.handler.render; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -import gtPlusPlus.core.lib.CORE; - -public class FirepitModel extends ModelBase { - - // fields - ModelRenderer Side_A; - ModelRenderer Side_B; - ModelRenderer Side_C; - ModelRenderer Side_D; - ModelRenderer Log1; - ModelRenderer Log2; - ModelRenderer Log3; - ModelRenderer Log4; - - public FirepitModel() { - this.textureWidth = 16; - this.textureHeight = 16; - - this.Side_A = new ModelRenderer(this, 0, 0); - this.Side_A.addBox(0F, 0F, 0F, 12, 6, 1); - this.Side_A.setRotationPoint(-6F, 18F, -6F); - this.Side_A.setTextureSize(16, 16); - this.Side_A.mirror = true; - setRotation(this.Side_A, -0.3148822F, 0F, 0F); - // Side_A.mirror = false; - - this.Side_B = new ModelRenderer(this, 0, 0); - this.Side_B.addBox(0F, 0F, 0F, 12, 6, 1); - this.Side_B.setRotationPoint(-6F, 18F, 6F); - this.Side_B.setTextureSize(16, 16); - this.Side_B.mirror = true; - setRotation(this.Side_B, -0.3148822F, (CORE.PI / 2), 0F); - - this.Side_C = new ModelRenderer(this, 0, 0); - this.Side_C.addBox(0F, 0F, 0F, 12, 6, 1); - this.Side_C.setRotationPoint(6F, 18F, 6F); - this.Side_C.setTextureSize(16, 16); - this.Side_C.mirror = true; - setRotation(this.Side_C, -0.3148822F, CORE.PI, 0F); - // Side_C.mirror = false; - - this.Side_D = new ModelRenderer(this, 0, 0); - this.Side_D.addBox(0F, 0F, 0F, 12, 6, 1); - this.Side_D.setRotationPoint(6F, 18F, -6F); - this.Side_D.setTextureSize(16, 16); - this.Side_D.mirror = true; - setRotation(this.Side_D, -0.3148822F, 4.712389F, 0F); - - this.Log1 = new ModelRenderer(this, 0, 10); - this.Log1.addBox(0F, 0F, 0F, 14, 2, 2); - this.Log1.setRotationPoint(4F, 10F, -4F); - this.Log1.setTextureSize(16, 16); - this.Log1.mirror = true; - setRotation(this.Log1, 0F, 0F, (CORE.PI / 2)); - - this.Log2 = new ModelRenderer(this, -2, 10); - this.Log2.addBox(0F, 0F, 0F, 14, 2, 2); - this.Log2.setRotationPoint(-4F, 10F, -4F); - this.Log2.setTextureSize(16, 16); - this.Log2.mirror = true; - setRotation(this.Log2, (CORE.PI / 2), 0F, (CORE.PI / 2)); - // Log2.mirror = false; - - this.Log3 = new ModelRenderer(this, 0, 10); - this.Log3.addBox(0F, 0F, 0F, 14, 2, 2); - this.Log3.setRotationPoint(-4F, 10F, 4F); - this.Log3.setTextureSize(16, 16); - this.Log3.mirror = true; - setRotation(this.Log3, CORE.PI, 0F, (CORE.PI / 2)); - - this.Log4 = new ModelRenderer(this, -2, 10); - this.Log4.addBox(0F, 0F, 0F, 14, 2, 2); - this.Log4.setRotationPoint(4F, 10F, 4F); - this.Log4.setTextureSize(16, 16); - this.Log4.mirror = true; - setRotation(this.Log4, 4.712389F, 0F, (CORE.PI / 2)); - // Log4.mirror = false; - } - - @Override - public void render(final Entity entity, final float f, final float f1, final float f2, final float f3, - final float f4, final float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - this.Side_A.render(f5); - this.Side_B.render(f5); - this.Side_C.render(f5); - this.Side_D.render(f5); - this.Log1.render(f5); - this.Log2.render(f5); - this.Log3.render(f5); - this.Log4.render(f5); - } - - private static void setRotation(final ModelRenderer model, final float x, final float y, final float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(final float f, final float f1, final float f2, final float f3, final float f4, - final float f5, final Entity entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } -} diff --git a/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java b/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java deleted file mode 100644 index 0237047121..0000000000 --- a/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java +++ /dev/null @@ -1,60 +0,0 @@ -package gtPlusPlus.core.handler.render; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -public class FirepitRender extends TileEntitySpecialRenderer { - - ResourceLocation texture = new ResourceLocation(GTPlusPlus.ID + ":" + "textures/blocks/FirePit/mossyFirepit.png"); - - private final FirepitModel model; - - public FirepitRender() { - this.model = new FirepitModel(); - } - - private void adjustRotatePivotViaMeta(final World world, final int x, final int y, final int z) { - final int meta = world.getBlockMetadata(x, y, z); - GL11.glPushMatrix(); - GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); - GL11.glPopMatrix(); - } - - @Override - public void renderTileEntityAt(final TileEntity entity, final double x, final double y, final double z, - final float i) { - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.1F, (float) y + 1.0F, (float) z + 0.5F); - GL11.glRotatef(180, 0F, 0F, 1F); - - this.bindTexture(this.texture); - GL11.glPushMatrix(); - this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - GL11.glTranslatef(1.0f, 1.0f, 1.0f); - GL11.glPopMatrix(); - GL11.glPopMatrix(); - } - - // Set the lighting stuff, so it changes it's brightness properly. - private void adjustLightFixture(final World world, final int i, final int j, final int k, final Block block) { - final Tessellator tess = Tessellator.instance; - // float brightness = block.getBlockBrightness(world, i, j, k); - // As of MC 1.7+ block.getBlockBrightness() has become block.getLightValue(): - final float brightness = block.getLightValue(world, i, j, k); - final int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); - final int modulousModifier = skyLight % 65536; - final int divModifier = skyLight / 65536; - tess.setColorOpaque_F(brightness, brightness, brightness); - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier); - } -} diff --git a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java b/src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java deleted file mode 100644 index f4a632a6fc..0000000000 --- a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java +++ /dev/null @@ -1,215 +0,0 @@ -package gtPlusPlus.core.inventories; - -import java.util.UUID; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraftforge.common.util.Constants; - -import gtPlusPlus.core.item.base.BaseItemBackpack; - -public class BaseInventoryBackpack implements IInventory { - - private final String name = "Inventory Item"; - - /** Provides NBT Tag Compound to reference */ - private final ItemStack invItem; - - /** Defining your inventory size this way is handy */ - public static final int INV_SIZE = 8; - - /** Inventory's size must be same as number of slots you add to the Container class */ - private final ItemStack[] inventory = new ItemStack[INV_SIZE]; - - // declaration of variable: - protected String uniqueID; - - /** - * @param stack - the ItemStack to which this inventory belongs - */ - public BaseInventoryBackpack(final ItemStack stack) { - this.invItem = stack; - - /** initialize variable within the constructor: */ - this.uniqueID = ""; - - if (!stack.hasTagCompound()) { - stack.setTagCompound(new NBTTagCompound()); - // no tag compound means the itemstack does not yet have a UUID, so assign one: - this.uniqueID = UUID.randomUUID().toString(); - } - - // Create a new NBT Tag Compound if one doesn't already exist, or you will crash - if (!stack.hasTagCompound()) { - stack.setTagCompound(new NBTTagCompound()); - } - // note that it's okay to use stack instead of invItem right there - // both reference the same memory location, so whatever you change using - // either reference will change in the other - - // Read the inventory contents from NBT - this.readFromNBT(stack.getTagCompound()); - } - - @Override - public int getSizeInventory() { - return this.inventory.length; - } - - @Override - public ItemStack getStackInSlot(final int slot) { - return this.inventory[slot]; - } - - @Override - public ItemStack decrStackSize(final int slot, final int amount) { - ItemStack stack = this.getStackInSlot(slot); - if (stack != null) { - if (stack.stackSize > amount) { - stack = stack.splitStack(amount); - // Don't forget this line or your inventory will not be saved! - this.markDirty(); - } else { - // this method also calls markDirty, so we don't need to call it again - this.setInventorySlotContents(slot, null); - } - } - return stack; - } - - @Override - public ItemStack getStackInSlotOnClosing(final int slot) { - final ItemStack stack = this.getStackInSlot(slot); - this.setInventorySlotContents(slot, null); - return stack; - } - - @Override - public void setInventorySlotContents(final int slot, final ItemStack stack) { - this.inventory[slot] = stack; - - if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) { - stack.stackSize = this.getInventoryStackLimit(); - } - - // Don't forget this line or your inventory will not be saved! - this.markDirty(); - } - - // 1.7.2+ renamed to getInventoryName - @Override - public String getInventoryName() { - return this.name; - } - - // 1.7.2+ renamed to hasCustomInventoryName - @Override - public boolean hasCustomInventoryName() { - return this.name.length() > 0; - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - /** - * This is the method that will handle saving the inventory contents, as it is called (or should be called!) anytime - * the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also let you change - * things in your inventory without ever opening a Gui, if you want. - */ - // 1.7.2+ renamed to markDirty - @Override - public void markDirty() { - for (int i = 0; i < this.getSizeInventory(); ++i) { - if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) { - this.inventory[i] = null; - } - } - - // This line here does the work: - this.writeToNBT(this.invItem.getTagCompound()); - } - - @Override - public boolean isUseableByPlayer(final EntityPlayer entityplayer) { - return true; - } - - // 1.7.2+ renamed to openInventory(EntityPlayer player) - @Override - public void openInventory() {} - - // 1.7.2+ renamed to closeInventory(EntityPlayer player) - @Override - public void closeInventory() {} - - /** - * This method doesn't seem to do what it claims to do, as items can still be left-clicked and placed in the - * inventory even when this returns false - */ - @Override - public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { - // Don't want to be able to store the inventory item within itself - // Bad things will happen, like losing your inventory - // Actually, this needs a custom Slot to work - return !(itemstack.getItem() instanceof BaseItemBackpack); - } - - /** - * A custom method to read our inventory from an ItemStack's NBT compound - */ - public void readFromNBT(final NBTTagCompound compound) { - // Gets the custom taglist we wrote to this compound, if any - // 1.7.2+ change to compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND); - final NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND); - - if ("".equals(this.uniqueID)) { - // try to read unique ID from NBT - this.uniqueID = compound.getString("uniqueID"); - // if it's still "", assign a new one: - if ("".equals(this.uniqueID)) { - this.uniqueID = UUID.randomUUID().toString(); - } - } - - for (int i = 0; i < items.tagCount(); ++i) { - // 1.7.2+ change to items.getCompoundTagAt(i) - final NBTTagCompound item = items.getCompoundTagAt(i); - final int slot = item.getInteger("Slot"); - - // Just double-checking that the saved slot index is within our inventory array bounds - if ((slot >= 0) && (slot < this.getSizeInventory())) { - this.inventory[slot] = ItemStack.loadItemStackFromNBT(item); - } - } - } - - /** - * A custom method to write our inventory to an ItemStack's NBT compound - */ - public void writeToNBT(final NBTTagCompound tagcompound) { - // Create a new NBT Tag List to store itemstacks as NBT Tags - final NBTTagList items = new NBTTagList(); - - for (int i = 0; i < this.getSizeInventory(); ++i) { - // Only write stacks that contain items - if (this.getStackInSlot(i) != null) { - // Make a new NBT Tag Compound to write the itemstack and slot index to - final NBTTagCompound item = new NBTTagCompound(); - item.setInteger("Slot", i); - // Writes the itemstack in slot(i) to the Tag Compound we just made - this.getStackInSlot(i).writeToNBT(item); - - // add the tag compound to our tag list - items.appendTag(item); - } - } - tagcompound.setString("uniqueID", this.uniqueID); - // Add the TagList to the ItemStack's Tag Compound with the name "ItemInventory" - tagcompound.setTag("ItemInventory", items); - } -} diff --git a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java b/src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java deleted file mode 100644 index 5692612d5f..0000000000 --- a/src/main/java/gtPlusPlus/core/inventories/BaseInventoryGrindle.java +++ /dev/null @@ -1,219 +0,0 @@ -package gtPlusPlus.core.inventories; - -import java.util.UUID; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraftforge.common.util.Constants; - -import gtPlusPlus.core.item.base.BaseItemBackpack; - -public class BaseInventoryGrindle implements IInventory { - - private final String name = "Inventory Item"; - - /** Provides NBT Tag Compound to reference */ - private final ItemStack invItem; - - /** Defining your inventory size this way is handy */ - public static final int INV_SIZE = 6; - - /** - * Inventory's size must be same as number of slots you add to the Container class - */ - private final ItemStack[] inventory = new ItemStack[INV_SIZE]; - - // declaration of variable: - protected String uniqueID; - - /** - * @param itemstack - the ItemStack to which this inventory belongs - */ - public BaseInventoryGrindle(final ItemStack stack) { - this.invItem = stack; - - /** initialize variable within the constructor: */ - this.uniqueID = ""; - - if (!stack.hasTagCompound()) { - stack.setTagCompound(new NBTTagCompound()); - // no tag compound means the itemstack does not yet have a UUID, so assign one: - this.uniqueID = UUID.randomUUID().toString(); - } - - // Create a new NBT Tag Compound if one doesn't already exist, or you will crash - if (!stack.hasTagCompound()) { - stack.setTagCompound(new NBTTagCompound()); - } - // note that it's okay to use stack instead of invItem right there - // both reference the same memory location, so whatever you change using - // either reference will change in the other - - // Read the inventory contents from NBT - this.readFromNBT(stack.getTagCompound()); - } - - @Override - public int getSizeInventory() { - return this.inventory.length; - } - - @Override - public ItemStack getStackInSlot(final int slot) { - return this.inventory[slot]; - } - - @Override - public ItemStack decrStackSize(final int slot, final int amount) { - ItemStack stack = this.getStackInSlot(slot); - if (stack != null) { - if (stack.stackSize > amount) { - stack = stack.splitStack(amount); - // Don't forget this line or your inventory will not be saved! - this.markDirty(); - } else { - // this method also calls markDirty, so we don't need to call it again - this.setInventorySlotContents(slot, null); - } - } - return stack; - } - - @Override - public ItemStack getStackInSlotOnClosing(final int slot) { - final ItemStack stack = this.getStackInSlot(slot); - this.setInventorySlotContents(slot, null); - return stack; - } - - @Override - public void setInventorySlotContents(final int slot, final ItemStack stack) { - this.inventory[slot] = stack; - - if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) { - stack.stackSize = this.getInventoryStackLimit(); - } - - // Don't forget this line or your inventory will not be saved! - this.markDirty(); - } - - // 1.7.2+ renamed to getInventoryName - @Override - public String getInventoryName() { - return this.name; - } - - // 1.7.2+ renamed to hasCustomInventoryName - @Override - public boolean hasCustomInventoryName() { - return this.name.length() > 0; - } - - @Override - public int getInventoryStackLimit() { - return 1; - } - - /** - * This is the method that will handle saving the inventory contents, as it is called (or should be called!) anytime - * the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also let you change - * things in your inventory without ever opening a Gui, if you want. - */ - // 1.7.2+ renamed to markDirty - @Override - public void markDirty() { - for (int i = 0; i < this.getSizeInventory(); ++i) { - if ((this.getStackInSlot(i) != null) && (this.getStackInSlot(i).stackSize == 0)) { - this.inventory[i] = null; - } - } - - // This line here does the work: - this.writeToNBT(this.invItem.getTagCompound()); - } - - @Override - public boolean isUseableByPlayer(final EntityPlayer entityplayer) { - return true; - } - - // 1.7.2+ renamed to openInventory(EntityPlayer player) - @Override - public void openInventory() {} - - // 1.7.2+ renamed to closeInventory(EntityPlayer player) - @Override - public void closeInventory() {} - - /** - * This method doesn't seem to do what it claims to do, as items can still be left-clicked and placed in the - * inventory even when this returns false - */ - @Override - public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { - // Don't want to be able to store the inventory item within itself - // Bad things will happen, like losing your inventory - // Actually, this needs a custom Slot to work - return !(itemstack.getItem() instanceof BaseItemBackpack); - } - - /** - * A custom method to read our inventory from an ItemStack's NBT compound - */ - public void readFromNBT(final NBTTagCompound compound) { - // Gets the custom taglist we wrote to this compound, if any - // 1.7.2+ change to compound.getTagList("ItemInventory", - // Constants.NBT.TAG_COMPOUND); - final NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND); - - if ("".equals(this.uniqueID)) { - // try to read unique ID from NBT - this.uniqueID = compound.getString("uniqueID"); - // if it's still "", assign a new one: - if ("".equals(this.uniqueID)) { - this.uniqueID = UUID.randomUUID().toString(); - } - } - - for (int i = 0; i < items.tagCount(); ++i) { - // 1.7.2+ change to items.getCompoundTagAt(i) - final NBTTagCompound item = items.getCompoundTagAt(i); - final int slot = item.getInteger("Slot"); - - // Just double-checking that the saved slot index is within our inventory array - // bounds - if ((slot >= 0) && (slot < this.getSizeInventory())) { - this.inventory[slot] = ItemStack.loadItemStackFromNBT(item); - } - } - } - - /** - * A custom method to write our inventory to an ItemStack's NBT compound - */ - public void writeToNBT(final NBTTagCompound tagcompound) { - // Create a new NBT Tag List to store itemstacks as NBT Tags - final NBTTagList items = new NBTTagList(); - - for (int i = 0; i < this.getSizeInventory(); ++i) { - // Only write stacks that contain items - if (this.getStackInSlot(i) != null) { - // Make a new NBT Tag Compound to write the itemstack and slot index to - final NBTTagCompound item = new NBTTagCompound(); - item.setInteger("Slot", i); - // Writes the itemstack in slot(i) to the Tag Compound we just made - this.getStackInSlot(i).writeToNBT(item); - - // add the tag compound to our tag list - items.appendTag(item); - } - } - tagcompound.setString("uniqueID", this.uniqueID); - // Add the TagList to the ItemStack's Tag Compound with the name "ItemInventory" - tagcompound.setTag("ItemInventory", items); - } -} diff --git a/src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java b/src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java deleted file mode 100644 index fb9b481f88..0000000000 --- a/src/main/java/gtPlusPlus/core/inventories/InventoryHeliumGenerator.java +++ /dev/null @@ -1,157 +0,0 @@ -package gtPlusPlus.core.inventories; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -public class InventoryHeliumGenerator implements IInventory { - - private final String name = "Helium"; - - /** Defining your inventory size this way is handy */ - public static final int INV_SIZE = 19; - - /** Inventory's size must be same as number of slots you add to the Container class */ - private ItemStack[] inventory = new ItemStack[INV_SIZE]; - - public void readFromNBT(final NBTTagCompound nbt) { - final NBTTagList list = nbt.getTagList("Items", 10); - this.inventory = new ItemStack[INV_SIZE]; - for (int i = 0; i < list.tagCount(); i++) { - final NBTTagCompound data = list.getCompoundTagAt(i); - final int slot = data.getInteger("Slot"); - if ((slot >= 0) && (slot < INV_SIZE)) { - // Utils.LOG_INFO("Trying to read NBT data from inventory."); - this.inventory[slot] = ItemStack.loadItemStackFromNBT(data); - } - } - } - - public void writeToNBT(final NBTTagCompound nbt) { - final NBTTagList list = new NBTTagList(); - for (int i = 0; i < INV_SIZE; i++) { - final ItemStack stack = this.inventory[i]; - if (stack != null) { - // Utils.LOG_INFO("Trying to write NBT data to inventory."); - final NBTTagCompound data = new NBTTagCompound(); - stack.writeToNBT(data); - data.setInteger("Slot", i); - list.appendTag(data); - } - } - nbt.setTag("Items", list); - } - - @Override - public int getSizeInventory() { - return this.inventory.length; - } - - public ItemStack[] getInventory() { - return this.inventory; - } - - @Override - public ItemStack getStackInSlot(final int slot) { - return this.inventory[slot]; - } - - @Override - public ItemStack decrStackSize(final int slot, final int amount) { - ItemStack stack = this.getStackInSlot(slot); - if (stack != null) { - if (stack.stackSize > amount) { - stack = stack.splitStack(amount); - // Don't forget this line or your inventory will not be saved! - this.markDirty(); - } else { - // this method also calls markDirty, so we don't need to call it again - this.setInventorySlotContents(slot, null); - } - } - return stack; - } - - @Override - public ItemStack getStackInSlotOnClosing(final int slot) { - final ItemStack stack = this.getStackInSlot(slot); - this.setInventorySlotContents(slot, null); - return stack; - } - - @Override - public void setInventorySlotContents(final int slot, final ItemStack stack) { - this.inventory[slot] = stack; - - if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) { - stack.stackSize = this.getInventoryStackLimit(); - } - - // Don't forget this line or your inventory will not be saved! - this.markDirty(); - } - - // 1.7.2+ renamed to getInventoryName - @Override - public String getInventoryName() { - return this.name; - } - - // 1.7.2+ renamed to hasCustomInventoryName - @Override - public boolean hasCustomInventoryName() { - return this.name.length() > 0; - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - /** - * This is the method that will handle saving the inventory contents, as it is called (or should be called!) anytime - * the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also let you change - * things in your inventory without ever opening a Gui, if you want. - */ - // 1.7.2+ renamed to markDirty - @Override - public void markDirty() { - for (int i = 0; i < this.getSizeInventory(); ++i) { - final ItemStack temp = this.getStackInSlot(i); - if (temp != null) { - // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize); - } - - if ((temp != null) && (temp.stackSize == 0)) { - this.inventory[i] = null; - } - } - } - - @Override - public boolean isUseableByPlayer(final EntityPlayer entityplayer) { - return true; - } - - // 1.7.2+ renamed to openInventory(EntityPlayer player) - @Override - public void openInventory() {} - - // 1.7.2+ renamed to closeInventory(EntityPlayer player) - @Override - public void closeInventory() {} - - /** - * This method doesn't seem to do what it claims to do, as items can still be left-clicked and placed in the - * inventory even when this returns false - */ - @Override - public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { - // Don't want to be able to store the inventory item within itself - // Bad things will happen, like losing your inventory - // Actually, this needs a custom Slot to work - return true; - } -} diff --git a/src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java b/src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java deleted file mode 100644 index 0593bdd237..0000000000 --- a/src/main/java/gtPlusPlus/core/inventories/box/LunchBoxInventory.java +++ /dev/null @@ -1,18 +0,0 @@ -package gtPlusPlus.core.inventories.box; - -import net.minecraft.item.ItemStack; - -import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory; -import gtPlusPlus.core.slots.SlotLunchBox; - -public class LunchBoxInventory extends CustomBoxInventory { - - public LunchBoxInventory(ItemStack stack) { - super(stack, "Lunch Box", gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS); - } - - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemstack) { - return SlotLunchBox.isItemValid_STATIC(itemstack); - } -} diff --git a/src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java b/src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java deleted file mode 100644 index 6e47fb0d3c..0000000000 --- a/src/main/java/gtPlusPlus/core/inventories/box/MagicBagInventory.java +++ /dev/null @@ -1,18 +0,0 @@ -package gtPlusPlus.core.inventories.box; - -import net.minecraft.item.ItemStack; - -import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory; -import gtPlusPlus.core.slots.SlotMagicToolBag; - -public class MagicBagInventory extends CustomBoxInventory { - - public MagicBagInventory(ItemStack stack) { - super(stack, "Mystic Bag", gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS); - } - - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemstack) { - return SlotMagicToolBag.isItemValid_STATIC(itemstack); - } -} diff --git a/src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java b/src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java deleted file mode 100644 index 0c0d381c4c..0000000000 --- a/src/main/java/gtPlusPlus/core/inventories/box/ToolBoxInventory.java +++ /dev/null @@ -1,19 +0,0 @@ -package gtPlusPlus.core.inventories.box; - -import net.minecraft.item.ItemStack; - -import gtPlusPlus.core.item.tool.misc.box.CustomBoxInventory; -import gtPlusPlus.core.item.tool.misc.box.UniversalToolBox; -import gtPlusPlus.core.slots.SlotToolBox; - -public class ToolBoxInventory extends CustomBoxInventory { - - public ToolBoxInventory(ItemStack stack) { - super(stack, "Tool Box", UniversalToolBox.SLOTS); - } - - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemstack) { - return SlotToolBox.isItemValid_STATIC(itemstack); - } -} diff --git a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java b/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java deleted file mode 100644 index 0168a5cfdf..0000000000 --- a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularMain.java +++ /dev/null @@ -1,175 +0,0 @@ -package gtPlusPlus.core.inventories.modulartable; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; - -public class InventoryModularMain implements IInventory { - - private final String name = "Inventory Grid"; - - /** Defining your inventory size this way is handy */ - public static final int INV_SIZE = 9; - - /** Inventory's size must be same as number of slots you add to the Container class */ - private ItemStack[] inventory = new ItemStack[INV_SIZE]; - - /** - * @param itemstack - the ItemStack to which this inventory belongs - */ - public InventoryModularMain() {} - - public void readFromNBT(final NBTTagCompound nbt) { - final NBTTagList list = nbt.getTagList("Items", 10); - this.inventory = new ItemStack[INV_SIZE]; - for (int i = 0; i < list.tagCount(); i++) { - final NBTTagCompound data = list.getCompoundTagAt(i); - final int slot = data.getInteger("Slot"); - if ((slot >= 0) && (slot < INV_SIZE)) { - this.inventory[slot] = ItemStack.loadItemStackFromNBT(data); - } - } - } - - public void writeToNBT(final NBTTagCompound nbt) { - final NBTTagList list = new NBTTagList(); - for (int i = 0; i < INV_SIZE; i++) { - final ItemStack stack = this.inventory[i]; - if (stack != null) { - final NBTTagCompound data = new NBTTagCompound(); - stack.writeToNBT(data); - data.setInteger("Slot", i); - list.appendTag(data); - } - } - nbt.setTag("Items", list); - } - - @Override - public int getSizeInventory() { - return this.inventory.length; - } - - public ItemStack[] getInventory() { - return this.inventory; - } - - @Override - public ItemStack getStackInSlot(final int slot) { - // Utils.LOG_INFO("getStackInSlot["+slot+"]"); - try { - if (slot >= this.inventory.length) { - // Utils.LOG_INFO("Returning invalid slot item."); - return null; - } - return this.inventory[slot]; - } catch (Throwable t) { - t.printStackTrace(); - return null; - } - } - - @Override - public ItemStack decrStackSize(final int slot, final int amount) { - ItemStack stack = this.getStackInSlot(slot); - if (stack != null) { - if (stack.stackSize > amount) { - stack = stack.splitStack(amount); - // Don't forget this line or your inventory will not be saved! - this.markDirty(); - } else { - // this method also calls markDirty, so we don't need to call it again - this.setInventorySlotContents(slot, null); - } - } - return stack; - } - - @Override - public ItemStack getStackInSlotOnClosing(final int slot) { - final ItemStack stack = this.getStackInSlot(slot); - this.setInventorySlotContents(slot, null); - return stack; - } - - @Override - public void setInventorySlotContents(final int slot, final ItemStack stack) { - if (slot >= this.inventory.length) { - return; - } - this.inventory[slot] = stack; - - if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) { - stack.stackSize = this.getInventoryStackLimit(); - } - - // Don't forget this line or your inventory will not be saved! - this.markDirty(); - } - - // 1.7.2+ renamed to getInventoryName - @Override - public String getInventoryName() { - return this.name; - } - - // 1.7.2+ renamed to hasCustomInventoryName - @Override - public boolean hasCustomInventoryName() { - return this.name.length() > 0; - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - /** - * This is the method that will handle saving the inventory contents, as it is called (or should be called!) anytime - * the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also let you change - * things in your inventory without ever opening a Gui, if you want. - */ - // 1.7.2+ renamed to markDirty - @Override - public void markDirty() { - for (int i = 0; i < this.getSizeInventory(); ++i) { - final ItemStack temp = this.getStackInSlot(i); - if (temp != null) { - // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" x"+temp.stackSize); - } - - if ((temp != null) && (temp.stackSize == 0)) { - this.inventory[i] = null; - } - } - } - - @Override - public boolean isUseableByPlayer(final EntityPlayer entityplayer) { - return true; - } - - // 1.7.2+ renamed to openInventory(EntityPlayer player) - @Override - public void openInventory() {} - - // 1.7.2+ renamed to closeInventory(EntityPlayer player) - @Override - public void closeInventory() {} - - /** - * This method doesn't seem to do what it claims to do, as items can still be left-clicked and placed in the - * inventory even when this returns false - */ - @Override - public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { - // Don't want to be able to store the inventory item within itself - // Bad things will happen, like losing your inventory - // Actually, this needs a custom Slot to work - return TileEntityModularityTable.isValidUpgrade(itemstack); - } -} diff --git a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java b/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java deleted file mode 100644 index a1dddd09bd..0000000000 --- a/src/main/java/gtPlusPlus/core/inventories/modulartable/InventoryModularOutput.java +++ /dev/null @@ -1,185 +0,0 @@ -package gtPlusPlus.core.inventories.modulartable; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; - -public class InventoryModularOutput implements IInventory { - - private final String name = "Inventory Output"; - - /** Defining your inventory size this way is handy */ - public static final int INV_SIZE = 3; - - private int mRecpeTime = -1; - - /** - * Inventory's size must be same as number of slots you add to the Container class - */ - private ItemStack[] inventory = new ItemStack[INV_SIZE]; - - /** - * @param itemstack - the ItemStack to which this inventory belongs - */ - public InventoryModularOutput() {} - - public void readFromNBT(final NBTTagCompound nbt) { - if (this.mRecpeTime > -1) { - nbt.setInteger("mRecipeTime", this.mRecpeTime); - } - final NBTTagList list = nbt.getTagList("Items", 10); - this.inventory = new ItemStack[INV_SIZE]; - for (int i = 0; i < list.tagCount(); i++) { - final NBTTagCompound data = list.getCompoundTagAt(i); - final int slot = data.getInteger("Slot"); - if ((slot >= 0) && (slot < INV_SIZE)) { - this.inventory[slot] = ItemStack.loadItemStackFromNBT(data); - } - } - } - - public void writeToNBT(final NBTTagCompound nbt) { - final NBTTagList list = new NBTTagList(); - if (nbt.hasKey("mRecipeTime")) { - this.mRecpeTime = nbt.getInteger("mRecipeTime"); - } - for (int i = 0; i < INV_SIZE; i++) { - final ItemStack stack = this.inventory[i]; - if (stack != null) { - final NBTTagCompound data = new NBTTagCompound(); - stack.writeToNBT(data); - data.setInteger("Slot", i); - list.appendTag(data); - } - } - nbt.setTag("Items", list); - } - - public int setRecipeTime(int mTime) { - return (this.mRecpeTime = mTime); - } - - public int getRecipeTime() { - return this.mRecpeTime; - } - - @Override - public int getSizeInventory() { - return this.inventory.length; - } - - public ItemStack[] getInventory() { - return this.inventory; - } - - @Override - public ItemStack getStackInSlot(final int slot) { - return this.inventory[slot]; - } - - @Override - public ItemStack decrStackSize(final int slot, final int amount) { - ItemStack stack = this.getStackInSlot(slot); - if (stack != null) { - if (stack.stackSize > amount) { - stack = stack.splitStack(amount); - // Don't forget this line or your inventory will not be saved! - this.markDirty(); - } else { - // this method also calls markDirty, so we don't need to call it - // again - this.setInventorySlotContents(slot, null); - } - } - return stack; - } - - @Override - public ItemStack getStackInSlotOnClosing(final int slot) { - final ItemStack stack = this.getStackInSlot(slot); - this.setInventorySlotContents(slot, null); - return stack; - } - - @Override - public void setInventorySlotContents(final int slot, final ItemStack stack) { - this.inventory[slot] = stack; - - if ((stack != null) && (stack.stackSize > this.getInventoryStackLimit())) { - stack.stackSize = this.getInventoryStackLimit(); - } - - // Don't forget this line or your inventory will not be saved! - this.markDirty(); - } - - // 1.7.2+ renamed to getInventoryName - @Override - public String getInventoryName() { - return this.name; - } - - // 1.7.2+ renamed to hasCustomInventoryName - @Override - public boolean hasCustomInventoryName() { - return this.name.length() > 0; - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - /** - * This is the method that will handle saving the inventory contents, as it is called (or should be called!) anytime - * the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also let you change - * things in your inventory without ever opening a Gui, if you want. - */ - // 1.7.2+ renamed to markDirty - @Override - public void markDirty() { - for (int i = 0; i < this.getSizeInventory(); ++i) { - final ItemStack temp = this.getStackInSlot(i); - if (temp != null) { - // Utils.LOG_INFO("Slot "+i+" contains "+temp.getDisplayName()+" - // x"+temp.stackSize); - } - - if ((temp != null) && (temp.stackSize == 0)) { - this.inventory[i] = null; - } - } - } - - @Override - public boolean isUseableByPlayer(final EntityPlayer entityplayer) { - return true; - } - - // 1.7.2+ renamed to openInventory(EntityPlayer player) - @Override - public void openInventory() {} - - // 1.7.2+ renamed to closeInventory(EntityPlayer player) - @Override - public void closeInventory() {} - - /** - * This method doesn't seem to do what it claims to do, as items can still be left-clicked and placed in the - * inventory even when this returns false - */ - @Override - public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { - // Don't want to be able to store the inventory item within itself - // Bad things will happen, like losing your inventory - // Actually, this needs a custom Slot to work - if (slot == 0) { - return TileEntityModularityTable.isValidUpgrade(itemstack); - } - return TileEntityModularityTable.isValidModularPiece(itemstack); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java index 558353ddb3..45dc15b3f2 100644 --- a/src/main/java/gtPlusPlus/core/item/ModItems.java +++ b/src/main/java/gtPlusPlus/core/item/ModItems.java @@ -1,22 +1,15 @@ package gtPlusPlus.core.item; -import static gregtech.api.enums.Mods.Baubles; -import static gregtech.api.enums.Mods.EnderIO; import static gregtech.api.enums.Mods.Forestry; import static gregtech.api.enums.Mods.GTPlusPlus; import static gregtech.api.enums.Mods.GregTech; import static gregtech.api.enums.Mods.Thaumcraft; -import static gtPlusPlus.core.creative.AddToCreativeTab.tabMachines; import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc; -import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; -import net.minecraft.item.Item.ToolMaterial; -import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -31,55 +24,37 @@ import gtPlusPlus.core.block.base.BlockBaseModular; import gtPlusPlus.core.common.compat.COMPAT_Baubles; import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.item.base.BaseEuItem; -import gtPlusPlus.core.item.base.BaseItemBackpack; import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes; import gtPlusPlus.core.item.base.BaseItemDamageable; import gtPlusPlus.core.item.base.BaseItemTCShard; import gtPlusPlus.core.item.base.CoreItem; import gtPlusPlus.core.item.base.dusts.BaseItemDust; import gtPlusPlus.core.item.base.foil.BaseItemFoil; -import gtPlusPlus.core.item.base.foods.BaseItemFood; -import gtPlusPlus.core.item.base.foods.BaseItemHotFood; import gtPlusPlus.core.item.base.gears.BaseItemSmallGear; import gtPlusPlus.core.item.base.ingots.BaseItemIngot; import gtPlusPlus.core.item.base.ingots.BaseItemIngot_OLD; -import gtPlusPlus.core.item.base.misc.BaseItemMisc; -import gtPlusPlus.core.item.base.misc.BaseItemMisc.MiscTypes; import gtPlusPlus.core.item.base.plates.BaseItemPlate; import gtPlusPlus.core.item.base.plates.BaseItemPlateDouble; import gtPlusPlus.core.item.bauble.BatteryPackBaseBauble; -import gtPlusPlus.core.item.bauble.HealthBoostBauble; -import gtPlusPlus.core.item.bauble.ModularBauble; -import gtPlusPlus.core.item.bauble.MonsterKillerBaseBauble; import gtPlusPlus.core.item.chemistry.AgriculturalChem; import gtPlusPlus.core.item.chemistry.CoalTar; import gtPlusPlus.core.item.chemistry.GenericChem; import gtPlusPlus.core.item.chemistry.IonParticles; import gtPlusPlus.core.item.chemistry.MilledOreProcessing; -import gtPlusPlus.core.item.chemistry.NuclearChem; import gtPlusPlus.core.item.chemistry.RocketFuels; import gtPlusPlus.core.item.chemistry.StandardBaseParticles; import gtPlusPlus.core.item.crafting.ItemDummyResearch; import gtPlusPlus.core.item.food.BaseItemMetaFood; -import gtPlusPlus.core.item.general.BaseItemGrindle; import gtPlusPlus.core.item.general.BufferCore; import gtPlusPlus.core.item.general.ItemAirFilter; -import gtPlusPlus.core.item.general.ItemAreaClear; -import gtPlusPlus.core.item.general.ItemBasicFirestarter; import gtPlusPlus.core.item.general.ItemBasicScrubberTurbine; import gtPlusPlus.core.item.general.ItemBlueprint; -import gtPlusPlus.core.item.general.ItemControlCore; import gtPlusPlus.core.item.general.ItemEmpty; -import gtPlusPlus.core.item.general.ItemGemShards; import gtPlusPlus.core.item.general.ItemGenericToken; -import gtPlusPlus.core.item.general.ItemGiantEgg; import gtPlusPlus.core.item.general.ItemHalfCompleteCasings; import gtPlusPlus.core.item.general.ItemLavaFilter; import gtPlusPlus.core.item.general.ItemMagicFeather; -import gtPlusPlus.core.item.general.ItemSunnariumBit; import gtPlusPlus.core.item.general.books.ItemBaseBook; -import gtPlusPlus.core.item.general.capture.ItemEntityCatcher; import gtPlusPlus.core.item.general.chassis.ItemBoilerChassis; import gtPlusPlus.core.item.general.chassis.ItemDehydratorCoil; import gtPlusPlus.core.item.general.chassis.ItemDehydratorCoilWire; @@ -91,14 +66,6 @@ import gtPlusPlus.core.item.materials.DustDecayable; import gtPlusPlus.core.item.tool.misc.DebugScanner; import gtPlusPlus.core.item.tool.misc.GregtechPump; -import gtPlusPlus.core.item.tool.misc.SandstoneHammer; -import gtPlusPlus.core.item.tool.misc.box.AutoLunchBox; -import gtPlusPlus.core.item.tool.misc.box.MagicToolBag; -import gtPlusPlus.core.item.tool.misc.box.UniversalToolBox; -import gtPlusPlus.core.item.tool.staballoy.MultiPickaxeBase; -import gtPlusPlus.core.item.tool.staballoy.MultiSpadeBase; -import gtPlusPlus.core.item.tool.staballoy.StaballoyAxe; -import gtPlusPlus.core.item.tool.staballoy.StaballoyPickaxe; import gtPlusPlus.core.item.wearable.WearableLoader; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.ConfigSwitches; @@ -118,112 +85,34 @@ import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.everglades.GTplusplus_Everglades; -import gtPlusPlus.xmod.cofh.HANDLER_COFH; -import gtPlusPlus.xmod.eio.material.MaterialEIO; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.helpers.VolumetricFlaskHelper; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems; public final class ModItems { - public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18); - public static Item ZZZ_Empty; public static Item AAA_Broken; public static Item itemAlkalusDisk; - public static Item itemDebugShapeSpawner; public static ItemCustomSpawnEgg itemCustomSpawnEgg; - // EnderIO - public static Item itemPlateSoularium; - public static Item itemPlateRedstoneAlloy; - public static Item itemPlateElectricalSteel; - public static Item itemPlatePulsatingIron; - public static Item itemPlateEnergeticAlloy; - public static Item itemPlateVibrantAlloy; - public static Item itemPlateConductiveIron; - public static Item itemPlateDarkSteel; - public static Item itemDustSoularium; - public static Item itemDustRedstoneAlloy; - public static Item itemDustElectricalSteel; - public static Item itemDustPulsatingIron; - public static Item itemDustEnergeticAlloy; - public static Item itemDustVibrantAlloy; - public static Item itemDustConductiveIron; - - // Staballoy - public static Item itemStaballoyPickaxe; - public static Item itemStaballoyAxe; - // Tools - public static Item itemSandstoneHammer; - // Machine Related - public static Item itemBufferCore0; - // Material related - public static Item itemStickyRubber; public static Item itemIngotBatteryAlloy; public static Item itemPlateBatteryAlloy; - public static Item itemHeliumBlob; public static Item itemHydrogenBlob; - public static Item itemPLACEHOLDER_Circuit; - - public static Item FuelRod_Empty; - public static Item FuelRod_Thorium; - public static Item FuelRod_Uranium; - public static Item FuelRod_Plutonium; public static Item itemBedLocator_Base; public static Item itemBaseItemWithCharge; - public static Item itemIngotRaisinBread; - public static Item itemHotIngotRaisinBread; - - public static ItemFood itemFoodRaisinToast; - public static BaseItemHotFood itemHotFoodRaisinToast; - public static BaseItemFood itemFoodCurriedSausages; - public static BaseItemHotFood itemHotFoodCurriedSausages; - - public static Item RfEuBattery; public static Item itemPersonalCloakingDevice; - public static Item itemPersonalCloakingDeviceCharged; public static Item itemPersonalHealingDevice; - public static Item itemPersonalFireProofDevice; public static Item itemSlowBuildingRing; - public static MultiPickaxeBase MP_GTMATERIAL; - public static MultiSpadeBase MS_GTMATERIAL; - - public static ItemStack FluidCell; - - public static BaseItemBackpack backpack_Red; - public static BaseItemBackpack backpack_Green; - public static BaseItemBackpack backpack_Blue; - public static BaseItemBackpack backpack_Yellow; - public static BaseItemBackpack backpack_Purple; - public static BaseItemBackpack backpack_Cyan; - public static BaseItemBackpack backpack_Maroon; - public static BaseItemBackpack backpack_Olive; - public static BaseItemBackpack backpack_DarkGreen; - public static BaseItemBackpack backpack_DarkPurple; - public static BaseItemBackpack backpack_Teal; - public static BaseItemBackpack backpack_Navy; - public static BaseItemBackpack backpack_Silver; - public static BaseItemBackpack backpack_Gray; - public static BaseItemBackpack backpack_Black; - public static BaseItemBackpack backpack_White; - public static ItemBlueprint itemBlueprintBase; public static Item dustLithiumCarbonate; public static Item dustLithiumHydroxide; public static Item dustLithiumPeroxide; - public static Item dustLithiumFluoride; - - public static Item dustUranium232; - public static Item dustUraniumTetraFluoride; - public static Item dustUraniumHexaFluoride; - - public static Item dustBerylliumFluoride; public static Item dustQuicklime; public static Item dustCalciumHydroxide; @@ -240,45 +129,20 @@ public final class ModItems { public static Item cellHydrogenChlorideMix; - public static BaseEuItem metaItem2; - public static Item shardAer; public static Item shardIgnis; public static Item shardTerra; public static Item shardAqua; - // Tc Compat for energy crystal recipes - public static Item shardDull; - - // Lighter - public static Item itemBasicFireMaker; - // Zirconium public static Item itemZirconiumChlorideCinterPellet; public static Item dustZrCl4; public static Item dustCookedZrCl4; - public static Item dustZrF4; - - public static Item dustNaBF4NaF; - public static Item dustLiFBeF2ZrF4UF4; - public static Item dustLiFBeF2ZrF4U235; - public static Item dustLiFBeF2ThF4UF4; public static Item dustCalciumSulfate; public static Item dustFertUN18; public static Item dustFertUN32; - - // public static Fluid fluidFLiBeSalt; - // public static Fluid fluidFLiBeSaltBurnt; - - public static Fluid fluidLftrCore1; - public static Fluid fluidLftrCore2; - public static Fluid fluidLftrCore3; - public static Fluid fluidLftrCore4; - public static Fluid fluidLftrBlanket1; - public static Fluid fluidLftrBlanket2; - public static Fluid fluidLftrBlanket3; public static Fluid fluidNuclearWaste; // Possibly missing base items that GT may be missing. @@ -311,38 +175,23 @@ public final class ModItems { public static Item itemCircuitLFTR; public static Item itemBasicTurbine; - public static Item itemDebugAreaClear; - - public static Item itemGemShards; public static Item itemHalfCompleteCasings; public static Item itemSulfuricPotion; public static Item itemHydrofluoricPotion; - public static Item itemModularBauble; public static Item itemCustomBook; - public static Item itemGrindleTablet; - public static Item itemRope; - public static Item itemFiber; - public static Item itemDragonJar; - // Unstable Elements & Related Content public static Item dustNeptunium238; public static Item dustDecayedRadium226; public static Item dustRadium226; public static Item dustProtactinium233; - public static ItemGiantEgg itemBigEgg; - public static GregtechPump toolGregtechPump; public static ItemGenericToken itemGenericToken; - public static Item itemControlCore; - - public static Item itemSunnariumBit; - public static ItemStack itemHotTitaniumIngot; public static Fluid fluidZrF4; @@ -350,10 +199,6 @@ public final class ModItems { public static Fluid fluidFertUN32; public static Fluid fluidFertUN18; - public static Item boxTools; - public static Item boxFood; - public static Item boxMagic; - public static DustDecayable dustMolybdenum99; public static DustDecayable dustTechnetium99; public static DustDecayable dustTechnetium99M; @@ -380,17 +225,6 @@ public final class ModItems { public static CoreItem itemDetCable; public static ItemThrowableBomb itemBomb; - public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Zombie; - public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Skeleton; - public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Spider; - public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Creeper; - public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Enderman; - - public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Nether; - public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Infernal; - - public static CoreItem itemExquisiteIndustrialDiamond; - public static BaseItemMetaFood itemMetaFood; public static ItemMagicFeather itemMagicFeather; @@ -407,7 +241,7 @@ public final class ModItems { ZZZ_Empty = new ItemEmpty(); } - public static final void init() { + public static void init() { itemDebugScanner = new DebugScanner(); itemMagicFeather = new ItemMagicFeather(); @@ -422,80 +256,24 @@ public static final void init() { EnumChatFormatting.AQUA, false, null); - itemBigEgg = new ItemGiantEgg(); + itemGenericToken = new ItemGenericToken(); itemDummyResearch = new ItemDummyResearch(); itemCustomSpawnEgg = new ItemCustomSpawnEgg(); - itemDebugAreaClear = new ItemAreaClear(); - // Register meta item, because we need them for everything. MetaGeneratedGregtechItems.INSTANCE.generateMetaItems(); - // Some Simple forms of materials - itemStickyRubber = new Item().setUnlocalizedName("itemStickyRubber").setCreativeTab(tabMachines) - .setTextureName(GTPlusPlus.ID + ":itemStickyRubber"); - GameRegistry.registerItem(itemStickyRubber, "itemStickyRubber"); - GT_OreDictUnificator - .registerOre("ingotRubber", ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemStickyRubber", 1)); - // Register Hydrogen Blobs first, so we can replace old helium blobs. itemHydrogenBlob = new CoreItem("itemHydrogenBlob", "Mysterious Hydrogen Blob", tabMisc) .setTextureName(GTPlusPlus.ID + ":itemHeliumBlob"); // Register Old Helium Blob, this will be replaced when held by a player. - itemHeliumBlob = new CoreItem("itemHeliumBlob", tabMisc, ItemUtils.getSimpleStack(itemHydrogenBlob)) - .setTextureName(GTPlusPlus.ID + ":itemHydrogenBlob"); - - // Register this neato device, for making some fires. - itemBasicFireMaker = new ItemBasicFirestarter(); - - // Register Rope - itemFiber = new CoreItem("itemFiber", "Plant Fiber", tabMisc); - itemRope = new CoreItem("itemRope", "Rope", tabMisc); // Load Wearable Items WearableLoader.run(); - // Make some backpacks - // Primary colours - backpack_Red = new BaseItemBackpack("backpackRed", Utils.rgbtoHexValue(200, 0, 0)); - backpack_Green = new BaseItemBackpack("backpackGreen", Utils.rgbtoHexValue(0, 200, 0)); - backpack_Blue = new BaseItemBackpack("backpackBlue", Utils.rgbtoHexValue(0, 0, 200)); - // Secondary Colours - backpack_Yellow = new BaseItemBackpack("backpackYellow", Utils.rgbtoHexValue(200, 200, 0)); - backpack_Purple = new BaseItemBackpack("backpackPurple", Utils.rgbtoHexValue(200, 0, 200)); - backpack_Cyan = new BaseItemBackpack("backpackCyan", Utils.rgbtoHexValue(0, 200, 200)); - // Tertiary Colours - backpack_Maroon = new BaseItemBackpack("backpackMaroon", Utils.rgbtoHexValue(128, 0, 0)); - backpack_Olive = new BaseItemBackpack("backpackOlive", Utils.rgbtoHexValue(128, 128, 0)); - backpack_DarkGreen = new BaseItemBackpack("backpackDarkGreen", Utils.rgbtoHexValue(0, 128, 0)); - backpack_DarkPurple = new BaseItemBackpack("backpackDarkPurple", Utils.rgbtoHexValue(128, 0, 128)); - backpack_Teal = new BaseItemBackpack("backpackTeal", Utils.rgbtoHexValue(0, 128, 128)); - backpack_Navy = new BaseItemBackpack("backpackNavy", Utils.rgbtoHexValue(0, 0, 128)); - // Shades - backpack_Silver = new BaseItemBackpack("backpackSilver", Utils.rgbtoHexValue(192, 192, 192)); - backpack_Gray = new BaseItemBackpack("backpackGray", Utils.rgbtoHexValue(128, 128, 128)); - backpack_Black = new BaseItemBackpack("backpackBlack", Utils.rgbtoHexValue(20, 20, 20)); - backpack_White = new BaseItemBackpack("backpackWhite", Utils.rgbtoHexValue(240, 240, 240)); - - // Load Custom Box/bags - boxTools = new UniversalToolBox("Tool Box"); - boxFood = new AutoLunchBox("Eatotron-9000"); - boxMagic = new MagicToolBag("Mystic Bag"); - itemBlueprintBase = new ItemBlueprint("itemBlueprint"); - itemGemShards = new ItemGemShards( - "itemGemShards", - "Gem Shards", - AddToCreativeTab.tabMisc, - 32, - 0, - "They glitter in the light", - EnumRarity.rare, - EnumChatFormatting.GRAY, - false, - Utils.rgbtoHexValue(182, 114, 18)).setTextureName(GTPlusPlus.ID + ":itemHeliumBlob"); itemHalfCompleteCasings = new ItemHalfCompleteCasings( "itemHalfCompleteCasings", AddToCreativeTab.tabMisc, @@ -540,20 +318,13 @@ public static final void init() { MaterialGenerator.generate(ELEMENT.getInstance().THALLIUM); // RADIOACTIVE ELEMENTS - MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().TECHNETIUM, false); // LFTR byproduct MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().POLONIUM, false); - MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().ASTATINE, false); // MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().RADON, false); - MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().FRANCIUM, false); MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().RADIUM, false); MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PROMETHIUM, false); - MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().ACTINIUM, false); MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PROTACTINIUM, false); - MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().NEPTUNIUM, false); // LFTR byproduct MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().CURIUM, false); - MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().BERKELIUM, false); MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().CALIFORNIUM, false); - MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().EINSTEINIUM, false); MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().FERMIUM, false); // Nuclear Isotopes @@ -580,18 +351,12 @@ public static final void init() { // and radioisotope heater units - one gram of plutonium-238 generates approximately 0.5 W of thermal power. MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().PLUTONIUM238, false); - // RTG Fuel Materials - MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().STRONTIUM90, false); - MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().POLONIUM210, false); - MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().AMERICIUM241, false); - // Custom Materials that will have standalone refinery processes MaterialGenerator.generate(ELEMENT.STANDALONE.ADVANCED_NITINOL, false); MaterialGenerator.generate(ELEMENT.STANDALONE.ASTRAL_TITANIUM); MaterialGenerator.generate(ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN); MaterialGenerator.generate(ELEMENT.STANDALONE.HYPOGEN); MaterialGenerator.generate(ELEMENT.STANDALONE.CHRONOMATIC_GLASS); - MaterialGenerator.generate(ELEMENT.STANDALONE.FORCE); // Custom Materials that are from Runescape MaterialGenerator.generate(ELEMENT.STANDALONE.BLACK_METAL); @@ -739,21 +504,9 @@ public static final void init() { } catch (final Throwable r) { Logger.INFO("Failed to Generated a Material. " + r.getMessage()); - // Utils.LOG_INFO("Failed to Generated a Material. "+r.getCause().getMessage()); - // Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[0].getMethodName()); - // Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[1].getMethodName()); r.printStackTrace(); - // System.exit(1); } - // TC Style Shards, for use in making energy crystal mix. - // A dull shard, able to be infused with an element. - shardDull = new BaseItemTCShard( - "Drained", - Utils.rgbtoHexValue(75, 75, 75), - new String[] { "Can be infused to create a magical shard.", - "Obtained from Mining Stone/SandStone, Chopping Logs or Shovelling Dirt." }); - // Generates four elemental shards when TC is not installed. if (!Thaumcraft.isModLoaded()) { shardAer = new BaseItemTCShard("Aer", Utils.rgbtoHexValue(225, 225, 5)); @@ -985,30 +738,6 @@ public static final void init() { true); // Test items - metaItem2 = new BaseEuItem(); - metaItem2.registerItem(0, EnumChatFormatting.BLACK + "Test Item 0", 0, 0, "I am 0."); - metaItem2.registerItem(1, EnumChatFormatting.GREEN + "Test Item 1", 1006346000, 1, "I Hold EU 1.", 500); - metaItem2.registerItem(2, EnumChatFormatting.GOLD + "Test Item 2", 1004630000, 2, "I Hold EU 2.", 8000); - metaItem2.registerItem(3, "Test Item 3", 1000765000, 4, "I Hold EU 3.", 32000); - metaItem2.registerItem( - 4, - "Whirlygig", - 1043644000, - (short) 5, - "Spin me right round.", - EnumRarity.rare, - EnumChatFormatting.DARK_GREEN, - true); - metaItem2.registerItem( - 5, - "Whirlygig 2", - 2124867000, - (short) 7, - "Spin me right round.", - EnumRarity.uncommon, - EnumChatFormatting.RED, - true); - toolGregtechPump = new GregtechPump(); toolGregtechPump.registerPumpType(0, "Simple Hand Pump", 0, 0); toolGregtechPump.registerPumpType(1, "Advanced Hand Pump", 32000, 1); @@ -1023,21 +752,6 @@ public static final void init() { FluidUtils.generateFluidNoPrefix("xpjuice", "xpjuice", 0, new short[] { 50, 150, 50, 100 }); } - // Industrial Diamonds - itemExquisiteIndustrialDiamond = new CoreItem( - "IndustrialDiamondExquisite", - "High Quality Industrial Diamond", - tabMisc); - ItemStack tempStack = itemExquisiteIndustrialDiamond.getStack(); - ItemUtils.addItemToOreDictionary(tempStack, "gemDiamond"); - ItemUtils.addItemToOreDictionary(tempStack, "craftingIndustrialDiamond"); - ItemUtils.addItemToOreDictionary(tempStack, "gemExquisiteDiamond"); - ItemUtils.addItemToOreDictionary(tempStack, "craftingExquisiteIndustrialDiamond"); - - /* - * Decayable Materials - */ - dustNeptunium238 = new DustDecayable( "dustNeptunium238", Utils.rgbtoHexValue(175, 240, 75), @@ -1067,22 +781,6 @@ public static final void init() { "Result: Uranium 233(" + StringUtils.superscript("233U") + ")" }, ELEMENT.getInstance().URANIUM233.getDust(1).getItem(), 6); - dustTechnetium99 = new DustDecayable( - "dustTechnetium99", - ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(), - 164500, - new String[] { "" + StringUtils.superscript("99Tc"), - "Result: Ruthenium 99(" + StringUtils.superscript("99Ru") + ")" }, - ELEMENT.getInstance().RUTHENIUM.getDust(1).getItem(), - 4); - dustTechnetium99M = new DustDecayable( - "dustTechnetium99M", - ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(), - 8570, - new String[] { "" + StringUtils.superscript("99ᵐTc"), - "Result: Technicium 99 (" + StringUtils.superscript("99Tc") + ")" }, - dustTechnetium99, - 4); dustMolybdenum99 = new DustDecayable( "dustMolybdenum99", ELEMENT.getInstance().MOLYBDENUM.getRgbAsHex(), @@ -1108,20 +806,10 @@ public static final void init() { itemAirFilter = new ItemAirFilter(); itemLavaFilter = new ItemLavaFilter(); - itemGrindleTablet = new BaseItemGrindle(); - itemDragonJar = new ItemEntityCatcher(); - - itemControlCore = new ItemControlCore(); - - itemSunnariumBit = new ItemSunnariumBit(); - // Chemistry new CoalTar(); new RocketFuels(); - // Nuclear Processing - new NuclearChem(); - // Farm Animal Fun new AgriculturalChem(); @@ -1140,135 +828,6 @@ public static final void init() { itemDetCable.setTextureName("string"); itemBomb = new ItemThrowableBomb(); - // Misc Items - @SuppressWarnings("unused") - Item tI; - tI = new BaseItemMisc("Chilly", new short[] { 0, 64, 196 }, 32, MiscTypes.POTION, new String[] { "It's Blue" }); - tI = new BaseItemMisc( - "4000DC's", - new short[] { 180, 100, 30 }, - 1, - MiscTypes.BIGKEY, - new String[] { "It opens things." }); - tI = new BaseItemMisc("Dull", new short[] { 64, 64, 64 }, 64, MiscTypes.GEM, null); - tI = new BaseItemMisc( - "Forest", - new short[] { 130, 164, 96 }, - 64, - MiscTypes.MUSHROOM, - new String[] { "You Found this on the ground.", "Definitely not sure if it's worth eating." }); - - // Baubles - if (Baubles.isModLoaded()) { - tI = new HealthBoostBauble(); - itemModularBauble = new ModularBauble(); - } - - // EnderIO Resources - if ((EnderIO.isModLoaded() || LOAD_ALL_CONTENT)) { - Logger.INFO("EnderIO Found - Loading Resources."); - // Enderio Dusts - itemDustSoularium = ItemUtils.generateSpecialUseDusts( - "Soularium", - "Soularium", - MaterialEIO.SOULARIUM.vChemicalFormula, - MaterialEIO.SOULARIUM.getRgbAsHex())[0]; - itemDustRedstoneAlloy = ItemUtils.generateSpecialUseDusts( - "RedstoneAlloy", - "Redstone Alloy", - MaterialEIO.REDSTONE_ALLOY.vChemicalFormula, - MaterialEIO.REDSTONE_ALLOY.getRgbAsHex())[0]; - itemDustElectricalSteel = ItemUtils.generateSpecialUseDusts( - "ElectricalSteel", - "Electrical Steel", - MaterialEIO.ELECTRICAL_STEEL.vChemicalFormula, - MaterialEIO.ELECTRICAL_STEEL.getRgbAsHex())[0]; - itemDustPulsatingIron = ItemUtils.generateSpecialUseDusts( - "PulsatingIron", - "Pulsating Iron", - MaterialEIO.PULSATING_IRON.vChemicalFormula, - MaterialEIO.PULSATING_IRON.getRgbAsHex())[0]; - itemDustEnergeticAlloy = ItemUtils.generateSpecialUseDusts( - "EnergeticAlloy", - "Energetic Alloy", - MaterialEIO.ENERGETIC_ALLOY.vChemicalFormula, - MaterialEIO.ENERGETIC_ALLOY.getRgbAsHex())[0]; - itemDustVibrantAlloy = ItemUtils.generateSpecialUseDusts( - "VibrantAlloy", - "Vibrant Alloy", - MaterialEIO.VIBRANT_ALLOY.vChemicalFormula, - MaterialEIO.VIBRANT_ALLOY.getRgbAsHex())[0]; - itemDustConductiveIron = ItemUtils.generateSpecialUseDusts( - "ConductiveIron", - "Conductive Iron", - MaterialEIO.CONDUCTIVE_IRON.vChemicalFormula, - MaterialEIO.CONDUCTIVE_IRON.getRgbAsHex())[0]; - - // EnderIO Plates - itemPlateSoularium = ItemUtils.generateSpecialUsePlate( - "Soularium", - "Soularium", - MaterialEIO.SOULARIUM.vChemicalFormula, - MaterialEIO.SOULARIUM.getRgbAsHex(), - 0); - itemPlateRedstoneAlloy = ItemUtils.generateSpecialUsePlate( - "RedstoneAlloy", - "Redstone Alloy", - MaterialEIO.REDSTONE_ALLOY.vChemicalFormula, - MaterialEIO.REDSTONE_ALLOY.getRgbAsHex(), - 0); - itemPlateElectricalSteel = ItemUtils.generateSpecialUsePlate( - "ElectricalSteel", - "Electrical Steel", - MaterialEIO.ELECTRICAL_STEEL.vChemicalFormula, - MaterialEIO.ELECTRICAL_STEEL.getRgbAsHex(), - 0); - itemPlatePulsatingIron = ItemUtils.generateSpecialUsePlate( - "PhasedIron", - "Phased Iron", - MaterialEIO.PULSATING_IRON.vChemicalFormula, - MaterialEIO.PULSATING_IRON.getRgbAsHex(), - 0); - itemPlateEnergeticAlloy = ItemUtils.generateSpecialUsePlate( - "EnergeticAlloy", - "Energetic Alloy", - MaterialEIO.ENERGETIC_ALLOY.vChemicalFormula, - MaterialEIO.ENERGETIC_ALLOY.getRgbAsHex(), - 0); - itemPlateVibrantAlloy = ItemUtils.generateSpecialUsePlate( - "VibrantAlloy", - "Vibrant Alloy", - MaterialEIO.VIBRANT_ALLOY.vChemicalFormula, - MaterialEIO.VIBRANT_ALLOY.getRgbAsHex(), - 0); - itemPlateConductiveIron = ItemUtils.generateSpecialUsePlate( - "ConductiveIron", - "Conductive Iron", - MaterialEIO.CONDUCTIVE_IRON.vChemicalFormula, - MaterialEIO.CONDUCTIVE_IRON.getRgbAsHex(), - 0); - - // Register odd naming conventions. - GT_OreDictUnificator.registerOre("dustPhasedGold", ItemUtils.getSimpleStack(itemDustVibrantAlloy)); - GT_OreDictUnificator.registerOre("platePhasedGold", ItemUtils.getSimpleStack(itemPlateVibrantAlloy)); - GT_OreDictUnificator.registerOre("dustPhasedIron", ItemUtils.getSimpleStack(itemDustPulsatingIron)); - GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron)); - GT_OreDictUnificator - .registerOre("blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1)); - - } else { - /* - * Logger.WARNING("EnderIO not Found - Generating our own Resources."); - * MaterialGenerator.generate(MaterialEIO.CONDUCTIVE_IRON); - * MaterialGenerator.generate(MaterialEIO.PULSATING_IRON); - * MaterialGenerator.generate(MaterialEIO.REDSTONE_ALLOY); - * MaterialGenerator.generate(MaterialEIO.SOULARIUM); - * MaterialGenerator.generate(MaterialEIO.ELECTRICAL_STEEL); - * MaterialGenerator.generate(MaterialEIO.ENERGETIC_ALLOY); - * MaterialGenerator.generate(MaterialEIO.VIBRANT_ALLOY); - */ - } - // IC2 Exp Logger.INFO("IndustrialCraft2 Found - Loading Resources."); @@ -1286,48 +845,17 @@ public static final void init() { // Special Item Handling Case if (ConfigSwitches.enableAlternativeBatteryAlloy) { - // ModItems.itemIngotBatteryAlloy = new BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", new - // short[]{35, 228, 141}, 0); TODO ModItems.itemPlateBatteryAlloy = ItemUtils .generateSpecialUsePlate("BatteryAlloy", "Battery Alloy", new short[] { 35, 228, 141 }, 0); } - // UtilsItems.generateSpawnEgg("ic2", "boatcarbon", Utils.generateSingularRandomHexValue(), - // Utils.generateSingularRandomHexValue()); - - HANDLER_COFH.initItems(); - - /* - * Misc Items - */ - - // Staballoy Equipment - itemStaballoyPickaxe = new StaballoyPickaxe("itemStaballoyPickaxe", STABALLOY) - .setCreativeTab(AddToCreativeTab.tabTools); - GameRegistry.registerItem(itemStaballoyPickaxe, itemStaballoyPickaxe.getUnlocalizedName()); - itemStaballoyAxe = new StaballoyAxe("itemStaballoyAxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools); - GameRegistry.registerItem(itemStaballoyAxe, itemStaballoyAxe.getUnlocalizedName()); - - // Sandstone Hammer - itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer").setCreativeTab(AddToCreativeTab.tabTools); - GameRegistry.registerItem(itemSandstoneHammer, itemSandstoneHammer.getUnlocalizedName()); - // Buffer Cores! Item itemBufferCore; for (int i = 1; i <= 10; i++) { - // Utils.LOG_INFO(""+i); itemBufferCore = new BufferCore("itemBufferCore", i).setCreativeTab(AddToCreativeTab.tabMachines); GameRegistry.registerItem(itemBufferCore, itemBufferCore.getUnlocalizedName()); - // System.out.println("Buffer Core registration count is: "+i); } - itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit") - .setTextureName(GTPlusPlus.ID + ":itemPLACEHOLDER_Circuit"); - GameRegistry.registerItem(itemPLACEHOLDER_Circuit, "itemPLACEHOLDER_Circuit"); - - // ItemBlockGtFrameBox = new ItemBlockGtFrameBox(ModBlocks.blockGtFrameSet1); - // GameRegistry.registerItem(ItemBlockGtFrameBox, "itemGtFrameBoxSet1"); - itemCustomBook = new ItemBaseBook(); registerCustomTokens(); } @@ -1462,30 +990,6 @@ public static void registerCustomMaterialComponents() { MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.TRINIUM_REINFORCED_STEEL); MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ELEMENT.STANDALONE.CHRONOMATIC_GLASS); - // Dense Plates - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.POTIN); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.AQUATIC_STEEL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.BRONZE); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.OSMIRIDIUM); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.QUANTUM); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STEEL_BLACK); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STAINLESS_STEEL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.EGLIN_STEEL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.MARAGING300); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.TALONITE); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.HYPOGEN); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.RHUGNOR); - MaterialUtils - .generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ADVANCED_NITINOL); - MaterialUtils - .generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ASTRAL_TITANIUM); - MaterialUtils.generateComponentAndAssignToAMaterial( - ComponentTypes.PLATEHEAVY, - ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.WHITE_METAL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.BLACK_METAL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.GRANITE); - // Special Sillyness if (true) { diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java deleted file mode 100644 index b724687c1a..0000000000 --- a/src/main/java/gtPlusPlus/core/item/base/BaseItemBackpack.java +++ /dev/null @@ -1,75 +0,0 @@ -package gtPlusPlus.core.item.base; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.util.GT_OreDictUnificator; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.handler.GuiHandler; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class BaseItemBackpack extends Item { - - protected final int colourValue; - protected final String unlocalName; - - public BaseItemBackpack(final String unlocalizedName, final int colour) { - this.unlocalName = unlocalizedName; - this.setUnlocalizedName(unlocalizedName); - this.setTextureName(GTPlusPlus.ID + ":" + "itemBackpack"); - this.colourValue = colour; - GameRegistry.registerItem(this, unlocalizedName); - GT_OreDictUnificator.registerOre("storageBackpack", ItemUtils.getSimpleStack(this)); - this.setMaxStackSize(1); - this.setCreativeTab(AddToCreativeTab.tabOther); - } - - // Without this method, your inventory will NOT work!!! - @Override - public int getMaxItemUseDuration(final ItemStack stack) { - return 1; // return any value greater than zero - } - - @Override - public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) { - if (!world.isRemote) { - // If player not sneaking, open the inventory gui - if (!player.isSneaking()) { - player.openGui(GTplusplus.instance, GuiHandler.GUI3, world, 0, 0, 0); - } - - // Otherwise, stealthily place some diamonds in there for a nice surprise next time you open it up :) - else { - // Utils.LOG_INFO("Player is Sneaking, giving them sneaky diamonds."); - // new BaseInventoryBackpack(player.getHeldItem()).setInventorySlotContents(0, new - // ItemStack(Items.diamond,4)); - } - } - - return itemstack; - } - - @Override - public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) { - if (this.colourValue == 0) { - return MathUtils.generateSingularRandomHexValue(); - } - return this.colourValue; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(final IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(GTPlusPlus.ID + ":" + "itemBackpack"); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java index dd4cd24366..7b6be7ddfe 100644 --- a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -338,7 +338,6 @@ public int getColorFromItemStack(final ItemStack stack, final int renderPass) { return Utils.rgbtoHexValue(255, 255, 255); } } - if (this.componentType == ComponentTypes.PLATEHEAVY) {} try { if (this.componentMaterial == null) { @@ -422,7 +421,6 @@ public static enum ComponentTypes { PLASMACELL("CellPlasma", "@ Plasma Cell", "cellPlasma", OrePrefixes.cellPlasma), CELL("Cell", "@ Cell", "cell", OrePrefixes.cell), NUGGET("Nugget", "@ Nugget", "nugget", OrePrefixes.nugget), - PLATEHEAVY("HeavyPlate", "Heavy @ Plate", "plateHeavy", OrePrefixes.plateQuadruple), SPRING("Spring", "@ Spring", "spring", OrePrefixes.spring), SMALLSPRING("SmallSpring", "Small @ Spring", "springSmall", OrePrefixes.springSmall), FINEWIRE("FineWire", "Fine @ Wire", "wireFine", OrePrefixes.wireFine), diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java deleted file mode 100644 index c730deb436..0000000000 --- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockEntityBase.java +++ /dev/null @@ -1,42 +0,0 @@ -package gtPlusPlus.core.item.base.itemblock; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - -import gtPlusPlus.core.block.general.BlockTankXpConverter; -import gtPlusPlus.core.creative.AddToCreativeTab; - -public class ItemBlockEntityBase extends ItemBlock { - - public ItemBlockEntityBase(final Block block) { - super(block); - this.setMaxDamage(0); - // this.setHasSubtypes(true); - this.setCreativeTab(AddToCreativeTab.tabMachines); - } - - @Override - public int getColorFromItemStack(final ItemStack p_82790_1_, final int p_82790_2_) { - return super.getColorFromItemStack(p_82790_1_, p_82790_2_); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, - final boolean bool) { - if (Block.getBlockFromItem(stack.getItem()) instanceof BlockTankXpConverter) { - /* - * list.add(EnumChatFormatting.GRAY+"Can convert Liquid Xp to Mob Essence and back."); - * list.add(EnumChatFormatting.GRAY+"Right click with a Screwdriver to change mode."); - * list.add(EnumChatFormatting.GRAY+"Shift+Right click to view tank information."); - */ - list.add(EnumChatFormatting.GRAY + "Currently disabled, Use a GT Brewery instead. (New Recipes Added!)"); - } - super.addInformation(stack, aPlayer, list, bool); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java deleted file mode 100644 index b4c2d1c244..0000000000 --- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockSpawner.java +++ /dev/null @@ -1,39 +0,0 @@ -package gtPlusPlus.core.item.base.itemblock; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration; -import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner; - -public class ItemBlockSpawner extends ItemBlockMeta { - - private final Block mBlock; - - public ItemBlockSpawner(Block aBlock) { - super(aBlock); - mBlock = aBlock; - } - - @Override - public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aBool) { - if (mBlock != null) { - int x = this.getMetadata(aStack.getItemDamage()); - if (x >= 0) { - try { - EntityRegistration x1 = EntityRegistry.instance() - .lookupModSpawn(TileEntityGenericSpawner.mSpawners.get(x), false); - if (x1 != null) { - aList.add(EnumChatFormatting.RED + x1.getEntityName()); - } - } catch (Throwable t) {} - } - } - super.addInformation(aStack, aPlayer, aList, aBool); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java b/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java deleted file mode 100644 index a3a8eb6153..0000000000 --- a/src/main/java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java +++ /dev/null @@ -1,47 +0,0 @@ -package gtPlusPlus.core.item.base.plates; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.item.base.BaseItemComponent; -import gtPlusPlus.core.material.Material; - -public class BaseItemPlateHeavy extends BaseItemComponent { - - static final ComponentTypes HEAVY = ComponentTypes.PLATEHEAVY; - - public BaseItemPlateHeavy(final Material material) { - super(material, HEAVY); - } - - @Override - public String getCorrectTextures() { - return GTPlusPlus.ID + ":" + "itemHeavyPlate"; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() { - return true; - } - - @Override - public void registerIcons(final IIconRegister i) { - this.base = i.registerIcon(GTPlusPlus.ID + ":" + "itemHeavyPlate"); - this.overlay = i.registerIcon(GTPlusPlus.ID + ":" + "itemHeavyPlate_Overlay"); - } - - @Override - public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) { - - if (pass == 0) { - return this.base; - } else { - return this.overlay; - } - } -} diff --git a/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java deleted file mode 100644 index b5d7b8fdbb..0000000000 --- a/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java +++ /dev/null @@ -1,137 +0,0 @@ -package gtPlusPlus.core.item.bauble; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.UUID; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -import baubles.api.BaubleType; -import cpw.mods.fml.common.registry.GameRegistry; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.preloader.DevHelper; - -public class FireProtectionBauble extends BaseBauble { - - public static HashMap mDataMap = new HashMap(); - public static HashSet mPlayerMap = new HashSet(); - - private static Field isImmuneToFire; - - static { - isImmuneToFire = ReflectionUtils - .getField(Entity.class, DevHelper.isObfuscatedEnvironment() ? "func_70045_F" : "isImmuneToFire"); - } - - public static boolean fireImmune(Entity aEntity) { - return aEntity.isImmuneToFire(); - } - - public static boolean setEntityImmuneToFire(Entity aEntity, boolean aImmune) { - try { - return ReflectionUtils.setField(aEntity, isImmuneToFire, aImmune); - } catch (Throwable t) {} - return false; - } - - public FireProtectionBauble() { - super(BaubleType.RING, "GTPP.bauble.fireprotection.0" + ".name", 0); - String aUnlocalName = "GTPP.bauble.fireprotection.0" + ".name"; - this.setUnlocalizedName(aUnlocalName); - this.setTextureName(GTPlusPlus.ID + ":" + getTextureNameForBauble()); - this.setMaxDamage(100); - this.setMaxStackSize(1); - this.setNoRepair(); - this.setCreativeTab(AddToCreativeTab.tabMachines); - if (GameRegistry.findItem(GTPlusPlus.ID, aUnlocalName) == null) { - GameRegistry.registerItem(this, aUnlocalName); - } - } - - @Override - public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_, - final boolean p_77663_5_) { - super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_); - } - - @Override - public String getItemStackDisplayName(final ItemStack p_77653_1_) { - return (EnumChatFormatting.DARK_RED + super.getItemStackDisplayName(p_77653_1_) + EnumChatFormatting.GRAY); - } - - @Override - public boolean showDurabilityBar(final ItemStack stack) { - return false; - } - - @SuppressWarnings("unchecked") - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - super.addInformation(stack, aPlayer, list, bool); - } - - @Override - public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) { - return true; - } - - @Override - public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) { - return true; - } - - @Override - public void onEquipped(final ItemStack arg0, final EntityLivingBase aPlayer) { - if (!aPlayer.worldObj.isRemote) { - if (aPlayer instanceof EntityPlayer) { - EntityPlayer bPlayer = (EntityPlayer) aPlayer; - mPlayerMap.add(bPlayer.getUniqueID()); - } - } - } - - @Override - public void onUnequipped(final ItemStack arg0, final EntityLivingBase aPlayer) { - if (!aPlayer.worldObj.isRemote) { - if (aPlayer instanceof EntityPlayer) { - EntityPlayer bPlayer = (EntityPlayer) aPlayer; - if (bPlayer.isPotionActive(Potion.fireResistance)) { - bPlayer.removePotionEffect(Potion.fireResistance.id); - } - mPlayerMap.remove(bPlayer.getUniqueID()); - setEntityImmuneToFire(bPlayer, false); - } - } - } - - @Override - public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayer) { - if (!aPlayer.worldObj.isRemote) { - if (aPlayer instanceof EntityPlayer) { - EntityPlayer bPlayer = (EntityPlayer) aPlayer; - if (!fireImmune(bPlayer)) { - setEntityImmuneToFire(bPlayer, true); - } - if (!bPlayer.isPotionActive(Potion.fireResistance)) { - bPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 100, 4)); - } - } - } - } - - public String getTextureNameForBauble() { - return "baubles/itemFireProtectGlovesBetter"; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java deleted file mode 100644 index 703fb7c5bb..0000000000 --- a/src/main/java/gtPlusPlus/core/item/bauble/HealthBoostBauble.java +++ /dev/null @@ -1,40 +0,0 @@ -package gtPlusPlus.core.item.bauble; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import com.google.common.collect.Multimap; - -import baubles.api.BaubleType; - -public class HealthBoostBauble extends BaseBauble { - - public HealthBoostBauble() { - super(BaubleType.AMULET, "The Key to the City"); - addDamageNegation(DamageSource.wither); - this.setTextureName(GTPlusPlus.ID + ":" + "itemKeyGold"); - } - - @Override - void fillModifiers(Multimap attributes, ItemStack stack) { - attributes.put( - SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 40, 0)); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { - list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.thekeytothecity.tooltip.0")); - list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.thekeytothecity.tooltip.1")); - super.addInformation(stack, player, list, bool); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java deleted file mode 100644 index 63a812e8ca..0000000000 --- a/src/main/java/gtPlusPlus/core/item/bauble/ModularBauble.java +++ /dev/null @@ -1,495 +0,0 @@ -package gtPlusPlus.core.item.bauble; - -import static gregtech.api.enums.Mods.GTPlusPlus; -import static gregtech.api.enums.Mods.Thaumcraft; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; - -import org.lwjgl.input.Keyboard; - -import com.google.common.collect.Multimap; - -import baubles.api.BaubleType; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers; -import gtPlusPlus.core.util.minecraft.NBTUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; - -public class ModularBauble extends BaseBauble { - - @SideOnly(Side.CLIENT) - private IIcon mTextureAmulet; - - @SideOnly(Side.CLIENT) - private IIcon mTextureRing; - - @SideOnly(Side.CLIENT) - private IIcon mTextureBelt; - - private IIcon iconArray[] = new IIcon[3]; - - @SideOnly(Side.CLIENT) - private IIcon mfallback; - - public ModularBauble() { - super(BaubleType.AMULET, "Modular Bauble"); - } - - @Override - void fillModifiers(Multimap attributes, ItemStack stack) { - - // Get Stats - int mStatlevel = 0; - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DAMAGE)) > 0) { - if (mStatlevel > 0 && mStatlevel < 20) { - attributes.put( - SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 1, 0)); - } else if (mStatlevel > 20 && mStatlevel < 45) { - attributes.put( - SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 2, 0)); - } else if (mStatlevel >= 45 && mStatlevel < 75) { - attributes.put( - SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 4, 0)); - } else if (mStatlevel >= 75 && mStatlevel < 99) { - attributes.put( - SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 8, 0)); - } else if (mStatlevel >= 100) { - attributes.put( - SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "AD" + mStatlevel, 16, 0)); - } - } - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DEF)) > 0) { - if (mStatlevel > 0 && mStatlevel < 20) { - attributes.put( - SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 1, 0)); - } else if (mStatlevel > 20 && mStatlevel < 45) { - attributes.put( - SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 2, 0)); - } else if (mStatlevel > 45 && mStatlevel < 75) { - attributes.put( - SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 3, 0)); - } else if (mStatlevel > 75 && mStatlevel < 99) { - attributes.put( - SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 6, 0)); - } else if (mStatlevel >= 100) { - attributes.put( - SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "BD" + mStatlevel, 10, 0)); - } - } - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HP)) > 0) { - if (mStatlevel > 0 && mStatlevel <= 100) { - int bonus = mStatlevel / 5; - attributes.put( - SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "HP" + mStatlevel, bonus * 2, 0)); - } - } - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_SPEED)) > 0) { - if (mStatlevel > 0 && mStatlevel < 20) { - attributes.put( - SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 1, 0)); - } else if (mStatlevel > 20 && mStatlevel < 45) { - attributes.put( - SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 2, 0)); - } else if (mStatlevel > 45 && mStatlevel < 75) { - attributes.put( - SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 3, 0)); - } else if (mStatlevel > 75 && mStatlevel < 99) { - attributes.put( - SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 4, 0)); - } else if (mStatlevel >= 100) { - attributes.put( - SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), - new AttributeModifier(getBaubleUUID(stack), "SP" + mStatlevel, 5, 0)); - } - } - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_MINING)) > 0) {} - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HOLY)) > 0) {} - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { - // Bauble Type - if (ModularArmourUtils.getBaubleType(stack) == BaubleType.AMULET) { - list.add( - EnumChatFormatting.GRAY + "Current Form: " - + EnumChatFormatting.RED - + "Amulet" - + EnumChatFormatting.GRAY - + "."); - list.add(EnumChatFormatting.GRAY + "You can change this into a Ring or a Belt."); - } else if (ModularArmourUtils.getBaubleType(stack) == BaubleType.RING) { - list.add( - EnumChatFormatting.GRAY + "Current Form: " - + EnumChatFormatting.RED - + "Ring" - + EnumChatFormatting.GRAY - + "."); - list.add(EnumChatFormatting.GRAY + "You can change this into an Amulet or a Belt."); - } else if (ModularArmourUtils.getBaubleType(stack) == BaubleType.BELT) { - list.add( - EnumChatFormatting.GRAY + "Current Form: " - + EnumChatFormatting.RED - + "Belt" - + EnumChatFormatting.GRAY - + "."); - list.add(EnumChatFormatting.GRAY + "You can change this into a Ring or an Amulet."); - } - - // Get Stats - int mStatlevel = 0; - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DAMAGE)) > 0) { - list.add( - EnumChatFormatting.GRAY + "Damage Boost: " - + EnumChatFormatting.DARK_RED - + mStatlevel - + EnumChatFormatting.GRAY - + "/100."); - } - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HP)) > 0) { - list.add( - EnumChatFormatting.GRAY + "Health Boost: " - + EnumChatFormatting.RED - + mStatlevel - + EnumChatFormatting.GRAY - + "/100. Bonus " - + (mStatlevel / 5) - + " hearts."); - } - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_SPEED)) > 0) { - list.add( - EnumChatFormatting.GRAY + "Speed Boost: " - + EnumChatFormatting.WHITE - + mStatlevel - + EnumChatFormatting.GRAY - + "/100."); - } - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_MINING)) > 0) { - list.add( - EnumChatFormatting.GRAY + "Mining Boost: " - + EnumChatFormatting.DARK_GRAY - + mStatlevel - + EnumChatFormatting.GRAY - + "/100."); - } - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HOLY)) > 0) { - list.add( - EnumChatFormatting.GRAY + "Holy Boost: " - + EnumChatFormatting.GOLD - + mStatlevel - + EnumChatFormatting.GRAY - + "/100."); - } - - // Defence Boost - if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_DEF)) > 0) { - list.add( - EnumChatFormatting.GRAY + "Defence Boost: " - + EnumChatFormatting.BLUE - + mStatlevel - + EnumChatFormatting.GRAY - + "/100."); - - if ((Keyboard.isKeyDown(42)) || (Keyboard.isKeyDown(54))) { - - if (mStatlevel >= 1) { - list.add( - EnumChatFormatting.GRAY + "Protected From: " - + EnumChatFormatting.BLUE - + "Cactus" - + EnumChatFormatting.GRAY - + "."); - } - if (mStatlevel >= 10) { - list.add( - EnumChatFormatting.GRAY + "Protected From: " - + EnumChatFormatting.BLUE - + "Falling Blocks" - + EnumChatFormatting.GRAY - + "."); - } - if (mStatlevel >= 20) { - list.add( - EnumChatFormatting.GRAY + "Protected From: " - + EnumChatFormatting.BLUE - + "Wall Suffocation" - + EnumChatFormatting.GRAY - + "."); - } - if (mStatlevel >= 35) { - list.add( - EnumChatFormatting.GRAY + "Protected From: " - + EnumChatFormatting.BLUE - + "Drowning" - + EnumChatFormatting.GRAY - + "."); - } - if (mStatlevel >= 50) { - list.add( - EnumChatFormatting.GRAY + "Protected From: " - + EnumChatFormatting.BLUE - + "Starvation" - + EnumChatFormatting.GRAY - + "."); - } - if (mStatlevel >= 60) { - list.add( - EnumChatFormatting.GRAY + "Protected From: " - + EnumChatFormatting.BLUE - + "Falling" - + EnumChatFormatting.GRAY - + "."); - } - if (mStatlevel >= 75) { - list.add( - EnumChatFormatting.GRAY + "Protected From: " - + EnumChatFormatting.BLUE - + "Lava" - + EnumChatFormatting.GRAY - + "."); - } - if (mStatlevel >= 80) { - list.add( - EnumChatFormatting.GRAY + "Protected From: " - + EnumChatFormatting.BLUE - + "Magic" - + EnumChatFormatting.GRAY - + "."); - } - if (mStatlevel >= 95) { - list.add( - EnumChatFormatting.GRAY + "Protected From: " - + EnumChatFormatting.BLUE - + "Wither" - + EnumChatFormatting.GRAY - + "."); - } - if (mStatlevel >= 100) { - list.add( - EnumChatFormatting.GRAY + "Protected From: " - + EnumChatFormatting.BLUE - + "Fire" - + EnumChatFormatting.GRAY - + "."); - } - if (mStatlevel >= 100) { - list.add( - EnumChatFormatting.GRAY + "Protected From: " - + EnumChatFormatting.BLUE - + "Void" - + EnumChatFormatting.GRAY - + "."); - } - - } else { - list.add(EnumChatFormatting.GRAY + ""); - } - } - - if (NBTUtils.getBotanicaSoulboundOwner(stack) != null) { - if (!NBTUtils.getBotanicaSoulboundOwner(stack).equals("")) { - list.add( - EnumChatFormatting.GRAY + "Owner: " - + EnumChatFormatting.GREEN - + NBTUtils.getBotanicaSoulboundOwner(stack) - + EnumChatFormatting.GRAY - + "."); - } - } - super.addInformation(stack, player, list, bool); - } - - @Override - public boolean addDamageNegation(DamageSource damageSource, ItemStack aStack) { - - this.clearDamageNegation(); - int mStatlevel = 0; - if ((mStatlevel = ModularArmourUtils.getModifierLevel(aStack, Modifiers.BOOST_HOLY)) > 0) { - if (mStatlevel >= 1) { - addDamageNegation(DamageSource.cactus); - } - if (mStatlevel >= 10) { - addDamageNegation(DamageSource.fallingBlock); - } - if (mStatlevel >= 20) { - addDamageNegation(DamageSource.inWall); - } - if (mStatlevel >= 35) { - addDamageNegation(DamageSource.drown); - } - if (mStatlevel >= 50) { - addDamageNegation(DamageSource.starve); - } - if (mStatlevel >= 60) { - addDamageNegation(DamageSource.fall); - } - if (mStatlevel >= 75) { - addDamageNegation(DamageSource.lava); - } - if (mStatlevel >= 80) { - addDamageNegation(DamageSource.magic); - } - if (mStatlevel >= 95) { - addDamageNegation(DamageSource.wither); - } - if (mStatlevel >= 100) { - addDamageNegation(DamageSource.inFire); - } - if (mStatlevel >= 100) { - addDamageNegation(DamageSource.onFire); - } - if (mStatlevel >= 100) { - addDamageNegation(DamageSource.outOfWorld); - } - } - return super.addDamageNegation(damageSource, null); - } - - @Override - public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) { - if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_AMULET.getID()) { - this.SetBaubleType(BT.TYPE_AMULET); - } else if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_RING.getID()) { - this.SetBaubleType(BT.TYPE_RING); - } else if (ModularArmourUtils.getBaubleTypeID(arg0) == BT.TYPE_BELT.getID()) { - this.SetBaubleType(BT.TYPE_BELT); - } else { - this.SetBaubleType(BT.TYPE_RING); - } - if (PlayerUtils.isPlayerOP((EntityPlayer) arg1)) { - return true; // Let OPs wear other peoples stuff. - } - - String mOwner; - if (NBTUtils.getBotanicaSoulboundOwner(arg0) == null || NBTUtils.getBotanicaSoulboundOwner(arg0).equals("")) { - return true; - } else if ((mOwner = NBTUtils.getBotanicaSoulboundOwner(arg0)) != null) { - String mPlayerName = arg1.getCommandSenderName(); - if (mOwner.toLowerCase().equals(mPlayerName.toLowerCase())) { - return true; - } else { - return false; - } - } else { - return false; - } - } - - @Override - public BaubleType getBaubleType(ItemStack arg0) { - return ModularArmourUtils.getBaubleType(arg0); - } - - @Override - public void onEquipped(ItemStack stack, EntityLivingBase entity) { - if (entity instanceof EntityPlayer) { - if (NBTUtils.getBotanicaSoulboundOwner(stack) == null - || NBTUtils.getBotanicaSoulboundOwner(stack).equals("")) { - NBTUtils.setBotanicaSoulboundOwner(stack, entity.getCommandSenderName()); - } - } - super.onEquipped(stack, entity); - } - - /* - * @Override - * @SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack - * usingItem, int useRemaining) { if (usingItem == null) { return mfallback; } try { if (stack.getItemDamage() == 0) - * { return mfallback = mTextureAmulet; } else if (stack.getItemDamage() == 1) { return mfallback = mTextureRing; } - * else if (stack.getItemDamage() == 2) { return mfallback = mTextureBelt; } else { return mfallback = mTextureRing; - * } } catch (Throwable t) { return mfallback = mTextureRing; } } - */ - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int meta) { - if (meta < this.iconArray.length && this.iconArray[meta] != null) { - return this.iconArray[meta]; - } - return this.mfallback; - } - - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - for (int i = 0; i < 3; i++) { - list.add(new ItemStack(item, 1, i)); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) { - this.mfallback = register.registerIcon(GTPlusPlus.ID + ":" + "itemAmulet"); - // you cannot initialize iconArray when declared nor in the constructor, - // as it is client-side only, so do it here: - if (Thaumcraft.isModLoaded()) { - iconArray[0] = register.registerIcon("thaumcraft" + ":" + "bauble_amulet"); - iconArray[1] = register.registerIcon("thaumcraft" + ":" + "bauble_ring"); - iconArray[2] = register.registerIcon("thaumcraft" + ":" + "bauble_belt"); - } else { - iconArray[0] = register.registerIcon(GTPlusPlus.ID + ":" + "itemAmulet"); - iconArray[1] = register.registerIcon(GTPlusPlus.ID + ":" + "itemRingWearable"); - iconArray[2] = register.registerIcon(GTPlusPlus.ID + ":" + "itemBelt"); - } - - mTextureAmulet = iconArray[0]; - mTextureRing = iconArray[1]; - mTextureBelt = iconArray[2]; - } - - @Override - public void onWornTick(ItemStack stack, EntityLivingBase player) { - super.onWornTick(stack, player); - } - - @Override - public boolean showDurabilityBar(ItemStack stack) { - return false; - } - - @Override - public Item setFull3D() { - // TODO Auto-generated method stub - return super.setFull3D(); - } - - @Override - public boolean isFull3D() { - return true; - } - - @Override - public boolean isRepairable() { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java deleted file mode 100644 index f7740f73cc..0000000000 --- a/src/main/java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java +++ /dev/null @@ -1,181 +0,0 @@ -package gtPlusPlus.core.item.bauble; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -import baubles.api.BaubleType; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GT_Values; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.minecraft.AABB; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.EntityUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import ic2.api.item.ElectricItem; - -public class MonsterKillerBaseBauble extends ElectricBaseBauble { - - private final Class[] mTargets; - - public MonsterKillerBaseBauble(Class[] aMonsterBaseClassArray, String aMonsterTypeName, int aPowerTier) { - super( - BaubleType.AMULET, - aPowerTier, - GT_Values.V[aPowerTier] * 20 * 300, - "GTPP.MonsterKiller." + aMonsterTypeName + ".name"); - mTargets = aMonsterBaseClassArray; - } - - @SideOnly(Side.CLIENT) - @Override - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - ItemStack charged; - if (this.getEmptyItem(itemStack) == this) { - charged = new ItemStack(this, 1); - ElectricItem.manager.charge(charged, 0.0D, Integer.MAX_VALUE, true, false); - itemList.add(charged); - } - if (this.getChargedItem(itemStack) == this) { - charged = new ItemStack(this, 1); - ElectricItem.manager.charge(charged, Double.POSITIVE_INFINITY, Integer.MAX_VALUE, true, false); - itemList.add(charged); - } - } - - @Override - public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_, - final boolean p_77663_5_) { - super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_); - } - - @Override - public boolean canProvideEnergy(final ItemStack itemStack) { - double aItemCharge = ElectricItem.manager.getCharge(itemStack); - return aItemCharge > 0; - } - - @Override - public String getItemStackDisplayName(final ItemStack p_77653_1_) { - return (EnumChatFormatting.WHITE + super.getItemStackDisplayName(p_77653_1_) + EnumChatFormatting.GRAY); - } - - @Override - public boolean showDurabilityBar(final ItemStack stack) { - return true; - } - - @SuppressWarnings("unchecked") - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - list.add(""); - String aString1 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.1"); - String aString2 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.2"); - String aString3 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.3"); - String aString4 = StatCollector.translateToLocal("GTPP.monsterkiller.tooltip.4"); - String aEU = StatCollector.translateToLocal("GTPP.info.eu"); - String aEUT = aEU + "/t"; - - list.add(EnumChatFormatting.GREEN + aString1 + EnumChatFormatting.GRAY); - list.add( - EnumChatFormatting.GREEN + aString2 - + " " - + (int) getTransferLimit(stack) - + aEUT - + " " - + aString3 - + EnumChatFormatting.GRAY); - list.add(""); - list.add("" + EnumChatFormatting.GREEN + aString4 + " " + EnumChatFormatting.GRAY); - for (Class cz : mTargets) { - list.add( - "- " + EnumChatFormatting.DARK_GREEN - + cz.getSimpleName().replace("Entity", "") - + EnumChatFormatting.GRAY); - } - - super.addInformation(stack, aPlayer, list, bool); - } - - @Override - public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) { - return true; - } - - @Override - public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) { - return true; - } - - @Override - public void onEquipped(final ItemStack arg0, final EntityLivingBase arg1) {} - - @Override - public void onUnequipped(final ItemStack arg0, final EntityLivingBase arg1) {} - - @Override // TODO - public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayerEntity) { - if (aPlayerEntity == null) { - return; - } - EntityPlayer aPlayer = (EntityPlayer) aPlayerEntity; - if (!aPlayer.worldObj.isRemote) { - if (this.getCharge(aBaubleStack) >= getTransferLimit(aBaubleStack)) { - AABB aPlayerBox = new AABB(aPlayerEntity, 5, 5, 5); - if (this.mTargets != null && this.mTargets.length > 0) { - for (Class clazz : mTargets) { - AutoMap aEnts = EntityUtils.getEntitiesWithinBoundingBox(clazz, aPlayerBox); - if (aEnts.isEmpty()) { - continue; - } else { - EntityLiving aClosest = null; - double aEntityDistance = Short.MIN_VALUE; - for (Object ent : aEnts) { - if (!EntityLiving.class.isInstance(ent)) { - continue; - } else { - double aCurEntDis = EntityUtils.getDistance(aPlayerEntity, (Entity) ent); - if (aEntityDistance == Short.MIN_VALUE || aCurEntDis < aEntityDistance) { - aEntityDistance = aCurEntDis; - aClosest = (EntityLiving) ent; - } - } - } - if (aClosest != null) { - float aEntHealth = aClosest.getHealth(); - float aEntMaxHealth = aClosest.getMaxHealth(); - double aEntHealthPerc = MathUtils.findPercentage(aEntHealth, aEntMaxHealth); - long aEuUsage = (long) (aEntHealthPerc * 50 * aEntMaxHealth); - if (this.discharge(aBaubleStack, aEuUsage, mTier, true, false, false) > 0) { - aClosest.setDead(); - PlayerUtils.messagePlayer(aPlayer, "Removed 1x " + aClosest.getCommandSenderName()); - break; - } - } else { - continue; - } - } - } - } - } else { - return; - } - } - } - - @Override - public String getTextureNameForBauble() { - return "baubles/itemAmulet"; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java index 0db5a9bba3..0096f48148 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java @@ -1,12 +1,9 @@ package gtPlusPlus.core.item.chemistry; import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import gtPlusPlus.api.objects.minecraft.ItemPackage; -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.item.chemistry.general.ItemNuclearChemBase; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; @@ -23,36 +20,8 @@ public class NuclearChem extends ItemPackage { public static Fluid GeneticMutagen; private static boolean generateMutagenRecipe = false; - public static ItemNuclearChemBase mNuclearChemItem1; - - public static ItemStack mResidueUranium; - public static ItemStack mResiduePlutonium; - public static ItemStack mResidueFluorides; - public static ItemStack mResidueNobles; - @Override - public void items() { - - mNuclearChemItem1 = new ItemNuclearChemBase(); - registerItemStacks(); - registerOreDict(); - } - - public void registerItemStacks() { - - mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 0, 1); - mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 1, 1); - mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 2, 1); - mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 3, 1); - } - - public void registerOreDict() { - - ItemUtils.addItemToOreDictionary(mResidueUranium, "dustResidueUranium"); - ItemUtils.addItemToOreDictionary(mResiduePlutonium, "dustResiduePlutonium"); - ItemUtils.addItemToOreDictionary(mResidueFluorides, "dustResidueFluoride"); - ItemUtils.addItemToOreDictionary(mResidueNobles, "dustResidueNoble"); - } + public void items() {} @Override public void blocks() {} @@ -112,7 +81,6 @@ public boolean generateRecipes() { if (generateMutagenRecipe) { chemReator_CreateMutagen(); } - chemReactor_MutagenWithEggs(); return true; } @@ -127,14 +95,4 @@ private static void chemReator_CreateMutagen() { 500); } - private static void chemReactor_MutagenWithEggs() { - CORE.RA.addChemicalRecipe( - CI.getNumberedCircuit(20), - ItemUtils.getSimpleStack(Items.egg, 2), - FluidUtils.getFluidStack(GeneticMutagen, 500), - null, - ItemUtils.getSimpleStack(ModItems.itemBigEgg, 2), - 300 * 20, - 500); - } } diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java b/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java deleted file mode 100644 index 0f9f7d0e5c..0000000000 --- a/src/main/java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java +++ /dev/null @@ -1,145 +0,0 @@ -package gtPlusPlus.core.item.chemistry.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class ItemNuclearChemBase extends Item { - - protected final IIcon base[]; - - private final int aMetaSize = 4; - - /* - * 0 - Uranium Residue 1 - Plutonium Residue 2 - Fluoride Reside 3 - Noble Gas Residue - */ - - public ItemNuclearChemBase() { - this.setHasSubtypes(true); - this.setNoRepair(); - this.setMaxStackSize(64); - this.setMaxDamage(0); - base = new IIcon[aMetaSize]; - this.setUnlocalizedName("BasicNuclearChemItem"); - GameRegistry.registerItem(this, this.getUnlocalizedName()); - } - - @Override - public int getItemStackLimit(ItemStack stack) { - return super.getItemStackLimit(stack); - } - - @Override - public boolean isDamageable() { - return false; - } - - @Override - public boolean shouldRotateAroundWhenRendering() { - return super.shouldRotateAroundWhenRendering(); - } - - @Override - public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, - boolean p_77663_5_) { - super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_); - } - - @Override - public String getItemStackDisplayName(ItemStack aStack) { - return super.getItemStackDisplayName(aStack); - } - - @Override - public EnumRarity getRarity(ItemStack p_77613_1_) { - return EnumRarity.common; - } - - @Override - public boolean requiresMultipleRenderPasses() { - return false; - } - - @Override - public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) { - for (int i = 0; i < aMetaSize; i++) { - aList.add(ItemUtils.simpleMetaStack(aItem, i, 1)); - } - } - - @Override - public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { - return false; - } - - @Override - public boolean isRepairable() { - return false; - } - - @Override - public boolean isBookEnchantable(ItemStack stack, ItemStack book) { - return false; - } - - @Override - public int getItemEnchantability() { - return 0; - } - - @Override - public int getItemEnchantability(ItemStack stack) { - return 0; - } - - @Override - public void registerIcons(final IIconRegister u) { - for (int i = 0; i < this.aMetaSize; i++) { - String aPath = GTPlusPlus.ID + ":" + "science/nuclear/MetaItem1/" + i; - this.base[i] = u.registerIcon(aPath); - } - } - - @Override - public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) { - return this.base[damage]; - } - - @Override - public IIcon getIconFromDamage(int damage) { - return this.base[damage]; - } - - @Override - public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - return this.base[stack.getItemDamage()]; - } - - @Override - public IIcon getIcon(ItemStack stack, int pass) { - return this.base[stack.getItemDamage()]; - } - - @Override - public String getUnlocalizedName(ItemStack stack) { - return super.getUnlocalizedName() + "." + stack.getItemDamage(); - } - - @Override - public void addInformation(ItemStack aStack, EntityPlayer player, List list, boolean bool) { - super.addInformation(aStack, player, list, bool); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java b/src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java deleted file mode 100644 index 1ed6e1d32c..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/BaseItemGrindle.java +++ /dev/null @@ -1,76 +0,0 @@ -package gtPlusPlus.core.item.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.handler.GuiHandler; - -public class BaseItemGrindle extends Item { - - protected final String unlocalName; - - public BaseItemGrindle() { - this.unlocalName = "itemGrindleTablet"; - this.setUnlocalizedName("itemGrindleTablet"); - this.setTextureName(GTPlusPlus.ID + ":" + "itemTablet"); - GameRegistry.registerItem(this, "itemGrindleTablet"); - this.setMaxStackSize(1); - this.setCreativeTab(AddToCreativeTab.tabOther); - } - - @Override - public int getMaxItemUseDuration(final ItemStack stack) { - return 1; - } - - @Override - public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) { - if (!world.isRemote) { - if (!player.isSneaking()) { - player.openGui(GTplusplus.instance, GuiHandler.GUI9, world, 0, 0, 0); - } - } - return itemstack; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(final IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(GTPlusPlus.ID + ":" + "itemTablet"); - } - - @Override - public String getPotionEffect(ItemStack p_150896_1_) { - return super.getPotionEffect(p_150896_1_); - } - - @Override - public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { - super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); - aList.add(StatCollector.translateToLocal("item.itemGrindleTablet.tooltip")); - } - - @Override - public EnumRarity getRarity(ItemStack i) { - return EnumRarity.uncommon; - } - - @Override - public boolean isRepairable() { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java b/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java deleted file mode 100644 index 3db9672630..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java +++ /dev/null @@ -1,205 +0,0 @@ -package gtPlusPlus.core.item.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.common.blocks.GT_Block_Ores; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.core.block.base.BlockBaseOre; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.item.base.CoreItem; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.EntityUtils; - -public class ItemAreaClear extends CoreItem { - - public IIcon[] mIcon = new IIcon[1]; - - public ItemAreaClear() { - super( - "itemDebugClearing", - AddToCreativeTab.tabMachines, - 1, - 100, - new String[] { EnumChatFormatting.OBFUSCATED + "F A N C Y N A M E" }, - EnumRarity.rare, - EnumChatFormatting.BOLD, - false, - null); - } - - @Override - public void registerIcons(IIconRegister reg) { - this.mIcon[0] = reg.registerIcon(GTPlusPlus.ID + ":" + "itemLavaFilter"); - } - - @Override - public IIcon getIconFromDamage(int meta) { - return this.mIcon[0]; - } - - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - for (int i = 0; i < 2; i++) { - list.add(new ItemStack(item, 1, i)); - } - } - - @Override - public String getItemStackDisplayName(final ItemStack tItem) { - return StatCollector.translateToLocalFormatted("item.itemDebugClearing.name", tItem.getItemDamage() + 1); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { - list.add( - EnumChatFormatting.GRAY + "" - + StatCollector - .translateToLocal("item.itemDebugClearing." + stack.getItemDamage() + ".tooltip")); - super.addInformation(stack, player, list, bool); - } - - private static boolean createNBT(ItemStack rStack) { - final NBTTagCompound tagMain = new NBTTagCompound(); - final NBTTagCompound tagNBT = new NBTTagCompound(); - tagNBT.setLong("Mode", 0); - tagMain.setTag("GTPP_DEBUG", tagNBT); - rStack.setTagCompound(tagMain); - return true; - } - - public static final long getFilterDamage(final ItemStack aStack) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("GTPP_DEBUG"); - if (aNBT != null) { - return aNBT.getLong("Mode"); - } - } else { - createNBT(aStack); - } - return 0L; - } - - public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("GTPP_DEBUG"); - if (aNBT != null) { - aNBT.setLong("Mode", aDamage); - return true; - } - } - return false; - } - - public boolean removeBlocks(World world, BlockPos pos) { - int x1 = pos.xPos; - int y1 = pos.yPos; - int z1 = pos.zPos; - - int x2 = (x1 - 24); - int y2 = (y1 - 10); - int z2 = (z1 - 24); - - removeBlockColumn(world, new BlockPos(x2, y2, z2, world)); - return true; - } - - public boolean removeBlockColumn(World world, BlockPos pos) { - for (int i = 0; i < 50; i++) { - removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos - 10, pos.zPos + i, world)); - removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos + i, world)); - removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos + 10, pos.zPos + i, world)); - } - return true; - } - - public boolean removeBlockRow(World world, BlockPos pos) { - for (int j = 0; j < 20; j++) { - for (int i = 0; i < 50; i++) { - - if (!(world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) instanceof BlockBaseOre) - && !(world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) instanceof IGregTechTileEntity) - && !(world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) instanceof GT_Block_Ores)) { - if (!world.isAirBlock(pos.xPos + i, pos.yPos + j, pos.zPos) - && world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) != Blocks.bedrock) { - int chance = MathUtils.randInt(0, 500); - if (chance <= 0) { - if (pos.yPos + j <= 50) { - world.setBlock(pos.xPos + i, pos.yPos + j, pos.zPos, Blocks.glowstone); - } - } else { - if ((world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) == Blocks.glowstone - && ((pos.yPos + j) > 50)) - || world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) != Blocks.glowstone) { - world.setBlockToAir(pos.xPos + i, pos.yPos + j, pos.zPos); - } - } - } - } - } - } - return true; - } - - public boolean fillBlocks(World world, BlockPos pos) { - int x1 = pos.xPos; - int y1 = pos.yPos; - int z1 = pos.zPos; - - int x2 = (x1 - 15); - int y2 = (y1 - 1); - int z2 = (z1 - 15); - - fillBlockColumn(world, new BlockPos(x2, y2, z2, world)); - return true; - } - - public boolean fillBlockColumn(World world, BlockPos pos) { - for (int i = 0; i < 30; i++) { - fillBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos + i, world)); - } - return true; - } - - public boolean fillBlockRow(World world, BlockPos pos) { - for (int j = 0; j < 2; j++) { - for (int i = 0; i < 30; i++) { - if (world.getBlock(pos.xPos + i, pos.yPos + j, pos.zPos) != Blocks.bedrock) { - world.setBlock(pos.xPos + i, pos.yPos + j, pos.zPos, Blocks.dirt); - world.setBlockMetadataWithNotify(pos.xPos + i, pos.yPos + j, pos.zPos, 2, 2); - } - } - } - return true; - } - - @Override - public ItemStack onItemRightClick(ItemStack thisItem, World world, EntityPlayer parEntity) { - BlockPos groundBlock = EntityUtils.findBlockPosUnderEntity(parEntity); - if (thisItem.getItemDamage() == 0) { - removeBlocks(world, groundBlock); - } else { - Logger.INFO("Filling."); - fillBlocks(world, groundBlock); - } - return super.onItemRightClick(thisItem, world, parEntity); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java b/src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java deleted file mode 100644 index d473723bf8..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/ItemBasicFirestarter.java +++ /dev/null @@ -1,98 +0,0 @@ -package gtPlusPlus.core.item.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -import gtPlusPlus.core.block.general.FirePit; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.item.base.CoreItem; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; - -public class ItemBasicFirestarter extends CoreItem { - - public ItemBasicFirestarter() { - super("itemSimpleFiremaker", AddToCreativeTab.tabTools, 1, 5, "Can probably make you a fire"); - this.setTextureName(GTPlusPlus.ID + ":" + "itemFireStarter"); - } - - @Override - public boolean onItemUse(final ItemStack thisItem, final EntityPlayer thisPlayer, final World thisWorld, int blockX, - int blockY, int blockZ, final int p_77648_7_, final float p_77648_8_, final float p_77648_9_, - final float p_77648_10_) { - if (p_77648_7_ == 0) { - --blockY; - } - if (p_77648_7_ == 1) { - ++blockY; - } - if (p_77648_7_ == 2) { - --blockZ; - } - if (p_77648_7_ == 3) { - ++blockZ; - } - if (p_77648_7_ == 4) { - --blockX; - } - if (p_77648_7_ == 5) { - ++blockX; - } - if (!thisPlayer.canPlayerEdit(blockX, blockY, blockZ, p_77648_7_, thisItem)) { - return false; - } - if (thisWorld.getBlock(blockX, blockY, blockZ) instanceof FirePit) { - thisWorld.setBlockMetadataWithNotify(blockX, blockY, blockZ, 2, 4); - PlayerUtils.messagePlayer(thisPlayer, StatCollector.translateToLocal("item.itemSimpleFiremaker.message.0")); - } - if (thisWorld.isAirBlock(blockX, blockY, blockZ)) { - final int random = MathUtils.randInt(0, 3); - // Explode, lol. - if (random == 0) { - PlayerUtils.messagePlayer( - thisPlayer, - StatCollector.translateToLocal("item.itemSimpleFiremaker.message.1")); - thisWorld.playSoundEffect( - thisPlayer.posX + 0.5D, - thisPlayer.posY + 0.5D, - thisPlayer.posZ + 0.5D, - "fire.ignite", - 1.0F, - (itemRand.nextFloat() * 0.4F) + 0.8F); - thisPlayer.setFire(4); - thisItem.damageItem(thisItem.getMaxDamage(), thisPlayer); - } - - // Create a fire - else if (random == 2) { - PlayerUtils.messagePlayer( - thisPlayer, - StatCollector.translateToLocal("item.itemSimpleFiremaker.message.2")); - thisWorld.playSoundEffect( - blockX + 0.5D, - blockY + 0.5D, - blockZ + 0.5D, - "fire.ignite", - 1.0F, - (itemRand.nextFloat() * 0.4F) + 0.8F); - thisWorld.setBlock(blockX, blockY, blockZ, Blocks.fire); - } - - // Do nothing - else { - PlayerUtils.messagePlayer( - thisPlayer, - StatCollector.translateToLocal("item.itemSimpleFiremaker.message.3")); - thisItem.damageItem(1, thisPlayer); - return false; - } - } - thisItem.damageItem(1, thisPlayer); - return true; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java b/src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java deleted file mode 100644 index 0618d451fe..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/ItemControlCore.java +++ /dev/null @@ -1,82 +0,0 @@ -package gtPlusPlus.core.item.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; - -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; - -public class ItemControlCore extends Item { - - public static IIcon[] icons = new IIcon[10]; - - public ItemControlCore() { - super(); - this.setHasSubtypes(true); - String unlocalizedName = "itemControlCore"; - this.setUnlocalizedName(unlocalizedName); - this.setCreativeTab(GregTech_API.TAB_GREGTECH); - // this.setCreativeTab(AddToCreativeTab.tabMisc); - GameRegistry.registerItem(this, unlocalizedName); - } - - @Override - public void registerIcons(IIconRegister reg) { - icons[0] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_0"); - icons[1] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_1"); - icons[2] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_2"); - icons[3] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_3"); - icons[4] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_4"); - icons[5] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_5"); - icons[6] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_6"); - icons[7] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_7"); - icons[8] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_8"); - icons[9] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_9"); - } - - @Override - public IIcon getIconFromDamage(int meta) { - return this.icons[meta]; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - for (int i = 0; i < 10; i++) { - list.add(new ItemStack(item, 1, i)); - } - } - - @Override - public String getUnlocalizedName(ItemStack stack) { - return this.getUnlocalizedName() + "_" + stack.getItemDamage(); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - list.add( - EnumChatFormatting.GRAY + StatCollector.translateToLocalFormatted( - "item.itemControlCore.tooltip.0", - GT_Values.VN[stack.getItemDamage()])); - list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.itemControlCore.tooltip.1")); - list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.itemControlCore.tooltip.2")); - } - - @Override - public String getItemStackDisplayName(final ItemStack tItem) { - return StatCollector - .translateToLocalFormatted("item.itemControlCore.name", GT_Values.VN[tItem.getItemDamage()]); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java b/src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java deleted file mode 100644 index d88cf3328a..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/ItemGemShards.java +++ /dev/null @@ -1,67 +0,0 @@ -package gtPlusPlus.core.item.general; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; - -import gtPlusPlus.core.item.base.BaseItemColourable; -import gtPlusPlus.core.util.Utils; - -public class ItemGemShards extends BaseItemColourable { - - public ItemGemShards(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, - String description, EnumRarity regRarity, EnumChatFormatting colour, boolean Effect, int rgb) { - super(unlocalizedName, creativeTab, stackSize, maxDmg, description, regRarity, colour, Effect, rgb); - } - - public ItemGemShards(String unlocalizedName, String displayName, CreativeTabs creativeTab, int stackSize, - int maxDmg, String description, EnumRarity regRarity, EnumChatFormatting colour, boolean Effect, int rgb) { - super( - unlocalizedName, - displayName, - creativeTab, - stackSize, - maxDmg, - description, - regRarity, - colour, - Effect, - rgb); - } - - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - for (int i = 0; i < 4; i++) { - list.add(new ItemStack(item, 1, i)); - } - } - - // 0 - Diamond - // 1 - Emerald - // 2 - Ruby - // 3 - Sapphire - - @Override - public String getItemStackDisplayName(final ItemStack tItem) { - return StatCollector - .translateToLocal(getUnlocalizedNameInefficiently(tItem) + "." + tItem.getItemDamage() + ".name"); - } - - @Override - public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { - if (this.getDamage(stack) == 0) { - return Utils.rgbtoHexValue(150, 150, 220); - } else if (this.getDamage(stack) == 1) { - return Utils.rgbtoHexValue(75, 182, 75); - } else if (this.getDamage(stack) == 2) { - return Utils.rgbtoHexValue(182, 77, 77); - } else { - return Utils.rgbtoHexValue(77, 75, 182); - } - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java b/src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java deleted file mode 100644 index 8cd9970625..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/ItemGiantEgg.java +++ /dev/null @@ -1,297 +0,0 @@ -package gtPlusPlus.core.item.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; -import static gtPlusPlus.core.lib.CORE.RANDOM; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -import gregtech.api.enums.ItemList; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.entity.item.ItemEntityGiantEgg; -import gtPlusPlus.core.item.base.BaseItemTickable; -import gtPlusPlus.core.item.general.spawn.ItemCustomSpawnEgg; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.NBTUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; - -public class ItemGiantEgg extends BaseItemTickable { - - private static ItemStack turnsIntoItem; - private static ItemStack mCorrectEgg; - private static ItemStack mCorrectStemCells; - - public void registerFuel(int burn) { - CORE.burnables.add(new Pair(burn, ItemUtils.getSimpleStack(this, 1))); - } - - public final void registerOrdictionary(String name) { - ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), name); - } - - public ItemGiantEgg() { - this( - Utils.rgbtoHexValue(255, 255, 255), - Short.MAX_VALUE * Byte.MAX_VALUE, - new String[] { "I had best try disassemble this.. for science!" }); - } - - private ItemGiantEgg(int colour, int maxTicks, String[] desc1) { - super(true, false, "itemBigEgg", colour, maxTicks, desc1); - setTextureName(GTPlusPlus.ID + ":itemBigEgg"); - this.setMaxStackSize(1); - registerFuel(5000); - registerOrdictionary("fuelLargeChickenEgg"); - } - - public static void postInit(ItemGiantEgg aGiantEggItem) { - ItemGiantEgg.turnsIntoItem = getSpawnEggStack(); - // new DecayableRecipe(aGiantEggItem.maxTicks, getSimpleStack(aGiantEggItem), - // ItemUtils.getSimpleStack(ItemGiantEgg.turnsIntoItem, 1)); - } - - private static ItemStack getSpawnEggStack() { - // Set the correct egg for future hatches - if (mCorrectEgg == null) { - /* - * for (int g=0;g 0) { - NBTUtils.setInteger(aStack, "mExpected", mexpected); - NBTUtils.writeItemsToGtCraftingComponents( - aStack, - new ItemStack[] { ItemUtils.getSimpleStack(aStemCells, mexpected) }, - true); - } - } - return aSuper; - } - - @Override - public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, - final boolean p_77663_5_) { - if (world == null || iStack == null) { - return; - } - if (world.isRemote) { - return; - } - if (iStack.getTagCompound() == null || !iStack.getTagCompound().hasKey("size")) { - this.createNBT(world, iStack); - Logger.INFO("Egg has no NBT, creating (onUpdate)"); - } - boolean a1, a2; - a1 = this.isTicking(world, iStack); - a2 = a1 ? tickItemTag(world, iStack) : false; - - // Logger.INFO("Is Ticking? "+a1); - // Logger.INFO("Did Tick? "+a2); - if (!a1 && !a2) { - if (entityHolding instanceof EntityPlayer) { - if (MathUtils.randInt(0, 1000) >= 990) { - if (NBTUtils.hasKey(iStack, "size")) { - if ((NBTUtils.getInteger(iStack, "size") + 1) >= MathUtils.randInt(0, 9)) { - ItemStack replacement = ItemUtils.getSimpleStack(getHatchResult(), 1); - if (replacement == null) {} - - // Logger.INFO("Replacing "+iStack.getDisplayName()+" with - // "+replacement.getDisplayName()+"."); - final ItemStack tempTransform = replacement.copy(); - if (iStack.stackSize > 1) { - int u = iStack.stackSize; - tempTransform.stackSize = u; - ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform)); - for (int l = 0; l < u; l++) { - ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this); - } - } else { - tempTransform.stackSize = 1; - ((EntityPlayer) entityHolding).inventory.addItemStackToInventory((tempTransform)); - ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this); - } - } - } - } - } - } - } - - public ItemStack getHatchResult() { - return turnsIntoItem; - } - - @Override - public String getItemStackDisplayName(ItemStack aStack) { - String localName = super.getItemStackDisplayName(aStack); - /* - * if (aStack.getTagCompound() == null){ createNBT(null, aStack); - * Logger.INFO("Egg has no NBT, creating (getDisplayName)"); } - */ - int size = 1; - if (NBTUtils.hasKey(aStack, "size")) { - size = NBTUtils.getInteger(aStack, "size"); - return "" + size + " " + localName; - } - return "?? " + localName; - } - - @Override - public boolean hasCustomEntity(ItemStack stack) { - return true; - } - - @Override - public Entity createEntity(World world, Entity location, ItemStack itemstack) { - if (location instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) location; - if (itemstack == null) { - return null; - } else if (itemstack.stackSize == 0) { - return null; - } else { - ItemEntityGiantEgg entityitem = new ItemEntityGiantEgg( - world, - player.posX, - player.posY - 0.30000001192092896D + (double) player.getEyeHeight(), - player.posZ, - itemstack); - entityitem.delayBeforeCanPickup = 40; - entityitem.func_145799_b(player.getCommandSenderName()); - float f = 0.1F; - float f1; - f = 0.3F; - entityitem.motionX = (double) (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) - * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) - * f); - entityitem.motionZ = (double) (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) - * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) - * f); - entityitem.motionY = (double) (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI) * f - + 0.1F); - f = 0.02F; - f1 = RANDOM.nextFloat() * (float) Math.PI * 2.0F; - f *= RANDOM.nextFloat(); - entityitem.motionX += Math.cos((double) f1) * (double) f; - entityitem.motionY += (double) ((RANDOM.nextFloat() - RANDOM.nextFloat()) * 0.1F); - entityitem.motionZ += Math.sin((double) f1) * (double) f; - return entityitem; - } - } - return null; - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - int size = 0; - long age = 0; - long life = 0; - int expected = 0; - if (this.descriptionString.length > 0) { - list.add(EnumChatFormatting.GRAY + this.descriptionString[0]); - } - if (NBTUtils.hasKey(stack, "size")) { - size = NBTUtils.getInteger(stack, "size"); - if (size > 0 && NBTUtils.hasKey(stack, "TickableItem")) { - NBTTagCompound aNBT = stack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("TickableItem"); - if (aNBT != null) { - age = aNBT.getLong("Tick"); - } - } - } - if (NBTUtils.hasKey(stack, "mEggAge")) { - life = NBTUtils.getInteger(stack, "mEggAge"); - } - if (NBTUtils.hasKey(stack, "mExpected")) { - expected = NBTUtils.getInteger(stack, "mExpected"); - } - } - String aSize = size > 0 ? "" + size : "??"; - String aExpected = expected > 0 ? "" + expected : "??"; - String aAge = age > 0 ? "" + (age / 20) : "??"; - String aLife = life > 0 ? "" + (life / 20) : "??"; - list.add("Egg Size: " + aSize + " ounces"); - list.add("Expected Stem Cells: " + aExpected); - list.add("Age: " + aAge + "s" + " / " + aLife + "s"); - list.add("Larger eggs take longer to hatch,"); - list.add("but have a better chance of hatching."); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java b/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java deleted file mode 100644 index 3dd1abe58f..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java +++ /dev/null @@ -1,27 +0,0 @@ -package gtPlusPlus.core.item.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.item.EnumRarity; -import net.minecraft.util.EnumChatFormatting; - -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.item.base.CoreItem; - -public class ItemSunnariumBit extends CoreItem { - - public ItemSunnariumBit() { - super( - "SunnariumBit", - "Sunnarium Bit", - AddToCreativeTab.tabMisc, - 64, - 0, - new String[] {}, - EnumRarity.uncommon, - EnumChatFormatting.GOLD, - false, - null); - this.setTextureName(GTPlusPlus.ID + ":" + "itemSunnariumBit"); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java b/src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java deleted file mode 100644 index 671a1ec344..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/RF2EU_Battery.java +++ /dev/null @@ -1,307 +0,0 @@ -package gtPlusPlus.core.item.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MathHelper; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -import cofh.api.energy.ItemEnergyContainer; -import cpw.mods.fml.common.IFuelHandler; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import ic2.api.item.ElectricItem; -import ic2.api.item.IElectricItem; -import ic2.api.item.IElectricItemManager; - -public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, IElectricItemManager, IFuelHandler { - - public static double rfPerEU = 3.4; - private final String unlocalizedName = "rfEUBattery"; - private final ItemStack thisStack; - private static final int maxValueEU = 100000000; - private static final int maxValueRF = (int) (maxValueEU * rfPerEU); - protected double chargeEU = 0; - - public RF2EU_Battery() { - super(maxValueRF); - GameRegistry.registerFuelHandler(this); - this.setCreativeTab(AddToCreativeTab.tabMachines); - this.setUnlocalizedName(this.unlocalizedName); - this.setMaxStackSize(1); - this.setTextureName(GTPlusPlus.ID + ":" + "itemIngot"); - this.thisStack = ItemUtils.getSimpleStack(this); - GameRegistry.registerItem(this, this.unlocalizedName); - } - - @Override - public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_, - final boolean p_77663_5_) { - this.getEnergyStored(itemStack); - if (worldObj.isRemote) { - return; - } - - if (player instanceof EntityPlayer) { - for (final ItemStack is : ((EntityPlayer) player).inventory.mainInventory) { - if (is == itemStack) { - continue; - } - if (is != null) { - if (is.getItem() instanceof IElectricItem) { - final IElectricItem electricItem = (IElectricItem) is.getItem(); - this.chargeEU = ElectricItem.manager.getCharge(is); - } - } - } - } - - super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_); - } - - @Override - public boolean canProvideEnergy(final ItemStack itemStack) { - return true; - } - - @Override - public Item getChargedItem(final ItemStack itemStack) { - final ItemStack x = itemStack.copy(); - x.setItemDamage(maxValueEU); - return x.getItem(); - } - - @Override - public Item getEmptyItem(final ItemStack itemStack) { - final ItemStack x = itemStack.copy(); - x.setItemDamage(0); - return x.getItem(); - } - - @Override - public double getMaxCharge(final ItemStack itemStack) { - return maxValueEU; - } - - @Override - public int getTier(final ItemStack itemStack) { - return 3; - } - - @Override - public double getTransferLimit(final ItemStack itemStack) { - return 8196; - } - - @Override - public double getDurabilityForDisplay(final ItemStack stack) { - // return 1.0D - getEnergyStored(stack) / this.capacity; - return MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack)); - } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(final ItemStack par1ItemStack, final int par2) { - final int i = 30; - - final float f13 = (((Minecraft.getSystemTime() % 6000L) / 3000.0F) * CORE.PI * 2.0F); - - final float t = 0.9F + (0.1F * MathHelper.cos(f13)); - - final double v = 1.0D - this.getDurabilityForDisplay(par1ItemStack); - - int r = i + (int) (v * (255 - i) * t); - if (r > 255) { - r = 255; - } - final int g = i + (int) (v * (64 - i) * t); - - return (r << 16) | (g << 8) | i; - } - - @Override - public boolean showDurabilityBar(final ItemStack stack) { - return false; - } - - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - list.add(StatCollector.translateToLocal("item.rfEUBattery.tooltip.0")); - list.add( - StatCollector.translateToLocalFormatted( - "item.rfEUBattery.tooltip.1", - this.getTier(this.thisStack), - (long) this.getCharge(stack))); - list.add( - StatCollector.translateToLocalFormatted( - "item.rfEUBattery.tooltip.2", - this.getTransferLimit(this.thisStack), - (this.getBurnTime(stack) / 20))); - list.add(""); - list.add(StatCollector.translateToLocal("item.rfEUBattery.tooltip.3")); - list.add( - StatCollector - .translateToLocalFormatted("item.rfEUBattery.tooltip.4", this.maxExtract, this.maxReceive)); - list.add( - StatCollector.translateToLocalFormatted( - "item.rfEUBattery.tooltip.5", - this.getEnergyStored(stack), - this.getMaxEnergyStored(stack), - MathUtils.findPercentage(this.getEnergyStored(stack), this.getMaxEnergyStored(stack)))); - super.addInformation(stack, aPlayer, list, bool); - } - - @Override - public ItemStack getContainerItem(final ItemStack itemStack) { - final ItemStack newItem = itemStack.copy(); - newItem.stackSize = 1; - this.extractEnergy(newItem, 150000, false); - return newItem; - } - - @Override - public boolean hasContainerItem(final ItemStack stack) { - return true; - } - - @Override - public int getBurnTime(final ItemStack fuel) { - if ((fuel == null) || (fuel.getItem() != this)) { - return 0; - } - return this.extractEnergy(fuel, 150000, true) / 50 / 100; - } - - @Override - public double charge(final ItemStack stack, final double amount, final int tier, final boolean ignoreTransferLimit, - final boolean simulate) { - if (stack.stackTagCompound == null) { - stack.stackTagCompound = new NBTTagCompound(); - } - int energy = stack.stackTagCompound.getInteger("Energy"); - final int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, this.maxReceive)); - if (!simulate) { - energy += energyReceived; - stack.stackTagCompound.setInteger("Energy", energy); - ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false); - ElectricItem.manager.charge(stack, energy / rfPerEU, 3, true, false); - } - return ElectricItem.manager.charge(stack, amount, tier, ignoreTransferLimit, simulate); - } - - @Override - public double discharge(final ItemStack stack, final double amount, final int tier, - final boolean ignoreTransferLimit, final boolean externally, final boolean simulate) { - if ((stack.stackTagCompound == null) || (!stack.stackTagCompound.hasKey("Energy"))) { - final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this)); - if ((euCharge != 0) && (euCharge >= 1)) { - return (int) (MathUtils.decimalRoundingToWholes(euCharge * rfPerEU)); - } - return 0; - } - int energy = stack.stackTagCompound.getInteger("Energy"); - final int energyExtracted = Math.min(energy, Math.min(this.maxExtract, this.maxExtract)); - if (!simulate) { - energy -= energyExtracted; - stack.stackTagCompound.setInteger("Energy", energy); - ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false); - ElectricItem.manager.charge(stack, energy / rfPerEU, 3, true, false); - } - - return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate); - } - - @Override - public double getCharge(final ItemStack stack) { - return ElectricItem.manager.getCharge(stack); - } - - @Override - public boolean canUse(final ItemStack stack, final double amount) { - return ElectricItem.manager.canUse(stack, amount); - } - - @Override - public boolean use(final ItemStack stack, final double amount, final EntityLivingBase entity) { - return ElectricItem.manager.use(stack, amount, entity); - } - - @Override - public void chargeFromArmor(final ItemStack stack, final EntityLivingBase entity) { - ElectricItem.manager.chargeFromArmor(stack, entity); - } - - @Override - public String getToolTip(final ItemStack stack) { - return ElectricItem.manager.getToolTip(stack); - } - - @Override - public int receiveEnergy(final ItemStack container, final int maxReceive, final boolean simulate) { - if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) { - final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this)); - if ((euCharge != 0) && (euCharge >= 1)) { - return (int) (MathUtils.decimalRoundingToWholes(euCharge * rfPerEU)); - } - return 0; - } - int energy = container.stackTagCompound.getInteger("Energy"); - final int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, maxReceive)); - if (!simulate) { - energy += energyReceived; - container.stackTagCompound.setInteger("Energy", energy); - ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false); - ElectricItem.manager.charge(container, energy / rfPerEU, 3, true, false); - } - return energyReceived; - } - - @Override - public int extractEnergy(final ItemStack container, final int maxExtract, final boolean simulate) { - if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) { - final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this)); - if ((euCharge != 0) && (euCharge >= 1)) { - return (int) (MathUtils.decimalRoundingToWholes(euCharge * rfPerEU)); - } - return 0; - } - int energy = container.stackTagCompound.getInteger("Energy"); - final int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract)); - if (!simulate) { - energy -= energyExtracted; - container.stackTagCompound.setInteger("Energy", energy); - ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false); - ElectricItem.manager.charge(container, energy / rfPerEU, 3, true, false); - } - return energyExtracted; - } - - @Override - public int getEnergyStored(final ItemStack container) { - if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) { - final double euCharge = this.getCharge(ItemUtils.getSimpleStack(this)); - if ((euCharge != 0) && (euCharge >= 1)) { - return (int) (MathUtils.decimalRoundingToWholes(euCharge * rfPerEU)); - } - return 0; - } - final int energy = container.stackTagCompound.getInteger("Energy"); - ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false); - ElectricItem.manager.charge(container, energy / rfPerEU, 3, true, false); - return energy; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java b/src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java deleted file mode 100644 index 38e34a9a01..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java +++ /dev/null @@ -1,250 +0,0 @@ -package gtPlusPlus.core.item.general.capture; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; -import java.util.UUID; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import gtPlusPlus.api.interfaces.IEntityCatcher; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.minecraft.NBTUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; - -public class ItemEntityCatcher extends Item implements IEntityCatcher { - - // PlayerInteractEvent.EntityInteract; - - public ItemEntityCatcher() { - // Probably won't ever need this event handler. - // Utils.registerEvent(this); - this.setUnlocalizedName("itemDragonJar"); - this.setTextureName(GTPlusPlus.ID + ":" + getUnlocalizedName()); - this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setMaxStackSize(16); - this.setMaxDamage(0); - GameRegistry.registerItem(this, getUnlocalizedName()); - } - - @Override - public boolean hasEntity(ItemStack aStack) { - if (NBTUtils.hasKey(aStack, "mHasEntity")) { - return NBTUtils.getBoolean(aStack, "mHasEntity"); - } - return false; - } - - @Override - public Entity getStoredEntity(World aWorld, ItemStack aStack) { - if (aStack == null || !hasEntity(aStack)) { - Logger.INFO("Cannot get stored entity."); - return null; - } - - Entity mEntityToSpawn; - int mEntityID; - Logger.WARNING("getStoredEntity(1)"); - - mEntityID = NBTUtils.getInteger(aStack, "mEntityID"); - mEntityToSpawn = EntityList.createEntityByID(mEntityID, aWorld); - if (mEntityToSpawn != null) { - Logger.WARNING("getStoredEntity(2)"); - return mEntityToSpawn; - } - - Logger.INFO("Failed to get stored entity. - getStoredEntity()"); - return null; - } - - @Override - public boolean setStoredEntity(World aWorld, ItemStack aStack, Entity aEntity) { - if (aEntity == null) { - NBTUtils.setBoolean(aStack, "mHasEntity", false); - Logger.INFO("Bad Entity being stored."); - return false; - } - - Logger.WARNING("setStoredEntity(1)"); - - NBTTagCompound mEntityData; - Class mEntityClass; - String mClassName; - String mEntityName; - int mEntityID, mEntityHashcode; - UUID mUuidPersistent, mUuidUnique; - Logger.WARNING("setStoredEntity(2)"); - - mEntityData = aEntity.getEntityData(); - mEntityClass = aEntity.getClass(); - mClassName = mEntityClass.getName(); - mEntityName = aEntity.getCommandSenderName(); - // mEntityID = aEntity.getEntityId(); - mEntityID = EntityList.getEntityID(aEntity); - mEntityHashcode = aEntity.hashCode(); - mUuidPersistent = aEntity.getPersistentID(); - mUuidUnique = aEntity.getUniqueID(); - Logger.WARNING("setStoredEntity(3)"); - - NBTUtils.createTagCompound(aStack, "mEntityData", mEntityData); - NBTUtils.setString(aStack, "mEntityName", mEntityName); - NBTUtils.setInteger(aStack, "mEntityID", mEntityID); - NBTUtils.setString(aStack, "mClassName", mClassName); - NBTUtils.setString(aStack, "mUuidPersistent", mUuidPersistent.toString()); - NBTUtils.setString(aStack, "mUuidUnique", mUuidUnique.toString()); - NBTUtils.setInteger(aStack, "mEntityHashcode", mEntityHashcode); - NBTUtils.setBoolean(aStack, "mHasEntity", true); - Logger.WARNING("setStoredEntity(4)"); - return true; - } - - @SuppressWarnings("unchecked") - @Override - public Class getStoredEntityClass(ItemStack aStack) { - if (aStack == null || !hasEntity(aStack)) { - return null; - } - Class mEntityClass; - String mClassName; - mClassName = NBTUtils.getString(aStack, "mClassName"); - mEntityClass = (Class) ReflectionUtils.getClass(mClassName); - if (mEntityClass != null) { - return mEntityClass; - } - return null; - } - - @Override - public boolean spawnStoredEntity(World aWorld, ItemStack aStack, BlockPos aPos) { - if (aStack == null || !hasEntity(aStack)) { - Logger.INFO("Cannot release, either invalid Itemstack or no entity stored."); - return false; - } - - NBTTagCompound mEntityData = NBTUtils.getTagCompound(aStack, "mEntityData"); - - int mEntityID = NBTUtils.getInteger(aStack, "mEntityID"); - String mClassName = NBTUtils.getString(aStack, "mClassName"); - UUID mUuidPersistent = UUID.fromString(NBTUtils.getString(aStack, "mUuidPersistent")); - UUID mUuidUnique = UUID.fromString(NBTUtils.getString(aStack, "mUuidUnique")); - int mEntityHashcode = NBTUtils.getInteger(aStack, "mEntityHashcode"); - - EntityLiving mEntityToSpawn = (EntityLiving) getStoredEntity(aWorld, aStack); - Class mEntityClass = getStoredEntityClass(aStack); - - Logger.WARNING("spawnStoredEntity(1)"); - - if (mEntityToSpawn != null && mEntityClass != null) { - Logger.WARNING("spawnStoredEntity(2)"); - if (mEntityToSpawn.getEntityData() != mEntityData) { - Logger.WARNING("spawnStoredEntity(x)"); - NBTUtils.setEntityCustomData(mEntityToSpawn, mEntityData); - } - - mEntityToSpawn - .setLocationAndAngles(aPos.xPos, aPos.yPos, aPos.zPos, aWorld.rand.nextFloat() * 360.0F, 0.0F); - if (mEntityToSpawn != null) { - mEntityToSpawn.onSpawnWithEgg(null); - aWorld.spawnEntityInWorld(mEntityToSpawn); - Logger.WARNING("spawnStoredEntity(3)"); - } - if (mEntityToSpawn != null) { - mEntityToSpawn.playLivingSound(); - Logger.WARNING("spawnStoredEntity(4)"); - } - Logger.WARNING("spawnStoredEntity(5)"); - NBTUtils.setBoolean(aStack, "mHasEntity", false); - return true; - } - Logger.INFO("Failed to spawn stored entity. - spawnStoredEntity()"); - return false; - } - - @Override - public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { - return super.onItemRightClick(aStack, aWorld, aPlayer); - } - - @Override - public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { - if (hasEntity(p_77624_1_)) { - String mName = NBTUtils.getString(p_77624_1_, "mEntityName"); - if (mName != null && !mName.equals("")) { - p_77624_3_.add( - EnumChatFormatting.GRAY - + StatCollector.translateToLocalFormatted("item.itemDragonJar.1.tooltip", mName)); - } - } else { - p_77624_3_.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.itemDragonJar.0.tooltip")); - } - } - - @Override - public boolean showDurabilityBar(ItemStack stack) { - return false; - } - - @Override - public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, - float xOffset, float yOffset, float zOffset) { - if (Utils.isServer()) { - Logger.WARNING("Trying to release (1)"); - if (NBTUtils.hasKey(itemstack, "mHasEntity") && NBTUtils.getBoolean(itemstack, "mHasEntity")) { - Logger.WARNING("Trying to release (2)"); - boolean mDidSpawn = spawnStoredEntity(world, itemstack, new BlockPos(x, y + 1, z, world)); - - if (!mDidSpawn) { - PlayerUtils.messagePlayer( - player, - "You failed to release a " + NBTUtils.getString(itemstack, "mEntityName") + "."); - } - - return mDidSpawn; - } - } - return super.onItemUse(itemstack, player, world, x, y, z, side, xOffset, yOffset, zOffset); - } - - @Override - public boolean itemInteractionForEntity(ItemStack aStack, EntityPlayer aPlayer, EntityLivingBase aEntity) { - if (Utils.isServer()) { - Logger.WARNING("Trying to catch (1)"); - if (!hasEntity(aStack)) { - Logger.WARNING("Trying to catch (2)"); - boolean mStored = setStoredEntity(aPlayer.worldObj, aStack, aEntity); - if (mStored) { - Logger.WARNING("Trying to catch (3)"); - aEntity.setDead(); - PlayerUtils.messagePlayer( - aPlayer, - "You have captured a " + NBTUtils.getString(aStack, "mEntityName") + " in the Jar."); - // NBTUtils.tryIterateNBTData(aStack); - } - } - } - return super.itemInteractionForEntity(aStack, aPlayer, aEntity); - } - - @Override - public String getItemStackDisplayName(ItemStack aStack) { - if (hasEntity(aStack)) { - return StatCollector.translateToLocal("item.itemDragonJar.1.name"); - } - return StatCollector.translateToLocal("item.itemDragonJar.0.name"); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java b/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java index 475707e950..31d69044cc 100644 --- a/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java +++ b/src/main/java/gtPlusPlus/core/item/general/throwables/ItemThrowableBomb.java @@ -20,7 +20,6 @@ import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.entity.projectile.EntityThrowableBomb; -import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.base.CoreItem; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; @@ -54,7 +53,6 @@ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer play mLighters.put(ItemList.Tool_Lighter_Invar_Used.get(1)); mLighters.put(ItemList.Tool_Lighter_Platinum_Full.get(1)); mLighters.put(ItemList.Tool_Lighter_Platinum_Used.get(1)); - mLighters.put(ItemUtils.getSimpleStack(ModItems.itemBasicFireMaker)); } // Unlit diff --git a/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java b/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java index aa44b467ce..acddd58a7b 100644 --- a/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java +++ b/src/main/java/gtPlusPlus/core/item/init/ItemsFoods.java @@ -1,20 +1,13 @@ package gtPlusPlus.core.item.init; -import static gregtech.api.enums.Mods.GTPlusPlus; - import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityOcelot; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.item.base.foods.BaseItemFood; -import gtPlusPlus.core.item.base.foods.BaseItemHotFood; import gtPlusPlus.core.item.food.BaseItemMetaFood; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -28,69 +21,6 @@ public static void load() { private static void run() { - // Raisin Bread - ModItems.itemIngotRaisinBread = new BaseItemFood( - "itemIngotRaisinBread", - "Raisin Bread", - 3, - 1.5f, - false, - new PotionEffect(Potion.weakness.id, 40, 1)).setAlwaysEdible(); - GT_OreDictUnificator.registerOre( - "foodRaisinBread", - ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemIngotRaisinBread", 1)); - // Hot Raisin Bread - ModItems.itemHotIngotRaisinBread = new BaseItemHotFood( - "itemHotIngotRaisinBread", - 1, - 0.5f, - "Raisin Bread", - 120, - ModItems.itemIngotRaisinBread); - GT_OreDictUnificator.registerOre( - "foodHotRaisinBread", - ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemHotIngotRaisinBread", 1)); - - // Raisin Bread - ModItems.itemFoodRaisinToast = new BaseItemFood("itemFoodRaisinToast", "Raisin Toast", 1, 0.5f, false) - .setAlwaysEdible(); - GT_OreDictUnificator.registerOre( - "foodRaisinToast", - ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemFoodRaisinToast", 1)); - // Hot Raisin Bread - ModItems.itemHotFoodRaisinToast = new BaseItemHotFood( - "itemHotFoodRaisinToast", - 1, - 0.5f, - "Raisin Toast", - 20, - ModItems.itemFoodRaisinToast); - GT_OreDictUnificator.registerOre( - "foodHotRaisinToast", - ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemHotFoodRaisinToast", 1)); - - // Raisin Bread - ModItems.itemFoodCurriedSausages = new BaseItemFood( - "itemFoodCurriedSausages", - "Curried Sausages", - 5, - 2f, - false); - GT_OreDictUnificator.registerOre( - "foodCurriedSausages", - ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemFoodCurriedSausages", 1)); - // Hot Raisin Bread - ModItems.itemHotFoodCurriedSausages = new BaseItemHotFood( - "itemHotFoodCurriedSausages", - 1, - 0.5f, - "Curried Sausages", - 240, - ModItems.itemFoodCurriedSausages); - GT_OreDictUnificator.registerOre( - "foodHotCurriedSausages", - ItemUtils.getItemStackFromFQRN(GTPlusPlus.ID + ":itemHotFoodCurriedSausages", 1)); - ModItems.itemMetaFood = new BaseItemMetaFood(); BaseItemMetaFood.registerFoodsToOreDict(); addCookingRecipes(); diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java b/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java index a614a2b737..2c550962c9 100644 --- a/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java +++ b/src/main/java/gtPlusPlus/core/item/tool/misc/GregtechPump.java @@ -2,6 +2,7 @@ import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.Mods.GTPlusPlus; +import static gregtech.api.util.GT_Utility.formatNumbers; import java.util.ArrayList; import java.util.BitSet; @@ -202,7 +203,7 @@ public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, L EnumChatFormatting.BLUE + (f != null ? "" + f.amount : "" + 0) + "L" + " / " - + getCapacity(aStack) + + formatNumbers(getCapacity(aStack)) + "L"); } @@ -212,7 +213,7 @@ public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, L aList.add( EnumChatFormatting.AQUA + StatCollector.translateToLocalFormatted( "item.itemBaseEuItem.tooltip.1", - GT_Utility.formatNumbers(tStats[3]), + formatNumbers(tStats[3]), (tStats[2] >= 0 ? tStats[2] : 0)) + EnumChatFormatting.GRAY); } else { final long tCharge = this.getRealCharge(aStack); @@ -224,8 +225,8 @@ public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, L aList.add( EnumChatFormatting.AQUA + StatCollector.translateToLocalFormatted( "item.itemBaseEuItem.tooltip.3", - GT_Utility.formatNumbers(tCharge), - GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: ", + formatNumbers(tCharge), + formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: ", V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)]) + EnumChatFormatting.GRAY); } diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java b/src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java deleted file mode 100644 index dbaee70bd0..0000000000 --- a/src/main/java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java +++ /dev/null @@ -1,75 +0,0 @@ -package gtPlusPlus.core.item.tool.misc; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.item.base.BaseItemWithDamageValue; - -public class SandstoneHammer extends BaseItemWithDamageValue { - - /* - * (non-Javadoc) - * @see net.minecraft.item.Item#getColorFromItemStack(net.minecraft.item.ItemStack, int) - */ - @Override - public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) { - // Figure Out Damage - - return super.getColorFromItemStack(stack, HEX_OxFFFFFF); - } - - public SandstoneHammer(final String unlocalizedName) { - super(unlocalizedName); - this.setTextureName(GTPlusPlus.ID + ":" + unlocalizedName); - this.setMaxStackSize(1); - this.setMaxDamage(2500); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - list.add(EnumChatFormatting.GRAY + "Allows you to craft sand from cobble, or sandstone from sand."); - super.addInformation(stack, aPlayer, list, bool); - } - - @Override - public boolean doesContainerItemLeaveCraftingGrid(final ItemStack itemStack) { - return false; - } - - @Override - public boolean getShareTag() { - return true; - } - - @Override - public boolean hasContainerItem(final ItemStack itemStack) { - return true; - } - - @Override - public ItemStack getContainerItem(final ItemStack itemStack) { - itemStack.setItemDamage(itemStack.getItemDamage() + 8); - - return itemStack; - } - - @Override - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(final ItemStack par1ItemStack) { - return EnumRarity.uncommon; - } - - @Override - public boolean hasEffect(final ItemStack par1ItemStack, final int pass) { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java deleted file mode 100644 index 492adc4e07..0000000000 --- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/AutoLunchBox.java +++ /dev/null @@ -1,15 +0,0 @@ -package gtPlusPlus.core.item.tool.misc.box; - -public class AutoLunchBox extends BaseBoxItem { - - public static final int SLOTS = 9; - - public AutoLunchBox(String displayName) { - super( - displayName, - new String[] { "Stores 9 pieces of food", - "Food will automatically be eaten from slot 1, through to " - + gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS }, - gtPlusPlus.core.item.tool.misc.box.AutoLunchBox.SLOTS); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java deleted file mode 100644 index e121bb5085..0000000000 --- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/MagicToolBag.java +++ /dev/null @@ -1,14 +0,0 @@ -package gtPlusPlus.core.item.tool.misc.box; - -public class MagicToolBag extends BaseBoxItem { - - public static final int SLOTS = 24; - - public MagicToolBag(String displayName) { - super( - displayName, - new String[] { "Can store magic tools from TC, BM, etc", - "Please ask for additional mod support on Github" }, - gtPlusPlus.core.item.tool.misc.box.MagicToolBag.SLOTS); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java b/src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java deleted file mode 100644 index b39609fb02..0000000000 --- a/src/main/java/gtPlusPlus/core/item/tool/misc/box/UniversalToolBox.java +++ /dev/null @@ -1,16 +0,0 @@ -package gtPlusPlus.core.item.tool.misc.box; - -import gtPlusPlus.core.handler.GuiHandler; - -public class UniversalToolBox extends BaseBoxItem { - - public static final int SLOTS = 16; - - public UniversalToolBox(String displayName) { - super( - displayName, - new String[] { "Can store tools from Gregtech, IC2, BC, Forestry", - "Please ask for additional mod support on Github" }, - GuiHandler.GUI10); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java deleted file mode 100644 index d4caadc7f7..0000000000 --- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java +++ /dev/null @@ -1,287 +0,0 @@ -package gtPlusPlus.core.item.tool.staballoy; - -import static gregtech.api.enums.Mods.GTPlusPlus; -import static gregtech.api.enums.Mods.Minecraft; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.RecipeUtils; - -public class MultiPickaxeBase extends StaballoyPickaxe { - - /* - * (non-Javadoc) - * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack) - */ - @Override - public double getDurabilityForDisplay(final ItemStack stack) { - if (super.getDurabilityForDisplay(stack) > 0) { - return super.getDurabilityForDisplay(stack); - } - return 0; - } - - protected boolean canBreak = true; - protected final int colour; - protected final String materialName; - protected final String displayName; - public boolean isValid = true; - private final Pair enchantment; - - public MultiPickaxeBase(final String unlocalizedName, final ToolMaterial material, final long materialDurability, - final int colour, final Object enchant) { - super(Utils.sanitizeString(unlocalizedName), material); - this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName)); - // this.setTextureName(GTPlusPlus.ID + ":" + "itemPickaxe"); - this.setTextureName(Minecraft.ID + ":" + "iron_pickaxe"); - this.setMaxStackSize(1); - if ((materialDurability * 3) <= Integer.MAX_VALUE) { - this.setMaxDamage((int) (materialDurability * 3)); - } else { - this.setMaxDamage(Integer.MAX_VALUE); - this.canBreak = false; - } - this.colour = colour; - this.materialName = material.name(); - this.displayName = unlocalizedName; - this.setCreativeTab(AddToCreativeTab.tabTools); - this.miningLevel = material.getHarvestLevel(); - - if (enchant != null) { - if (enchant instanceof Pair) { - this.enchantment = (Pair) enchant; - } else { - this.enchantment = null; - } - } else { - this.enchantment = null; - } - - try { - this.isValid = this.addRecipe(); - } catch (final Throwable e) {} - if ((colour != 0) && this.isValid && (materialDurability > 10000)) { - if (GameRegistry.findItem(GTPlusPlus.ID, Utils.sanitizeString(unlocalizedName)) == null) { - GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName)); - } - } - } - - /* - * Methods - */ - - private boolean addRecipe() { - - final String cleanName = Utils.sanitizeString(this.materialName); - - final String plateDense = "plateDense" + cleanName; - final String plateDouble = "plateDouble" + cleanName; - final String rodLong = "stickLong" + cleanName; - final String toolHammer = "craftingToolHardHammer"; - final String toolWrench = "craftingToolWrench"; - final String toolFile = "craftingToolFile"; - final String toolScrewDriver = "craftingToolScrewdriver"; - - if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)) { - Logger.WARNING("stickLong of " + cleanName + " does not exist."); - return false; - } - if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)) { - Logger.WARNING("plateDense of " + cleanName + " does not exist."); - if (null != ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDouble, 1)) { - Logger.WARNING("plateDouble of " + cleanName + " does exist. Using it instead."); - RecipeUtils.recipeBuilder( - plateDouble, - plateDouble, - plateDouble, - toolFile, - rodLong, - toolHammer, - toolWrench, - rodLong, - toolScrewDriver, - ItemUtils.getSimpleStack(this)); - - return true; - } - Logger.WARNING("plateDouble of " + cleanName + " does not exist."); - return false; - } - - RecipeUtils.recipeBuilder( - plateDense, - plateDense, - plateDense, - toolFile, - rodLong, - toolHammer, - toolWrench, - rodLong, - toolScrewDriver, - ItemUtils.getSimpleStack(this)); - - return true; - } - - public final String getMaterialName() { - return this.materialName; - } - - @Override - public String getItemStackDisplayName(final ItemStack iStack) { - return this.displayName; - } - - @Override - public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) { - if (this.colour == 0) { - return MathUtils.generateSingularRandomHexValue(); - } - return this.colour; - } - - private float calculateDurabilityLoss(final World world, final int X, final int Y, final int Z) { - float bDurabilityLoss = 0; - Boolean correctTool = false; - float bHardness = 0; - if (!world.isRemote) { - try { - final Block removalist = world.getBlock(X, Y, Z); - // Utils.LOG_WARNING(removalist.toString()); - - bHardness = removalist.getBlockHardness(world, X, Y, Z) * 100; - Logger.INFO("Hardness: " + bHardness); - - bDurabilityLoss = 100; - // Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss); - - correctTool = this.canPickaxeBlock(removalist, world, new int[] { X, Y, Z }); - Logger.WARNING("" + correctTool); - - if (!correctTool) { - return 0; - } - - } catch (final NullPointerException e) { - - } - } - return bDurabilityLoss; - } - - // Should clear up blocks quicker if I chain it. - /* - * @Override public void removeBlockAndDropAsItem(World world, int X, int Y, int Z, ItemStack heldItem){ localWorld - * = world; try { Block block = world.getBlock(X, Y, Z); float dur = calculateDurabilityLoss(world, X, Y, Z); - * Utils.LOG_WARNING(block.toString()); String removalTool = ""; removalTool = block.getHarvestTool(1); if - * (removalTool.equals("pickaxe") || UtilsMining.getBlockType(block, world, new int[]{X,Y,Z}, miningLevel)){ if - * (canPickaxeBlock(block, world, new int[]{X,Y,Z})){ if((block != Blocks.bedrock) && (block.getBlockHardness(world, - * X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != - * Blocks.lava)){ if (heldItem.getItemDamage() <= (heldItem.getMaxDamage()-dur)){ block.dropBlockAsItem(world, X, Y, - * Z, world.getBlockMetadata(X, Y, Z), 0); world.setBlockToAir(X, Y, Z); } else { return; } } } else { - * Utils.LOG_WARNING("Incorrect Tool for mining this block."); } } } catch (NullPointerException e){ } } - */ - - @Override - public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer) { - if (this.canBreak) { - item.damageItem(damage, localPlayer); - } - } - - @Override - public void setItemDamage(final ItemStack item, final int damage) { - if (this.canBreak) { - item.setItemDamage(damage - 1); - } - } - - @Override - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(final ItemStack par1ItemStack) { - return EnumRarity.uncommon; - } - - @Override - public boolean hasEffect(final ItemStack par1ItemStack, final int pass) { - return false; - } - - @Override - public void onCreated(final ItemStack mThisItem, final World mWorld, final EntityPlayer mPlayer) { - Enchantment enchant = null; - int enchantmentLevel = 0; - final Pair Y = this.enchantment; - if (Y != null) { - if (Y.getKey() != null) { - enchant = (Enchantment) this.enchantment.getKey(); - } - if (Y.getValue() != null) { - enchantmentLevel = ((Integer) this.enchantment.getValue()).intValue(); - } - } - final ItemStack itemToEnchant = mThisItem; - if ((enchant != null) && (enchantmentLevel != 0) && (enchantmentLevel >= 1)) { - itemToEnchant.addEnchantment(enchant, enchantmentLevel); - } - super.onCreated(itemToEnchant, mWorld, mPlayer); - } - - @Override - public void getSubItems(final Item mItem, final CreativeTabs mCreativeTab, final List mList) { - Enchantment enchant = null; - int enchantmentLevel = 0; - final Pair Y = this.enchantment; - if (Y != null) { - if (Y.getKey() != null) { - enchant = (Enchantment) this.enchantment.getKey(); - } - if (Y.getValue() != null) { - enchantmentLevel = ((Integer) this.enchantment.getValue()).intValue(); - } - } - - final Item thisItem = mItem; - final ItemStack itemToEnchant = ItemUtils.getSimpleStack(thisItem); - if ((enchant != null) && (enchantmentLevel != 0) && (enchantmentLevel >= 1)) { - itemToEnchant.addEnchantment(enchant, enchantmentLevel); - mList.add(itemToEnchant); - } else { - mList.add(new ItemStack(thisItem, 1, 0)); - } - } - - /** - * - * Time to Override Minecraft stupid mechanics, allowing unbreakable stuff. - * - */ - @Override - public boolean isDamageable() { - if (this.getMaxDamage() > 0 && !this.hasSubtypes) { - if (this.canBreak) { - return true; - } - } - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java deleted file mode 100644 index 660ec408c1..0000000000 --- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java +++ /dev/null @@ -1,372 +0,0 @@ -package gtPlusPlus.core.item.tool.staballoy; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockAir; -import net.minecraft.block.BlockCocoa; -import net.minecraft.block.BlockDirt; -import net.minecraft.block.BlockDoublePlant; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.BlockGrass; -import net.minecraft.block.BlockHugeMushroom; -import net.minecraft.block.BlockLeavesBase; -import net.minecraft.block.BlockLog; -import net.minecraft.block.BlockMushroom; -import net.minecraft.block.BlockSand; -import net.minecraft.block.BlockSnow; -import net.minecraft.block.BlockSnowBlock; -import net.minecraft.block.BlockTallGrass; -import net.minecraft.block.BlockVine; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemAxe; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class StaballoyAxe extends ItemAxe { - - public String mat; - - public StaballoyAxe(final String unlocalizedName, final ToolMaterial material) { - super(material); - this.setUnlocalizedName(unlocalizedName); - this.setTextureName(GTPlusPlus.ID + ":" + unlocalizedName); - } - - // EXPLODE TREE - byte[] tre = new byte[32000]; - byte unchecked = 0; - byte needcheck = 1; - byte ignore = 2; - byte harvest = 3; - - private boolean setcheck(final int x, final int y, final int z) { - if ((x < 0) || (x > 19) || (z < 0) || (z > 19) || (y < 0) || (y > 79)) { - return false; - } - final int o = x + (z * 20) + (y * 400); - if (this.tre[o] == this.unchecked) { - this.tre[o] = this.needcheck; - } - return true; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - list.add(EnumChatFormatting.GOLD + "Fells entire trees in a single swipe!.."); - list.add(EnumChatFormatting.GRAY + "Ask Alkalus for new trees to be supported."); - super.addInformation(stack, aPlayer, list, bool); - } - - public static boolean canIgnore(final Block bit) { - if (bit instanceof BlockAir) { - return true; - } - if (bit instanceof BlockGrass) { - return true; - } - if (bit instanceof BlockSand) { - return true; - } - if (bit instanceof BlockDirt) { - return true; - } - if (bit instanceof BlockCocoa) { - return true; - } - if (bit instanceof BlockVine) { - return true; - } - if (bit instanceof BlockMushroom) { - return true; - } - if (bit instanceof BlockSnow) { - return true; - } - if (bit instanceof BlockSnowBlock) { - return true; - } - if (bit instanceof BlockFlower) { - return true; - } - if (bit instanceof BlockTallGrass) { - return true; - } - if (bit instanceof BlockDoublePlant) { - return true; - } - - // LoonTools.log("Found uncuttable "+bit.getClass().getSimpleName()); - return false; - } - - private int check(final World par1World, final int x, final int y, final int z, final int xo, final int yo, - final int zo) { - int f = 0; - final int o = x + (z * 20) + (y * 400); - if (this.tre[o] == this.needcheck) { - this.tre[o] = this.ignore; - final Block bit = par1World.getBlock(x + xo, y + yo, z + zo); - if ((bit instanceof BlockLog) || (bit instanceof BlockLeavesBase) - || (bit instanceof BlockHugeMushroom) - || (bit.getUnlocalizedName().toLowerCase().contains("log")) - || (bit.getUnlocalizedName().toLowerCase().contains("wood"))) { - f = 1; - this.tre[o] = this.harvest; - // if (bit instanceof BlockLog){ - // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" "); - // } - for (int xb = -1; xb < 2; xb++) { - for (int yb = -1; yb < 2; yb++) { - for (int zb = -1; zb < 2; zb++) { - if (!this.setcheck(x + xb, y + yb, z + zb)) { - return 3; - } - } - } - } - } else { - if (!canIgnore(bit)) { - return 2; - } - } - } - return f; - } - - public int checkTree(final World par1World, final int xo, final int yo, final int zo) { - boolean f; - for (f = true; f == true;) { - f = false; - for (int y = 0; y < 80; y++) { - for (int z = 0; z < 20; z++) { - for (int x = 0; x < 20; x++) { - final int r = this.check(par1World, x, y, z, xo, yo, zo); - if (r == 3) { - return 3; - } - if (r == 2) { - return 2; - } - if (r == 1) { - f = true; - } - } - } - } - - for (int y = 79; y >= 0; y--) { - for (int z = 19; z >= 0; z--) { - for (int x = 19; x >= 0; x--) { - final int r = this.check(par1World, x, y, z, xo, yo, zo); - if (r == 2) { - return 3; - } - // if (r==2) return 2; - if (r == 1) { - f = true; - } - } - } - } - } - return 1; - } - - private int check2(final World par1World, final int x, final int y, final int z, final int xo, final int yo, - final int zo) { - int f = 0; - final int o = x + (z * 20) + (y * 400); - if (this.tre[o] == this.needcheck) { - this.tre[o] = this.ignore; - final Block bit = par1World.getBlock(x + xo, y + yo, z + zo); - if (bit instanceof BlockLog) { - f = 1; - this.tre[o] = this.harvest; - // if (bit instanceof BlockLog){ - // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" "); - // } - for (int xb = -1; xb < 2; xb++) { - for (int yb = -1; yb < 2; yb++) { - for (int zb = -1; zb < 2; zb++) { - if (!this.setcheck(x + xb, y + yb, z + zb)) { - return 3; - } - } - } - } - } else if (bit instanceof BlockLeavesBase) {} else { - if (!canIgnore(bit)) { - return 2; - } - } - } - return f; - } - - public int checkTree2(final World par1World, final int xo, final int yo, final int zo) { - boolean f; - for (f = true; f == true;) { - f = false; - for (int y = 0; y < 80; y++) { - for (int z = 0; z < 20; z++) { - for (int x = 0; x < 20; x++) { - final int r = this.check2(par1World, x, y, z, xo, yo, zo); - if (r == 3) { - return 3; - } - if (r == 2) { - return 2; - } - if (r == 1) { - f = true; - } - } - } - } - - for (int y = 79; y >= 0; y--) { - for (int z = 19; z >= 0; z--) { - for (int x = 19; x >= 0; x--) { - final int r = this.check2(par1World, x, y, z, xo, yo, zo); - if (r == 2) { - return 3; - } - // if (r==2) return 2; - if (r == 1) { - f = true; - } - } - } - } - } - return 1; - } - - public void exploadTree(final World par1World, final int xo, final int yo, final int zo, final EntityPlayer plr) { - for (int y = 0; y < 80; y++) { - for (int z = 0; z < 20; z++) { - for (int x = 0; x < 20; x++) { - final int o = x + (z * 20) + (y * 400); - if (this.tre[o] == this.harvest) { - final Block bit = par1World.getBlock(x + xo, y + yo, z + zo); - final int met = par1World.getBlockMetadata(x + xo, y + yo, z + zo); - - if ((bit instanceof BlockLog) || (bit instanceof BlockLeavesBase) - || (bit.getUnlocalizedName().toLowerCase().contains("log")) - || (bit.getUnlocalizedName().toLowerCase().contains("wood"))) { - bit.harvestBlock(par1World, plr, x + xo, y + yo, z + zo, met); - par1World.setBlockToAir(x + xo, y + yo, z + zo); - } - } - } - } - } - } - - private static void breakMushroom(final World wld, final Block bit, final EntityPlayer plr, final boolean silk, - final int x, final int y, final int z, final int met) { - if (silk) { - final ItemStack stk = null; // TODO - /* - * if (bit==Blocks.brown_mushroom_block) stk = new ItemStack(LoonToolItems.brown_mushroom_block,1,met); else - * if (bit==Blocks.red_mushroom_block) stk = new ItemStack(LoonToolItems.red_mushroom_block,1,met); else stk - * = new ItemStack(bit,1,met); - */ - final EntityItem entityitem = new EntityItem(wld, x + 0.5, y + 0.5, z + 0.5, stk); - entityitem.delayBeforeCanPickup = 10; - wld.spawnEntityInWorld(entityitem); - } else { - bit.harvestBlock(wld, plr, x, y, z, met); - } - wld.setBlockToAir(x, y, z); - } - - public void exploadMushroom(final World par1World, final int xo, final int yo, final int zo, final EntityPlayer plr, - final boolean silk) { - for (int y = 0; y < 80; y++) { - for (int z = 0; z < 20; z++) { - for (int x = 0; x < 20; x++) { - final int o = x + (z * 20) + (y * 400); - if (this.tre[o] == this.harvest) { - final Block bit = par1World.getBlock(x + xo, y + yo, z + zo); - final int met = par1World.getBlockMetadata(x + xo, y + yo, z + zo); - if (bit instanceof BlockHugeMushroom) { - breakMushroom(par1World, bit, plr, silk, x + xo, y + yo, z + zo, met); - } else { - bit.harvestBlock(par1World, plr, x + xo, y + yo, z + zo, met); - par1World.setBlockToAir(x + xo, y + yo, z + zo); - } - } - } - } - } - } - - @Override - public boolean onBlockDestroyed(final ItemStack itm, final World wld, final Block blk, final int x, final int y, - final int z, final EntityLivingBase plr) { - if (!wld.isRemote) { - final Block bit = wld.getBlock(x, y, z); - final boolean silk = EnchantmentHelper.getSilkTouchModifier(plr); - if ((bit instanceof BlockHugeMushroom)) { - for (int n = 0; n < 32000; n++) { - this.tre[n] = this.unchecked; - } - final int met = wld.getBlockMetadata(x, y, z); - breakMushroom(wld, bit, (EntityPlayer) plr, silk, x, y, z, met); - wld.setBlockToAir(x, y, z); - this.tre[2210] = this.needcheck; - if (this.checkTree(wld, x - 10, y - 4, z - 10) == 1) { - this.exploadMushroom(wld, x - 10, y - 4, z - 10, (EntityPlayer) plr, silk); - } - } - - if ((bit instanceof BlockLog) || (bit.getUnlocalizedName().toLowerCase().contains("log")) - || (bit.getUnlocalizedName().toLowerCase().contains("wood"))) { - // LoonTools.log("cutting tree @ "+x+" "+y+" "+z+" "); - for (int n = 0; n < 32000; n++) { - this.tre[n] = this.unchecked; - } - final int met = wld.getBlockMetadata(x, y, z); - bit.harvestBlock(wld, (EntityPlayer) plr, x, y, z, met); - wld.setBlockToAir(x, y, z); - this.tre[2210] = this.needcheck; - if (this.checkTree(wld, x - 10, y - 4, z - 10) == 1) { - this.exploadTree(wld, x - 10, y - 4, z - 10, (EntityPlayer) plr); - } else { - for (int n = 0; n < 32000; n++) { - this.tre[n] = this.unchecked; - } - this.tre[2210] = this.needcheck; - if (this.checkTree2(wld, x - 10, y - 4, z - 10) == 1) { - this.exploadTree(wld, x - 10, y - 4, z - 10, (EntityPlayer) plr); - } - } - } - } - return super.onBlockDestroyed(itm, wld, blk, x, y, z, plr); - } - - @Override - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(final ItemStack par1ItemStack) { - return EnumRarity.rare; - } - - @Override - public boolean hasEffect(final ItemStack par1ItemStack, final int pass) { - return true; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java deleted file mode 100644 index 9601662c39..0000000000 --- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java +++ /dev/null @@ -1,458 +0,0 @@ -package gtPlusPlus.core.item.tool.staballoy; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemPickaxe; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.MiningUtils; - -public class StaballoyPickaxe extends ItemPickaxe { - - /* - * (non-Javadoc) - * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack) - */ - @Override - public double getDurabilityForDisplay(final ItemStack stack) { - return (double) stack.getItemDamageForDisplay() / (double) stack.getMaxDamage(); - } - - /** - * Creates an NBT tag for this item if it doesn't have one. This also set some default values. - * - * @param rStack - * @return - */ - private static boolean createNBT(ItemStack rStack) { - final NBTTagCompound tagMain = new NBTTagCompound(); - final NBTTagCompound tagNBT = new NBTTagCompound(); - - tagNBT.setBoolean("FACING_HORIZONTAL", true); - tagNBT.setString("FACING", "north"); - tagNBT.setString("lookingDirection", ""); - - tagMain.setTag("PickStats", tagNBT); - rStack.setTagCompound(tagMain); - return true; - } - - /* - * Is the player facing horizontally? - */ - - public static final boolean isFacingHorizontal(final ItemStack aStack) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - return aNBT.getBoolean("FACING_HORIZONTAL"); - } - } else { - createNBT(aStack); - } - return true; - } - - public static final boolean setFacingHorizontal(final ItemStack aStack, final boolean aFacingHorizontal) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - aNBT.setBoolean("FACING_HORIZONTAL", aFacingHorizontal); - return true; - } - } - return false; - } - - /* - * Handles the Direction the player is facing - */ - - public static final String getFacingDirection(final ItemStack aStack) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - return aNBT.getString("FACING"); - } - } else { - createNBT(aStack); - } - return "north"; - } - - public static final boolean setFacingDirection(final ItemStack aStack, final String aFacingHorizontal) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - aNBT.setString("FACING", aFacingHorizontal); - return true; - } - } - return false; - } - - /* - * The Looking Direction handlers - */ - - public static final String getLookingDirection(final ItemStack aStack) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - return aNBT.getString("lookingDirection"); - } - } else { - createNBT(aStack); - } - return ""; - } - - public static final boolean setLookingDirection(final ItemStack aStack, final String aFacingHorizontal) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - aNBT.setString("lookingDirection", aFacingHorizontal); - return true; - } - } - return false; - } - - protected int miningLevel; - - /* - * Methods - */ - - @Override - public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer aPlayer) { - return super.onItemRightClick(stack, world, aPlayer); - } - - @Override - public boolean onBlockDestroyed(final ItemStack stack, final World world, final Block block, final int X, - final int Y, final int Z, final EntityLivingBase entity) { - if (!world.isRemote) { - if (entity instanceof EntityPlayer) { - this.GetDestroyOrientation( - (EntityPlayer) entity, - block, - getLookingDirection(stack), - world, - X, - Y, - Z, - stack); - } - } - return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity); - } - - private float calculateDurabilityLoss(final World world, final int X, final int Y, final int Z) { - float bDurabilityLoss = 0; - Boolean correctTool = false; - float bHardness = 0; - if (!world.isRemote) { - try { - final Block removalist = world.getBlock(X, Y, Z); - // Utils.LOG_WARNING(removalist.toString()); - - bHardness = removalist.getBlockHardness(world, X, Y, Z); - Logger.WARNING("Hardness: " + bHardness); - - bDurabilityLoss = (bDurabilityLoss + bHardness); - // Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss); - - correctTool = this.canPickaxeBlock(removalist, world, new int[] { X, Y, Z }); - Logger.WARNING("" + correctTool); - - if (!correctTool) { - return 0; - } - - } catch (final NullPointerException e) { - - } - } - return 100; - } - - public Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld, final int[] xyz) { - String correctTool = ""; - if (!currentWorld.isRemote) { - try { - correctTool = currentBlock.getHarvestTool(0); - if (MiningUtils.getBlockType(currentBlock, currentWorld, xyz, this.miningLevel) - || correctTool.equals("pickaxe") - || correctTool.equals("null")) { - // Utils.LOG_WARNING(correctTool); - return true; - } - } catch (final NullPointerException e) { - return false; - } - } - return false; - } - - private void GetDestroyOrientation(EntityPlayer entity, final Block block, final String FACING, final World world, - final int X, final int Y, final int Z, final ItemStack heldItem) { - float DURABILITY_LOSS = 0; - if (!world.isRemote) { - - Logger.WARNING("hardness:" + block.getBlockHardness(world, X, Y, Z)); - if (FACING.equals("below") || FACING.equals("above")) { - DURABILITY_LOSS = 0; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - final float dur = this.calculateDurabilityLoss(world, X + i, Y, Z + j); - DURABILITY_LOSS = (DURABILITY_LOSS + dur); - Logger.WARNING("Added Loss: " + dur); - this.removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem); - } - } - } else if (FACING.equals("facingEast") || FACING.equals("facingWest")) { - DURABILITY_LOSS = 0; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - final float dur = this.calculateDurabilityLoss(world, X, Y + i, Z + j); - DURABILITY_LOSS = (DURABILITY_LOSS + dur); - Logger.WARNING("Added Loss: " + dur); - this.removeBlockAndDropAsItem(world, X, Y + i, Z + j, heldItem); - } - } - } else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")) { - DURABILITY_LOSS = 0; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - final float dur = this.calculateDurabilityLoss(world, X + j, Y + i, Z); - DURABILITY_LOSS = (DURABILITY_LOSS + dur); - Logger.WARNING("Added Loss: " + dur); - this.removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem); - } - } - } - - // int heldItemDurability = heldItem.getDamage(1); - Logger.WARNING("Total Loss: " + (int) DURABILITY_LOSS); - // heldItem.setDamage(heldStack, DURABILITY_LOSS); - // Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage()); - // Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack)); - Logger.WARNING("1x: " + (heldItem.getItemDamage())); - final int itemdmg = heldItem.getItemDamage(); - final int maxdmg = heldItem.getMaxDamage(); - final int dodmg = (int) DURABILITY_LOSS; - final int durNow = maxdmg - itemdmg; - final int durLeft = (int) ((maxdmg - itemdmg) - DURABILITY_LOSS); - - Logger.WARNING( - "Current Damage: " + itemdmg - + " Max Damage: " - + maxdmg - + " Durability to be lost: " - + dodmg - + " Current Durability: " - + durNow - + " Remaining Durability: " - + durLeft); - - // Break Tool - if (((durNow - dodmg) <= (99)) && (itemdmg != 0)) { - // TODO break tool - Logger.WARNING("Breaking Tool"); - heldItem.stackSize = 0; - } - // Do Damage - else { - // setItemDamage(heldItem, durLeft); - Logger.WARNING("" + (durNow - durLeft)); - this.damageItem(heldItem, (durNow - durLeft) - 1, entity); - } - - /* - * if (heldItem.getItemDamage() <= ((heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS)){ - * Utils.LOG_WARNING("2: "+DURABILITY_LOSS+" 3: "+((heldItem.getMaxDamage()-heldItem.getItemDamage())- - * DURABILITY_LOSS)); setItemDamage(heldItem, (int) - * (heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage())-DURABILITY_LOSS)); } else { - * Utils.LOG_WARNING("3: "+( heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage()))); - * setItemDamage(heldItem, heldItem.getMaxDamage()-(heldItem.getMaxDamage()-heldItem.getItemDamage())); } - */ - // Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage()); - DURABILITY_LOSS = 0; - } - } - - public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer) { - item.damageItem(damage, localPlayer); - } - - public void setItemDamage(final ItemStack item, final int damage) { - item.setItemDamage(damage - 1); - } - - // Should clear up blocks quicker if I chain it. - public final void removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z, - final ItemStack heldItem) { - try { - final Block block = world.getBlock(X, Y, Z); - final float dur = this.calculateDurabilityLoss(world, X, Y, Z); - Logger.WARNING(block.toString()); - String removalTool = ""; - removalTool = block.getHarvestTool(1); - - Logger.WARNING("Removing.1 " + removalTool); - /* - * if ((removalTool.equalsIgnoreCase("pickaxe") || removalTool.equalsIgnoreCase("null") || removalTool == - * null)){ Utils.LOG_WARNING("Removing.2"); if (UtilsMining.getBlockType(block, world, new int[]{X,Y,Z}, - * miningLevel)) { Utils.LOG_WARNING("Removing.3"); - */ - if (this.canPickaxeBlock(block, world, new int[] { X, Y, Z })) { - Logger.WARNING("Removing.4"); - - if (block == Blocks.air) { - return; - } - - if ((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) >= 0) - && (block.getBlockHardness(world, X, Y, Z) <= 100) - && (block != Blocks.water) - && (block != Blocks.lava)) { - - Logger.WARNING("Removing.5"); - if (heldItem.getItemDamage() <= (heldItem.getMaxDamage() - dur)) { - - if (X == 0 && Y == 0 && Z == 0) { - - } else { - block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0); - world.setBlockToAir(X, Y, Z); - } - } - } - /* - * } } - */ - } else { - Logger.WARNING("Incorrect Tool for mining this block."); - } - } catch (final NullPointerException e) { - - } - } - - public boolean checkFacing(final ItemStack aStack, final EntityPlayer aPlayer, final World world) { - if (aPlayer != null) { - final int direction = MathHelper.floor_double((aPlayer.rotationYaw * 4F) / 360F + 0.5D) & 3; - // Utils.LOG_WARNING("Player - F: "+direction); - // Utils.LOG_WARNING("Player - getLookVec(): "+localPlayer.getLookVec().yCoord); - - /* - * if (localPlayer.getLookVec().yCoord > 0){ localPlayer.getLookVec().yCoord; } - */ - - final MovingObjectPosition movingobjectposition = this - .getMovingObjectPositionFromPlayer(world, aPlayer, false); - if (movingobjectposition != null) { - final int sideHit = movingobjectposition.sideHit; - String playerStandingPosition = ""; - if (movingobjectposition != null) { - // System.out.println("Side Hit: "+movingobjectposition.sideHit); - } - - if (sideHit == 0) { - playerStandingPosition = "above"; - setFacingHorizontal(aStack, false); - } else if (sideHit == 1) { - playerStandingPosition = "below"; - setFacingHorizontal(aStack, false); - } else if (sideHit == 2) { - playerStandingPosition = "facingSouth"; - setFacingHorizontal(aStack, true); - } else if (sideHit == 3) { - playerStandingPosition = "facingNorth"; - setFacingHorizontal(aStack, true); - } else if (sideHit == 4) { - playerStandingPosition = "facingEast"; - setFacingHorizontal(aStack, true); - } else if (sideHit == 5) { - playerStandingPosition = "facingWest"; - setFacingHorizontal(aStack, true); - } - setLookingDirection(aStack, playerStandingPosition); - - if (direction == 0) { - setFacingDirection(aStack, "south"); - } else if (direction == 1) { - setFacingDirection(aStack, "west"); - } else if (direction == 2) { - setFacingDirection(aStack, "north"); - } else if (direction == 3) { - setFacingDirection(aStack, "east"); - } - } - - return true; - } - return false; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - list.add(EnumChatFormatting.GRAY + "Mines a 3x3 at 100 durability per block mined."); - list.add( - EnumChatFormatting.GRAY + "Durability: " - + (stack.getMaxDamage() - stack.getItemDamage()) - + "/" - + stack.getMaxDamage()); - // super.addInformation(stack, aPlayer, list, bool); - } - - @Override - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(final ItemStack par1ItemStack) { - return EnumRarity.rare; - } - - @Override - public boolean hasEffect(final ItemStack par1ItemStack, final int pass) { - return true; - } - - @Override - public boolean onBlockStartBreak(final ItemStack itemstack, final int X, final int Y, final int Z, - final EntityPlayer aPlayer) { - this.checkFacing(itemstack, aPlayer, aPlayer.getEntityWorld()); - return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer); - } - - public StaballoyPickaxe(final String unlocalizedName, final ToolMaterial material) { - super(material); - this.setUnlocalizedName(unlocalizedName); - this.setTextureName(GTPlusPlus.ID + ":" + unlocalizedName); - this.setMaxStackSize(1); - this.setMaxDamage(3200); - this.miningLevel = 5; - } -} diff --git a/src/main/java/gtPlusPlus/core/lib/CORE.java b/src/main/java/gtPlusPlus/core/lib/CORE.java index bec7c04c56..acb2ab1a07 100644 --- a/src/main/java/gtPlusPlus/core/lib/CORE.java +++ b/src/main/java/gtPlusPlus/core/lib/CORE.java @@ -134,7 +134,6 @@ public static class ConfigSwitches { public static boolean dumpItemAndBlockData = false; // Tools - public static boolean enableSkookumChoochers = true; public static boolean enableMultiSizeTools = true; // Block Drops @@ -153,7 +152,6 @@ public static class ConfigSwitches { public static boolean enableCustomCapes = false; public static boolean enableCustomCircuits = true; public static boolean enableOldGTcircuits = false; - public static boolean disableZombieReinforcement = false; public static int enableWatchdogBGM = CORE_Preloader.enableWatchdogBGM; public static boolean hideUniversalCells = true; @@ -162,7 +160,6 @@ public static class ConfigSwitches { // Single Block Machines public static boolean enableMachine_SolarGenerators = false; - public static boolean enableMachine_Safes = true; public static boolean enableMachine_Dehydrators = true; public static boolean enableMachine_SteamConverter = true; public static boolean enableMachine_FluidTanks = true; diff --git a/src/main/java/gtPlusPlus/core/material/ELEMENT.java b/src/main/java/gtPlusPlus/core/material/ELEMENT.java index a46559b56b..71580fb81f 100644 --- a/src/main/java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/main/java/gtPlusPlus/core/material/ELEMENT.java @@ -10,20 +10,7 @@ public final class ELEMENT { - public static final String[] NAMES = new String[] { "Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", - "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon", "Phosphorus", - "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium", - "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium", - "Bromine", "Krypton", "Rubidium", "Strontium", "Yttrium", "Zirconium", "Niobium", "Molybdenum", - "Technetium", "Ruthenium", "Rhodium", "Palladium", "Silver", "Cadmium", "Indium", "Tin", "Antimony", - "Tellurium", "Iodine", "Xenon", "Caesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium", - "Promethium", "Samarium", "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", - "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum", - "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Francium", "Radium", - "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium", "Americium", "Curium", - "Berkelium", "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium", - "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium", "Meitnerium", "Darmstadtium", "Roentgenium", - "Copernicium", "Nihonium", "Flerovium", "Moscovium", "Livermorium", "Tennessine", "Oganesson" }; + public static final String[] NAMES = new String[] { "Hydrogen", "Helium" }; // First 50 Elements public final Material HYDROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Hydrogen); @@ -131,18 +118,7 @@ public final class ELEMENT { 0); // Not a GT Inherited Material public final Material NIOBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Niobium); public final Material MOLYBDENUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Molybdenum); - public final Material TECHNETIUM = new Material( - "Technetium", - MaterialState.SOLID, - TextureSets.NUCLEAR.get(), - new short[] { 220, 220, 220 }, - 2200, - 4877, - 43, - 55, - false, - "Tc", - 2); // Not a GT Inherited Material + public final Material RUTHENIUM = new Material( "Ruthenium", MaterialState.SOLID, @@ -165,6 +141,32 @@ public final class ELEMENT { false, "Rh", 0); // Not a GT Inherited Material + public final Material AMERICIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Americium); + public final Material TECHNETIUM = new Material( + "Technetium", + MaterialState.SOLID, + TextureSets.NUCLEAR.get(), + new short[] { 220, 220, 220 }, + 2200, + 4877, + 43, + 55, + false, + "Tc", + 2); // Not a GT Inherited Material + public final Material NEPTUNIUM = new Material( + "Neptunium", + MaterialState.SOLID, + TextureSets.NUCLEAR.get(), + new short[] { 200, 220, 205 }, + 640, + 3902, + 93, + 144, + false, + "Np", + 2); // Not a GT Inherited Material + public final Material PALLADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Palladium); public final Material SILVER = MaterialUtils.generateMaterialFromGtENUM(Materials.Silver); public final Material CADMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Cadmium); @@ -288,31 +290,9 @@ public final class ELEMENT { false, "Po", 1); // Not a GT Inherited Material - public final Material ASTATINE = new Material( - "Astatine", - MaterialState.SOLID, - TextureSets.NUCLEAR.get(), - new short[] { 170, 180, 170 }, - 302, - 337, - 85, - 125, - false, - "At", - 1); // Not a GT Inherited Material + public final Material RADON = MaterialUtils.generateMaterialFromGtENUM(Materials.Radon); - public final Material FRANCIUM = new Material( - "Francium", - MaterialState.SOLID, - TextureSets.NUCLEAR.get(), - new short[] { 170, 160, 170 }, - 27, - 677, - 87, - 136, - false, - "Fr", - 1); // Not a GT Inherited Material + public final Material RADIUM = new Material( "Radium", MaterialState.SOLID, @@ -325,18 +305,7 @@ public final class ELEMENT { false, "Ra", 1); // Not a GT Inherited Material - public final Material ACTINIUM = new Material( - "Actinium", - MaterialState.SOLID, - TextureSets.NUCLEAR.get(), - new short[] { 150, 165, 165 }, - 1050, - 3200, - 89, - 138, - false, - "Ac", - 1); // Not a GT Inherited Material + public final Material THORIUM = new Material( "Thorium", MaterialState.SOLID, @@ -362,24 +331,7 @@ public final class ELEMENT { 1); // Not a GT Inherited Material public final Material URANIUM238 = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium); public final Material URANIUM235 = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium235); - public final Material NEPTUNIUM = new Material( - "Neptunium", - MaterialState.SOLID, - TextureSets.NUCLEAR.get(), - new short[] { 200, 220, 205 }, - 640, - 3902, - 93, - 144, - false, - "Np", - 2); // Not a GT Inherited Material - - public final Material PLUTONIUM244 = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium); // This one - // looks - // incorrect. public final Material PLUTONIUM241 = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium241); - public final Material AMERICIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Americium); // Americium public final Material CURIUM = new Material( "Curium", MaterialState.SOLID, @@ -392,18 +344,7 @@ public final class ELEMENT { false, "Cm", 3); // Not a GT Inherited Material - public final Material BERKELIUM = new Material( - "Berkelium", - MaterialState.SOLID, - TextureSets.NUCLEAR.get(), - new short[] { 110, 250, 85 }, - 985, - 710, - 97, - 150, - false, - "Bk", - 4); // Not a GT Inherited Material + public final Material CALIFORNIUM = new Material( "Californium", MaterialState.SOLID, @@ -416,18 +357,7 @@ public final class ELEMENT { false, "Cf", 4); // Not a GT Inherited Material - public final Material EINSTEINIUM = new Material( - "Einsteinium", - MaterialState.SOLID, - TextureSets.NUCLEAR.get(), - new short[] { 255, 85, 110 }, - 860, - 3500, - 99, - 153, - false, - "Es", - 5); // Not a GT Inherited Material //Boiling Point is made up + public final Material FERMIUM = new Material( "Fermium", MaterialState.LIQUID, @@ -454,9 +384,6 @@ public final class ELEMENT { public final Material ORDO = MaterialUtils .generateMaterialFromGtENUM(Materials.InfusedOrder, TextureSets.GEM_A.get()); - // Fictional - public final Material YELLORIUM = MaterialUtils - .generateMaterialFromGtENUM(Materials.Yellorium, new short[] { 255, 242, 10 }, TextureSets.NUCLEAR.get()); public final Material NAQUADAH = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadah); public final Material NAQUADAH_ENRICHED = MaterialUtils.generateMaterialFromGtENUM(Materials.NaquadahEnriched); public final Material NAQUADRIA = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadria); @@ -531,48 +458,6 @@ public final class ELEMENT { StringUtils.superscript("238Pu"), 2, false); // Not a GT Inherited Material - public final Material STRONTIUM90 = new Material( - "Strontium-90", - MaterialState.SOLID, - TextureSets.NUCLEAR.get(), - Materials.Strontium.mDurability, - Materials.Strontium.mRGBa, - Materials.Strontium.mMeltingPoint, - Materials.Strontium.mBlastFurnaceTemp, - 38, - 52, - false, - StringUtils.superscript("90Sr"), - 2, - false); // Not a GT Inherited Material - public final Material POLONIUM210 = new Material( - "Polonium-210", - MaterialState.SOLID, - TextureSets.NUCLEAR.get(), - POLONIUM.vDurability, - POLONIUM.getRGBA(), - POLONIUM.getMeltingPointK(), - POLONIUM.getBoilingPointK(), - 84, - 126, - false, - StringUtils.superscript("210Po"), - 2, - false); // Not a GT Inherited Material - public final Material AMERICIUM241 = new Material( - "Americium-241", - MaterialState.SOLID, - TextureSets.NUCLEAR.get(), - Materials.Americium.mDurability, - Materials.Americium.mRGBa, - Materials.Americium.mMeltingPoint, - Materials.Americium.mBlastFurnaceTemp, - 95, - 146, - false, - StringUtils.superscript("241Am"), - 2, - false); // Not a GT Inherited Material public final Material MAGIC = MaterialUtils .generateMaterialFromGtENUM(Materials.Magic, new short[] { 10, 185, 140 }); diff --git a/src/main/java/gtPlusPlus/core/material/Material.java b/src/main/java/gtPlusPlus/core/material/Material.java index 6e1c9b8b92..8068d6ab35 100644 --- a/src/main/java/gtPlusPlus/core/material/Material.java +++ b/src/main/java/gtPlusPlus/core/material/Material.java @@ -784,8 +784,6 @@ public TextureSet setTextureSet(TextureSet set, int aTier) { aShiny++; } else if (m.getStackMaterial() == ELEMENT.getInstance().PLATINUM) { aShiny++; - } else if (m.getStackMaterial() == ELEMENT.getInstance().AMERICIUM) { - aShiny++; } else if (m.getStackMaterial() == ELEMENT.getInstance().TITANIUM) { aShiny++; } else if (m.getStackMaterial() == ELEMENT.getInstance().GERMANIUM) { diff --git a/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java b/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java index e6c441d4e8..f1052d9332 100644 --- a/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java +++ b/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java @@ -36,12 +36,9 @@ import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.client.model.ModelGiantChicken; import gtPlusPlus.core.client.renderer.CustomItemBlockRenderer; import gtPlusPlus.core.client.renderer.CustomOreBlockRenderer; -import gtPlusPlus.core.client.renderer.RenderBatKing; import gtPlusPlus.core.client.renderer.RenderDecayChest; -import gtPlusPlus.core.client.renderer.RenderGiantChicken; import gtPlusPlus.core.client.renderer.RenderMiningExplosivesPrimed; import gtPlusPlus.core.client.renderer.RenderSickBlaze; import gtPlusPlus.core.client.renderer.RenderStaballoyConstruct; @@ -49,8 +46,6 @@ import gtPlusPlus.core.common.CommonProxy; import gtPlusPlus.core.common.compat.COMPAT_PlayerAPI; import gtPlusPlus.core.entity.EntityPrimedMiningExplosive; -import gtPlusPlus.core.entity.monster.EntityBatKing; -import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion; @@ -58,12 +53,10 @@ import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion; import gtPlusPlus.core.entity.projectile.EntityThrowableBomb; import gtPlusPlus.core.entity.projectile.EntityToxinballSmall; -import gtPlusPlus.core.handler.render.FirepitRender; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest; -import gtPlusPlus.core.tileentities.general.TileEntityFirepit; import gtPlusPlus.core.util.minecraft.particles.EntityParticleFXMysterious; import gtPlusPlus.xmod.gregtech.common.render.GTPP_CapeRenderer; import gtPlusPlus.xmod.gregtech.common.render.GTPP_FlaskRenderer; @@ -150,10 +143,6 @@ public void registerRenderThings() { RenderingRegistry.registerEntityRenderingHandler( EntityHydrofluoricAcidPotion.class, new RenderSnowball(ModItems.itemHydrofluoricPotion)); - RenderingRegistry.registerEntityRenderingHandler( - EntityGiantChickenBase.class, - new RenderGiantChicken(new ModelGiantChicken(), 1f)); - RenderingRegistry.registerEntityRenderingHandler(EntityBatKing.class, new RenderBatKing()); RenderingRegistry .registerEntityRenderingHandler(EntityThrowableBomb.class, new RenderSnowball(ModItems.itemBomb, 1)); RenderingRegistry.registerEntityRenderingHandler(EntityLightningAttack.class, new RenderFireball(1F)); @@ -161,8 +150,6 @@ public void registerRenderThings() { /** * Tiles */ - Logger.INFO("Registering Custom Renderer for the Fire Pit."); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFirepit.class, new FirepitRender()); Logger.INFO("Registering Custom Renderer for the Lead Lined Chest."); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecayablesChest.class, new RenderDecayChest()); Logger.INFO("Registering Custom Renderer for the Egg Box."); diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 87bd3ef8c4..57a2ed8345 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -1092,33 +1092,7 @@ private static void assemblerRecipes() { GregtechItemList.Bomb_Cast.get(4), 30, 120); - addAR( - ItemUtils.getSimpleStack(Items.redstone, 32), - ItemUtils.getSimpleStack(ModItems.itemRope, 16), - Materials.Glue.getFluid(500), - ItemUtils.getSimpleStack(ModItems.itemDetCable, 24), - 30, - 120); - - /* - * addAR(ItemUtils.getItemStackOfAmountFromOreDict("plateIncoloy020", 16), - * ItemUtils.getItemStackOfAmountFromOreDict("frameGtIncoloyMA956", 4), null, - * GregtechItemList.Casing_Power_SubStation.get(4), 80, 120); - */ - - /* - * CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] { GregtechItemList.Casing_Multi_Use.get(1), - * ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 1), - * ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(4), 8), CI.sensor_HV, CI.emitter_HV, - * CI.fieldGenerator_HV, }, null, ItemUtils.getSimpleStack(Dimension_Everglades.blockPortalFrame), 20*20, 2048); - */ - CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { ItemUtils.getSimpleStack(ModItems.itemRope, 6), ItemUtils.getGregtechCircuit(6) }, - null, - ItemUtils.getSimpleStack(ModBlocks.blockNet, 2), - 1 * 20, - 8); CORE.RA.addSixSlotAssemblingRecipe( new ItemStack[] { ItemUtils.getSimpleStack(CI.explosiveITNT, 2), ItemUtils.getSimpleStack(CI.explosiveTNT, 4), ELEMENT.getInstance().SULFUR.getDust(2), @@ -1261,17 +1235,6 @@ private static void assemblerRecipes() { ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_9_CLOAKING, 1), 20 * 60 * 10, (int) GT_Values.V[7]); - - // Supreme Pizza Gloves - CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { ItemUtils.getGregtechCircuit(19), ItemUtils.getSimpleStack(ModItems.itemRope, 32), - ItemUtils.getItemStackOfAmountFromOreDict("gearGtSmallWroughtIron", 8), - ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", 32), - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), 2) }, - FluidUtils.getFluidStack("molten.rubber", 2000), - ItemUtils.getSimpleStack(ModItems.itemPersonalFireProofDevice), - 20 * 60 * 5, - 30); } } diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java index b3371fc815..154ec9b940 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -266,70 +266,6 @@ private static void run() { Logger.INFO("Added a recipe for Wither Cages."); } - /* - * Logger.RECIPE("[Inspection] Xp Converter"); if (RecipeUtils.addShapedRecipe( - * getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 2, 1), - * getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1), - * getSimpleStack(Items.nether_star), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1), - * getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 2, 1), - * getSimpleStack(Items.experience_bottle), ItemUtils.getSimpleStack(ModBlocks.blockXpConverter, 1))){ - * Logger.INFO("Added a recipe for XP Converter."); } - */ - - // Rope/Fiber/Net - if (RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1), - ItemUtils.getSimpleStack(Items.reeds) }, - ItemUtils.getSimpleStack(ModItems.itemFiber, 16))) { - Logger.INFO("Added a recipe for Fiber."); - } - - if (RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1), - ItemUtils.getSimpleStack(Blocks.sapling) }, - ItemUtils.getSimpleStack(ModItems.itemFiber, 32))) { - Logger.INFO("Added a recipe for Fiber."); - } - - if (RecipeUtils.addShapedRecipe( - null, - ItemUtils.getSimpleStack(ModItems.itemFiber, 1), - null, - ItemUtils.getSimpleStack(ModItems.itemFiber, 1), - CI.craftingToolKnife, - ItemUtils.getSimpleStack(ModItems.itemFiber, 1), - null, - ItemUtils.getSimpleStack(ModItems.itemFiber, 1), - null, - ItemUtils.getSimpleStack(ModItems.itemRope, 3))) { - Logger.INFO("Added a recipe for Rope."); - } - - Logger.RECIPE("[Inspection] Net"); - if (RecipeUtils.addShapedRecipe( - ItemUtils.getSimpleStack(ModItems.itemRope, 1), - ItemUtils.getSimpleStack(ModItems.itemRope, 1), - ItemUtils.getSimpleStack(ModItems.itemRope, 1), - ItemUtils.getSimpleStack(ModItems.itemRope, 1), - ItemUtils.getSimpleStack(ModItems.itemRope, 1), - ItemUtils.getSimpleStack(ModItems.itemRope, 1), - null, - null, - null, - ItemUtils.getSimpleStack(ModBlocks.blockNet, 2))) { - Logger.INFO("Added a recipe for Nets."); - } - - // Slow Builders Ring - CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { ItemUtils.getSimpleStack(Blocks.ice, 8), - ItemUtils.getSimpleStack(ModBlocks.blockNet, 8), ItemUtils.getSimpleStack(Blocks.vine, 8), - ALLOY.TUMBAGA.getRing(1), }, - FluidUtils.getWater(1000), // Fluid - ItemUtils.getItemStackFromFQRN("miscutils:SlowBuildingRing", 1), // Output - 20 * 30, // Dur - 16); // Eu - // Magic Feather CORE.RA.addSixSlotAssemblingRecipe( new ItemStack[] { ItemUtils.getSimpleStack(Items.feather, 64), diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 6a738158de..bd75847153 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -1,18 +1,9 @@ package gtPlusPlus.core.recipe; -import static gregtech.api.enums.Mods.BartWorks; -import static gregtech.api.enums.Mods.COFHCore; -import static gregtech.api.enums.Mods.EternalSingularity; -import static gregtech.api.enums.Mods.GoodGenerator; -import static gregtech.api.enums.Mods.GregTech; -import static gregtech.api.enums.Mods.Railcraft; -import static gregtech.api.enums.Mods.RemoteIO; -import static gregtech.api.enums.Mods.ZTones; - -import net.minecraft.block.Block; +import static gregtech.api.enums.Mods.*; + import net.minecraft.init.Blocks; import net.minecraft.init.Items; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -39,19 +30,15 @@ import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.MISC_MATERIALS; -import gtPlusPlus.core.material.Material; import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.everglades.dimension.Dimension_Everglades; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.covers.CoverManager; import gtPlusPlus.xmod.gregtech.common.helpers.VolumetricFlaskHelper; -import gtPlusPlus.xmod.gregtech.common.items.MetaCustomCoverItem; public class RECIPES_Machines { @@ -241,13 +228,11 @@ private static void run() { initModItems(); tieredMachineHulls(); - controlCores(); energyCores(); wirelessChargers(); largeArcFurnace(); industrialVacuumFurnace(); fakeMachineCasingCovers(); - ztonesCoverRecipes(); overflowValveCovers(); superBuses(); roundRobinators(); @@ -1195,16 +1180,6 @@ private static void runModRecipes() { GregtechItemList.Energy_Buffer_RF_Convertor.get(1)); } - // Egg Box - CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { CI.getNumberedAdvancedCircuit(8), CI.getTieredMachineHull(3), - ItemUtils.getSimpleStack(Items.egg, 64), ItemUtils.getSimpleStack(ModItems.itemRope, 32), - CI.getPlate(4, 8) }, - FluidUtils.getFluidStack("mobessence", 4096), - ItemUtils.getSimpleStack(ModBlocks.blockEggBox, 1), - 20 * 60, - 480); - // Flask Configurator CORE.RA.addSixSlotAssemblingRecipe( new ItemStack[] { CI.getNumberedAdvancedCircuit(8), CI.getTieredMachineHull(2), @@ -2400,35 +2375,6 @@ private static void runModRecipes() { RECIPE_SaltPlantController); } - // Shelves - RecipeUtils.addShapedGregtechRecipe( - "screwWood", - "plateWood", - "screwWood", - CI.craftingToolHammer_Hard, - "frameGtWood", - CI.craftingToolHammer_Soft, - "plateWood", - "plateWood", - "plateWood", - GregtechItemList.GT4_Shelf.get(2)); - - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[] { GregtechItemList.GT4_Shelf.get(1) }, - GregtechItemList.GT4_Shelf_Compartment.get(1)); - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[] { GregtechItemList.GT4_Shelf_Compartment.get(1) }, - GregtechItemList.GT4_Shelf_Desk.get(1)); - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[] { GregtechItemList.GT4_Shelf_Desk.get(1) }, - GregtechItemList.GT4_Shelf_Iron.get(1)); - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[] { GregtechItemList.GT4_Shelf_Iron.get(1) }, - GregtechItemList.GT4_Shelf_FileCabinet.get(1)); - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[] { GregtechItemList.GT4_Shelf_FileCabinet.get(1) }, - GregtechItemList.GT4_Shelf.get(1)); - // Cyclotron if (CORE.ConfigSwitches.enableMultiblock_Cyclotron) { RECIPE_CyclotronController = GregtechItemList.COMET_Cyclotron.get(1); @@ -2975,76 +2921,6 @@ private static void runModRecipes() { Logger.INFO("Done loading recipes for the Various machine blocks."); } - private static void controlCores() { - - Material[] aMat_A = new Material[] { ALLOY.POTIN, ALLOY.ZIRCONIUM_CARBIDE, ALLOY.TANTALLOY_61, - ALLOY.INCONEL_792, ALLOY.STABALLOY, ALLOY.TALONITE, ALLOY.HASTELLOY_N, ALLOY.HG1223, ALLOY.LAFIUM, - ALLOY.PIKYONIUM }; - Material[] aMat_B = new Material[] { ALLOY.TUMBAGA, ALLOY.SILICON_CARBIDE, ALLOY.EGLIN_STEEL, ALLOY.NICHROME, - ALLOY.TUNGSTEN_CARBIDE, ALLOY.STELLITE, ALLOY.HASTELLOY_C276, ALLOY.NITINOL_60, ALLOY.ZERON_100, - ALLOY.CINOBITE }; - - Item aBaseCore = ModItems.itemControlCore; - ItemStack[] aInputPrevTier = new ItemStack[] { - ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore2", 1), - ItemUtils.simpleMetaStack(aBaseCore, 0, 1), ItemUtils.simpleMetaStack(aBaseCore, 1, 1), - ItemUtils.simpleMetaStack(aBaseCore, 2, 1), ItemUtils.simpleMetaStack(aBaseCore, 3, 1), - ItemUtils.simpleMetaStack(aBaseCore, 4, 1), ItemUtils.simpleMetaStack(aBaseCore, 5, 1), - ItemUtils.simpleMetaStack(aBaseCore, 6, 1), ItemUtils.simpleMetaStack(aBaseCore, 7, 1), - ItemUtils.simpleMetaStack(aBaseCore, 8, 1), }; - ItemStack[] aOutput = new ItemStack[] { ItemUtils.simpleMetaStack(aBaseCore, 0, 1), - ItemUtils.simpleMetaStack(aBaseCore, 1, 1), ItemUtils.simpleMetaStack(aBaseCore, 2, 1), - ItemUtils.simpleMetaStack(aBaseCore, 3, 1), ItemUtils.simpleMetaStack(aBaseCore, 4, 1), - ItemUtils.simpleMetaStack(aBaseCore, 5, 1), ItemUtils.simpleMetaStack(aBaseCore, 6, 1), - ItemUtils.simpleMetaStack(aBaseCore, 7, 1), ItemUtils.simpleMetaStack(aBaseCore, 8, 1), - ItemUtils.simpleMetaStack(aBaseCore, 9, 1), }; - - CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { CI.machineHull_HV, aOutput[1], aMat_A[1].getGear(2), aMat_B[2].getPlateDouble(8), - ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore" + ("1"), 2), - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(2), 5) }, - aMat_B[3].getFluidStack(144 * 8), // Input Fluid - GregtechItemList.Hatch_Control_Core.get(1), - 60 * 20 * 5, - MaterialUtils.getVoltageForTier(3)); - - for (int i = 0; i < 10; i++) { - ItemStack aPlateStack = aMat_A[i].getPlateDouble(8); - ItemStack aGearStack = aMat_B[i].getGear(2); - ItemStack aRodStack = aMat_A[i].getLongRod(8); - ItemStack aScrewStack = aMat_B[i].getScrew(32); - - if (!ItemUtils.checkForInvalidItems(aPlateStack)) { - aPlateStack = aMat_A[i].getPlate(16); - if (!ItemUtils.checkForInvalidItems(aPlateStack)) { - aPlateStack = aMat_B[i].getPlateDouble(8); - if (!ItemUtils.checkForInvalidItems(aPlateStack)) { - aPlateStack = aMat_B[i].getPlate(16); - } - } - } - if (!ItemUtils.checkForInvalidItems(aGearStack)) { - aGearStack = aMat_A[i].getGear(4); - } - if (!ItemUtils.checkForInvalidItems(aRodStack)) { - aRodStack = aMat_B[i].getLongRod(16); - } - if (!ItemUtils.checkForInvalidItems(aScrewStack)) { - aScrewStack = aMat_A[i].getScrew(32); - } - - CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { CI.getEnergyCore(i, 4), aPlateStack, aGearStack, aRodStack, aScrewStack, - ItemUtils.getItemStackOfAmountFromOreDict( - CI.getTieredCircuitOreDictName((int) (4 + Math.ceil((double) i / (double) 2))), - i * 2) }, - CI.getTieredFluid(i, 144 * 4 * (i + 1)), // Input Fluid - aOutput[i], - 60 * 20 * 1 * (i + 1), - MaterialUtils.getVoltageForTier(i)); - } - } - private static void energyCores() { ItemStack[] aBufferOutput = new ItemStack[] { RECIPE_Buffer_ULV, RECIPE_Buffer_LV, RECIPE_Buffer_MV, @@ -3369,34 +3245,6 @@ private static void fakeMachineCasingCovers() { } } - private static void ztonesCoverRecipes() { - if (!ZTones.isModLoaded()) { - return; - } - Class ModBlocksClass = ReflectionUtils.getClass("com.riciJak.Ztones.init.ModBlocks"); - Block agon = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "agonBlock")); - Block korp = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "korpBlock")); - Block jelt = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "jeltBlock")); - Block bitt = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "bittBlock")); - Block iszm = ReflectionUtils.getFieldValue(ReflectionUtils.getField(ModBlocksClass, "iszmBlock")); - - // "agon", "iszm", "korp", "jelt", "bitt" - - ItemStack[] aBlocks = new ItemStack[] { ItemUtils.getSimpleStack(agon), ItemUtils.getSimpleStack(iszm), - ItemUtils.getSimpleStack(korp), ItemUtils.getSimpleStack(jelt), ItemUtils.getSimpleStack(bitt) }; - MetaCustomCoverItem[] aCovers = new MetaCustomCoverItem[] { CoverManager.Cover_Agon, CoverManager.Cover_Iszm, - CoverManager.Cover_Korp, CoverManager.Cover_Jelt, CoverManager.Cover_Bitt }; - - ItemStack aInputs[][] = new ItemStack[5][16]; - ItemStack aOutputs[][] = new ItemStack[5][16]; - for (int a = 0; a < 5; a++) { - for (int i = 0; i < 16; i++) { - aInputs[a][i] = ItemUtils.simpleMetaStack(aBlocks[a].getItem(), i, 1); - aOutputs[a][i] = ItemUtils.simpleMetaStack(aCovers[a], i, 9); - } - } - } - private static void superBuses() { GregtechItemList[] mSuperBusesInput = new GregtechItemList[] { GregtechItemList.Hatch_SuperBus_Input_ULV, GregtechItemList.Hatch_SuperBus_Input_LV, GregtechItemList.Hatch_SuperBus_Input_MV, diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java index 54deeab3a8..229b7cc045 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Tools.java @@ -5,22 +5,15 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.RecipeUtils; public class RECIPES_Tools { // Outputs - public static ItemStack RECIPE_StaballoyPickaxe = new ItemStack(ModItems.itemStaballoyPickaxe); - public static ItemStack RECIPE_StaballoyAxe = new ItemStack(ModItems.itemStaballoyAxe); - public static ItemStack RECIPE_SandstoneHammer = new ItemStack(ModItems.itemSandstoneHammer); - // public static ItemStack RECIPE_StaballoyIngot = new ItemStack(ModItems.itemIngotStaballoy); public static ItemStack RECIPE_SandStone = new ItemStack(Blocks.sandstone, 2); public static ItemStack RECIPE_Sand = new ItemStack(Blocks.sand, 4); - public static ItemStack RECIPE_FireStarter = ItemUtils.getSimpleStack(ModItems.itemBasicFireMaker); public static ItemStack RECIPE_DivisionSigil; @@ -118,85 +111,8 @@ public class RECIPES_Tools { public static String craftingToolKnife = "craftingToolKnife"; public static String craftingToolScrewdriver = "craftingToolScrewdriver"; - public static ItemStack sandHammer = new ItemStack(ModItems.itemSandstoneHammer, 1, OreDictionary.WILDCARD_VALUE); - public static String craftingToolSandHammer = "craftingToolSandHammer"; - public static ItemStack personalCloakingDevice = ItemUtils.getSimpleStack(ModItems.itemPersonalCloakingDevice); public static String plateDoubleNiChrome = "plateDoubleNichrome"; public static String plateIridiumAlloy = "plateAlloyIridium"; - public static final void loadRecipes() { - - run(); - } - - private static void run() { - // Staballoy Pickaxe - RecipeUtils.addShapedRecipe( - plateStaballoy, - plateStaballoy, - ingotStaballoy, - craftingToolFile, - stickTungsten, - craftingToolHardHammer, - craftingToolWrench, - stickTungsten, - craftingToolHardHammer, - RECIPE_StaballoyPickaxe); - - // Staballoy Axe - RecipeUtils.addShapedRecipe( - plateStaballoy, - ingotStaballoy, - craftingToolHardHammer, - plateStaballoy, - stickTungsten, - craftingToolHardHammer, - craftingToolFile, - stickTungsten, - craftingToolWrench, - RECIPE_StaballoyAxe); - - // Cobble to Sand - RecipeUtils.addShapedRecipe( - CobbleStone, - CobbleStone, - CobbleStone, - CobbleStone, - sandHammer, - CobbleStone, - CobbleStone, - CobbleStone, - CobbleStone, - RECIPE_Sand); - - // Sand to Sandstone - RecipeUtils.addShapedRecipe(Sand, Sand, Sand, Sand, sandHammer, Sand, Sand, Sand, Sand, RECIPE_SandStone); - - // Sandstone Hammer - RecipeUtils.addShapedRecipe( - plateElectrum, - ingotElectrum, - plateElectrum, - craftingToolScrewdriver, - stickBronze, - craftingToolHardHammer, - null, - stickSteel, - null, - RECIPE_SandstoneHammer); - - // Basic Firemaker - RecipeUtils.addShapedRecipe( - "cropWheat", - "cropWheat", - "cropWheat", - ItemUtils.getSimpleStack(Items.string), - stickWood, - ItemUtils.getSimpleStack(Items.string), - "cropWheat", - "cropWheat", - "cropWheat", - RECIPE_FireStarter); - } } diff --git a/src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java b/src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java deleted file mode 100644 index cf13bab8c9..0000000000 --- a/src/main/java/gtPlusPlus/core/slots/SlotItemBackpackInv.java +++ /dev/null @@ -1,27 +0,0 @@ -package gtPlusPlus.core.slots; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import gtPlusPlus.core.item.base.BaseItemBackpack; - -public class SlotItemBackpackInv extends Slot { - - public SlotItemBackpackInv(final IInventory inv, final int index, final int xPos, final int yPos) { - super(inv, index, xPos, yPos); - } - - // This is the only method we need to override so that - // we can't place our inventory-storing Item within - // its own inventory (thus making it permanently inaccessible) - // as well as preventing abuse of storing backpacks within backpacks - /** - * Check if the stack is a valid item for this slot. - */ - @Override - public boolean isItemValid(final ItemStack itemstack) { - // Everything returns true except an instance of our Item - return !(itemstack.getItem() instanceof BaseItemBackpack); - } -} diff --git a/src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java b/src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java deleted file mode 100644 index 7d91852e80..0000000000 --- a/src/main/java/gtPlusPlus/core/slots/SlotModularBauble.java +++ /dev/null @@ -1,31 +0,0 @@ -package gtPlusPlus.core.slots; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import gtPlusPlus.core.item.bauble.ModularBauble; - -public class SlotModularBauble extends Slot { - - public SlotModularBauble(final IInventory inventory, final int slot, final int x, final int y) { - super(inventory, slot, x, y); - } - - @Override - public boolean isItemValid(final ItemStack itemstack) { - boolean isValid = false; - - if (itemstack != null) { - if (itemstack.getItem() instanceof ModularBauble) { - isValid = true; - } - } - return isValid; - } - - @Override - public int getSlotStackLimit() { - return 1; - } -} diff --git a/src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java b/src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java deleted file mode 100644 index 0c90a50b89..0000000000 --- a/src/main/java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java +++ /dev/null @@ -1,56 +0,0 @@ -package gtPlusPlus.core.slots; - -import static gtPlusPlus.core.tileentities.machines.TileEntityModularityTable.mValidUpgradeList; -import static gtPlusPlus.core.tileentities.machines.TileEntityModularityTable.mValidUpgradeListFormChange; - -import java.util.Iterator; -import java.util.Map.Entry; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers; - -public class SlotModularBaubleUpgrades extends Slot { - - public SlotModularBaubleUpgrades(final IInventory inventory, final int slot, final int x, final int y) { - super(inventory, slot, x, y); - } - - @Override - public boolean isItemValid(final ItemStack itemstack) { - boolean isValid = false; - if (itemstack != null) { - Logger.INFO("trying to insert " + itemstack.getDisplayName()); - Logger.INFO("Valid Upgrade count: " + mValidUpgradeList.size()); - - Iterator> it = mValidUpgradeListFormChange.entrySet().iterator(); - while (it.hasNext()) { - Entry pair = it.next(); - if (pair.getKey().getItem() == itemstack.getItem() - && pair.getKey().getItemDamage() == itemstack.getItemDamage()) { - isValid = true; - } - } - - Iterator>> it2 = mValidUpgradeList.entrySet().iterator(); - while (it2.hasNext()) { - Entry> pair = it2.next(); - if (pair.getKey().getItem() == itemstack.getItem() - && pair.getKey().getItemDamage() == itemstack.getItemDamage()) { - isValid = true; - } - } - } - return isValid; - } - - @Override - public int getSlotStackLimit() { - return 64; - } -} diff --git a/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java b/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java index f7ed248669..1cb6e5699c 100644 --- a/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java +++ b/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java @@ -6,21 +6,15 @@ import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox; import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer; import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest; -import gtPlusPlus.core.tileentities.general.TileEntityEggBox; -import gtPlusPlus.core.tileentities.general.TileEntityFirepit; import gtPlusPlus.core.tileentities.general.TileEntityFishTrap; import gtPlusPlus.core.tileentities.general.TileEntityInfiniteFluid; import gtPlusPlus.core.tileentities.general.TileEntityPlayerDoorBase; import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter; -import gtPlusPlus.core.tileentities.general.TileEntityXpConverter; import gtPlusPlus.core.tileentities.machines.TileEntityAdvPooCollector; -import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller; import gtPlusPlus.core.tileentities.machines.TileEntityPooCollector; import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable; import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; -import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; -import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner; public class ModTileEntities { @@ -29,13 +23,8 @@ public static void init() { GameRegistry.registerTileEntity(TileEntityPooCollector.class, "TileEntityPooCollector"); GameRegistry.registerTileEntity(TileEntityAdvPooCollector.class, "TileEntityAdvPooCollector"); GameRegistry.registerTileEntity(TileEntityFishTrap.class, "TileFishTrap"); - GameRegistry.registerTileEntity(TileEntityFirepit.class, "TileFirePit"); GameRegistry.registerTileEntity(TileEntityInfiniteFluid.class, "TileInfiniteFluid"); GameRegistry.registerTileEntity(TileEntityProjectTable.class, "TileProjectTable"); - GameRegistry.registerTileEntity(TileEntityTradeTable.class, "TileTradeTable"); - GameRegistry.registerTileEntity(TileEntityModularityTable.class, "TileEntityModularityTable"); - GameRegistry.registerTileEntity(TileEntityXpConverter.class, "TileEntityXpConverter"); - GameRegistry.registerTileEntity(TileEntityGenericSpawner.class, "TileEntityGenericSpawner"); GameRegistry.registerTileEntity(TileEntityCircuitProgrammer.class, "TileCircuitProgrammer"); GameRegistry.registerTileEntity(TileEntityPlayerDoorBase.class, "TilePlayerDoorBase"); GameRegistry.registerTileEntity(TileEntityDecayablesChest.class, "TileDecayablesChest"); @@ -43,7 +32,6 @@ public static void init() { GameRegistry.registerTileEntity(TileEntitySuperLight.class, "TileEntitySuperLight"); GameRegistry.registerTileEntity(TileEntityPestKiller.class, "TileEntityPestKiller"); GameRegistry.registerTileEntity(TileEntityRoundRobinator.class, "TileEntityRoundRobinator"); - GameRegistry.registerTileEntity(TileEntityEggBox.class, "TileEggBox"); GameRegistry.registerTileEntity(TileEntityVolumetricFlaskSetter.class, "TileEntityVolumetricFlaskSetter"); } diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java deleted file mode 100644 index 27a1c4ad0c..0000000000 --- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityEggBox.java +++ /dev/null @@ -1,365 +0,0 @@ -package gtPlusPlus.core.tileentities.general; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.inventories.Inventory_EggBox; -import gtPlusPlus.core.item.general.ItemGiantEgg; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class TileEntityEggBox extends TileEntity implements ISidedInventory { - - private final Inventory_EggBox inventoryContents; - - /** Determines if the check for adjacent chests has taken place. */ - public boolean adjacentChestChecked; - /** Contains the chest tile located adjacent to this one (if any) */ - public TileEntityEggBox adjacentChestZNeg; - /** Contains the chest tile located adjacent to this one (if any) */ - public TileEntityEggBox adjacentChestXPos; - /** Contains the chest tile located adjacent to this one (if any) */ - public TileEntityEggBox adjacentChestXNeg; - /** Contains the chest tile located adjacent to this one (if any) */ - public TileEntityEggBox adjacentChestZPos; - /** The current angle of the lid (between 0 and 1) */ - public float lidAngle; - /** The angle of the lid last tick */ - public float prevLidAngle; - /** The number of players currently using this chest */ - public int numPlayersUsing; - - private String customName; - - private int cachedChestType; - private int tickCount = 0; - - public TileEntityEggBox() { - this.inventoryContents = new Inventory_EggBox(); - } - - public Inventory_EggBox getInventory() { - return this.inventoryContents; - } - - @Override - public void updateEntity() { - - // Try do chesty stuff - try { - this.updateEntityChest(); - } catch (Throwable t) { - - } - - try { - if (!this.worldObj.isRemote) { - this.tickCount++; - if ((this.tickCount % 10) == 0) { - cachedChestType = 1; - } - - if ((this.tickCount % 20) == 0) { - for (ItemStack inv : this.getInventory().getInventory()) { - if (inv == null) { - continue; - } - if (inv.getItem() instanceof ItemGiantEgg) { - ItemGiantEgg D = (ItemGiantEgg) inv.getItem(); - tryUpdateDecayable(D, inv, this.worldObj); - } - } - } - updateSlots(); - } - } catch (final Throwable t) {} - } - - public void tryUpdateDecayable(final ItemGiantEgg d, ItemStack iStack, final World world) { - if (world == null || iStack == null) { - return; - } - if (world.isRemote) { - return; - } - - boolean a1, a2; - int u = 0; - a1 = d.isTicking(world, iStack); - a2 = false; - int SECONDS_TO_PROCESS = 1; - while (u < (20 * SECONDS_TO_PROCESS)) { - if (!a1) { - break; - } - a1 = d.isTicking(world, iStack); - a2 = d.tickItemTag(world, iStack); - u++; - } - Logger.MACHINE_INFO("| " + d.getUnlocalizedName() + " | " + a1 + "/" + a2); - - if (!a1 && !a2) { - ItemStack replacement = ItemUtils.getSimpleStack(d.getHatchResult(), 1); - replacement.stackSize = 1; - // iStack = replacement.copy(); - for (int fff = 0; fff < this.inventoryContents.getSizeInventory(); fff++) { - if (this.inventoryContents.getStackInSlot(fff) == iStack) { - this.inventoryContents.setInventorySlotContents(fff, replacement.copy()); - } - } - - updateSlots(); - this.inventoryContents.markDirty(); - } - } - - public boolean anyPlayerInRange() { - return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null; - } - - public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) { - if (!nbt.hasKey(tag)) { - nbt.setTag(tag, new NBTTagCompound()); - } - return nbt.getCompoundTag(tag); - } - - @Override - public void writeToNBT(final NBTTagCompound nbt) { - super.writeToNBT(nbt); - // Utils.LOG_WARNING("Trying to write NBT data to TE."); - final NBTTagCompound chestData = new NBTTagCompound(); - this.inventoryContents.writeToNBT(chestData); - nbt.setTag("ContentsChest", chestData); - if (this.hasCustomInventoryName()) { - nbt.setString("CustomName", this.getCustomName()); - } - } - - @Override - public void readFromNBT(final NBTTagCompound nbt) { - super.readFromNBT(nbt); - // Utils.LOG_WARNING("Trying to read NBT data from TE."); - this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest")); - if (nbt.hasKey("CustomName", 8)) { - this.setCustomName(nbt.getString("CustomName")); - } - } - - @Override - public int getSizeInventory() { - return this.getInventory().getSizeInventory(); - } - - @Override - public ItemStack getStackInSlot(final int slot) { - return this.getInventory().getStackInSlot(slot); - } - - @Override - public ItemStack decrStackSize(final int slot, final int count) { - return this.getInventory().decrStackSize(slot, count); - } - - @Override - public ItemStack getStackInSlotOnClosing(final int slot) { - return this.getInventory().getStackInSlotOnClosing(slot); - } - - @Override - public void setInventorySlotContents(final int slot, final ItemStack stack) { - this.getInventory().setInventorySlotContents(slot, stack); - } - - @Override - public int getInventoryStackLimit() { - return this.getInventory().getInventoryStackLimit(); - } - - @Override - public boolean isUseableByPlayer(final EntityPlayer entityplayer) { - return this.getInventory().isUseableByPlayer(entityplayer); - } - - @Override - public void openInventory() { - if (this.numPlayersUsing < 0) { - this.numPlayersUsing = 0; - } - if (!this.worldObj.isRemote) { - this.numPlayersUsing++; - cachedChestType = 1; - } - this.worldObj - .addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); - this.getInventory().openInventory(); - } - - @Override - public void closeInventory() { - if (!this.worldObj.isRemote) { - this.numPlayersUsing--; - cachedChestType = 1; - } - this.worldObj - .addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); - this.getInventory().closeInventory(); - } - - @Override - public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { - return this.getInventory().isItemValidForSlot(slot, itemstack); - } - - @Override - public int[] getAccessibleSlotsFromSide(final int p_94128_1_) { - final int[] accessibleSides = new int[this.getSizeInventory()]; - for (int r = 0; r < this.getInventory().getSizeInventory(); r++) { - accessibleSides[r] = r; - } - return accessibleSides; - } - - @Override - public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) { - return this.getInventory().isItemValidForSlot(0, p_102007_2_); - } - - @Override - public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) { - return this.getInventory().isItemValidForSlot(0, p_102008_2_); - } - - public String getCustomName() { - return this.customName; - } - - public void setCustomName(final String customName) { - this.customName = customName; - } - - @Override - public String getInventoryName() { - return this.hasCustomInventoryName() ? this.customName : "container.EggBox"; - } - - @Override - public boolean hasCustomInventoryName() { - return (this.customName != null) && !this.customName.equals(""); - } - - /** - * Causes the TileEntity to reset all it's cached values for it's container Block, metadata and in the case of - * chests, the adjacent chest check - */ - @Override - public void updateContainingBlockInfo() { - super.updateContainingBlockInfo(); - this.adjacentChestChecked = false; - } - - /** - * Performs the check for adjacent chests to determine if this chest is double or not. - */ - public void checkForAdjacentChests() { - if (!this.adjacentChestChecked) { - this.adjacentChestChecked = true; - this.adjacentChestZNeg = null; - this.adjacentChestXPos = null; - this.adjacentChestXNeg = null; - this.adjacentChestZPos = null; - } - } - - public void updateEntityChest() { - float f; - this.prevLidAngle = this.lidAngle; - f = 0.04F; - double d2; - if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F - && this.adjacentChestZNeg == null - && this.adjacentChestXNeg == null) { - double d1 = (double) this.xCoord + 0.5D; - d2 = (double) this.zCoord + 0.5D; - this.worldObj.playSoundEffect( - d1, - (double) this.yCoord + 0.5D, - d2, - "random.chestopen", - 0.5F, - this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - } - - if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) { - float f1 = this.lidAngle; - if (this.numPlayersUsing > 0) { - // this.lidAngle += f; - this.lidAngle += (float) (f * (1 + 0.10 * 0.01)); - } else { - // this.lidAngle -= f; - this.lidAngle -= (float) (f * (1 + 0.10 * 0.01)); - } - if (this.lidAngle > 1.0F) { - this.lidAngle = 1.0F; - } - float f2 = 0.5F; - if (this.lidAngle < f2 && f1 >= f2 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) { - d2 = (double) this.xCoord + 0.5D; - double d0 = (double) this.zCoord + 0.5D; - this.worldObj.playSoundEffect( - d2, - (double) this.yCoord + 0.5D, - d0, - "random.chestclosed", - 0.5F, - this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - } - - if (this.lidAngle < 0.0F) { - this.lidAngle = 0.0F; - } - } - } - - /** - * Called when a client event is received with the event number and argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) { - if (p_145842_1_ == 1) { - this.numPlayersUsing = p_145842_2_; - return true; - } else { - return super.receiveClientEvent(p_145842_1_, p_145842_2_); - } - } - - /** - * invalidates a tile entity - */ - @Override - public final void invalidate() { - super.invalidate(); - cachedChestType = 1; - this.updateContainingBlockInfo(); - this.checkForAdjacentChests(); - } - - private final int updateSlots() { - // Have slots changed? - if (cachedChestType == 0) { - return 0; - } - ItemUtils.organiseInventory(getInventory()); - cachedChestType = 0; - return cachedChestType; - } -} diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java deleted file mode 100644 index 08feceb192..0000000000 --- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java +++ /dev/null @@ -1,38 +0,0 @@ -package gtPlusPlus.core.tileentities.general; - -import java.util.UUID; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -public class TileEntityFirepit extends TileEntity { - - private UUID ownerUUID; - - public UUID getOwnerUUID() { - return this.ownerUUID; - } - - public void setOwnerUUID(final UUID ownerUUID) { - this.ownerUUID = ownerUUID; - this.markDirty(); - } - - @Override - public void writeToNBT(final NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - - final UUID ownerUUID = this.getOwnerUUID(); - if (ownerUUID != null) { - tagCompound.setLong("OwnerUUIDMost", ownerUUID.getMostSignificantBits()); - tagCompound.setLong("OwnerUUIDLeast", ownerUUID.getLeastSignificantBits()); - } - } - - @Override - public void readFromNBT(final NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - - this.setOwnerUUID(new UUID(tagCompound.getLong("OwnerUUIDMost"), tagCompound.getLong("OwnerUUIDLeast"))); - } -} diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java deleted file mode 100644 index 3e24c7fe96..0000000000 --- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityHeliumGenerator.java +++ /dev/null @@ -1,117 +0,0 @@ -package gtPlusPlus.core.tileentities.general; - -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -import gregtech.api.enums.GT_Values; -import gtPlusPlus.core.inventories.InventoryHeliumGenerator; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class TileEntityHeliumGenerator extends TileEntity { - - private int tickCount = 0; - private final InventoryHeliumGenerator inventoryContents; // TODO - private int locationX; - private int locationY; - private int locationZ; - private int baseTickRate = 1200; - - public TileEntityHeliumGenerator() { - this.inventoryContents = new InventoryHeliumGenerator(); // number of slots - without product slot - this.setTileLocation(); - } - - public boolean setTileLocation() { - if (this.hasWorldObj()) { - if (!this.getWorldObj().isRemote) { - this.locationX = this.xCoord; - this.locationY = this.yCoord; - this.locationZ = this.zCoord; - return true; - } - } - return false; - } - - public InventoryHeliumGenerator getInventory() { - return this.inventoryContents; - } - - public boolean tryAddLoot() { - if (this.getInventory().getInventory() != null) { - int checkingSlot = 0; - final ItemStack loot = this.generateLootForFishTrap(); - for (final ItemStack contents : this.getInventory().getInventory()) { - if (contents == null) { - this.getInventory().setInventorySlotContents(checkingSlot, loot); - this.markDirty(); - return true; - } else if (contents.getItem() == loot.getItem()) { - if (contents.stackSize < contents.getMaxStackSize()) { - contents.stackSize++; - this.markDirty(); - return true; - } else { - this.getInventory().setInventorySlotContents(checkingSlot, loot); - this.markDirty(); - return true; - } - } else { - - } - checkingSlot++; - } - } - this.markDirty(); - return false; - } - - private ItemStack generateLootForFishTrap() { - final int lootWeight = MathUtils.randInt(0, 1000); - ItemStack loot = GT_Values.NI; - if (lootWeight > 990) { - loot = ItemUtils.getSimpleStack(Items.slime_ball); - } - return loot; - } - - @Override - public void updateEntity() { - if (!this.worldObj.isRemote) {} - } - - public void calculateTickrate() { - int calculateTickrate = 0; - this.baseTickRate = calculateTickrate; - } - - public boolean anyPlayerInRange() { - return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null; - } - - public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) { - if (!nbt.hasKey(tag)) { - nbt.setTag(tag, new NBTTagCompound()); - } - return nbt.getCompoundTag(tag); - } - - @Override - public void writeToNBT(final NBTTagCompound nbt) { - super.writeToNBT(nbt); - // Utils.LOG_INFO("Trying to write NBT data to TE."); - final NBTTagCompound chestData = new NBTTagCompound(); - this.inventoryContents.writeToNBT(chestData); - nbt.setTag("ContentsChest", chestData); - } - - @Override - public void readFromNBT(final NBTTagCompound nbt) { - super.readFromNBT(nbt); - // Utils.LOG_INFO("Trying to read NBT data from TE."); - this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest")); - } -} diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java deleted file mode 100644 index 8fa0580158..0000000000 --- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityXpConverter.java +++ /dev/null @@ -1,297 +0,0 @@ -package gtPlusPlus.core.tileentities.general; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; - -import org.lwjgl.input.Keyboard; - -import gtPlusPlus.api.objects.minecraft.BTF_FluidTank; -import gtPlusPlus.core.tileentities.base.TileBasicTank; -import gtPlusPlus.core.util.minecraft.EnchantingUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; - -public class TileEntityXpConverter extends TileBasicTank { - - public BTF_FluidTank tankEssence = new BTF_FluidTank( - (int) (64000 * EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP)); - public BTF_FluidTank tankLiquidXp = new BTF_FluidTank(64000); - private boolean mConvertToEssence = true; - - public TileEntityXpConverter() { - super(4, 32000); - } - - private void changeMode() { - if (this.mConvertToEssence) { - this.mConvertToEssence = false; - return; - } else { - this.mConvertToEssence = true; - return; - } - } - - public float getAdjustedVolume() { - if (this.mConvertToEssence) { - if ((this.tankLiquidXp.getFluid() != null) && (this.tankLiquidXp.getFluidAmount() >= 100) - && (this.tankEssence.getFluidAmount() <= (this.tankEssence.getCapacity() - - (100 * EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP)))) { - final FluidStack bigStorage = EnchantingUtils.getEssenceFromLiquidXp(100); - this.tankEssence.fill(bigStorage, true); - this.tankLiquidXp.drain(100, true); - return (this.tankEssence.getCapacity() - this.tankEssence.getFluidAmount()); - } - } else { - final double rm = EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP; - if ((this.tankEssence.getFluid() != null) && (this.tankEssence.getFluidAmount() >= rm) - && (this.tankLiquidXp.getFluidAmount() <= (this.tankLiquidXp.getCapacity() - rm))) { - final FluidStack bigStorage = EnchantingUtils.getLiquidXP(1); - this.tankLiquidXp.fill(bigStorage, true); - this.tankEssence.drain((int) rm, true); - return (this.tankLiquidXp.getCapacity() - this.tankLiquidXp.getFluidAmount()); - } - } - return 0f; - } - - @Override - public void readFromNBT(final NBTTagCompound tag) { - this.tankEssence.readFromNBT(tag); - this.tankLiquidXp.readFromNBT(tag); - this.mConvertToEssence = tag.getBoolean("mConvertToEssence"); - super.readFromNBT(tag); - } - - @Override - public void writeToNBT(final NBTTagCompound tag) { - this.tankEssence.writeToNBT(tag); - this.tankLiquidXp.writeToNBT(tag); - tag.setBoolean("mConvertToEssence", this.mConvertToEssence); - super.writeToNBT(tag); - } - - @Override - public Packet getDescriptionPacket() { - final NBTTagCompound tag = new NBTTagCompound(); - this.writeToNBT(tag); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag); - } - - @Override - public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) { - final NBTTagCompound tag = pkt.func_148857_g(); - this.readFromNBT(tag); - } - - public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY, - final float aZ) { - if (this.isServerSide()) { - if (this.mConvertToEssence) { - PlayerUtils.messagePlayer(aPlayer, "Converting from Mob Essence to Liquid Xp."); - } else { - PlayerUtils.messagePlayer(aPlayer, "Converting from Liquid Xp to Mob Essence."); - } - // Mode Change - this.changeMode(); - } - } - - public void onRightClick(final byte aSide, final EntityPlayer aPlayer, final int aX, final int aY, final int aZ) { - if ((Keyboard.isKeyDown(42)) || (Keyboard.isKeyDown(54))) { - String mInput; - String mOutput; - - if (this.mConvertToEssence) { - mInput = "Liquid Xp"; - mOutput = "Mob Essence"; - } else { - mInput = "Mob Essence"; - mOutput = "Liquid Xp"; - } - - PlayerUtils.messagePlayer(aPlayer, "Input: " + mInput + "."); - PlayerUtils.messagePlayer(aPlayer, "Output: " + mOutput + "."); - } - } - - @Override - public boolean onPreTick(long aTick) { - boolean aSuperResult = super.onPreTick(aTick); - long aTankSpaceLeft = 0; - double aAmount = 0; - int aRuns = 0; - if (this.mConvertToEssence) { - aTankSpaceLeft = (this.tankEssence.getCapacity() - this.tankEssence.getFluidAmount()); - aAmount = EnchantingUtils.getEssenceFromLiquidXp(100).amount; - } else { - aTankSpaceLeft = (this.tankLiquidXp.getCapacity() - this.tankLiquidXp.getFluidAmount()); - aAmount = EnchantingUtils.RATIO_MOB_ESSENCE_TO_LIQUID_XP; - } - aRuns = (int) (aTankSpaceLeft / aAmount); - for (int i = 0; i < aRuns; i++) { - if (getAdjustedVolume() == 0) { - break; - } - } - return aSuperResult; - } - - @Override - public boolean isLiquidInput(ForgeDirection side) { - if (mConvertToEssence) { - if (side.offsetY != 0) { - return false; - } - } else { - if (side.offsetY != 0) { - return true; - } - } - return false; - } - - @Override - public boolean isLiquidOutput(ForgeDirection side) { - if (mConvertToEssence) { - if (side.offsetY != 0) { - return true; - } - } else { - if (side.offsetY != 0) { - return false; - } - } - return false; - } - - @Override - public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { - if (mConvertToEssence) { - if (aSide != ForgeDirection.UP && aSide != ForgeDirection.DOWN) { - return this.tankLiquidXp.fill(aFluid, doFill); - } - } else { - if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN) { - return this.tankEssence.fill(aFluid, doFill); - } - } - return 0; - } - - @Override - public FluidStack drain(ForgeDirection side, int maxDrain, boolean doDrain) { - if (mConvertToEssence) { - if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) { - return this.tankEssence.drain(maxDrain, doDrain); - } - } else { - if (side != ForgeDirection.UP && side != ForgeDirection.DOWN) { - return this.tankLiquidXp.drain(maxDrain, doDrain); - } - } - return null; - } - - @Override - public FluidStack drain(ForgeDirection side, FluidStack aFluid, boolean doDrain) { - if (mConvertToEssence) { - if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) { - return this.tankEssence.drain(aFluid, doDrain); - } - } else { - if (side != ForgeDirection.UP && side != ForgeDirection.DOWN) { - return this.tankLiquidXp.drain(aFluid, doDrain); - } - } - return null; - } - - @Override - public boolean canFill(ForgeDirection side, Fluid aFluid) { - if (mConvertToEssence) { - if (side != ForgeDirection.UP && side != ForgeDirection.DOWN) { - return this.tankLiquidXp.canTankBeFilled(); - } - } else { - if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) { - return this.tankEssence.canTankBeFilled(); - } - } - return false; - } - - @Override - public boolean canDrain(ForgeDirection side, Fluid aFluid) { - if (mConvertToEssence) { - if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) { - return this.tankEssence.canTankBeEmptied(); - } - } else { - if (side != ForgeDirection.UP && side != ForgeDirection.DOWN) { - return this.tankLiquidXp.canTankBeEmptied(); - } - } - return false; - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection side) { - if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) { - return new FluidTankInfo[] { this.tankEssence.getInfo() }; - } else { - return new FluidTankInfo[] { this.tankLiquidXp.getInfo() }; - } - } - - @Override - public FluidStack getFluid() { - if (mConvertToEssence) { - return this.tankEssence.getFluid(); - } else { - return this.tankLiquidXp.getFluid(); - } - } - - @Override - public int getFluidAmount() { - if (mConvertToEssence) { - return this.tankEssence.getFluidAmount(); - } else { - return this.tankLiquidXp.getFluidAmount(); - } - } - - @Override - public FluidTankInfo getInfo() { - if (mConvertToEssence) { - return this.tankEssence.getInfo(); - } else { - return this.tankLiquidXp.getInfo(); - } - } - - @Override - public int fill(FluidStack resource, boolean doFill) { - if (mConvertToEssence) { - return this.tankEssence.fill(resource, doFill); - } else { - return this.tankLiquidXp.fill(resource, doFill); - } - } - - @Override - public FluidStack drain(int maxDrain, boolean doDrain) { - if (mConvertToEssence) { - return this.tankEssence.drain(maxDrain, doDrain); - } else { - return this.tankLiquidXp.drain(maxDrain, doDrain); - } - } -} diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java deleted file mode 100644 index 45c20ce07d..0000000000 --- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityModularityTable.java +++ /dev/null @@ -1,482 +0,0 @@ -package gtPlusPlus.core.tileentities.machines; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -import gregtech.api.enums.ItemList; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.container.Container_ModularityTable; -import gtPlusPlus.core.inventories.modulartable.InventoryModularMain; -import gtPlusPlus.core.inventories.modulartable.InventoryModularOutput; -import gtPlusPlus.core.item.bauble.ModularBauble; -import gtPlusPlus.core.tileentities.base.TileEntityBase; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers; - -public class TileEntityModularityTable extends TileEntityBase implements ISidedInventory { - - public InventoryModularMain inventoryGrid; - public InventoryModularOutput inventoryOutputs; - public InventoryModularOutput mTempRecipeStorage; - private Container_ModularityTable container; - private String customName; - private int mRecipeTimeRemaining = -1; - - public TileEntityModularityTable() { - super(16); - this.inventoryGrid = new InventoryModularMain(); - this.inventoryOutputs = new InventoryModularOutput(); - this.mTempRecipeStorage = new InventoryModularOutput(); - this.canUpdate(); - generateAllValidUpgrades(); - } - - public void setContainer(Container_ModularityTable container_ModularityTable) { - this.container = container_ModularityTable; - } - - public Container_ModularityTable getContainer() { - return this.container; - } - - public int getRecipeTime() { - return this.mRecipeTimeRemaining; - } - - @Override - public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) { - if (!nbt.hasKey(tag)) { - nbt.setTag(tag, new NBTTagCompound()); - } - return nbt.getCompoundTag(tag); - } - - @Override - public void writeToNBT(final NBTTagCompound nbt) { - super.writeToNBT(nbt); - nbt.setInteger("mRecipeTime", this.mRecipeTimeRemaining); - this.inventoryOutputs.writeToNBT(this.getTag(nbt, "ContentsOutput")); - this.inventoryGrid.writeToNBT(this.getTag(nbt, "ContentsGrid")); - this.mTempRecipeStorage.writeToNBT(this.getTag(nbt, "ContentsRecipeTemp")); - if (this.hasCustomInventoryName()) { - nbt.setString("CustomName", this.getCustomName()); - } - } - - @Override - public void readFromNBT(final NBTTagCompound nbt) { - super.readFromNBT(nbt); - this.mRecipeTimeRemaining = nbt.getInteger("mRecipeTime"); - this.inventoryOutputs.readFromNBT(nbt.getCompoundTag("ContentsOutput")); - this.inventoryGrid.readFromNBT(nbt.getCompoundTag("ContentsGrid")); - this.mTempRecipeStorage.readFromNBT(nbt.getCompoundTag("ContentsRecipeTemp")); - if (nbt.hasKey("CustomName", 8)) { - this.setCustomName(nbt.getString("CustomName")); - } - } - - protected ItemStack mOutputStack; // Upgraded Bauble - protected ItemStack mInputstackA; // Bauble - protected ItemStack mInputstackB; // Upgrade - - public ItemStack getPendingOutputItem() { - this.mRecipeTimeRemaining--; - return this.mOutputStack; - } - - public ItemStack[] getCurrentInputItems() { - if (this.mRecipeTimeRemaining < 0) { - return null; - } else { - return new ItemStack[] { this.mInputstackA, this.mInputstackB }; - } - } - - public boolean setInputStacks(ItemStack tBauble, ItemStack tUpgrade) { - if (tBauble != null) { - this.mInputstackA = tBauble; - } else { - this.mInputstackA = null; - } - if (tUpgrade != null) { - this.mInputstackB = tBauble; - } else { - this.mInputstackB = null; - } - if (this.mInputstackA != null && this.mInputstackB != null) { - return true; - } - return false; - } - - public boolean setOutputStack(ItemStack mNewBauble) { - if (mNewBauble != null) { - this.mOutputStack = mNewBauble; - return true; - } else { - this.mOutputStack = null; - return false; - } - } - - public boolean clearRecipeData() { - this.mInputstackA = null; - this.mInputstackB = null; - this.mOutputStack = null; - return true; - } - - @Override - public boolean canUpdate() { - return true; - } - - public static Map> mValidUpgradeList = new HashMap>(); - public static Map mValidUpgradeListFormChange = new HashMap(); - - private static boolean generateAllValidUpgrades() { - - // Form Change - generateUpgradeFormData(ItemList.Sensor_MV.get(1), BT.TYPE_RING); - generateUpgradeFormData(ItemList.Electric_Piston_MV.get(1), BT.TYPE_BELT); - generateUpgradeFormData(ItemList.Emitter_MV.get(1), BT.TYPE_AMULET); - - // Damage Boost - generateUpgradeData(ItemList.Electric_Motor_LV.get(1), Modifiers.BOOST_DAMAGE, 1); - generateUpgradeData(ItemList.Electric_Motor_MV.get(1), Modifiers.BOOST_DAMAGE, 2); - generateUpgradeData(ItemList.Electric_Motor_HV.get(1), Modifiers.BOOST_DAMAGE, 3); - generateUpgradeData(ItemList.Electric_Motor_EV.get(1), Modifiers.BOOST_DAMAGE, 4); - generateUpgradeData(ItemList.Electric_Motor_IV.get(1), Modifiers.BOOST_DAMAGE, 5); - - // Defence Boost - generateUpgradeData( - ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateAluminium", 1), - Modifiers.BOOST_DEF, - 1); - generateUpgradeData( - ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateStainlessSteel", 1), - Modifiers.BOOST_DEF, - 2); - generateUpgradeData( - ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateTungsten", 1), - Modifiers.BOOST_DEF, - 3); - generateUpgradeData( - ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateTungstenSteel", 1), - Modifiers.BOOST_DEF, - 4); - generateUpgradeData( - ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateNaquadah", 1), - Modifiers.BOOST_DEF, - 5); - - // Hp Boost - generateUpgradeData(ItemUtils.simpleMetaStack(Items.golden_apple, 0, 1), Modifiers.BOOST_HP, 1); - generateUpgradeData(ItemUtils.simpleMetaStack(Items.golden_apple, 1, 1), Modifiers.BOOST_HP, 2); - generateUpgradeData(ItemUtils.simpleMetaStack(Items.nether_star, 0, 1), Modifiers.BOOST_HP, 3); - generateUpgradeData( - ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32725", 32725, 1), - Modifiers.BOOST_HP, - 4); - generateUpgradeData( - ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01:32726", 32726, 1), - Modifiers.BOOST_HP, - 5); - - return true; - } - - public static boolean generateUpgradeData(ItemStack tStack, Modifiers tMod, int tLevel) { - Pair tTemp = new Pair(tMod, tLevel); - if (mValidUpgradeList.put(tStack, tTemp) != null) { - return true; - } - return false; - } - - public static boolean generateUpgradeFormData(ItemStack tStack, BT tMod) { - if (mValidUpgradeListFormChange.put(tStack, tMod) != null) { - return true; - } - return false; - } - - public static boolean addUpgrade(ItemStack tStack, ItemStack tBauble) { - - try { - Iterator> it = mValidUpgradeListFormChange.entrySet().iterator(); - while (it.hasNext()) { - Entry pair = it.next(); - if (pair.getKey().getItem() == tStack.getItem() - && pair.getKey().getItemDamage() == tStack.getItemDamage()) { - ModularArmourUtils.setBaubleType(tBauble, pair.getValue()); - tBauble.setItemDamage(ModularArmourUtils.getBaubleTypeID(tBauble)); - return true; - } - } - } catch (Throwable t) { - - } - try { - Iterator>> it2 = mValidUpgradeList.entrySet().iterator(); - while (it2.hasNext()) { - Entry> pair = it2.next(); - if (pair.getKey().getItem() == tStack.getItem() - && pair.getKey().getItemDamage() == tStack.getItemDamage()) { - Pair newPair = pair.getValue(); - ModularArmourUtils.setModifierLevel(tBauble, newPair); - return true; - } - } - } catch (Throwable t) { - - } - return false; - } - - @Override - public int getSizeInventory() { - return 11; - } - - @Override - public ItemStack getStackInSlot(int slot) { - if (slot >= this.inventoryGrid.getSizeInventory()) { - return this.inventoryOutputs.getStackInSlot(slot - 9); - } else if (slot < this.inventoryGrid.getSizeInventory()) { - return this.inventoryGrid.getStackInSlot(slot); - } else { - return null; - } - } - - @Override - public ItemStack decrStackSize(int slot, int count) { - if (slot < this.inventoryGrid.getSizeInventory()) { - return this.inventoryGrid.decrStackSize(slot, count); - } else if (slot >= this.inventoryGrid.getSizeInventory()) { - return this.inventoryOutputs.decrStackSize(slot - 9, count); - } else { - return null; - } - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - return this.getStackInSlot(slot); - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - if (slot >= this.inventoryGrid.getSizeInventory()) { - this.inventoryOutputs.setInventorySlotContents(slot - 9, stack); - } else if (slot < this.inventoryGrid.getSizeInventory()) { - this.inventoryGrid.setInventorySlotContents(slot, stack); - } - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return true; - } - - @Override - public void openInventory() { - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); - this.inventoryGrid.openInventory(); - this.inventoryOutputs.openInventory(); - } - - @Override - public void closeInventory() { - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); - this.inventoryGrid.openInventory(); - this.inventoryOutputs.openInventory(); - } - - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemstack) { - if (slot >= this.inventoryGrid.getSizeInventory()) { - return this.inventoryOutputs.isItemValidForSlot(slot - 9, itemstack); - } else if (slot < this.inventoryGrid.getSizeInventory()) { - return this.inventoryGrid.isItemValidForSlot(slot, itemstack); - } else { - return false; - } - } - - @Override - public int[] getAccessibleSlotsFromSide(int side) { - int[] accessibleSides = new int[this.getSizeInventory()]; - for (int r = 0; r < this.getSizeInventory(); r++) { - accessibleSides[r] = r; - } - return accessibleSides; - } - - @Override - public boolean canInsertItem(int slot, ItemStack item, int side) { - Logger.INFO("Slot:" + slot + " | side? " + side); - - /* - * if (side == 1){ return this.inventoryOutputs.isItemValidForSlot(slot-9, item); } - */ - if (slot >= 9) { - return this.inventoryOutputs.isItemValidForSlot(slot - 9, item); - } else { - return this.inventoryGrid.isItemValidForSlot(slot, item); - } - } - - @Override - public boolean canExtractItem(int slot, ItemStack item, int side) { - Logger.INFO("Slot:" + slot + " | side? " + side); - if (slot == 11 || slot <= 8) { - return true; - } - return false; - } - - @Override - public String getCustomName() { - return this.customName; - } - - @Override - public void setCustomName(String customName) { - this.customName = customName; - } - - @Override - public String getInventoryName() { - return this.hasCustomInventoryName() ? this.customName : "container.fishtrap"; - } - - @Override - public boolean hasCustomInventoryName() { - return this.customName != null && !this.customName.equals(""); - } - - @Override - public boolean onPreTick(long aTick) { - // Check for active recipe - if (this.mRecipeTimeRemaining > -1 - || (this.mTempRecipeStorage != null) && (this.mTempRecipeStorage.getRecipeTime() > -1)) { - if ((this.mTempRecipeStorage != null) && this.mTempRecipeStorage.getRecipeTime() > -1) { - if (this.mRecipeTimeRemaining < this.mTempRecipeStorage.getRecipeTime()) { - this.mRecipeTimeRemaining = this.mTempRecipeStorage.getRecipeTime(); - this.markDirty(); - } - } - if (this.mInputstackA != null && this.mInputstackB != null && this.mOutputStack != null) { - this.mTempRecipeStorage.setInventorySlotContents(0, this.mInputstackA); - this.mTempRecipeStorage.setInventorySlotContents(1, this.mInputstackB); - this.mTempRecipeStorage.setInventorySlotContents(2, this.mOutputStack); - this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining); - this.markDirty(); - } - } - return true; - } - - @Override - public boolean onPostTick(long aTick) { - if (mRecipeTimeRemaining == 0) { - this.inventoryOutputs.setInventorySlotContents(2, this.getPendingOutputItem()); - clearRecipeData(); - this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining); - this.markDirty(); - } else if (mRecipeTimeRemaining > 0) { - mRecipeTimeRemaining--; - this.mTempRecipeStorage.setRecipeTime(this.mRecipeTimeRemaining); - } - return true; - } - - @Override - public boolean processRecipe() { - boolean removeInputA = false; - boolean removeInputB = false; - // Data stick - ItemStack tBauble = this.inventoryOutputs.getStackInSlot(0); - ItemStack tUpgrade = this.inventoryOutputs.getStackInSlot(1); - if (tBauble != null && tUpgrade != null && this.container != null) { - if (tBauble.getItem() instanceof ModularBauble && this.mRecipeTimeRemaining == -1) { - if (tUpgrade != null && tBauble != null) { - removeInputA = true; - this.setInputStacks(tBauble, tUpgrade); - try { - removeInputB = addUpgrade(tUpgrade, tBauble); - if (!removeInputB) {} - } catch (Throwable t) {} - if (removeInputA && removeInputB) { - if (this.setOutputStack(tBauble)) { - if (this.inventoryOutputs.getStackInSlot(1).stackSize > 1) { - ItemStack mTempStack = this.inventoryOutputs.getStackInSlot(1); - mTempStack.stackSize--; - this.inventoryOutputs.setInventorySlotContents(1, mTempStack); - } else { - this.inventoryOutputs.setInventorySlotContents(1, null); - } - this.inventoryOutputs.setInventorySlotContents(0, null); - this.mRecipeTimeRemaining = 80; - this.markDirty(); - return true; - } - } - } - } - } - return false; - } - - public static boolean isValidModularPiece(final ItemStack itemstack) { - if (itemstack.getItem() instanceof ModularBauble) { - return true; - } - return false; - } - - public static boolean isValidUpgrade(final ItemStack itemstack) { - boolean isValid = false; - if (itemstack != null) { - Iterator> it = mValidUpgradeListFormChange.entrySet().iterator(); - while (it.hasNext()) { - Entry pair = it.next(); - if (pair.getKey().getItem() == itemstack.getItem() - && pair.getKey().getItemDamage() == itemstack.getItemDamage()) { - isValid = true; - } - } - Iterator>> it2 = mValidUpgradeList.entrySet().iterator(); - while (it2.hasNext()) { - Entry> pair = it2.next(); - if (pair.getKey().getItem() == itemstack.getItem() - && pair.getKey().getItemDamage() == itemstack.getItemDamage()) { - isValid = true; - } - } - } - return isValid; - } -} diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java index 0d74b69fb2..0229f89402 100644 --- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java +++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityProjectTable.java @@ -4,7 +4,6 @@ import java.util.Vector; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; @@ -17,11 +16,6 @@ import gtPlusPlus.core.container.Container_ProjectTable; import gtPlusPlus.core.inventories.projecttable.InventoryProjectMain; import gtPlusPlus.core.inventories.projecttable.InventoryProjectOutput; -import gtPlusPlus.core.item.bauble.ModularBauble; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils.Modifiers; import gtPlusPlus.core.util.minecraft.NBTUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems; @@ -165,136 +159,6 @@ public void updateEntity() { } } - // Utils.LOG_INFO("Doing thing 1"); - if (dataStick != null) if (dataStick.getItem() instanceof ModularBauble) { - Logger.INFO("Doing thing 2"); - ItemStack tBauble = dataStick; - dataStick = null; - this.inventoryOutputs.setInventorySlotContents(0, dataStick); - if (this.inventoryGrid != null) { - Logger.INFO("Doing things"); - ItemStack[] tStack = container.getInputComponents(); - if (tStack != null) { - // Utils.LOG_INFO(""+tStack.length); - if (tBauble != null) { - for (int i = 0; i < tStack.length; i++) { - - ItemStack testStack; - if ((testStack = container.inventoryGrid.getStackInSlot(i)) != null) { - Logger.INFO("FOUND: " + testStack.getDisplayName()); - } - - if (tStack[i] != null) { - Logger.INFO("found " + tStack[i].getDisplayName()); - try { - if (tStack[i].getItem() == Items.feather) { - ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_BELT); - Logger.INFO("buffed Modular bauble"); - tStack[i] = null; - container.inventoryGrid.setInventorySlotContents(i, null); - this.inventoryGrid.setInventorySlotContents(i, null); - } - if (tStack[i].getItem() == Items.bed) { - ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_RING); - Logger.INFO("buffed Modular bauble"); - tStack[i] = null; - container.inventoryGrid.setInventorySlotContents(i, null); - this.inventoryGrid.setInventorySlotContents(i, null); - } - if (tStack[i].getItem() == Items.boat) { - ModularArmourUtils.setBaubleType(tBauble, BT.TYPE_AMULET); - Logger.INFO("buffed Modular bauble"); - tStack[i] = null; - container.inventoryGrid.setInventorySlotContents(i, null); - this.inventoryGrid.setInventorySlotContents(i, null); - } - - if (tStack[i].getItem() == Items.egg) { - ModularArmourUtils.setModifierLevel( - tBauble, - Modifiers.BOOST_HOLY, - ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_HOLY) - + 1); - Logger.INFO("buffed Modular bauble"); - tStack[i] = null; - container.inventoryGrid.setInventorySlotContents(i, null); - this.inventoryGrid.setInventorySlotContents(i, null); - } - - if (tStack[i].getItem() == Items.baked_potato) { - ModularArmourUtils.setModifierLevel( - tBauble, - Modifiers.BOOST_DEF, - ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DEF) - + 1); - Logger.INFO("buffed Modular bauble"); - tStack[i] = null; - container.inventoryGrid.setInventorySlotContents(i, null); - this.inventoryGrid.setInventorySlotContents(i, null); - } - - if (tStack[i].getItem() == Items.cooked_beef) { - ModularArmourUtils.setModifierLevel( - tBauble, - Modifiers.BOOST_HP, - ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_HP) - + 1); - Logger.INFO("buffed Modular bauble"); - tStack[i] = null; - container.inventoryGrid.setInventorySlotContents(i, null); - this.inventoryGrid.setInventorySlotContents(i, null); - } - - if (tStack[i] == ItemUtils - .simpleMetaStack("gregtech:gt.metaitem.01:17019", 17019, 1)) { - ModularArmourUtils.setModifierLevel( - tBauble, - Modifiers.BOOST_DEF, - ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DEF) - + 1); - Logger.INFO("buffed Modular bauble"); - tStack[i] = null; - container.inventoryGrid.setInventorySlotContents(i, null); - } - if (tStack[i] == ItemList.Electric_Motor_LV.get(1)) { - ModularArmourUtils.setModifierLevel( - tBauble, - Modifiers.BOOST_DAMAGE, - ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DAMAGE) - + 1); - Logger.INFO("buffed Modular bauble"); - tStack[i] = null; - container.inventoryGrid.setInventorySlotContents(i, null); - } else if (tStack[i] == ItemList.Electric_Motor_MV.get(1)) { - ModularArmourUtils.setModifierLevel( - tBauble, - Modifiers.BOOST_DAMAGE, - ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DAMAGE) - + 2); - Logger.INFO("buffed Modular bauble"); - tStack[i] = null; - container.inventoryGrid.setInventorySlotContents(i, null); - } else if (tStack[i] == ItemList.Electric_Motor_HV.get(1)) { - ModularArmourUtils.setModifierLevel( - tBauble, - Modifiers.BOOST_DAMAGE, - ModularArmourUtils.getModifierLevel(tBauble, Modifiers.BOOST_DAMAGE) - + 3); - Logger.INFO("buffed Modular bauble"); - tStack[i] = null; - container.inventoryGrid.setInventorySlotContents(i, null); - } - } catch (Throwable t) { - - } - } - } - Logger.INFO("set new Modular bauble"); - this.inventoryOutputs.setInventorySlotContents(1, tBauble); - } - } - } - } } super.updateEntity(); } diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java deleted file mode 100644 index bf3a3c704e..0000000000 --- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityTradeTable.java +++ /dev/null @@ -1,123 +0,0 @@ -package gtPlusPlus.core.tileentities.machines; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -import gtPlusPlus.core.container.Container_TradeTable; -import gtPlusPlus.core.inventories.tradetable.InventoryTradeMain; -import gtPlusPlus.core.inventories.tradetable.InventoryTradeOutput; -import gtPlusPlus.core.tileentities.base.TileEntityBase; -import gtPlusPlus.core.util.minecraft.NBTUtils; - -public class TileEntityTradeTable extends TileEntityBase { - - public InventoryTradeMain inventoryGrid; - public InventoryTradeOutput inventoryOutputs; - - private Container_TradeTable container; - - public TileEntityTradeTable() { - super(2); - this.inventoryGrid = new InventoryTradeMain(); // number of slots - without product slot - this.inventoryOutputs = new InventoryTradeOutput(); // number of slots - without product slot - } - - public void setContainer(Container_TradeTable container_TradeTable) { - this.container = container_TradeTable; - } - - @Override - public void writeToNBT(final NBTTagCompound nbt) { - super.writeToNBT(nbt); - this.inventoryGrid.writeToNBT(this.getTag(nbt, "ContentsGrid")); - this.inventoryOutputs.writeToNBT(this.getTag(nbt, "ContentsOutput")); - } - - @Override - public void readFromNBT(final NBTTagCompound nbt) { - this.inventoryGrid.readFromNBT(nbt); - this.inventoryOutputs.readFromNBT(nbt); - super.readFromNBT(nbt); - } - - @Override - public void updateEntity() { - if (!this.worldObj.isRemote) { - ItemStack slot0; - try { - - slot0 = this.inventoryOutputs.getStackInSlot(0); - if (slot0 != null && slot0.hasTagCompound()) { - NBTUtils.tryIterateNBTData(slot0); - this.inventoryOutputs.setInventorySlotContents(0, null); - this.inventoryOutputs.setInventorySlotContents(1, slot0); - } - - } catch (Throwable t) { - t.printStackTrace(); - this.inventoryOutputs.setInventorySlotContents(0, null); - } - } - super.updateEntity(); - } - - @Override - public int getSizeInventory() { - return 0; - } - - @Override - public ItemStack getStackInSlot(int p_70301_1_) { - return null; - } - - @Override - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { - return null; - } - - @Override - public ItemStack getStackInSlotOnClosing(int p_70304_1_) { - return null; - } - - @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {} - - @Override - public int getInventoryStackLimit() { - return 64; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return true; - } - - @Override - public void openInventory() {} - - @Override - public void closeInventory() {} - - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return false; - } - - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return new int[] {}; - } - - @Override - public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int side) { - return false; - } - - @Override - public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/util/Utils.java b/src/main/java/gtPlusPlus/core/util/Utils.java index 5908941dfc..2b6ad41f13 100644 --- a/src/main/java/gtPlusPlus/core/util/Utils.java +++ b/src/main/java/gtPlusPlus/core/util/Utils.java @@ -1,15 +1,8 @@ package gtPlusPlus.core.util; import java.awt.*; -import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.IOException; -import java.io.ObjectOutput; -import java.io.ObjectOutputStream; import java.lang.reflect.Method; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -18,8 +11,6 @@ import java.util.Timer; import java.util.TimerTask; -import javax.xml.bind.DatatypeConverter; - import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; @@ -42,8 +33,6 @@ import org.apache.commons.lang3.EnumUtils; import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -57,13 +46,10 @@ import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.NBTUtils; -import gtPlusPlus.core.util.sys.SystemUtils; -import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner; import ic2.core.Ic2Items; import ic2.core.init.InternalName; import ic2.core.item.resources.ItemCell; @@ -659,28 +645,7 @@ public static ToolMaterial generateToolMaterialFromGT(final Materials gtMaterial return temp; } - public static ToolMaterial generateToolMaterial(final Material material) { - final String name = material.getLocalizedName(); - final int harvestLevel = material.vHarvestLevel; - final int durability = (int) material.vDurability; - final float damage = material.vToolQuality; - final int efficiency = material.vToolQuality; - // int enchantability = material.mEnchantmentToolsLevel; - Logger.INFO( - "ToolMaterial stats for " + material.getLocalizedName() - + " | harvestLevel:" - + harvestLevel - + " | durability:" - + durability - + " | toolQuality:" - + damage - + " | toolSpeed:" - + damage); - final ToolMaterial temp = EnumHelper.addToolMaterial(name, harvestLevel, durability, efficiency, damage, 0); - return temp; - } - - public static enum Versioning { + public enum Versioning { EQUAL(0), NEWER(1), @@ -688,7 +653,7 @@ public static enum Versioning { private final int versioningInfo; - private Versioning(final int versionStatus) { + Versioning(final int versionStatus) { this.versioningInfo = versionStatus; } @@ -746,13 +711,12 @@ public static ItemStack getWrittenBook(final ItemStack aBook, final int aID, fin Logger.INFO("WARNING: String for written Book too long! -> " + aPages[i]); GT_Log.err.println( new StringBuilder().append("WARNING: String for written Book too long! -> ") - .append(aPages[i]).toString()); + .append(aPages[i])); } } else { Logger.INFO("WARNING: Too much Pages for written Book! -> " + aTitle); GT_Log.err.println( - new StringBuilder().append("WARNING: Too much Pages for written Book! -> ").append(aTitle) - .toString()); + new StringBuilder().append("WARNING: Too much Pages for written Book! -> ").append(aTitle)); break; } } @@ -765,100 +729,17 @@ public static ItemStack getWrittenBook(final ItemStack aBook, final int aID, fin rStack.setTagCompound(tNBT); GT_Log.out.println( new StringBuilder().append("GT++_Mod: Added Book to Book++ List - Mapping: '").append(aMapping) - .append("' - Name: '").append(aTitle).append("' - Author: '").append(aAuthor).append("'") - .toString()); + .append("' - Name: '").append(aTitle).append("' - Author: '").append(aAuthor).append("'")); NBTUtils.createIntegerTagCompound(rStack, "stats", "mMeta", vMeta); CORE.sBookList.put(aMapping, rStack); Logger.INFO("Creating book: " + aTitle + " by " + aAuthor + ". Using Meta " + vMeta + "."); return GT_Utility.copy(new Object[] { rStack }); } - public static SecureRandom generateSecureRandom() { - SecureRandom secRan; - String secRanType; - - if (SystemUtils.isWindows()) { - secRanType = "Windows-PRNG"; - } else { - secRanType = "NativePRNG"; - } - try { - secRan = SecureRandom.getInstance(secRanType); - // Default constructor would have returned insecure SHA1PRNG algorithm, so make an explicit call. - byte[] b = new byte[64]; - secRan.nextBytes(b); - return secRan; - } catch (NoSuchAlgorithmException e) { - return null; - } - } - - public static String calculateChecksumMD5(Object bytes) { - byte[] result = new byte[] {}; - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutput out = null; - try { - out = new ObjectOutputStream(bos); - out.writeObject(bytes); - out.flush(); - result = bos.toByteArray(); - } catch (IOException e) {} finally { - try { - bos.close(); - } catch (IOException e) {} - } - return calculateChecksumMD5(result); - } - - public static String calculateChecksumMD5(byte[] bytes) { - MessageDigest md; - try { - md = MessageDigest.getInstance("MD5"); - md.update(bytes); - byte[] digest = md.digest(); - String myHash = DatatypeConverter.printHexBinary(digest).toUpperCase(); - return myHash; - } catch (NoSuchAlgorithmException e) { - return null; - } - } - - public static boolean createNewMobSpawner(int aID, Entity aEntity) { - if (aEntity instanceof Entity) { - Class c = aEntity.getClass(); - return createNewMobSpawner(aID, c); - } - return false; - } - - public static boolean createNewMobSpawner(int aID, Class aEntity) { - Logger.INFO("[Spawn] Generating new spawner for entity with class (" + aEntity.getSimpleName() + ")."); - if (TileEntityGenericSpawner.registerNewMobSpawner(aID, (Class) aEntity)) { - EntityRegistration x = EntityRegistry.instance().lookupModSpawn((Class) aEntity, true); - if (x != null) { - Logger.INFO("[Spawn] Registration for " + x.getEntityName() + " successful"); - return true; - } else { - Logger.INFO("[Spawn] Registration for " + aEntity.getSimpleName() + " successful"); - return true; - } - } - Logger.INFO("[Spawn] Mob Spawner creation for " + aEntity.getName() + " failed"); - return false; - } - public static long getMillisSince(long aStartTime, long aCurrentTime) { return (aCurrentTime - aStartTime); } - public static long getSecondsFromMillis(long aMillis) { - return (aMillis / 1000); - } - - public static long getTicksFromSeconds(long aSeconds) { - return (aSeconds * 20); - } - public static byte getTier(long l) { byte i = -1; do { diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java index 58832e095b..6e9bd64c61 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -1,9 +1,6 @@ package gtPlusPlus.core.util.minecraft; -import static gregtech.api.enums.Mods.GTPlusPlus; -import static gregtech.api.enums.Mods.GregTech; -import static gregtech.api.enums.Mods.IndustrialCraft2; -import static gregtech.api.enums.Mods.Minecraft; +import static gregtech.api.enums.Mods.*; import java.util.ArrayList; import java.util.HashMap; @@ -16,7 +13,6 @@ import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; -import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -42,13 +38,9 @@ import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.base.BasicSpawnEgg; import gtPlusPlus.core.item.base.dusts.BaseItemDustUnique; -import gtPlusPlus.core.item.base.dusts.decimal.BaseItemCentidust; -import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust; import gtPlusPlus.core.item.base.plates.BaseItemPlate_OLD; import gtPlusPlus.core.item.chemistry.AgriculturalChem; import gtPlusPlus.core.item.chemistry.GenericChem; -import gtPlusPlus.core.item.tool.staballoy.MultiPickaxeBase; -import gtPlusPlus.core.item.tool.staballoy.MultiSpadeBase; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.recipe.common.CI; @@ -103,31 +95,12 @@ public static ItemStack getSimpleStack(final ItemStack x, final int i) { public static final int WILDCARD_VALUE = Short.MAX_VALUE; - public static ItemStack getWildcardStack(final Item x) { - final ItemStack y = new ItemStack(x, 1, WILDCARD_VALUE); - return y; - } - public static ItemStack getWildcardStack(final ItemStack x) { - final ItemStack y = ItemUtils.simpleMetaStack(x, WILDCARD_VALUE, 1); - return y; - } - - public static ItemStack getIC2Cell(final String S) { - final ItemStack moreTemp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + S, 1); - - if (moreTemp == null) { - final int cellID = 0; - final ItemStack temp = GT_ModHandler.getModItem(IndustrialCraft2.ID, "itemCellEmpty", 1L, cellID); - return temp != null ? temp : null; - } - - return moreTemp; + return ItemUtils.simpleMetaStack(x, WILDCARD_VALUE, 1); } public static ItemStack getIC2Cell(final int meta) { - final ItemStack temp = GT_ModHandler.getModItem(IndustrialCraft2.ID, "itemCellEmpty", 1L, meta); - return temp != null ? temp : null; + return GT_ModHandler.getModItem(IndustrialCraft2.ID, "itemCellEmpty", 1L, meta); } public static ItemStack getEmptyCell() { @@ -241,14 +214,7 @@ public static ItemStack simpleMetaStack(final Item item, int meta, int size) { if (size < 0 || size > 64) { size = 1; } - // Logger.INFO("Found Metastack: " + item.getUnlocalizedName() + ":" + meta); - // Logger.INFO(""+ReflectionUtils.getMethodName(0)); - // Logger.INFO(""+ReflectionUtils.getMethodName(1)); - // Logger.INFO(""+ReflectionUtils.getMethodName(2)); - // Logger.INFO(""+ReflectionUtils.getMethodName(3)); - // Logger.INFO(""+ReflectionUtils.getMethodName(4)); - final ItemStack metaStack = new ItemStack(item, size, meta); - return metaStack; + return new ItemStack(item, size, meta); } public static ItemStack simpleMetaStack(final Block block, final int meta, final int size) { @@ -580,164 +546,6 @@ public static Item[] generateSpecialUseDusts(final Material material, final bool return output; } - public static MultiPickaxeBase generateMultiPick(final boolean GT_Durability, final Materials material) { - final ToolMaterial customMaterial = Utils.generateToolMaterialFromGT(material); - final int enchantLevel = material.mEnchantmentToolsLevel; - final Object enchant = new Pair(material.mEnchantmentTools, enchantLevel); - return generateMultiPick( - GT_Durability, - customMaterial, - material.mDefaultLocalName, - material.mDurability, - material.mRGBa, - enchant); - } - - public static MultiPickaxeBase generateMultiPick(final Material material) { - final ToolMaterial customMaterial = Utils.generateToolMaterial(material); - return generateMultiPick( - true, - customMaterial, - material.getLocalizedName(), - (int) material.vDurability, - material.getRGBA(), - null); - } - - public static MultiPickaxeBase generateMultiPick(final boolean GT_Durability, final ToolMaterial customMaterial, - final String name, final int durability, final short[] rgba, final Object enchantment) { - Logger.WARNING("Generating a Multi-Pick out of " + name); - final short[] rgb = rgba; - int dur = customMaterial.getMaxUses(); - Logger.WARNING("Determined durability for " + name + " is " + dur); - if (GT_Durability) { - dur = durability * 100; - Logger.WARNING("Using gregtech durability value, " + name + " is now " + dur + "."); - } else if (dur <= 0) { - dur = durability; - Logger.WARNING( - "Determined durability too low, " + name - + " is now " - + dur - + " based on the GT material durability."); - } - if (dur <= 0) { - Logger.WARNING("Still too low, " + name + " will now go unused."); - return null; - } - - Object enchant; - if (enchantment != null) { - if (enchantment instanceof Pair) { - enchant = enchantment; - } - } else { - enchant = null; - } - - final MultiPickaxeBase MP_Redstone = new MultiPickaxeBase( - name + " Multipick", - (customMaterial), - dur, - Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]), - enchantment); - - if (MP_Redstone.isValid) { - return MP_Redstone; - } - Logger.WARNING("Pickaxe was not valid."); - return null; - } - - public static MultiSpadeBase generateMultiShovel(final boolean GT_Durability, final Materials material) { - final ToolMaterial customMaterial = Utils.generateToolMaterialFromGT(material); - return generateMultiShovel( - GT_Durability, - customMaterial, - material.mDefaultLocalName, - material.mDurability, - material.mRGBa); - } - - public static MultiSpadeBase generateMultiShovel(final Material material) { - final ToolMaterial customMaterial = Utils.generateToolMaterial(material); - return generateMultiShovel( - true, - customMaterial, - material.getLocalizedName(), - (int) material.vDurability, - material.getRGBA()); - } - - public static MultiSpadeBase generateMultiShovel(final boolean GT_Durability, final ToolMaterial customMaterial, - final String name, final int durability, final short[] rgba) { - Logger.WARNING("Generating a Multi-Spade out of " + name); - final short[] rgb = rgba; - int dur = customMaterial.getMaxUses(); - Logger.WARNING("Determined durability for " + name + " is " + dur); - if (GT_Durability) { - dur = durability * 100; - Logger.WARNING("Using gregtech durability value, " + name + " is now " + dur + "."); - } else if (dur <= 0) { - dur = durability; - Logger.WARNING( - "Determined durability too low, " + name - + " is now " - + dur - + " based on the GT material durability."); - } - if (dur <= 0) { - Logger.WARNING("Still too low, " + name + " will now go unused."); - return null; - } - final MultiSpadeBase MP_Redstone = new MultiSpadeBase( - name + " Multispade", - (customMaterial), - dur, - Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2])); - - if (MP_Redstone.isValid) { - return MP_Redstone; - } - return null; - } - - public static BaseItemDecidust generateDecidust(final Materials material) { - if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null) { - final Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material); - if (placeholder != null) { - generateDecidust(placeholder); - } - } - return null; - } - - public static BaseItemDecidust generateDecidust(final Material material) { - if ((material.getDust(1) != null) && MaterialUtils.hasValidRGBA(material.getRGBA())) { - final BaseItemDecidust Decidust = new BaseItemDecidust(material); - return Decidust; - } - return null; - } - - public static BaseItemCentidust generateCentidust(final Materials material) { - if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null) { - final Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material); - if (placeholder != null) { - generateCentidust(placeholder); - } - } - return null; - } - - public static BaseItemCentidust generateCentidust(final Material material) { - if ((material.getDust(1) != null) && MaterialUtils.hasValidRGBA(material.getRGBA())) { - final BaseItemCentidust Centidust = new BaseItemCentidust(material); - return Centidust; - } - return null; - } - public static boolean isRadioactive(final String materialName) { int sRadiation = 0; if (materialName.toLowerCase().contains("uranium")) { diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java index 3fdef9f94f..36c630051b 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java @@ -22,7 +22,6 @@ import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes; import gtPlusPlus.core.item.base.foil.BaseItemFoil; -import gtPlusPlus.core.item.base.plates.BaseItemPlateHeavy; import gtPlusPlus.core.item.base.wire.BaseItemFineWire; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; @@ -382,9 +381,7 @@ public static void generateComponentAndAssignToAMaterial(ComponentTypes aType, M public static void generateComponentAndAssignToAMaterial(ComponentTypes aType, Material aMaterial, boolean generateRecipes) { Item aGC; - if (aType == ComponentTypes.PLATEHEAVY) { - aGC = new BaseItemPlateHeavy(aMaterial); - } else if (aType == ComponentTypes.FINEWIRE) { + if (aType == ComponentTypes.FINEWIRE) { aGC = new BaseItemFineWire(aMaterial); } else if (aType == ComponentTypes.FOIL) { aGC = new BaseItemFoil(aMaterial); diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java index 74b0ad6a62..2be3f781a3 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/PlayerUtils.java @@ -194,24 +194,6 @@ public static final UUID getPlayersUUIDByName(final String aPlayerName) { return null; } - @SideOnly(Side.CLIENT) - public static final boolean isPlayerAlkalus() { - if (Utils.isServer()) { - return false; - } - return isPlayerAlkalus(Minecraft.getMinecraft().thePlayer); - } - - public static final boolean isPlayerAlkalus(EntityPlayer player) { - if (player != null) { - if (player.getDisplayName().toLowerCase().equals("draknyte1") - || player.getDisplayName().toLowerCase().equals("alkalus")) { - return true; - } - } - return false; - } - public static void messageAllPlayers(String string) { Utils.sendServerMessage(string); } diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java b/src/main/java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java index 42f3587b0d..0c3d7d2867 100644 --- a/src/main/java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java +++ b/src/main/java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java @@ -2,7 +2,6 @@ import gtPlusPlus.api.interfaces.IPlugin; import gtPlusPlus.plugin.agrichem.block.AgrichemFluids; -import gtPlusPlus.plugin.agrichem.fluids.FluidLoader; import gtPlusPlus.plugin.manager.Core_Manager; // Called by Core_Manager#veryEarlyInit @@ -19,10 +18,7 @@ public class Core_Agrichem implements IPlugin { @Override public boolean preInit() { - mInstance.log("Generating Fluids"); - FluidLoader.generate(); AgrichemFluids.init(); - mInstance.log("Generating Items"); return true; } diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/fluids/FluidLoader.java b/src/main/java/gtPlusPlus/plugin/agrichem/fluids/FluidLoader.java deleted file mode 100644 index f8982ffbad..0000000000 --- a/src/main/java/gtPlusPlus/plugin/agrichem/fluids/FluidLoader.java +++ /dev/null @@ -1,19 +0,0 @@ -package gtPlusPlus.plugin.agrichem.fluids; - -import gtPlusPlus.core.fluids.FluidFactory; - -public class FluidLoader { - - private static final int ID_DIRTY_WATER = 50; - private static final int ID_RAW_SEWERAGE = 51; - private static final int ID_GUANO = 52; - private static final int ID_POOPJUICE = 53; - - public static void generate() { - - FluidFactory.generate(ID_DIRTY_WATER, "dirtywater", new short[] { 25, 25, 180 }); - FluidFactory.generate(ID_RAW_SEWERAGE, "sewerage", new short[] { 100, 45, 25 }); - FluidFactory.generate(ID_GUANO, "guano", new short[] { 175, 175, 180 }); - FluidFactory.generate(ID_POOPJUICE, "poo", new short[] { 75, 45, 10 }); - } -} diff --git a/src/main/java/gtPlusPlus/plugin/villagers/Core_VillagerAdditions.java b/src/main/java/gtPlusPlus/plugin/villagers/Core_VillagerAdditions.java deleted file mode 100644 index 1ea7bc02ba..0000000000 --- a/src/main/java/gtPlusPlus/plugin/villagers/Core_VillagerAdditions.java +++ /dev/null @@ -1,113 +0,0 @@ -package gtPlusPlus.plugin.villagers; - -import static gtPlusPlus.plugin.villagers.VillagerUtils.mVillagerMap; - -import java.util.HashMap; - -import net.minecraft.util.ResourceLocation; - -import cpw.mods.fml.common.registry.VillagerRegistry; -import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler; -import gtPlusPlus.api.interfaces.IPlugin; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.plugin.manager.Core_Manager; -import gtPlusPlus.plugin.villagers.trade.TradeHandlerBanker; -import gtPlusPlus.plugin.villagers.trade.TradeHandlerTechnician; -import gtPlusPlus.plugin.villagers.trade.TradeHandlerTrader; - -// Called by Core_Manager#veryEarlyInit -@SuppressWarnings("unused") -public class Core_VillagerAdditions implements IPlugin { - - public static final Core_VillagerAdditions mInstance; - private static boolean shouldLoad = false; - - public static final HashMap mVillagerSkins = new HashMap<>(); - public static final AutoMap> mVillagerTrades = new AutoMap<>(); - - static { - mInstance = new Core_VillagerAdditions(); - Core_Manager.registerPlugin(mInstance); - mInstance.log("Preparing " + mInstance.getPluginName() + " for use."); - } - - @Override - public boolean preInit() { - if ( - /* CORE.ConfigSwitches.enableSulfuricAcidFix || */ CORE.DEVENV) { - shouldLoad = true; - } - if (shouldLoad) { - // Register Custom Villager Entity - VillagerUtils.registerNewVillager(0, "Banker", "Banker", "Banker", "banker", new TradeHandlerBanker()); - VillagerUtils.registerNewVillager( - 1, - "Technician", - "Technician", - "Technician", - "technician", - new TradeHandlerTechnician()); - VillagerUtils.registerNewVillager(2, "Trader", "Trader", "Trader", "trader", new TradeHandlerTrader()); - - if (mVillagerMap.size() > 0) { - for (VillagerObject g : mVillagerMap.values()) { - if (g != null && g.mID >= 0) { - VillagerRegistry.instance().registerVillagerId(7735 + g.mID); - log("Registered a Custom Villager with ID of " + g.mID + "."); - // Utils.createNewMobSpawner(10+g.mID, EntityBaseVillager.class); - if (mVillagerSkins.get(g.mID) != null) { - VillagerRegistry.instance().registerVillagerSkin(7735 + g.mID, mVillagerSkins.get(g.mID)); - log("Registered a Custom Skin for Villager with ID of " + g.mID + "."); - } - } - } - } - - // Register all Villager ID's and their Custom Trades. - if (mVillagerTrades.size() > 0) { - for (Pair g : mVillagerTrades) { - if (g != null && g.getKey() != null) { - if (g.getValue() != null) { - VillagerRegistry.instance().registerVillageTradeHandler(g.getKey(), g.getValue()); - log("Registered a Custom Trade for Villager with ID of " + g.getKey() + "."); - } - } - } - } - return true; - } - return false; - } - - @Override - public boolean init() { - return shouldLoad; - } - - @Override - public boolean postInit() { - return shouldLoad; - } - - @Override - public boolean serverStart() { - return shouldLoad; - } - - @Override - public boolean serverStop() { - return shouldLoad; - } - - @Override - public String getPluginName() { - return "GT++ Enhanced Villagers"; - } - - @Override - public String getPluginAbbreviation() { - return "Bank"; - } -} diff --git a/src/main/java/gtPlusPlus/plugin/villagers/VillagerObject.java b/src/main/java/gtPlusPlus/plugin/villagers/VillagerObject.java deleted file mode 100644 index 6a39fb0166..0000000000 --- a/src/main/java/gtPlusPlus/plugin/villagers/VillagerObject.java +++ /dev/null @@ -1,41 +0,0 @@ -package gtPlusPlus.plugin.villagers; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.util.ResourceLocation; - -import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler; -import gtPlusPlus.api.objects.data.Pair; - -public class VillagerObject { - - public final int mID; - public final String mName; - public final IVillageTradeHandler mCustomTrade; - - public VillagerObject(int aID, String aName, Object aProfession, Object aCareer, Object aSkin, - IVillageTradeHandler aCustomTrade) { - - mID = aID; - mName = aName; - mCustomTrade = aCustomTrade; - - // Register Custom Trade to Registry. - if (aCustomTrade != null) { - Core_VillagerAdditions.mVillagerTrades - .put(new Pair(7735 + aID, aCustomTrade)); - } - // Register Skin to Registry. - if (aSkin != null) { - - if (aSkin instanceof String) { - String s = (String) aSkin; - aSkin = new ResourceLocation(GTPlusPlus.ID + ":" + "textures/entity/villager/" + s + ".png"); - } - if (aSkin instanceof ResourceLocation) { - Core_VillagerAdditions.mVillagerSkins.put(aID, (ResourceLocation) aSkin); - } - } - VillagerUtils.registerNewVillager(aID, this); - } -} diff --git a/src/main/java/gtPlusPlus/plugin/villagers/VillagerUtils.java b/src/main/java/gtPlusPlus/plugin/villagers/VillagerUtils.java deleted file mode 100644 index 9ca9377865..0000000000 --- a/src/main/java/gtPlusPlus/plugin/villagers/VillagerUtils.java +++ /dev/null @@ -1,19 +0,0 @@ -package gtPlusPlus.plugin.villagers; - -import java.util.HashMap; - -import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler; - -public class VillagerUtils { - - public static final HashMap mVillagerMap = new HashMap(); - - public static void registerNewVillager(int aID, String aName, Object aProfession, Object aCareer, Object aSkin, - IVillageTradeHandler aCustomTrade) { - registerNewVillager(aID, new VillagerObject(aID, aName, aProfession, aCareer, aSkin, aCustomTrade)); - } - - public static void registerNewVillager(int aID, VillagerObject aVillager) { - mVillagerMap.put(aID, aVillager); - } -} diff --git a/src/main/java/gtPlusPlus/plugin/villagers/block/BlockGenericSpawner.java b/src/main/java/gtPlusPlus/plugin/villagers/block/BlockGenericSpawner.java deleted file mode 100644 index a620ed590b..0000000000 --- a/src/main/java/gtPlusPlus/plugin/villagers/block/BlockGenericSpawner.java +++ /dev/null @@ -1,58 +0,0 @@ -package gtPlusPlus.plugin.villagers.block; - -import static gtPlusPlus.core.lib.CORE.RANDOM; - -import java.util.List; - -import net.minecraft.block.BlockMobSpawner; -import net.minecraft.creativetab.CreativeTabs; -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 cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.item.base.itemblock.ItemBlockSpawner; -import gtPlusPlus.plugin.villagers.Core_VillagerAdditions; -import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner; - -public class BlockGenericSpawner extends BlockMobSpawner { - - public BlockGenericSpawner() { - this.disableStats(); - this.setHardness(5.0F); - this.setStepSound(soundTypeMetal); - this.setBlockName("blockMobSpawnerEx"); - this.setBlockTextureName("mob_spawner"); - this.setResistance(2000.0F); - GameRegistry.registerBlock(this, ItemBlockSpawner.class, "blockMobSpawnerEx"); - Core_VillagerAdditions.mInstance.log("Registered Custom Spawner Block."); - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - @Override - public TileEntity createNewTileEntity(World world, int meta) { - return new TileEntityGenericSpawner(meta); - } - - @Override - public int getExpDrop(IBlockAccess world, int metadata, int fortune) { - return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15); - } - - /** - * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) - */ - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { - for (int i = 0; i < Math.max(1, TileEntityGenericSpawner.mSpawners.size()); ++i) { - p_149666_3_.add(new ItemStack(p_149666_1_, 1, i)); - } - } -} diff --git a/src/main/java/gtPlusPlus/plugin/villagers/tile/MobSpawnerCustomLogic.java b/src/main/java/gtPlusPlus/plugin/villagers/tile/MobSpawnerCustomLogic.java deleted file mode 100644 index 967bc73bd0..0000000000 --- a/src/main/java/gtPlusPlus/plugin/villagers/tile/MobSpawnerCustomLogic.java +++ /dev/null @@ -1,68 +0,0 @@ -package gtPlusPlus.plugin.villagers.tile; - -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.MobSpawnerBaseLogic; -import net.minecraft.world.World; - -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration; -import gtPlusPlus.core.block.ModBlocks; - -public class MobSpawnerCustomLogic extends MobSpawnerBaseLogic { - - private TileEntityGenericSpawner mTile; - - public MobSpawnerCustomLogic(TileEntityGenericSpawner tile) { - if (tile != null) { - mTile = tile; - } - - if (TileEntityGenericSpawner.mSpawners.get(mTile.getID()) != null) { - Class c = TileEntityGenericSpawner.mSpawners.get(mTile.getID()); - EntityRegistration x = EntityRegistry.instance().lookupModSpawn(c, false); - if (x != null) { - this.setEntityName(x.getEntityName()); - } - } - } - - @Override - public void func_98267_a(int eventID) { - if (mTile != null) mTile.getWorldObj() - .addBlockEvent(mTile.xCoord, mTile.yCoord, mTile.zCoord, ModBlocks.blockCustomMobSpawner, eventID, 0); - } - - @Override - public World getSpawnerWorld() { - if (mTile != null) return mTile.getWorldObj(); - return null; - } - - @Override - public int getSpawnerX() { - if (mTile != null) return mTile.xCoord; - return 0; - } - - @Override - public int getSpawnerY() { - if (mTile != null) return mTile.yCoord; - return 0; - } - - @Override - public int getSpawnerZ() { - if (mTile != null) return mTile.zCoord; - return 0; - } - - @Override - public void setRandomEntity(MobSpawnerBaseLogic.WeightedRandomMinecart p_98277_1_) { - super.setRandomEntity(p_98277_1_); - if (mTile != null) { - if (this.getSpawnerWorld() != null) { - this.getSpawnerWorld().markBlockForUpdate(mTile.xCoord, mTile.yCoord, mTile.zCoord); - } - } - } -} diff --git a/src/main/java/gtPlusPlus/plugin/villagers/tile/TileEntityGenericSpawner.java b/src/main/java/gtPlusPlus/plugin/villagers/tile/TileEntityGenericSpawner.java deleted file mode 100644 index 451a4aefe5..0000000000 --- a/src/main/java/gtPlusPlus/plugin/villagers/tile/TileEntityGenericSpawner.java +++ /dev/null @@ -1,233 +0,0 @@ -package gtPlusPlus.plugin.villagers.tile; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.MobSpawnerBaseLogic; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityMobSpawner; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; - -public class TileEntityGenericSpawner extends TileEntityMobSpawner { - - /* - * Static Variables - */ - - /** A HashMap storing string names of classes mapping to the actual java.lang.Class type. */ - private static Map nameToClassMap_Ex = new HashMap(); - /** A HashMap storing the classes and mapping to the string names (reverse of nameToClassMap). */ - private static Map classToNameMap_Ex = new HashMap(); - - /** - * The Mob Spawner Map - */ - public static HashMap> mSpawners = new HashMap>(); - - /** - * Registers a New Mob Spawner Type - * - * @param aID - the Spawner type ID - * @param aEntity - the Entity which you'd like to spawn - */ - public static boolean registerNewMobSpawner(int aID, Class aEntity) { - int registered = mSpawners.size(); - Logger.INFO("Currently " + registered + " spawners are registered."); - if (!mSpawners.containsKey(aID) && !mSpawners.containsValue(aEntity)) { - mSpawners.put(aID, aEntity); - } - return mSpawners.size() > registered; - } - - /* - * Instance Variables - */ - - /** - * The {@link Entity} type which spawns. - */ - protected int mID; - - private final Class mSpawnType; - private MobSpawnerCustomLogic spawnerLogic; - - /* - * Constructors - */ - - /** - * Constructs a new Spawner, based on an existing type registered. - * - * @param aID - The ID in the {@link mSpawners} map. - */ - public TileEntityGenericSpawner(int aID) { - mID = aID; - if (mSpawners.get(aID) != null) { - mSpawnType = mSpawners.get(aID); - } else { - mSpawnType = null; - } - - // Last thing to Init - generateLogicObject(); - } - - /** - * Constructs a new Spawner, then registers it. - * - * @param aID - The ID to be used in the {@link mSpawners} map. - * @param aEntity - The {@link Entity} type which will be spawned. - */ - public TileEntityGenericSpawner(int aID, Entity aEntity) { - mID = aID; - if (aEntity != null) { - mSpawnType = aEntity.getClass(); - if (mSpawners.containsKey(aID)) { - registerNewMobSpawner(aID, mSpawnType); - } - } else { - mSpawnType = null; - } - - // Last thing to Init - generateLogicObject(); - } - - public final MobSpawnerCustomLogic getLogic() { - if (spawnerLogic == null || spawnerLogic.getSpawnerWorld() == null) { - generateLogicObject(); - } - return spawnerLogic; - } - - private final void generateLogicObject() { - spawnerLogic = new MobSpawnerCustomLogic(this); - } - - public int getID() { - return this.mID; - } - - @Override - public void readFromNBT(NBTTagCompound p_145839_1_) { - if (hasInternalFieldBeenSet()) { - this.getLogic().readFromNBT(p_145839_1_); - this.xCoord = p_145839_1_.getInteger("x"); - this.yCoord = p_145839_1_.getInteger("y"); - this.zCoord = p_145839_1_.getInteger("z"); - this.mID = p_145839_1_.getInteger("mID"); - } - } - - @Override - public void writeToNBT(NBTTagCompound p_145841_1_) { - if (hasInternalFieldBeenSet()) { - String s = (String) classToNameMap_Ex.get(this.getClass()); - if (s == null) { - for (Object g : classToNameMap_Ex.values()) { - if (g instanceof String) { - Logger.INFO("Found Translation for " + ((Class) nameToClassMap_Ex.get(g)).getName() + ": " + g); - } - } - - // throw new RuntimeException(this.getClass() + " is missing a mapping! This is a bug!"); - s = mSpawners.containsKey(this.mID) ? mSpawners.get(this.mID).getSimpleName() : "bad.class.name"; - p_145841_1_.setString("id", s); - Logger.WARNING(this.getClass() + " is missing a mapping! This is a bug! Used key: " + s); - p_145841_1_.setInteger("x", this.xCoord); - p_145841_1_.setInteger("y", this.yCoord); - p_145841_1_.setInteger("z", this.zCoord); - p_145841_1_.setInteger("mID", this.mID); - } else { - Logger.INFO(this.getClass() + " is not missing a mapping! Used key: " + s); - p_145841_1_.setString("id", s); - p_145841_1_.setInteger("x", this.xCoord); - p_145841_1_.setInteger("y", this.yCoord); - p_145841_1_.setInteger("z", this.zCoord); - p_145841_1_.setInteger("mID", this.mID); - } - this.getLogic().writeToNBT(p_145841_1_); - } - } - - @Override - public void updateEntity() { - if (Utils.isServer()) { - mTicks++; - if (hasInternalFieldBeenSet()) { - this.getLogic().updateSpawner(); - } - } - } - - private boolean isReady = false; - private long mTicks = 0; - - private boolean hasInternalFieldBeenSet() { - if (isReady && mTicks % 200 != 0) { - return true; - } else { - - if (Utils.isServer()) { - try { - Map a1 = (Map) ReflectionUtils.getField(TileEntity.class, "nameToClassMap").get(this); - Map a2 = (Map) ReflectionUtils.getField(TileEntity.class, "classToNameMap").get(this); - if (a1 != null) { - if (nameToClassMap_Ex == null) { - nameToClassMap_Ex = a1; - } - if (nameToClassMap_Ex != null) { - if (nameToClassMap_Ex.size() != a1.size()) { - nameToClassMap_Ex = a1; - } - } - } - if (a2 != null) { - if (classToNameMap_Ex == null) { - classToNameMap_Ex = a2; - } - if (classToNameMap_Ex != null) { - if (classToNameMap_Ex.size() != a2.size()) { - classToNameMap_Ex = a2; - } - } - if (nameToClassMap_Ex != null && classToNameMap_Ex != null) { - // Logger.INFO("nameToClassMap_Ex has a size of "+nameToClassMap_Ex.size()+"."); - // Logger.INFO("a1 has a size of "+a1.size()+"."); - // Logger.INFO("classToNameMap_Ex has a size of "+classToNameMap_Ex.size()+"."); - // Logger.INFO("a2 has a size of "+a2.size()+"."); - isReady = true; - return true; - } - } - - /* - * Field mInternalLogicField = ReflectionUtils.getField(getClass(), "field_145882_a"); if - * (mInternalLogicField != null) { MobSpawnerBaseLogic a = (MobSpawnerBaseLogic) - * mInternalLogicField.get(this); if (a != null) { ReflectionUtils.setField(this, "field_145882_a", - * getLogic()); if (a.equals(getLogic())) { isReady = true; return true; } } } - */ - } catch (IllegalArgumentException | IllegalAccessException e) {} - } - return false; - } - } - - /** - * Called when a client event is received with the event number and argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) { - return this.spawnerLogic.setDelayToMin(p_145842_1_) ? true : super.receiveClientEvent(p_145842_1_, p_145842_2_); - } - - @Override - public MobSpawnerBaseLogic func_145881_a() { - return this.spawnerLogic; - } -} diff --git a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBanker.java b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBanker.java deleted file mode 100644 index 3ad3cdd7eb..0000000000 --- a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBanker.java +++ /dev/null @@ -1,25 +0,0 @@ -package gtPlusPlus.plugin.villagers.trade; - -import java.util.Random; - -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.village.MerchantRecipe; -import net.minecraft.village.MerchantRecipeList; - -import gtPlusPlus.core.recipe.common.CI; - -public class TradeHandlerBanker extends TradeHandlerBase { - - @SuppressWarnings("unchecked") - @Override - public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) { - // if (villager.getProfession() == 7735) { - recipeList.add(new MerchantRecipe(CI.electricMotor_LV, CI.electricPiston_LV, CI.robotArm_LV)); - recipeList.add(new MerchantRecipe(CI.electricMotor_MV, CI.electricPiston_MV, CI.robotArm_MV)); - recipeList.add(new MerchantRecipe(CI.electricMotor_HV, CI.electricPiston_HV, CI.robotArm_HV)); - recipeList.add(new MerchantRecipe(CI.electricMotor_EV, CI.electricPiston_EV, CI.robotArm_EV)); - recipeList.add(new MerchantRecipe(CI.electricMotor_IV, CI.electricPiston_IV, CI.robotArm_IV)); - // Collections.shuffle(recipeList); - // } - } -} diff --git a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBase.java b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBase.java deleted file mode 100644 index fa95404f49..0000000000 --- a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerBase.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011-2014 SirSengir. All rights reserved. This program and the accompanying materials are made - * available under the terms of the GNU Lesser Public License v3 which accompanies this distribution, and is available - * at http://www.gnu.org/licenses/lgpl-3.0.txt - * - * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, - * MysteriousAges - ******************************************************************************/ -package gtPlusPlus.plugin.villagers.trade; - -import java.util.Random; - -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.village.MerchantRecipeList; - -import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler; - -public abstract class TradeHandlerBase implements IVillageTradeHandler { - - @SuppressWarnings("unchecked") - @Override - public abstract void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, - Random random); -} diff --git a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTechnician.java b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTechnician.java deleted file mode 100644 index 1b67e2b478..0000000000 --- a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTechnician.java +++ /dev/null @@ -1,25 +0,0 @@ -package gtPlusPlus.plugin.villagers.trade; - -import java.util.Random; - -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.village.MerchantRecipe; -import net.minecraft.village.MerchantRecipeList; - -import gtPlusPlus.core.recipe.common.CI; - -public class TradeHandlerTechnician extends TradeHandlerBase { - - @SuppressWarnings("unchecked") - @Override - public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) { - // if (villager.getProfession() == 7737) { - recipeList.add(new MerchantRecipe(CI.machineHull_LV, CI.electricMotor_LV, CI.machineHull_LV)); - recipeList.add(new MerchantRecipe(CI.machineHull_MV, CI.electricMotor_MV, CI.machineHull_MV)); - recipeList.add(new MerchantRecipe(CI.machineHull_HV, CI.electricMotor_HV, CI.machineHull_HV)); - recipeList.add(new MerchantRecipe(CI.machineHull_EV, CI.electricMotor_EV, CI.machineHull_EV)); - recipeList.add(new MerchantRecipe(CI.machineHull_IV, CI.electricMotor_IV, CI.machineHull_IV)); - // Collections.shuffle(recipeList); - // } - } -} diff --git a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java b/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java deleted file mode 100644 index 4b0e99471a..0000000000 --- a/src/main/java/gtPlusPlus/plugin/villagers/trade/TradeHandlerTrader.java +++ /dev/null @@ -1,52 +0,0 @@ -package gtPlusPlus.plugin.villagers.trade; - -import java.util.Collections; -import java.util.Random; - -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.village.MerchantRecipe; -import net.minecraft.village.MerchantRecipeList; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class TradeHandlerTrader extends TradeHandlerBase { - - public TradeHandlerTrader() { - Logger.INFO("Created Trade Manager for 'Trader' villager profession type."); - } - - @SuppressWarnings("unchecked") - @Override - public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) { - ItemStack Ore1 = null, Ore2 = null; - if (Ore1 == null) { - Ore1 = ELEMENT.getInstance().SILICON.getOre(1); - } - if (Ore2 == null) { - Ore2 = ELEMENT.getInstance().ALUMINIUM.getOre(1); - } - if (Ore1 == null) { - Ore1 = ELEMENT.getInstance().GOLD.getOre(1); - } - if (Ore2 == null) { - Ore2 = ELEMENT.getInstance().LEAD.getOre(1); - } - recipeList.add( - new MerchantRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("logWood", 32), - ELEMENT.getInstance().IRON.getOre(1))); - recipeList.add( - new MerchantRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 32), - ELEMENT.getInstance().COPPER.getOre(1))); - recipeList.add( - new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.obsidian, 6), ELEMENT.getInstance().TIN.getOre(1))); - recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.glowstone, 32), Ore1)); - recipeList.add(new MerchantRecipe(ItemUtils.getSimpleStack(Blocks.piston, 32), Ore2)); - Collections.shuffle(recipeList); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java b/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java index c44620e5da..e1b1d53b45 100644 --- a/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java +++ b/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java @@ -8,7 +8,6 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.xmod.bartcrops.crops.Crop_Force; import gtPlusPlus.xmod.bartcrops.crops.Crop_Hemp; import ic2.api.crops.CropCard; import ic2.api.crops.Crops; @@ -46,11 +45,10 @@ private static LoaderOfTheCrops cropHelper(CropCard cropObj) { return new LoaderOfTheCrops(cropObj, ItemUtils.getItemStackOfAmountFromOreDict("crop" + cropObj.name(), 0)); } - public static final List cropLoader() { + public static List cropLoader() { List p = new ArrayList(); p.add(new LoaderOfTheCrops(new Crop_Hemp(), new ItemStack(Item.getItemById(111), 3))); - p.add(new LoaderOfTheCrops(new Crop_Force(), new ItemStack(Item.getItemById(111), 3))); return p; } diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java b/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java deleted file mode 100644 index da29ca7f50..0000000000 --- a/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java +++ /dev/null @@ -1,61 +0,0 @@ -package gtPlusPlus.xmod.bartcrops.crops; - -import net.minecraft.item.ItemStack; - -import gtPlusPlus.core.material.ELEMENT.STANDALONE; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.preloader.CORE_Preloader; -import gtPlusPlus.xmod.bartcrops.abstracts.BaseAestheticCrop; -import ic2.api.crops.ICropTile; - -public class Crop_Force extends BaseAestheticCrop { - - @Override - public int tier() { - return 4; - } - - @Override - public String name() { - return "Force"; - } - - @Override - public String discoveredBy() { - return "Alkalus"; - } - - @Override - public int growthDuration(ICropTile crop) { - int ret = 800; - - /* - * if (crop.isBlockBelow(Blocks.dirt) || crop.isBlockBelow(Blocks.flowing_water)) { ret = 225; } - */ - - if (CORE_Preloader.DEBUG_MODE) { - ret = 1; - } - - return ret; - } - - @Override - public String[] attributes() { - return new String[] { "Power", "Soil", "Yellow", "Gold" }; - } - - @Override - public ItemStack getGain(ICropTile crop) { - ItemStack ret = this.getDisplayItem(); - if (MathUtils.randInt(0, 10) > 8) { - ret = STANDALONE.FORCE.getNugget(MathUtils.randInt(4, 8)); - } - return ret; - } - - @Override - public ItemStack getDisplayItem() { - return STANDALONE.FORCE.getNugget(0); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java b/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java index 66f0d19fd2..f5bf252edb 100644 --- a/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java +++ b/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Hemp.java @@ -1,11 +1,9 @@ package gtPlusPlus.xmod.bartcrops.crops; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.xmod.bartcrops.abstracts.BaseAestheticCrop; import ic2.api.crops.ICropTile; @@ -21,24 +19,9 @@ public String name() { return "Hemp"; } - @Override - public String discoveredBy() { - return "Alkalus"; - } - @Override public int growthDuration(ICropTile crop) { - int ret = 550; - - /* - * if (crop.isBlockBelow(Blocks.dirt) || crop.isBlockBelow(Blocks.flowing_water)) { ret = 225; } - */ - - if (CORE_Preloader.DEBUG_MODE) { - ret = 1; - } - - return ret; + return 550; } @Override @@ -48,17 +31,11 @@ public String[] attributes() { @Override public ItemStack getGain(ICropTile crop) { - - ItemStack ret = this.getDisplayItem(); - if (MathUtils.randInt(0, 10) > 8) { - ret = ItemUtils.getSimpleStack(ModItems.itemRope, MathUtils.randInt(1, 3)); - } - - return ret; + return new ItemStack(Items.string, MathUtils.randInt(1, 3), 0); } @Override public ItemStack getDisplayItem() { - return ItemUtils.getSimpleStack(ModItems.itemRope, 0); + return new ItemStack(Items.string, 1, 0); } } diff --git a/src/main/java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java b/src/main/java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java deleted file mode 100644 index 1c13f16a4b..0000000000 --- a/src/main/java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java +++ /dev/null @@ -1,15 +0,0 @@ -package gtPlusPlus.xmod.cofh; - -import static gregtech.api.enums.Mods.COFHCore; - -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.item.general.RF2EU_Battery; - -public class HANDLER_COFH { - - public static void initItems() { - if (COFHCore.isModLoaded()) { - ModItems.RfEuBattery = new RF2EU_Battery(); - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java b/src/main/java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java deleted file mode 100644 index caa49973d7..0000000000 --- a/src/main/java/gtPlusPlus/xmod/eio/handler/HandlerTooltip_EIO.java +++ /dev/null @@ -1,76 +0,0 @@ -package gtPlusPlus.xmod.eio.handler; - -import static gregtech.api.enums.Mods.EnderIO; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.disableEnderIOIngotTooltips; - -import java.lang.reflect.Field; - -import net.minecraft.item.Item; -import net.minecraftforge.event.entity.player.ItemTooltipEvent; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gregtech.api.enums.Materials; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.xmod.eio.material.MaterialEIO; - -public class HandlerTooltip_EIO { - - private static Item mIngot; - Class oMainClass; - Class oIngotClass; - - @SubscribeEvent - public void onItemTooltip(ItemTooltipEvent event) { - // Is EIO loaded? - if (!disableEnderIOIngotTooltips && EnderIO.isModLoaded()) { - - // Is the EIO Ingot Item null? - // If it is, reflect in. - if (mIngot == null) { - try { - oMainClass = ReflectionUtils.getClass("crazypants.enderio.EnderIO"); - oIngotClass = ReflectionUtils.getClass("crazypants.enderio.material.ItemAlloy"); - if (oMainClass != null && oIngotClass != null) { - Field oAlloyField = ReflectionUtils.getField(oMainClass, "itemAlloy"); - Object oAlloy = oAlloyField.get(oMainClass); - if (oAlloy != null) { - if (oIngotClass.isInstance(oAlloy) || Item.class.isInstance(oAlloy)) { - mIngot = (Item) oAlloy; - } - } - } - } catch (Throwable e) {} - } - - if (mIngot != null) { - // If the Item is an instance of ItemAlloy.class then proceed - if (event.itemStack.getItem() == mIngot || oIngotClass.isInstance(event.itemStack.getItem()) - || event.itemStack.getUnlocalizedName().toLowerCase().contains("item.itemAlloy")) { - - // If stacks match, add a tooltip. - if (mIngot != null) { - if (event.itemStack.getItem() == mIngot) { - if (event.itemStack.getItemDamage() == 0) { - event.toolTip.add(MaterialEIO.ELECTRICAL_STEEL.vChemicalFormula); - } else if (event.itemStack.getItemDamage() == 1) { - event.toolTip.add(MaterialEIO.ENERGETIC_ALLOY.vChemicalFormula); - } else if (event.itemStack.getItemDamage() == 2) { - event.toolTip.add(MaterialEIO.VIBRANT_ALLOY.vChemicalFormula); - } else if (event.itemStack.getItemDamage() == 3) { - event.toolTip.add(MaterialEIO.REDSTONE_ALLOY.vChemicalFormula); - } else if (event.itemStack.getItemDamage() == 4) { - event.toolTip.add(MaterialEIO.CONDUCTIVE_IRON.vChemicalFormula); - } else if (event.itemStack.getItemDamage() == 5) { - event.toolTip.add(MaterialEIO.PULSATING_IRON.vChemicalFormula); - } else if (event.itemStack.getItemDamage() == 6) { - event.toolTip.add(Materials.DarkSteel.mChemicalFormula); - } else if (event.itemStack.getItemDamage() == 7) { - event.toolTip.add(MaterialEIO.SOULARIUM.vChemicalFormula); - } - } - } - } - } - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/eio/material/MaterialEIO.java b/src/main/java/gtPlusPlus/xmod/eio/material/MaterialEIO.java deleted file mode 100644 index 0d07901310..0000000000 --- a/src/main/java/gtPlusPlus/xmod/eio/material/MaterialEIO.java +++ /dev/null @@ -1,109 +0,0 @@ -package gtPlusPlus.xmod.eio.material; - -import gtPlusPlus.core.material.ALLOY; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.MaterialStack; -import gtPlusPlus.core.material.NONMATERIAL; -import gtPlusPlus.core.material.state.MaterialState; - -public class MaterialEIO { - - public static final Material SOULARIUM = new Material( - "Soularium", // Material Name - MaterialState.SOLID, // State - new short[] { 95, 90, 54, 0 }, // Material Colour - 10, // Melting Point in C - 10, - 10, - 10, - false, // Uses Blast furnace? - false, // Generates a cell - // Material Stacks with Percentage of required elements. - new MaterialStack[] { new MaterialStack(ELEMENT.getInstance().GOLD, 1), - new MaterialStack(NONMATERIAL.SOULSAND, 1) }); - - public static final Material CONDUCTIVE_IRON = new Material( - "Conductive Iron", // Material Name - MaterialState.SOLID, // State - new short[] { 164, 109, 100, 0 }, // Material Colour - 10, // Melting Point in C - 10, - 10, - 10, - false, // Uses Blast furnace? - false, // Generates a cell - // Material Stacks with Percentage of required elements. - new MaterialStack[] { new MaterialStack(ELEMENT.getInstance().IRON, 1), - new MaterialStack(NONMATERIAL.REDSTONE, 1) }); - - public static final Material PULSATING_IRON = new Material( - "Pulsating Iron", // Material Name - MaterialState.SOLID, // State - new short[] { 50, 91, 21, 0 }, // Material Colour - 10, // Melting Point in C - 10, - 10, - 10, - false, // Uses Blast furnace? - false, // Generates a cell - // Material Stacks with Percentage of required elements. - new MaterialStack[] { new MaterialStack(ELEMENT.getInstance().IRON, 1), - new MaterialStack(NONMATERIAL.ENDERPEARL, 1) }); - - public static final Material ELECTRICAL_STEEL = new Material( - "Electrical Steel", // Material Name - MaterialState.SOLID, // State - new short[] { 194, 194, 194, 0 }, // Material Colour - 10, // Melting Point in C - 10, - 10, - 10, - true, // Uses Blast furnace? - false, // Generates a cell - // Material Stacks with Percentage of required elements. - new MaterialStack[] { new MaterialStack(ALLOY.STEEL, 3), - new MaterialStack(ELEMENT.getInstance().SILICON, 1) }); - - public static final Material ENERGETIC_ALLOY = new Material( - "Energetic Alloy", // Material Name - MaterialState.SOLID, // State - new short[] { 252, 151, 45, 0 }, // Material Colour - 10, // Melting Point in C - 10, - 10, - 10, - true, // Uses Blast furnace? - false, // Generates a cell - // Material Stacks with Percentage of required elements. - new MaterialStack[] { new MaterialStack(ELEMENT.getInstance().GOLD, 1), - new MaterialStack(NONMATERIAL.REDSTONE, 1), new MaterialStack(NONMATERIAL.GLOWSTONE, 1) }); - - public static final Material VIBRANT_ALLOY = new Material( - "Vibrant Alloy", // Material Name - MaterialState.SOLID, // State - new short[] { 204, 242, 142, 0 }, // Material Colour - 10, // Melting Point in C - 10, - 10, - 10, - true, // Uses Blast furnace? - false, // Generates a cell - // Material Stacks with Percentage of required elements. - new MaterialStack[] { new MaterialStack(ENERGETIC_ALLOY, 1), - new MaterialStack(NONMATERIAL.ENDERPEARL, 1) }); - - public static final Material REDSTONE_ALLOY = new Material( - "Redstone Alloy", // Material Name - MaterialState.SOLID, // State - new short[] { 178, 34, 34, 0 }, // Material Colour - 10, // Melting Point in C - 10, - 10, - 10, - false, // Uses Blast furnace? - false, // Generates a cell - // Material Stacks with Percentage of required elements. - new MaterialStack[] { new MaterialStack(ELEMENT.getInstance().SILICON, 1), - new MaterialStack(NONMATERIAL.REDSTONE, 1) }); -} diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java index ee3d8d05ef..6fea628473 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java @@ -14,7 +14,7 @@ import java.util.function.Consumer; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.BiomeDictionary.Type; +import net.minecraftforge.common.BiomeDictionary; import org.apache.commons.lang3.text.WordUtils; @@ -85,7 +85,7 @@ public enum GTPP_BeeDefinition implements IBeeDefinition { }, dis -> { IBeeMutationCustom tMutation = dis.registerMutation("STEEL", "GOLD", 10); tMutation.restrictHumidity(ARID); - tMutation.restrictBiomeType(Type.HOT); + tMutation.restrictBiomeType(BiomeDictionary.Type.HOT); }),; private final GTPP_BranchDefinition branch; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index 370b286957..977eb8a2c9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -24,7 +24,6 @@ import gregtech.common.items.behaviors.Behaviour_DataOrb; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.handler.COMPAT_HANDLER; -import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.everglades.gen.gt.WorldGen_GT; @@ -41,7 +40,6 @@ import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricButcherKnife; import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricLighter; import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricSnips; -import gtPlusPlus.xmod.gregtech.loaders.ProcessingToolHeadChoocher; import gtPlusPlus.xmod.gregtech.loaders.misc.AddCustomMachineToPA; import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_AlgaeFarm; import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_MolecularTransformer; @@ -74,18 +72,12 @@ public static void init() { // Register Tile Entities COMPAT_HANDLER.registerGregtechMachines(); - // Only loads if the config option is true (default: true) - if (CORE.ConfigSwitches.enableSkookumChoochers) { - sMetaGeneratedToolInstance = MetaGeneratedGregtechTools.getInstance(); - } + sMetaGeneratedToolInstance = MetaGeneratedGregtechTools.getInstance(); } public static void postInit() { // Only loads if the config option is true (default: true) - if (CORE.ConfigSwitches.enableSkookumChoochers) { - new ProcessingToolHeadChoocher().run(); - } new ProcessingAngleGrinder().run(); new ProcessingElectricSnips().run(); new ProcessingElectricButcherKnife().run(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index f7fc2712ce..90fd1e2358 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -31,35 +31,27 @@ public enum GregtechItemList implements GregtechItemContainer { Electric_Motor_LuV, Electric_Motor_ZPM, Electric_Motor_UV, - Electric_Motor_MAX, Electric_Pump_LuV, Electric_Pump_ZPM, Electric_Pump_UV, - Electric_Pump_MAX, Conveyor_Module_LuV, Conveyor_Module_ZPM, Conveyor_Module_UV, - Conveyor_Module_MAX, Electric_Piston_LuV, Electric_Piston_ZPM, Electric_Piston_UV, - Electric_Piston_MAX, Robot_Arm_LuV, Robot_Arm_ZPM, Robot_Arm_UV, - Robot_Arm_MAX, Field_Generator_LuV, Field_Generator_ZPM, Field_Generator_UV, - Field_Generator_MAX, Emitter_LuV, Emitter_ZPM, Emitter_UV, - Emitter_MAX, Sensor_LuV, Sensor_ZPM, Sensor_UV, - Sensor_MAX, // ULV Components Electric_Motor_ULV, @@ -179,10 +171,6 @@ public enum GregtechItemList implements GregtechItemContainer { Compressed_Fusion_Reactor, // Carbon Materials - NanoTube_Base_Substrate, - NanoTube_Finished, - Carbyne_Tube_Finished, - Carbyne_Sheet_Finished, // End Game Laser Engraver Lens Laser_Lens_WoodsGlass, @@ -198,13 +186,6 @@ public enum GregtechItemList implements GregtechItemContainer { // Pellet Mold Pellet_Mold, - // Charged Items for Tree Farms - Farm_Processor_EV, - Farm_Processor_IV, - Farm_Processor_LuV, - Farm_Processor_ZPM, - Farm_Processor_UV, - // Upgrade chip for Distillus Distillus_Upgrade_Chip, Maceration_Upgrade_Chip, @@ -532,9 +513,6 @@ public enum GregtechItemList implements GregtechItemContainer { // Standard Turbine Rotor Hatch Hatch_Input_TurbineHousing, - // Control Core - Hatch_Control_Core, - // Milling Ball Bus Bus_Milling_Balls, @@ -555,9 +533,6 @@ public enum GregtechItemList implements GregtechItemContainer { Hatch_Input_Elemental_Duplicator, // RTG Hatch - Hatch_RTG_LV, - Hatch_RTG_MV, - Hatch_RTG_HV, // Battery hatches for PSS Hatch_Input_Battery_MV, @@ -709,7 +684,6 @@ public enum GregtechItemList implements GregtechItemContainer { // Debug machine Pollution_Creator, - Garbage_Collector_Debug_Machine, // Basically is an automatic Cauldron SimpleDustWasher_ULV, @@ -764,8 +738,6 @@ public enum GregtechItemList implements GregtechItemContainer { GT_Solar_UV, GT_Solar_MAX, - // 512v Creative Buffer - Energy_Buffer_CREATIVE, // Variable voltage RF convertor Energy_Buffer_RF_Convertor, // Energy Buffers @@ -795,31 +767,11 @@ public enum GregtechItemList implements GregtechItemContainer { // The max Steam condenser Condensor_MAX, - // Player owned Safes - GT_Safe_ULV, - GT_Safe_LV, - GT_Safe_MV, - GT_Safe_HV, - GT_Safe_EV, - GT_Safe_IV, - GT_Safe_LuV, - GT_Safe_ZPM, - GT_Safe_UV, - GT_Safe_MAX, - // Rocket Engines Rocket_Engine_EV, Rocket_Engine_IV, Rocket_Engine_LuV, - // GT4 Shelves - GT4_Shelf, - GT4_Shelf_Iron, - GT4_Shelf_FileCabinet, - GT4_Shelf_Desk, - GT4_Shelf_Compartment, - GT4_Shelf_Large, - // Hi Amp Transformers Transformer_HA_LV_ULV, Transformer_HA_MV_LV, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java index 695474e5ec..61abc48a18 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java @@ -90,8 +90,6 @@ public enum GregtechOrePrefixes { type2("16x Wires", "16x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 8, 64, -1), - toolSkookumChoocher("Skookum Choocher", "", " Skookum Choocher", true, true, false, false, false, false, true, true, - false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots. toolAngleGrinder("Angle Grinder", "", "Angle Grinder", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots. toolElectricSnips("Electric Snips", "", "Electric Snips", true, true, false, false, false, false, true, true, false, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java index bae91b53fe..0a116b1b9f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java @@ -1,7 +1,6 @@ package gtPlusPlus.xmod.gregtech.api.enums; public enum GregtechToolDictNames { - craftingToolSkookumChoocher, craftingToolHandPump, craftingToolAngleGrinder, craftingToolElectricSnips, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java deleted file mode 100644 index e85cc1f6c2..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java +++ /dev/null @@ -1,166 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -import org.apache.commons.lang3.ArrayUtils; - -import com.gtnewhorizons.modularui.api.screen.ModularWindow; -import com.gtnewhorizons.modularui.api.screen.UIBuildContext; - -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.core.item.general.ItemControlCore; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch { - - public GT_Recipe_Map mRecipeMap = null; - - public BlockPos mControllerLocation; - - public GT_MetaTileEntity_Hatch_ControlCore(int aID, String aName, String aNameRegional, int aTier) { - super( - aID, - aName, - aNameRegional, - aTier, - getSlots(aTier), - "Core determines maximum tier machine will operate at"); - } - - public GT_MetaTileEntity_Hatch_ControlCore(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription, aTextures); - } - - public GT_MetaTileEntity_Hatch_ControlCore(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { - super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription[0], aTextures); - } - - @Override - public String[] getDescription() { - return ArrayUtils.add(this.mDescriptionArray, CORE.GT_Tooltip.get()); - } - - @Override - public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core) }; - } - - @Override - public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core) }; - } - - @Override - public boolean isSimpleMachine() { - return true; - } - - @Override - public boolean isFacingValid(ForgeDirection facing) { - return true; - } - - @Override - public boolean isAccessAllowed(EntityPlayer aPlayer) { - return true; - } - - @Override - public boolean isValidSlot(int aIndex) { - return true; - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_ControlCore(mName, mTier, mDescriptionArray, mTextures); - } - - @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); - return true; - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) { - fillStacksIntoFirstSlots(); - } - } - - public void updateSlots() { - for (int i = 0; i < mInventory.length; i++) - if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null; - fillStacksIntoFirstSlots(); - } - - protected void fillStacksIntoFirstSlots() { - for (int i = 0; i < mInventory.length; i++) - for (int j = i + 1; j < mInventory.length; j++) if (mInventory[j] != null - && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) { - GT_Utility.moveStackFromSlotAToSlotB( - getBaseMetaTileEntity(), - getBaseMetaTileEntity(), - j, - i, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - } - } - - @Override - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { - return false; - } - - @Override - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { - return side == getBaseMetaTileEntity().getFrontFacing() - && (aStack != null && aStack.getItem() instanceof ItemControlCore); - } - - public boolean setOwner(TileEntity aTileEntity) { - if (mControllerLocation != null) { - return false; - } else { - mControllerLocation = new BlockPos(aTileEntity); - return true; - } - } - - public boolean setOwner(IGregTechTileEntity aTileEntity) { - if (mControllerLocation != null) { - return false; - } else { - mControllerLocation = new BlockPos(aTileEntity); - return true; - } - } - - @Override - public boolean useModularUI() { - return true; - } - - @Override - public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - getBaseMetaTileEntity().add1by1Slot(builder); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java deleted file mode 100644 index 3fd3c7a82b..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java +++ /dev/null @@ -1,289 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; - -import static gregtech.api.enums.GT_Values.V; - -import java.util.HashMap; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; - -import com.gtnewhorizons.modularui.api.screen.ModularWindow; -import com.gtnewhorizons.modularui.api.screen.UIBuildContext; - -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.minecraft.InventoryUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GT_MetaTileEntity_Hatch_Energy_RTG extends GT_MetaTileEntity_Hatch_Energy { - - public GT_MetaTileEntity_Hatch_Energy_RTG(int aID, String aName, String aNameRegional, int aTier, - int aInvSlotCount) { - super( - aID, - aName, - aNameRegional, - aTier, - aInvSlotCount, - new String[] { "Energy Injector for Multiblocks", "Accepts up to 2 Amps" }); - } - - public GT_MetaTileEntity_Hatch_Energy_RTG(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { - super(aName, aTier, aInvSlotCount, aDescription, aTextures); - } - - @Override - public String[] getDescription() { - String[] S = super.getDescription(); - final String[] desc = new String[S.length + 1]; - System.arraycopy(S, 0, desc, 0, S.length); - desc[S.length] = CORE.GT_Tooltip.get(); - return desc; - } - - @Override - public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] { aBaseTexture, TexturesGtBlock - .getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_On, new short[] { 220, 220, 220, 0 }) }; - } - - @Override - public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] { aBaseTexture, TexturesGtBlock - .getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_Off, new short[] { 220, 220, 220, 0 }) }; - } - - @Override - public boolean isSimpleMachine() { - return true; - } - - @Override - public boolean isFacingValid(ForgeDirection facing) { - return true; - } - - @Override - public boolean isAccessAllowed(EntityPlayer aPlayer) { - return true; - } - - @Override - public boolean isEnetInput() { - return false; - } - - @Override - public boolean isInputFacing(ForgeDirection side) { - return side == getBaseMetaTileEntity().getFrontFacing(); - } - - @Override - public boolean isValidSlot(int aIndex) { - return true; - } - - @Override - public long getMinimumStoredEU() { - return 0; - } - - @Override - public long maxEUInput() { - return V[mTier]; - } - - @Override - public long maxEUStore() { - return Long.MAX_VALUE / (Short.MAX_VALUE * Byte.MAX_VALUE); - } - - @Override - public long maxAmperesIn() { - return 0; - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_Energy_RTG(mName, mTier, 9, mDescriptionArray, mTextures); - } - - @Override - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { - return false; - } - - @Override - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { - return true; - } - - @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); - return true; - } - - private static class Dat { - - protected final String mUniqueDataTag; - private final ItemStack mStack; - private final NBTTagCompound mNBT; - - public Dat(ItemStack aStack) { - mStack = aStack; - mNBT = (aStack.getTagCompound() != null ? aStack.getTagCompound() : new NBTTagCompound()); - mUniqueDataTag = "" + Item - .getIdFromItem(aStack.getItem()) + "" + aStack.getItemDamage() + "" + 1 + "" + mNBT.getId(); - } - - public int getKey() { - return Item.getIdFromItem(mStack.getItem()) + mStack.getItemDamage(); - } - } - - private static final HashMap mFuelInstanceMap = new HashMap(); - private static final HashMap mFuelValueMap = new HashMap(); - private static final HashMap mFuelTypeMap = new HashMap(); - private static final HashMap mFuelTypeMapReverse = new HashMap(); - - public static boolean registerPelletForHatch(ItemStack aStack, long aFuelValue) { - if (!ItemUtils.checkForInvalidItems(aStack)) { - return false; - } - ItemStack aTemp = aStack.copy(); - aTemp.stackSize = 1; - Dat aDat = new Dat(aTemp); - String aKey = aDat.mUniqueDataTag; - mFuelInstanceMap.put(aKey, aTemp); - mFuelValueMap.put(aKey, aFuelValue); - mFuelTypeMap.put(aKey, aDat.getKey()); - mFuelTypeMapReverse.put(aDat.getKey(), aKey); - Logger.INFO( - "RTG Hatch: Registered Fuel Pellet: " + ItemUtils.getItemName( - aTemp) + ", Fuel Value: " + aFuelValue + ", Key: " + aKey + ", Key2: " + aDat.getKey()); - return true; - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) { - InventoryUtils.sortInventoryItems(this); - } - if (aTimer % 100 == 0 && aBaseMetaTileEntity.isServerSide()) { - if (hasPellet(this)) { - Logger.INFO("Has Pellet"); - tryConsumePellet(this); - } - } - } - - private static void tryConsumePellet(GT_MetaTileEntity_Hatch_Energy_RTG aTile) { - ItemStack aPellet = getPelletToConsume(aTile); - if (aPellet != null) { - Logger.INFO("Found Pellet"); - long aFuel = getFuelValueOfPellet(aPellet); - if (aFuel > 0) { - Logger.INFO("Has Fuel Value: " + aFuel); - if (hasSpaceForEnergy(aTile, aFuel)) { - Logger.INFO("Can buffer"); - aPellet.stackSize = 0; - Logger.INFO("Stack set to 0"); - aPellet = null; - Logger.INFO("null stack"); - addEnergyToInternalStorage(aTile, aFuel); - Logger.INFO("Consumed"); - } - } - } - aTile.updateSlots(); - Logger.INFO("updating slots"); - } - - private static void addEnergyToInternalStorage(GT_MetaTileEntity_Hatch_Energy_RTG aTile, long aFuel) { - aTile.getBaseMetaTileEntity().increaseStoredEnergyUnits(aFuel, true); - } - - public static boolean hasSpaceForEnergy(GT_MetaTileEntity_Hatch_Energy_RTG aTile, long aAmount) { - long aMax = aTile.maxEUStore(); - long aCurrent = aTile.getEUVar(); - if ((aMax - aCurrent) >= aAmount) { - return true; - } - return false; - } - - public void updateSlots() { - for (int i = 0; i < mInventory.length; i++) { - if (mInventory[i] != null && mInventory[i].stackSize <= 0) { - mInventory[i] = null; - } - } - InventoryUtils.sortInventoryItems(this); - } - - public static boolean hasPellet(GT_MetaTileEntity_Hatch_Energy_RTG aTile) { - for (ItemStack o : aTile.mInventory) { - if (o != null) { - for (ItemStack i : mFuelInstanceMap.values()) { - if (GT_Utility.areStacksEqual(o, i)) { - return true; - } - } - } - } - return false; - } - - public static String getPelletType(ItemStack o) { - if (o == null) { - return "error"; - } - Dat aDat = new Dat(o); - return mFuelTypeMapReverse.get(aDat.getKey()); - } - - public static long getFuelValueOfPellet(ItemStack aPellet) { - String aType = getPelletType(aPellet); - if (mFuelValueMap.containsKey(aType)) { - return mFuelValueMap.get(aType); - } - return 0; - } - - public static ItemStack getPelletToConsume(GT_MetaTileEntity_Hatch_Energy_RTG aTile) { - for (ItemStack o : aTile.mInventory) { - if (o != null) { - for (ItemStack i : mFuelInstanceMap.values()) { - if (GT_Utility.areStacksEqual(o, i)) { - return o; - } - } - } - } - return null; - } - - @Override - public boolean useModularUI() { - return true; - } - - @Override - public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - getBaseMetaTileEntity().add3by3Slots(builder); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 3c567db889..194729a4a2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -83,7 +83,6 @@ import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.preloader.asm.AsmConfig; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBattery; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput; @@ -102,7 +101,6 @@ public abstract class GregtechMeta_MultiBlockBase mControlCoreBus = new ArrayList<>(); /** * Don't use this for recipe input check, otherwise you'll get duplicated fluids */ @@ -168,7 +166,8 @@ public String[] getInfoData() { long seconds = (this.mTotalRunTime / 20); int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7); int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks); - long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7 * weeks); + long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) + - TimeUnit.DAYS.toHours(7L * weeks); long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60); long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) * 60); @@ -179,11 +178,11 @@ public String[] getInfoData() { mInfo.add( StatCollector.translateToLocal("GTPP.multiblock.progress") + ": " + EnumChatFormatting.GREEN - + Integer.toString(mProgresstime / 20) + + mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW - + Integer.toString(mMaxProgresstime / 20) + + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s"); @@ -272,15 +271,6 @@ public String[] getInfoData() { + " %"); } - if (this.mControlCoreBus.size() > 0) { - int tTier = this.getControlCoreTier(); - mInfo.add( - StatCollector.translateToLocal("GTPP.CC.machinetier") + ": " - + EnumChatFormatting.GREEN - + tTier - + EnumChatFormatting.RESET); - } - mInfo.add( StatCollector.translateToLocal("GTPP.CC.parallel") + ": " + EnumChatFormatting.GREEN @@ -448,7 +438,6 @@ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long if (this.mUpdate == 1 || this.mStartUpCheck == 1) { this.mChargeHatches.clear(); this.mDischargeHatches.clear(); - this.mControlCoreBus.clear(); this.mAirIntakes.clear(); this.mTecTechEnergyHatches.clear(); this.mTecTechDynamoHatches.clear(); @@ -563,15 +552,6 @@ public void updateSlots() { super.updateSlots(); } - public boolean isToolCreative(ItemStack mStack) { - Materials t1 = GT_MetaGenerated_Tool.getPrimaryMaterial(mStack); - Materials t2 = GT_MetaGenerated_Tool.getSecondaryMaterial(mStack); - if (t1 == Materials._NULL && t2 == Materials._NULL) { - return true; - } - return false; - } - /** * Causes a Random Maint. Issue. * @@ -705,59 +685,6 @@ public boolean addToMachineListInternal(ArrayList aList, final IMetaTileE return false; } - public int getControlCoreTier() { - - // Always return best tier if config is off. - /* - * boolean aCoresConfig = gtPlusPlus.core.lib.CORE.ConfigSwitches.requireControlCores; if (!aCoresConfig) { - * return 10; } - */ - - if (mControlCoreBus.isEmpty()) { - log("No Control Core Modules Found."); - return 0; - } - GT_MetaTileEntity_Hatch_ControlCore i = getControlCoreBus(); - if (i != null) { - ItemStack x = i.mInventory[0]; - if (x != null) { - return x.getItemDamage(); - } - } - log("Control Core Module was null."); - return 0; - } - - public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() { - if (this.mControlCoreBus == null || this.mControlCoreBus.isEmpty()) { - return null; - } - GT_MetaTileEntity_Hatch_ControlCore x = this.mControlCoreBus.get(0); - if (x != null) { - log("getControlCore(ok)"); - return x; - } - log("getControlCore(bad)"); - return null; - } - - // mControlCoreBus - public boolean addControlCoreToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { - if (!mControlCoreBus.isEmpty()) { - log("Tried to add a secondary control core module."); - return false; - } - GT_MetaTileEntity_Hatch_ControlCore Module = (GT_MetaTileEntity_Hatch_ControlCore) getMetaTileEntity( - aTileEntity); - if (Module != null) { - if (Module.setOwner(aTileEntity)) { - log("Adding control core module."); - return addToMachineListInternal(mControlCoreBus, Module, aBaseCasingIndex); - } - } - return false; - } - private IMetaTileEntity getMetaTileEntity(final IGregTechTileEntity aTileEntity) { if (aTileEntity == null) { return null; @@ -780,14 +707,7 @@ public boolean addToMachineList(final IMetaTileEntity aMetaTileEntity, final int boolean aDidAdd = false; // Handle Custom Hatches - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ControlCore) { - log("Found GT_MetaTileEntity_Hatch_ControlCore"); - if (!mControlCoreBus.isEmpty()) { - log("Tried to add a secondary control core module."); - return false; - } - aDidAdd = addToMachineListInternal(this.mControlCoreBus, aMetaTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) { + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) { log("Found GT_MetaTileEntity_Hatch_InputBattery"); aDidAdd = addToMachineListInternal(mChargeHatches, aMetaTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBattery) { @@ -1782,14 +1702,6 @@ public long count(GregtechMeta_MultiBlockBase t) { return t.mAirIntakes.size(); } }, - ControlCore(GregtechMeta_MultiBlockBase::addControlCoreToMachineList, - GT_MetaTileEntity_Hatch_ControlCore.class) { - - @Override - public long count(GregtechMeta_MultiBlockBase t) { - return t.mControlCoreBus.size(); - } - }, TTDynamo(GregtechMeta_MultiBlockBase::addMultiAmpDynamoToMachineList, "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti") { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java deleted file mode 100644 index a53915b3d6..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java +++ /dev/null @@ -1,328 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines; - -import static gregtech.api.enums.GT_Values.V; - -import java.util.UUID; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.enums.Textures; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.core.util.player.PlayerCache; - -public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_TieredMachineBlock { - - public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false; - public int mSuccess = 0, mTargetStackSize = 0; - public UUID ownerUUID; - - public GregtechMetaSafeBlockBase(final int aID, final String aName, final String aNameRegional, final int aTier, - final int aInvSlotCount, final String aDescription) { - super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); - } - - public GregtechMetaSafeBlockBase(final String aName, final int aTier, final int aInvSlotCount, - final String[] aDescription, final ITexture[][][] aTextures) { - super(aName, aTier, aInvSlotCount, aDescription, aTextures); - } - - @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[6][17][]; - final ITexture tIcon = this.getOverlayIcon(), tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST), - tUp = new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT); - for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tUp, tIcon }; // Back - rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Right, - // Strangely - // The - // top - // side - // as - // well - // when - // facing - // East? - rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Top - // And - // Bottom, - // When - // Facing - // South - // (What - // the - // hell?) - rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Left, - // Top - // if - // facing - // West - // and - // Bottom - // if - // facing - // east? - rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Top - // and - // Bottom - // when - // Facing - // North.. - rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tOut }; // Front - } - return rTextures; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - if (side == facing) { - return this.mTextures[5][aColorIndex + 1]; - } - if (side.getOpposite() == facing) { - return this.mTextures[0][aColorIndex + 1]; - } - switch (facing) { - case DOWN: - return this.mTextures[4][aColorIndex + 1]; - case UP: - return this.mTextures[2][aColorIndex + 1]; - case NORTH: - switch (side) { - case DOWN: - return this.mTextures[2][aColorIndex + 1]; - case UP: - return this.mTextures[2][aColorIndex + 1]; - case WEST: - return this.mTextures[1][aColorIndex + 1]; - case EAST: - return this.mTextures[3][aColorIndex + 1]; - } - case SOUTH: - switch (side) { - case DOWN: - return this.mTextures[4][aColorIndex + 1]; - case UP: - return this.mTextures[4][aColorIndex + 1]; - case WEST: - return this.mTextures[3][aColorIndex + 1]; - case EAST: - return this.mTextures[1][aColorIndex + 1]; - } - case WEST: - switch (side) { - case DOWN: - return this.mTextures[3][aColorIndex + 1]; - case UP: - return this.mTextures[1][aColorIndex + 1]; - case NORTH: - return this.mTextures[3][aColorIndex + 1]; - case SOUTH: - return this.mTextures[1][aColorIndex + 1]; - } - case EAST: - switch (side) { - case DOWN: - return this.mTextures[1][aColorIndex + 1]; - case UP: - return this.mTextures[3][aColorIndex + 1]; - case NORTH: - return this.mTextures[1][aColorIndex + 1]; - case SOUTH: - return this.mTextures[3][aColorIndex + 1]; - } - } - return this.mTextures[5][aColorIndex + 1]; - } - - @Override - public boolean isSimpleMachine() { - return false; - } - - @Override - public boolean isValidSlot(final int aIndex) { - return aIndex < (this.mInventory.length - 1); - } - - @Override - public boolean isFacingValid(final ForgeDirection facing) { - return true; - } - - @Override - public boolean isEnetInput() { - return true; - } - - @Override - public boolean isEnetOutput() { - return true; - } - - @Override - public boolean isInputFacing(final ForgeDirection side) { - return !this.isOutputFacing(side); - } - - @Override - public boolean isOutputFacing(final ForgeDirection side) { - return this.getBaseMetaTileEntity().getBackFacing() == side; - } - - @Override - public boolean isTeleporterCompatible() { - return false; - } - - @Override - public long getMinimumStoredEU() { - return 512; - } - - @Override - public long maxEUStore() { - return 512 + (V[this.mTier] * 50); - } - - @Override - public long maxEUInput() { - return V[this.mTier]; - } - - @Override - public long maxEUOutput() { - return this.bOutput ? V[this.mTier] : 0; - } - - @Override - public long maxAmperesIn() { - return 1; - } - - @Override - public long maxAmperesOut() { - return 1; - } - - @Override - public boolean isAccessAllowed(final EntityPlayer aPlayer) { - return true; - } - - public abstract ITexture getOverlayIcon(); - - @Override - public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - - if (aBaseMetaTileEntity.isClientSide()) { - // Utils.LOG_WARNING("Clicky Clicky."); - return true; - } - if (aPlayer != null) { - final UUID tempUUID = aPlayer.getUniqueID(); - /* - * if (!aPlayer.worldObj.isRemote){ //PlayerCache.appendParamChanges(aPlayer.getDisplayName(), - * aPlayer.getUniqueID().toString()); } - */ - // Utils.LOG_INFO("test"); - if (this.ownerUUID == null) { - Logger.INFO("No owner yet for this block."); - } else { - // Utils.LOG_INFO("test"); - Logger.INFO( - "Current Owner: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID) - + " - UUID: " - + this.ownerUUID); - } - Logger.WARNING("Is ownerUUID Null"); - if (this.ownerUUID == null) { - Logger.WARNING("OwnerUUID is Null, let's set it."); - Logger.WARNING("Accessing Players UUID is: " + tempUUID); - this.ownerUUID = tempUUID; - // Utils.messagePlayer(aPlayer, "Owner of this safe, now set. Try accessing it again."); - Logger.WARNING("Block Owner is now set to: " + this.ownerUUID); - } - Logger.WARNING("No, it is not."); - Logger.WARNING("Checking ownerUUID."); - if (this.ownerUUID != null) { - Logger.WARNING("ownerUUID != Null, if accessor == owner."); - Logger.WARNING("Accessing is: " + PlayerCache.lookupPlayerByUUID(tempUUID)); - if (this.ownerUUID.equals(tempUUID)) { - Logger.WARNING("Owner's UUID: " + this.ownerUUID); - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); - // Utils.LOG_WARNING("GUI should now be open for you sir."); - } else { - PlayerUtils.messagePlayer(aPlayer, "Access Denied, This does not belong to you."); - PlayerUtils.messagePlayer( - aPlayer, - "it is owned by: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID)); - Logger.WARNING("Expecting Player : " + PlayerCache.lookupPlayerByUUID(this.ownerUUID)); - Logger.ERROR("Access Denied."); - return true; - } - } - - /* - * else { Utils.LOG_ERROR("This is NOT good. Tell Draknyte1 your safe broke."); } - */ - /* - * Utils.LOG_WARNING("Clicky Clicky."); Utils.messagePlayer(aPlayer, "Owner of this safe, now set."); - * aBaseMetaTileEntity.openGUI(aPlayer); - */ - - } - return true; - } - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - aNBT.setBoolean("bUnbreakable", this.bUnbreakable); - aNBT.setBoolean("bOutput", this.bOutput); - aNBT.setBoolean("bRedstoneIfFull", this.bRedstoneIfFull); - aNBT.setInteger("mTargetStackSize", this.mTargetStackSize); - if (this.ownerUUID != null) { - aNBT.setString("ownerUUID", this.ownerUUID.toString()); - } - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - this.bUnbreakable = aNBT.getBoolean("bUnbreakable"); - this.bOutput = aNBT.getBoolean("bOutput"); - this.bRedstoneIfFull = aNBT.getBoolean("bRedstoneIfFull"); - this.mTargetStackSize = aNBT.getInteger("mTargetStackSize"); - if (aNBT.hasKey("ownerUUID")) { - this.ownerUUID = UUID.fromString(aNBT.getString("ownerUUID")); - } - } - - @Override - public void setItemNBT(final NBTTagCompound aNBT) { - super.setItemNBT(aNBT); - if (this.mTargetStackSize > 0) { - aNBT.setInteger("mTargetStackSize", this.mTargetStackSize); - } - } - - @Override - public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return false; - } - - @Override - public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return side != aBaseMetaTileEntity.getBackFacing(); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java index 047e589db1..9a82ecf93b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java @@ -3,7 +3,9 @@ import java.util.List; import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -18,7 +20,26 @@ public class GregtechMetaCasingBlocks2 extends GregtechMetaCasingBlocksAbstract { - CasingTextureHandler2 TextureHandler = new CasingTextureHandler2(); + @Override + public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + aList.add(new ItemStack(aItem, 1, 0)); + aList.add(new ItemStack(aItem, 1, 1)); + aList.add(new ItemStack(aItem, 1, 2)); + aList.add(new ItemStack(aItem, 1, 3)); + aList.add(new ItemStack(aItem, 1, 4)); + aList.add(new ItemStack(aItem, 1, 5)); + aList.add(new ItemStack(aItem, 1, 6)); + aList.add(new ItemStack(aItem, 1, 7)); + aList.add(new ItemStack(aItem, 1, 8)); + aList.add(new ItemStack(aItem, 1, 9)); + aList.add(new ItemStack(aItem, 1, 10)); + aList.add(new ItemStack(aItem, 1, 11)); + aList.add(new ItemStack(aItem, 1, 12)); + aList.add(new ItemStack(aItem, 1, 13)); + + aList.add(new ItemStack(aItem, 1, 15)); + + } public static class GregtechMetaCasingItemBlocks2 extends GregtechMetaCasingItems { @@ -62,10 +83,9 @@ public GregtechMetaCasingBlocks2() { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Thermal Containment Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Bulk Production Frame"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Cutting Factory Frame"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Sterile Farm Casing"); // Tree - // Farmer - // Textures + + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Sterile Farm Casing"); + GregtechItemList.Casing_ThermalCentrifuge.set(new ItemStack(this, 1, 0)); GregtechItemList.Casing_Refinery_External.set(new ItemStack(this, 1, 1)); GregtechItemList.Casing_Refinery_Structural.set(new ItemStack(this, 1, 2)); @@ -80,6 +100,7 @@ public GregtechMetaCasingBlocks2() { GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11)); GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12)); GregtechItemList.Casing_CuttingFactoryFrame.set(new ItemStack(this, 1, 13)); + GregtechItemList.Casing_PLACEHOLDER_TreeFarmer.set(new ItemStack(this, 1, 15)); // Tree Farmer Textures } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java index 038e4f0366..cf9d272398 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -1,5 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -21,23 +25,15 @@ public GregtechMetaCasingBlocks4() { } TAE.registerTexture(3, i, new GTPP_CopiedBlockTexture(this, 6, i)); } - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Naquadah Reactor Base"); // 48 + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Naquadah Reactor Base"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reactor Piping"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Naquadah Containment Chamber"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Tempered Arc Furnace Casing"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Quantum Force Transformer Coil Casings"); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); // Unused + .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Quantum Force Transformer Coil Casings"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Turbodyne Casing"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused + GregtechItemList.Casing_Naq_Reactor_A.set(new ItemStack(this, 1, 0)); GregtechItemList.Casing_Naq_Reactor_B.set(new ItemStack(this, 1, 1)); GregtechItemList.Casing_Naq_Reactor_C.set(new ItemStack(this, 1, 2)); @@ -56,46 +52,75 @@ public static IIcon getStaticIcon(final byte aSide, final byte aMeta) { // Texture ID's. case 0 == ID[57] if ((aMeta >= 0) && (aMeta < 16)) { switch (aMeta) { - case 0: + case 0 -> { return TexturesGtBlock.Casing_Trinium_Titanium.getIcon(); - case 1: + } + case 1 -> { return TexturesGtBlock.TEXTURE_TECH_C.getIcon(); - case 2: + } + case 2 -> { return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon(); - case 3: + } + case 3 -> { return TexturesGtBlock.TEXTURE_METAL_PANEL_A.getIcon(); - case 4: + } + case 4 -> { return TexturesGtBlock.Casing_Coil_QFT.getIcon(); - case 5: + } + case 5 -> { return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 6: + } + case 6 -> { return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 7: + } + case 7 -> { return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 8: + } + case 8 -> { return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 9: + } + case 9 -> { return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); - case 10: + } + case 10 -> { if (aSide < 2) { return TexturesGtBlock.TEXTURE_STONE_RED_B.getIcon(); } else { return TexturesGtBlock.TEXTURE_STONE_RED_A.getIcon(); } - case 11: + } + case 11 -> { return TexturesGtBlock.TEXTURE_CASING_ROCKETDYNE.getIcon(); - case 12: + } + case 12 -> { return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 13: + } + case 13 -> { return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 14: + } + case 14 -> { return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 15: + } + case 15 -> { return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - default: + } + default -> { return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); + } } } return TexturesGtBlock._PlaceHolder.getIcon(); } + + @Override + public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + aList.add(new ItemStack(aItem, 1, 0)); + aList.add(new ItemStack(aItem, 1, 1)); + aList.add(new ItemStack(aItem, 1, 2)); + aList.add(new ItemStack(aItem, 1, 3)); + aList.add(new ItemStack(aItem, 1, 4)); + + aList.add(new ItemStack(aItem, 1, 10)); + aList.add(new ItemStack(aItem, 1, 11)); + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks6.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks6.java index a74d714a80..3cf25344ac 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks6.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks6.java @@ -3,7 +3,9 @@ import java.util.List; import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; @@ -21,6 +23,13 @@ public class GregtechMetaCasingBlocks6 extends GregtechMetaCasingBlocksAbstract public static boolean mConnectedMachineTextures = false; CasingTextureHandler6 TextureHandler = new CasingTextureHandler6(); + @Override + public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + for (int i = 0; i < 3; i++) { + aList.add(new ItemStack(aItem, 1, i)); + } + } + public static class GregtechMetaCasingItemBlocks3 extends GregtechMetaCasingItems { public GregtechMetaCasingItemBlocks3(Block par1) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java index 685bee8dab..b16868aeb2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java @@ -3,7 +3,9 @@ import java.util.List; import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -17,6 +19,13 @@ public class GregtechMetaSpecialMachineCasings extends GregtechMetaCasingBlocksAbstract { + @Override + public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + for (int i = 0; i < 4; i++) { + aList.add(new ItemStack(aItem, 1, i)); + } + } + public static class SpecialCasingItemBlock extends GregtechMetaCasingItems { public SpecialCasingItemBlock(Block par1) { @@ -47,18 +56,6 @@ public GregtechMetaSpecialMachineCasings() { TAE.registerTexture(84, new GTPP_CopiedBlockTexture(this, 6, 2)); GT_LanguageManager .addStringLocalization(this.getUnlocalizedName() + ".3.name", "Rugged Botmium Machine Casing"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", ""); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", ""); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused GregtechItemList.Casing_Machine_Custom_1.set(new ItemStack(this, 1, 0)); GregtechItemList.Casing_Machine_Custom_2.set(new ItemStack(this, 1, 1)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java index b81e381b8c..1cc2403973 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java @@ -3,7 +3,9 @@ import java.util.List; import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; @@ -18,6 +20,13 @@ public class GregtechMetaSpecialMultiCasings2 extends GregtechMetaCasingBlocksAbstract { + @Override + public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + for (int i = 0; i < 8; i++) { + aList.add(new ItemStack(aItem, 1, i)); + } + } + public static class SpecialCasingItemBlock extends GregtechMetaCasingItems { public SpecialCasingItemBlock(Block par1) { @@ -51,14 +60,6 @@ public GregtechMetaSpecialMultiCasings2() { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Modulator II"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Modulator III"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Modulator IV"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", ""); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused GregtechItemList.ResonanceChamber_I.set(new ItemStack(this, 1, 0)); GregtechItemList.ResonanceChamber_II.set(new ItemStack(this, 1, 1)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java index 0d4606ab4f..c9f748e171 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java @@ -3,7 +3,9 @@ import java.util.List; import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -16,6 +18,13 @@ public class GregtechMetaTieredCasingBlocks1 extends GregtechMetaCasingBlocksAbstract { + @Override + public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + for (int i = 0; i < 10; i++) { + aList.add(new ItemStack(aItem, 1, i)); + } + } + public static class TieredCasingItemBlock extends GregtechMetaCasingItems { public TieredCasingItemBlock(Block par1) { @@ -34,11 +43,6 @@ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, b public GregtechMetaTieredCasingBlocks1() { super(TieredCasingItemBlock.class, "gtplusplus.blocktieredcasings.1", GT_Material_Casings.INSTANCE); - for (byte i = 0; i < 16; i = (byte) (i + 1)) { - // TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i)); - // Don't register these Textures, Hatches should never need to use their Textures. - } - int aIndex = 0; GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Integral Encasement I"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Integral Encasement II"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Integral Encasement III"); @@ -49,12 +53,6 @@ public GregtechMetaTieredCasingBlocks1() { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Integral Framework III"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Integral Framework IV"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Integral Framework V"); - // GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing"); - // GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Turbodyne Casing"); - // GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); - // GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); - // GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Placeholder Block"); GregtechItemList.GTPP_Casing_ULV.set(new ItemStack(this, 1, 0)); GregtechItemList.GTPP_Casing_LV.set(new ItemStack(this, 1, 1)); @@ -66,13 +64,6 @@ public GregtechMetaTieredCasingBlocks1() { GregtechItemList.GTPP_Casing_ZPM.set(new ItemStack(this, 1, 7)); GregtechItemList.GTPP_Casing_UV.set(new ItemStack(this, 1, 8)); GregtechItemList.GTPP_Casing_MAX.set(new ItemStack(this, 1, 9)); - - // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 10)); - // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 11)); - // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 12)); - // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 13)); - // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 14)); - // GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 15)); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java deleted file mode 100644 index 5dda99f469..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java +++ /dev/null @@ -1,40 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.blocks.textures; - -import static gregtech.api.enums.Mods.ZTones; - -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; - -public class TexturesGtCutomCovers { - - public static final CustomIcon[] TEXTURE_ZTONES_AGON = new CustomIcon[16]; - public static final CustomIcon[] TEXTURE_ZTONES_ISZM = new CustomIcon[16]; - public static final CustomIcon[] TEXTURE_ZTONES_KORP = new CustomIcon[16]; - public static final CustomIcon[] TEXTURE_ZTONES_JELT = new CustomIcon[16]; - public static final CustomIcon[] TEXTURE_ZTONES_BITT = new CustomIcon[16]; - - public static void init() { - generateZTones(); - } - - private static void generateZTones() { - // ZTONES - String[] aZtoneCoverTextureNames = new String[] { "agon", "iszm", "korp", "jelt", "bitt" }; - int aArrayIndex = 0; - CustomIcon[][] aArrays = new CustomIcon[][] { TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, - TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT }; - - for (CustomIcon[] t : aArrays) { - for (int s = 0; s < 16; s++) { - t[s] = new CustomIcon( - ZTones.ID, - "sets/" + aZtoneCoverTextureNames[aArrayIndex] - + "/" - + aZtoneCoverTextureNames[aArrayIndex] - + "_ (" - + s - + ")"); - } - aArrayIndex++; - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java index 9819f9d59b..dfb519a445 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java @@ -12,7 +12,6 @@ public final class TexturesGtTools { - public static final CustomIcon SKOOKUM_CHOOCHER = new CustomIcon("iconsets/SKOOKUMCHOOCHER"); public static final CustomIcon ANGLE_GRINDER = new CustomIcon("iconsets/ANGLE_GRINDER"); public static final CustomIcon ELECTRIC_SNIPS = new CustomIcon("iconsets/ELECTRIC_SNIPS"); public static final CustomIcon ELECTRIC_LIGHTER = new CustomIcon("iconsets/ELECTRIC_LIGHTER"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java index 94d5402589..c1f87ef041 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java @@ -1,102 +1,16 @@ package gtPlusPlus.xmod.gregtech.common.covers; -import static gregtech.api.enums.Mods.ZTones; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers.TEXTURE_ZTONES_AGON; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers.TEXTURE_ZTONES_BITT; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers.TEXTURE_ZTONES_ISZM; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers.TEXTURE_ZTONES_JELT; -import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers.TEXTURE_ZTONES_KORP; - -import gtPlusPlus.core.lib.VanillaColours; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtCutomCovers; -import gtPlusPlus.xmod.gregtech.common.items.MetaCustomCoverItem; import gtPlusPlus.xmod.gregtech.common.items.covers.MetaItemCoverCasings; public class CoverManager { - // ZTones - public static MetaCustomCoverItem Cover_Agon; - public static MetaCustomCoverItem Cover_Iszm; - public static MetaCustomCoverItem Cover_Korp; - public static MetaCustomCoverItem Cover_Jelt; - public static MetaCustomCoverItem Cover_Bitt; - // GT public static MetaItemCoverCasings Cover_Gt_Machine_Casing; public static void generateCustomCovers() { - // init textures - TexturesGtCutomCovers.init(); - // GT Machine Casings Cover_Gt_Machine_Casing = new MetaItemCoverCasings(); - - if (ZTones.isModLoaded()) { - String[] aZtoneCoverTextureNames = new String[] { "agon", "iszm", "korp", "jelt", "bitt" }; - MetaCustomCoverItem[] aZtoneCoverItems = new MetaCustomCoverItem[] { Cover_Agon, Cover_Iszm, Cover_Korp, - Cover_Jelt, Cover_Bitt }; - CustomIcon[][] aArrays = new CustomIcon[][] { TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, - TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT }; - short[][][] aRGB = new short[][][] { ZTONES.RGB_AGON, ZTONES.RGB_ISZM, ZTONES.RGB_KORP, ZTONES.RGB_JELT, - ZTONES.RGB_BITT }; - for (int y = 0; y < aZtoneCoverTextureNames.length; y++) { - aZtoneCoverItems[y] = new MetaCustomCoverItem( - ZTones.ID, - 16, - aZtoneCoverTextureNames[y], - aArrays[y], - aRGB[y]); - } - } } - static final class ZTONES { - - private static final short[][] RGB_AGON = new short[][] { VanillaColours.DYE_WHITE.getAsShort(), - VanillaColours.DYE_YELLOW.getAsShort(), VanillaColours.DYE_LIME.getAsShort(), - VanillaColours.DYE_GREEN.getAsShort(), VanillaColours.DYE_CYAN.getAsShort(), - VanillaColours.DYE_LIGHT_BLUE.getAsShort(), VanillaColours.DYE_DARK_BLUE.getAsShort(), - VanillaColours.DYE_DARK_PURPLE.getAsShort(), VanillaColours.DYE_LIGHT_PURPLE.getAsShort(), - VanillaColours.DYE_PINK.getAsShort(), VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_BROWN.getAsShort(), - VanillaColours.DYE_BLACK.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_LIGHT_GRAY.getAsShort(), }; - private static final short[][] RGB_ISZM = new short[][] { VanillaColours.DYE_LIGHT_GRAY.getAsShort(), - VanillaColours.DYE_WHITE.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_BLUE.getAsShort(), VanillaColours.DYE_YELLOW.getAsShort(), - VanillaColours.DYE_DARK_BLUE.getAsShort(), VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_CYAN.getAsShort(), - VanillaColours.DYE_YELLOW.getAsShort(), VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_CYAN.getAsShort(), VanillaColours.DYE_GREEN.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_LIGHT_BLUE.getAsShort(), - VanillaColours.DYE_DARK_PURPLE.getAsShort(), }; - private static final short[][] RGB_KORP = new short[][] { new short[] { 125, 125, 125 }, - VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), new short[] { 22, 156, 156 }, new short[] { 22, 156, 156 }, - VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), }; - private static final short[][] RGB_JELT = new short[][] { VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), }; - private static final short[][] RGB_BITT = new short[][] { VanillaColours.DYE_BLACK.getAsShort(), - VanillaColours.DYE_WHITE.getAsShort(), VanillaColours.DYE_YELLOW.getAsShort(), - VanillaColours.DYE_LIME.getAsShort(), VanillaColours.DYE_GREEN.getAsShort(), - VanillaColours.DYE_CYAN.getAsShort(), VanillaColours.DYE_LIGHT_BLUE.getAsShort(), - VanillaColours.DYE_LIGHT_BLUE.getAsShort(), VanillaColours.DYE_DARK_BLUE.getAsShort(), - VanillaColours.DYE_DARK_PURPLE.getAsShort(), VanillaColours.DYE_LIGHT_PURPLE.getAsShort(), - VanillaColours.DYE_PINK.getAsShort(), VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_RED.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_BROWN.getAsShort(), }; - } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index f7f935fdf1..d7eccc0d6b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -5,8 +5,6 @@ import static gregtech.client.GT_TooltipHandler.registerTieredTooltip; import static gtPlusPlus.core.util.Utils.getTcAspectStack; -import net.minecraft.item.EnumAction; - import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -18,7 +16,6 @@ import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_FoodStat; import gregtech.api.util.GT_ModHandler; import gregtech.common.covers.GT_Cover_Arm; import gregtech.common.covers.GT_Cover_Conveyor; @@ -57,7 +54,6 @@ public void generateMetaItems() { // Simplify life. registerComponents_ULV(); - registerComponents_MAX(); // Extruder Shape GregtechItemList.Shape_Extruder_WindmillShaft @@ -192,21 +188,11 @@ public void generateMetaItems() { getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); this.setElectricStats(32000 + tLastID, GT_Values.V[6] * 10 * 60 * 20, GT_Values.V[5], 5L, -3L, true); - // FOOOOOOOOOOOOOOD - GregtechItemList.Food_Baked_Raisin_Bread.set( - this.addItem( - tLastID = 60, - "Raisin Bread", - "Extra Raisins, Just for ImQ009", - new Object[] { new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false, new int[0]), - getTcAspectStack(TC_Aspects.CORPUS, 1L), getTcAspectStack(TC_Aspects.FAMES, 1L), - getTcAspectStack(TC_Aspects.IGNIS, 1L) })); - GregtechItemList.Cover_Overflow_ULV.set( this.addItem( 71, "Overflow Valve (ULV)", - "Maximum void amount: 8000", + "Maximum void amount: 8,000", new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L) })); @@ -214,7 +200,7 @@ public void generateMetaItems() { this.addItem( 72, "Overflow Valve (LV)", - "Maximum void amount: 64000", + "Maximum void amount: 64,000", new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L) })); @@ -222,7 +208,7 @@ public void generateMetaItems() { this.addItem( 73, "Overflow Valve (MV)", - "Maximum void amount: 512000", + "Maximum void amount: 512,000", new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L) })); @@ -230,7 +216,7 @@ public void generateMetaItems() { this.addItem( 74, "Overflow Valve (HV)", - "Maximum void amount: 4096000", + "Maximum void amount: 4,096,000", new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L) })); @@ -238,7 +224,7 @@ public void generateMetaItems() { this.addItem( 75, "Overflow Valve (EV)", - "Maximum void amount: 32768000", + "Maximum void amount: 32,768,000", new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L) })); @@ -246,7 +232,7 @@ public void generateMetaItems() { this.addItem( 76, "Overflow Valve (IV)", - "Maximum void amount: 262144000", + "Maximum void amount: 262,144,000", new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L) })); @@ -295,21 +281,6 @@ public void generateMetaItems() { "Hypervisor Matrix (Fusion)", "A memory unit containing an RI (Restricted Intelligence)")); - // NanoTubes - GregtechItemList.NanoTube_Base_Substrate - .set(this.addItem(101, "Silicon Base Substrate", "Used in the production of Carbon Nanotubes")); - GregtechItemList.NanoTube_Finished.set( - this.addItem(102, "Carbon Nanotubes", "Multi-walled Zigzag nanotubes, possibly Carbon's final form")); - GregtechItemList.Carbyne_Tube_Finished.set( - this.addItem( - 103, - "Linear Acetylenic Carbon (LAC/Carbyne)", - "LAC chains grown inside Multi-walled Carbon Nanotubes, highly stable")); - GregtechItemList.Carbyne_Sheet_Finished.set( - this.addItem( - 104, - "Carbyne Composite Panel", - "Nanotubes which contain LAC, arranged side by side and compressed further")); GregtechItemList.Laser_Lens_Special .set(this.addItem(105, "Quantum Anomaly", "Probably should shoot it with lasers")); @@ -341,51 +312,6 @@ public void generateMetaItems() { /* * High Tier 'Saws' for the tree Farm */ - GregtechItemList.Farm_Processor_EV.set( - this.addItem( - tLastID = 120, - "Farm Processor [EV]", - "Reusable", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); - this.setElectricStats(32000 + tLastID, GT_Values.V[5] * 10 * 60 * 20, GT_Values.V[4], 4L, -3L, false); - GregtechItemList.Farm_Processor_IV.set( - this.addItem( - tLastID = 122, - "Farm Processor [IV]", - "Reusable", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); - this.setElectricStats(32000 + tLastID, GT_Values.V[6] * 10 * 60 * 20, GT_Values.V[5], 5L, -3L, false); - GregtechItemList.Farm_Processor_LuV.set( - this.addItem( - tLastID = 124, - "Farm Processor [LuV]", - "Reusable", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); - this.setElectricStats(32000 + tLastID, GT_Values.V[7] * 10 * 60 * 20, GT_Values.V[6], 6L, -3L, false); - GregtechItemList.Farm_Processor_ZPM.set( - this.addItem( - tLastID = 126, - "Farm Processor [ZPM]", - "Reusable", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); - this.setElectricStats(32000 + tLastID, GT_Values.V[8] * 10 * 60 * 20, GT_Values.V[7], 7L, -3L, false); - GregtechItemList.Farm_Processor_UV.set( - this.addItem( - tLastID = 128, - "Farm Processor [UV]", - "Reusable", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); - this.setElectricStats(32000 + tLastID, GT_Values.V[9] * 10 * 60 * 20, GT_Values.V[8], 8L, -3L, false); GregtechItemList.Laser_Lens_WoodsGlass.set( this.addItem( @@ -500,88 +426,6 @@ private boolean registerComponents_ULV() { return true; } - private boolean registerComponents_MAX() { - GregtechItemList.Electric_Pump_MAX.set( - this.addItem( - 3, - "Electric Pump (MAX)", - "", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L), - getTcAspectStack(TC_Aspects.AQUA, 8L) })); - GregtechItemList.Electric_Motor_MAX.set( - this.addItem( - 7, - "Electric Motor (MAX)", - "", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.MOTUS, 8L) })); - GregtechItemList.Conveyor_Module_MAX.set( - this.addItem( - 11, - "Conveyor Module (MAX)", - "", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L) })); - GregtechItemList.Electric_Piston_MAX.set( - this.addItem( - 15, - "Electric Piston (MAX)", - "", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L) })); - GregtechItemList.Robot_Arm_MAX.set( - this.addItem( - 19, - "Robot Arm (MAX)", - "", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L), - getTcAspectStack("COGNITIO", 8L) })); - GregtechItemList.Field_Generator_MAX.set( - this.addItem( - 23, - "Field Generator (MAX)", - "", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 16L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.TUTAMEN, 8L) })); - GregtechItemList.Emitter_MAX.set( - this.addItem( - 27, - "Emitter (MAX)", - "", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.LUX, 8L) })); - GregtechItemList.Sensor_MAX.set( - this.addItem( - 31, - "Sensor (MAX)", - "", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.SENSUS, 8L) })); - - GregTech_API.registerCover( - GregtechItemList.Electric_Pump_MAX.get(1L), - new GT_MultiTexture( - new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[8][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) }), - new GT_Cover_Pump(524288, TextureFactory.of(OVERLAY_PUMP))); - GregTech_API.registerCover( - GregtechItemList.Conveyor_Module_MAX.get(1L), - new GT_MultiTexture( - new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[4][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) }), - new GT_Cover_Conveyor(4, 1, TextureFactory.of(OVERLAY_CONVEYOR))); - GregTech_API.registerCover( - GregtechItemList.Robot_Arm_MAX.get(1L), - new GT_MultiTexture( - new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[4][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) }), - new GT_Cover_Arm(4, TextureFactory.of(OVERLAY_ARM))); - - return true; - } - public boolean registerOldCircuits() { // Enable Old Circuits Logger.INFO("[Old Feature - Circuits] Enabling Pre-5.09.28 Circuits and Data Storage."); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java index cd81bfce76..a07ed2131a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java @@ -6,7 +6,6 @@ import gregtech.api.items.GT_MetaGenerated_Tool; import gtPlusPlus.xmod.gregtech.api.enums.GregtechToolDictNames; import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_AngleGrinder; -import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_Choocher; import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_ElectricButcherKnife; import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_ElectricLighter; import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_ElectricSnips; @@ -15,7 +14,6 @@ public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool { public static final short ELECTRIC_LIGHTER = 7534; public static final short ELECTRIC_BUTCHER_KNIFE = 7634; - public static final short SKOOKUM_CHOOCHER = 7734; public static final short ANGLE_GRINDER = 7834; public static final short ELECTRIC_SNIPS = 7934; public static GT_MetaGenerated_Tool INSTANCE; @@ -30,19 +28,6 @@ public static GT_MetaGenerated_Tool getInstance() { private MetaGeneratedGregtechTools() { super("plusplus.metatool.01"); - // Skookum Choocher - GregTech_API.registerTool( - this.addTool( - SKOOKUM_CHOOCHER, - "Skookum Choocher", - "Can Really Chooch. Does a Skookum job at Hammering and Wrenching stuff.", - new TOOL_Gregtech_Choocher(), - new Object[] { GregtechToolDictNames.craftingToolSkookumChoocher, - ToolDictNames.craftingToolHardHammer, ToolDictNames.craftingToolWrench, - new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), - new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), - new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) }), - GregTech_API.sWrenchList); // Electric File this.addTool( diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index 51d7b4d186..3b54fb46a7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -28,7 +28,6 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; - private int mDays; private long mTicksToBurnFor; private int mVoltage = 0; private GT_Recipe mCurrentRecipe; @@ -79,7 +78,6 @@ public void saveNBTData(NBTTagCompound aNBT) { @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - // this.mMachineBlock = aNBT.getByte("mMachineBlock"); this.mTicksToBurnFor = aNBT.getLong("mTicksToBurnFor"); this.mVoltage = aNBT.getInteger("mVoltage"); this.mDaysRemaining = aNBT.getInteger("mDaysRemaining"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java deleted file mode 100644 index c04a04ae3c..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java +++ /dev/null @@ -1,234 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.generators.creative; - -import static gregtech.api.enums.GT_Values.V; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import com.gtnewhorizon.gtnhlib.reflect.Fields; - -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.core.util.sys.KeyboardUtils; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; -import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer; - -/** - * NEVER INCLUDE THIS FILE IN YOUR MOD!!! - * - * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple - * Machine - */ -public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { - - private int mVoltageTier = 3; - - public GregtechMetaCreativeEnergyBuffer(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures, final int aSlotCount) { - super(aName, aTier, aDescription, aTextures, aSlotCount); - // TODO Auto-generated constructor stub - } - - public GregtechMetaCreativeEnergyBuffer(final int aID, final String aName, final String aNameRegional, - final int aTier, final String aDescription, final int aSlotCount) { - super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount); - } - - @Override - public String[] getDescription() { - return new String[] { this.mDescription, "Use Screwdriver to change voltage", - "Hold Shift while using Screwdriver to change amperage", EnumChatFormatting.GREEN + "CREATIVE MACHINE", - CORE.GT_Tooltip.get() }; - } - - /* - * MACHINE_STEEL_SIDE - */ - @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - CustomIcon h = TexturesGtBlock.Casing_Material_RedSteel; - CustomIcon g = TexturesGtBlock.Casing_Material_Grisium; - CustomIcon k; - boolean j = MathUtils.isNumberEven(this.mVoltageTier); - final ITexture[][][] rTextures = new ITexture[2][17][]; - k = j ? g : h; - for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = new ITexture[] { new GT_RenderedTexture(k) }; - rTextures[1][i + 1] = new ITexture[] { new GT_RenderedTexture(k), - this.mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mVoltageTier] - : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mVoltageTier] }; - } - return rTextures; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[side == facing ? 1 : 0][aColorIndex + 1]; - } - - @Override - protected void showEnergy(final World worldIn, final EntityPlayer playerIn) { - final long tempStorage = this.getBaseMetaTileEntity().getStoredEU(); - final double c = ((double) tempStorage / this.maxEUStore()) * 100; - final double roundOff = Math.round(c * 100.00) / 100.00; - PlayerUtils.messagePlayer( - playerIn, - "Energy: " + GT_Utility - .formatNumbers(tempStorage) + " EU at " + V[this.mVoltageTier] + "v (" + roundOff + "%)"); - PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesOut()) + "A"); - } - - @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaCreativeEnergyBuffer( - this.mName, - this.mTier, - this.mDescription, - this.mTextures, - this.mInventory.length); - } - - @Override - public long getMinimumStoredEU() { - return 0; - } - - @Override - public long maxEUStore() { - return Long.MAX_VALUE; - } - - @Override - public long maxEUInput() { - return V[mVoltageTier]; - } - - @Override - public long maxEUOutput() { - return V[mVoltageTier]; - } - - @Override - public long maxAmperesIn() { - return aCurrentOutputAmperage; - } - - @Override - public long maxAmperesOut() { - return aCurrentOutputAmperage; - } - - @Override - public int getProgresstime() { - return Integer.MAX_VALUE; - } - - @Override - public int maxProgresstime() { - return Integer.MAX_VALUE; - } - - @Override - public boolean isAccessAllowed(final EntityPlayer aPlayer) { - return true; - } - - @Override - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - if (aBaseMetaTileEntity.isServerSide()) { - aBaseMetaTileEntity.increaseStoredEnergyUnits(Integer.MAX_VALUE, true); - } - } - - @Override - public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return false; - } - - @Override - public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return false; - } - - @Override - public String[] getInfoData() { - String[] infoData = super.getInfoData(); - return new String[] { infoData[0], "THIS IS A CREATIVE ITEM - FOR TESTING | Tier: " + this.mVoltageTier, - infoData[1], infoData[2] }; - } - - @Override - public boolean isGivingInformation() { - return true; - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setInteger("mVoltageTier", this.mVoltageTier); - super.saveNBTData(aNBT); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - this.mVoltageTier = aNBT.getInteger("mVoltageTier"); - super.loadNBTData(aNBT); - } - - private static Fields.ClassFields.Field mTexturesAccessor; - - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (KeyboardUtils.isShiftKeyDown()) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); - } else { - if (this.mVoltageTier < (GT_Values.VN[9].equals("UHV") ? GT_Values.V.length - 1 : 9)) { - this.mVoltageTier++; - } else { - this.mVoltageTier = 0; - } - this.markDirty(); - try { - if (mTexturesAccessor == null) { - mTexturesAccessor = Fields.ofClass(GregtechMetaCreativeEnergyBuffer.class) - .getField(Fields.LookupType.PUBLIC, "mTextures", ITexture[][][].class); - } - ITexture[][][] V = getTextureSet(null); - if (V != null) { - Logger.REFLECTION("Got Valid Textures."); - if (this.getBaseMetaTileEntity().isClientSide()) { - Logger.REFLECTION("Clientside Call."); - Logger.REFLECTION("Refreshing Textures on buffer."); - mTexturesAccessor.setValue(this, V); - Logger.REFLECTION("Refreshed Textures on buffer."); - } else { - Logger.REFLECTION("Serverside Call."); - } - } else { - Logger.REFLECTION("Bad mTextures setter."); - } - } catch (Throwable t) { - // Bad refresh. - t.printStackTrace(); - Logger.REFLECTION("Bad mTextures setter."); - } - PlayerUtils.messagePlayer(aPlayer, "Now running at " + GT_Values.VOLTAGE_NAMES[this.mVoltageTier] + "."); - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java deleted file mode 100644 index e815a622d9..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java +++ /dev/null @@ -1,386 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GregtechMetaGarbageCollector extends GregtechMetaTileEntity { - - long mLastCleanup = 0; - long mLocalTickVar = 0; - int mFrequency = 5; - - public GregtechMetaGarbageCollector(final String aName, final String aNameRegional, final String aDescription) { - super(991, aName, aNameRegional, 5, 0, aDescription); - } - - public GregtechMetaGarbageCollector(final String aName, final String aDescription, final ITexture[][][] aTextures) { - super(aName, 5, 0, aDescription, aTextures); - } - - @Override - public String[] getDescription() { - return new String[] { this.mDescription, "Can request the JVM to perform garbage collection", - "Configurable to run once every 5 minute interval (5-180)", "This Machine has no recipe", - "Admin Tool, Limit one per world if possible", CORE.GT_Tooltip.get() }; - } - - @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[10][17][]; - for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = this.getFront(i); - rTextures[1][i + 1] = this.getBack(i); - rTextures[2][i + 1] = this.getBottom(i); - rTextures[3][i + 1] = this.getTop(i); - rTextures[4][i + 1] = this.getSides(i); - rTextures[5][i + 1] = this.getFrontActive(i); - rTextures[6][i + 1] = this.getBackActive(i); - rTextures[7][i + 1] = this.getBottomActive(i); - rTextures[8][i + 1] = this.getTopActive(i); - rTextures[9][i + 1] = this.getSidesActive(i); - } - return rTextures; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[(aActive ? 5 : 0) - + (side == facing ? 0 - : side == facing.getOpposite() ? 1 - : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex - + 1]; - } - - public ITexture[] getFront(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) }; - } - - public ITexture[] getBack(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) }; - } - - public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) }; - } - - public ITexture[] getTop(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) }; - } - - public ITexture[] getSides(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3) }; - } - - public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) }; - } - - public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) }; - } - - public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) }; - } - - public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) }; - } - - public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3) }; - } - - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (mFrequency < 180) { - mFrequency += 5; - } else { - mFrequency = 5; - } - PlayerUtils.messagePlayer(aPlayer, "Running every " + mFrequency + " minutes."); - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); - } - - @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaGarbageCollector(this.mName, this.mDescription, this.mTextures); - } - - @Override - public boolean isSimpleMachine() { - return true; - } - - @Override - public boolean isElectric() { - return false; - } - - @Override - public boolean isValidSlot(final int aIndex) { - return false; - } - - @Override - public boolean isFacingValid(final ForgeDirection facing) { - return true; - } - - @Override - public boolean isEnetInput() { - return false; - } - - @Override - public boolean isEnetOutput() { - return false; - } - - @Override - public boolean isInputFacing(final ForgeDirection side) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); - } - - @Override - public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); - } - - @Override - public boolean isTeleporterCompatible() { - return false; - } - - @Override - public long getMinimumStoredEU() { - return 0; - } - - @Override - public long maxEUStore() { - return 0; - } - - @Override - public int getCapacity() { - return 0; - } - - @Override - public long maxEUInput() { - return 0; - } - - @Override - public long maxEUOutput() { - return 0; - } - - @Override - public long maxAmperesIn() { - return 0; - } - - @Override - public long maxAmperesOut() { - return 0; - } - - @Override - public int rechargerSlotStartIndex() { - return 0; - } - - @Override - public int dechargerSlotStartIndex() { - return 0; - } - - @Override - public int rechargerSlotCount() { - return 0; - } - - @Override - public int dechargerSlotCount() { - return 0; - } - - @Override - public int getProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored(); - } - - @Override - public int maxProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity(); - } - - @Override - public boolean isAccessAllowed(final EntityPlayer aPlayer) { - return true; - } - - @Override - public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } - this.showPollution(aPlayer.getEntityWorld(), aPlayer); - return true; - } - - private void showPollution(final World worldIn, final EntityPlayer playerIn) { - PlayerUtils.messagePlayer( - playerIn, - "Running every " + mFrequency + " minutes. Owner: " + this.getBaseMetaTileEntity().getOwnerName()); - long aDiff = mLocalTickVar - this.mLastCleanup; - PlayerUtils.messagePlayer(playerIn, "Last run: " + Utils.getSecondsFromMillis(aDiff) + " seconds ago."); - } - - @Override - public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return false; - } - - @Override - public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return false; - } - - @Override - public String[] getInfoData() { - return new String[] { this.getLocalName() }; - } - - @Override - public boolean isGivingInformation() { - return true; - } - - @Override - public int[] getAccessibleSlotsFromSide(final int p_94128_1_) { - return new int[] {}; - } - - @Override - public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) { - return false; - } - - @Override - public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) { - return false; - } - - @Override - public int getSizeInventory() { - return 0; - } - - @Override - public ItemStack getStackInSlot(final int p_70301_1_) { - return null; - } - - @Override - public ItemStack decrStackSize(final int p_70298_1_, final int p_70298_2_) { - return null; - } - - @Override - public ItemStack getStackInSlotOnClosing(final int p_70304_1_) { - return null; - } - - @Override - public void setInventorySlotContents(final int p_70299_1_, final ItemStack p_70299_2_) {} - - @Override - public String getInventoryName() { - return null; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public int getInventoryStackLimit() { - return 0; - } - - @Override - public boolean isUseableByPlayer(final EntityPlayer p_70300_1_) { - return true; - } - - @Override - public void openInventory() {} - - @Override - public void closeInventory() {} - - @Override - public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_2_) { - return false; - } - - @Override - public boolean isOverclockerUpgradable() { - return false; - } - - @Override - public boolean isTransformerUpgradable() { - return false; - } - - @Override - public void saveNBTData(final NBTTagCompound aNBT) {} - - @Override - public void loadNBTData(final NBTTagCompound aNBT) {} - - @Override - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - if (this.getBaseMetaTileEntity().isServerSide()) { - mLocalTickVar = System.currentTimeMillis(); - long aDiff = mLocalTickVar - this.mLastCleanup; - if (Utils.getSecondsFromMillis(aDiff) >= (this.mFrequency * 60)) { - System.gc(); - this.mLastCleanup = mLocalTickVar; - } - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java deleted file mode 100644 index 9a073e9e30..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java +++ /dev/null @@ -1,578 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.storage; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -import com.gtnewhorizons.modularui.api.screen.ModularWindow; -import com.gtnewhorizons.modularui.api.screen.UIBuildContext; -import com.gtnewhorizons.modularui.common.widget.DrawableWidget; -import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import com.gtnewhorizons.modularui.common.widget.TextWidget; - -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures.BlockIcons; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.modularui.IAddUIWidgets; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.data.ArrayUtils; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_TieredMachineBlock implements IAddUIWidgets { - - /* - * sides.put(getUp()); sides.put(getDown()); sides.put(getXPos()); sides.put(getXNeg()); sides.put(getZPos()); - * sides.put(getZNeg()); - */ - - public int mItemCount = 0; - public ItemStack mItemStack = null; - private static final double mStorageFactor = 2; - - // Meta Tile ID - public static final int mCrateID = 955; - - // Sides - public static final int SIDE_Up = 0; - public static final int SIDE_Down = 1; - public static final int SIDE_XPos = 2; - public static final int SIDE_XNeg = 3; - public static final int SIDE_ZPos = 4; - public static final int SIDE_ZNeg = 5; - public static final int[] SIDES = new int[] { SIDE_Up, SIDE_Down, SIDE_XPos, SIDE_XNeg, SIDE_ZPos, SIDE_ZNeg }; - - // Neighbour Cache - private GT_MetaTileEntity_ConnectableCrate[] mNeighbourCache = new GT_MetaTileEntity_ConnectableCrate[6]; - // Cached Crate Location - private BlockPos mCurrentPos = null; - // Master Crate Position - protected BlockPos mMasterCrateLocation = null; - // Is Master? - protected boolean mIsMaster = false; - // Is Connected? - protected boolean mIsConnected[] = new boolean[] { false, false, false, false, false, false }; - // How many are connected? - protected int mConnectedCount = 0; - // Map of connected locations - protected AutoMap mConnectedCache = new AutoMap(); - - public GT_MetaTileEntity_ConnectableCrate(int aID, String aName, String aNameRegional, int aTier) { - super( - aID, - aName, - aNameRegional, - aTier, - 3, - "This Crate stores " + (int) (Math.pow(6.0D, (double) aTier) * mStorageFactor) + " Items", - new ITexture[0]); - } - - public GT_MetaTileEntity_ConnectableCrate(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { - super(aName, aTier, 3, aDescription, aTextures); - } - - @Override - public String[] getDescription() { - return org.apache.commons.lang3.ArrayUtils.add(this.mDescriptionArray, CORE.GT_Tooltip.get()); - } - - @Override - public boolean isSimpleMachine() { - return true; - } - - public boolean isFacingValid(ForgeDirection facing) { - return true; - } - - @Override - public boolean isAccessAllowed(EntityPlayer aPlayer) { - return true; - } - - @Override - public boolean isValidSlot(int aIndex) { - return true; - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_ConnectableCrate(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); - } - - public int getOppositeSide(int side) { - if (side == SIDE_Up) { - return SIDE_Down; - } else if (side == SIDE_Down) { - return SIDE_Up; - } else if (side == SIDE_XNeg) { - return SIDE_XPos; - } else if (side == SIDE_XPos) { - return SIDE_XNeg; - } else if (side == SIDE_ZNeg) { - return SIDE_ZPos; - } else { - return SIDE_ZNeg; - } - } - - public boolean calculateOwnershipIfConnected() { - if (mCurrentPos == null) { - mCurrentPos = new BlockPos( - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getYCoord(), - this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld()); - } - AutoMap n = mCurrentPos.getSurroundingBlocks(); - int p = 0; - for (BlockPos i : n) { - if (i != null) { - if (doesSideContainCrate(p)) { - GT_MetaTileEntity_ConnectableCrate yu = getCrateAtBlockPos(i); - if (yu != null) { - mNeighbourCache[p] = yu; - } - } - } - p++; - } - - int e4 = 0; - if (mNeighbourCache.length > 0) { - for (GT_MetaTileEntity_ConnectableCrate e : mNeighbourCache) { - this.mConnectedCount = this.mConnectedCache.size(); - if (e != null) { - // First, we check if this Crate is a Master, if not, continue checking what it is. - if (this.mIsMaster) { - // So this other Crate is also a master? Which is more Powerful - if (e.mIsMaster) { - // This crate holds more connected, it becomes master now. - if (this.mConnectedCount > e.mConnectedCount) { - e.mIsMaster = false; - e.mMasterCrateLocation = this.mCurrentPos; - if (!e.mIsConnected[getOppositeSide(e4)]) { - e.mIsConnected[getOppositeSide(e4)] = true; - } - if (!this.mIsConnected[e4]) { - this.mIsConnected[e4] = true; - } - this.mConnectedCache = ArrayUtils.mergeTwoMaps(this.mConnectedCache, e.mConnectedCache); - continue; - } - // Other crate held more connected, it is now master. - else { - this.mIsMaster = false; - this.mMasterCrateLocation = e.mCurrentPos; - if (!this.mIsConnected[e4]) { - this.mIsConnected[e4] = true; - } - if (!e.mIsConnected[getOppositeSide(e4)]) { - e.mIsConnected[getOppositeSide(e4)] = true; - } - e.mConnectedCache = ArrayUtils.mergeTwoMaps(e.mConnectedCache, this.mConnectedCache); - // Best wipe our cache of connected blocks then, since they no longer hold value. - mConnectedCache.clear(); - continue; - } - } - // Other Crate was not a Master, but we are, time to inherit it into our connection hivemind. - else { - // It would appear this controller has another master, time to query it. - if (e.mMasterCrateLocation != null && !e.mMasterCrateLocation.getUniqueIdentifier() - .equalsIgnoreCase(this.mMasterCrateLocation.getUniqueIdentifier())) { - GT_MetaTileEntity_ConnectableCrate gM = getCrateAtBlockPos(e.mMasterCrateLocation); - if (gM != null) { - // Lets compare controller strengths - int gM_Owned = gM.mConnectedCount; - // We are stronger, let's inherit it. - if (this.mConnectedCount > gM_Owned) { - e.mIsMaster = false; - e.mMasterCrateLocation = this.mCurrentPos; - gM.mIsMaster = false; - gM.mMasterCrateLocation = this.mCurrentPos; - if (!e.mIsConnected[getOppositeSide(e4)]) { - e.mIsConnected[getOppositeSide(e4)] = true; - } - if (!this.mIsConnected[e4]) { - this.mIsConnected[e4] = true; - } - this.mConnectedCache = ArrayUtils - .mergeTwoMaps(this.mConnectedCache, gM.mConnectedCache); - continue; - } - // We lost, time to submit to a new master crate - else { - this.mIsMaster = false; - this.mMasterCrateLocation = e.mMasterCrateLocation; - if (!this.mIsConnected[e4]) { - this.mIsConnected[e4] = true; - } - if (!e.mIsConnected[getOppositeSide(e4)]) { - e.mIsConnected[getOppositeSide(e4)] = true; - } - gM.mConnectedCache = ArrayUtils - .mergeTwoMaps(gM.mConnectedCache, this.mConnectedCache); - // Best wipe our cache of connected blocks then, since they no longer hold - // value. - mConnectedCache.clear(); - continue; - } - } else { - // Could not get the Tile Entity for the Other Master Crate.. Guess I can just - // ignore this case for now~ TODO - continue; - } - } - // Either the other crate has no known Master or it is already this crate. - else { - // The other crate has no master, time to inherit. - if (e.mMasterCrateLocation == null || (!e.mIsConnected[getOppositeSide(e4)])) { - e.mMasterCrateLocation = this.mCurrentPos; - if (!e.mIsConnected[getOppositeSide(e4)]) { - e.mIsConnected[getOppositeSide(e4)] = true; - } - if (!this.mIsConnected[e4]) { - this.mIsConnected[e4] = true; - } - mConnectedCache.put(e.mCurrentPos.getUniqueIdentifier()); - continue; - } else { - // Do nothing, we own this Crate already :) - continue; - } - } - } - } - - // We are not a Storage Master Crate, into a brave new world we go - else { - // Best wipe our cache of connected blocks then, since they no longer hold value. - mConnectedCache.clear(); - - // Dang, the other crate is a master, time to get incorporated. - if (e.mIsMaster) { - this.mIsMaster = false; - this.mMasterCrateLocation = e.mCurrentPos; - this.mIsConnected[e4] = true; - if (!e.mIsConnected[e4]) { - e.mIsConnected[e4] = true; - } - if (e.mMasterCrateLocation == null) { - e.mMasterCrateLocation = e.mCurrentPos; - } - e.mConnectedCache.put(this.mCurrentPos.getUniqueIdentifier()); - continue; - } - // So the Crate we Checked is not a Master, so let's see if it knows where one is - else { - // So, this Crate we have found knows about a master - if (e.mMasterCrateLocation != null) { - GT_MetaTileEntity_ConnectableCrate gM = getCrateAtBlockPos(e.mMasterCrateLocation); - // Found the master crate - if (gM != null) { - this.mIsMaster = false; - this.mMasterCrateLocation = e.mMasterCrateLocation; - if (!this.mIsConnected[e4]) { - this.mIsConnected[e4] = true; - } - if (!e.mIsConnected[getOppositeSide(e4)]) { - e.mIsConnected[getOppositeSide(e4)] = true; - } - gM.mConnectedCache.put(this.mCurrentPos.getUniqueIdentifier()); - continue; - } else { - // Could not get the Tile Entity for the Other Master Crate.. Guess I can just - // ignore this case for now~ TODO - continue; - } - } - // This crate has no master, not going to check if it's connected. - else { - this.mIsMaster = true; - this.mMasterCrateLocation = this.mCurrentPos; - e.mIsMaster = false; - e.mMasterCrateLocation = this.mCurrentPos; - if (!e.mIsConnected[getOppositeSide(e4)]) { - e.mIsConnected[getOppositeSide(e4)] = true; - } - if (!this.mIsConnected[e4]) { - this.mIsConnected[e4] = true; - } - mConnectedCache.put(e.mCurrentPos.getUniqueIdentifier()); - continue; - } - } - } - } - e4++; - } - return true; - } else { - return false; - } - } - - public boolean doesSideContainCrate(int side) { - return checkSideForDataType(0, side); - } - - public boolean isCrateAtSideController(int side) { - return checkSideForDataType(1, side); - } - - private boolean checkSideForDataType(int aType, int ordinalSide) { - BlockPos mPosToCheck = ordinalSide == SIDE_Up ? mCurrentPos.getUp() - : ordinalSide == SIDE_Down ? mCurrentPos.getDown() - : ordinalSide == SIDE_XPos ? mCurrentPos.getXPos() - : ordinalSide == SIDE_XNeg ? mCurrentPos.getXNeg() - : ordinalSide == SIDE_ZPos ? mCurrentPos.getZPos() : mCurrentPos.getZNeg(); - GT_MetaTileEntity_ConnectableCrate g = getCrateAtBlockPos(mPosToCheck); - if (g != null) { - if (aType == 0) { - return true; - } else { - if (g.mIsMaster) { - return true; - } - } - } - return false; - } - - public GT_MetaTileEntity_ConnectableCrate getCrateAtBlockPos(BlockPos pos) { - if (pos != null) { - Block b = pos.getBlockAtPos(); - int m = pos.getMetaAtPos(); - TileEntity t = pos.world.getTileEntity(pos.xPos, pos.yPos, pos.zPos); - if (b != null && t != null) { - if (b == GregTech_API.sBlockMachines && m == mCrateID) { - if (t instanceof IGregTechTileEntity) { - IGregTechTileEntity g = (IGregTechTileEntity) t; - final IMetaTileEntity aMetaTileEntity = g.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return null; - } - if (aMetaTileEntity instanceof GT_MetaTileEntity_ConnectableCrate) { - return ((GT_MetaTileEntity_ConnectableCrate) aMetaTileEntity); - } - } - } - } - } - return null; - } - - @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); - return true; - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if (this.getBaseMetaTileEntity().isServerSide() && this.getBaseMetaTileEntity().isAllowedToWork()) { - if (this.getItemCount() <= 0) { - this.mItemStack = null; - this.mItemCount = 0; - } - - if (this.mItemStack == null && this.mInventory[0] != null) { - this.mItemStack = this.mInventory[0].copy(); - } - - if (this.mInventory[0] != null && this.mItemCount < this.getMaxItemCount() - && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) { - this.mItemCount += this.mInventory[0].stackSize; - if (this.mItemCount > this.getMaxItemCount()) { - this.mInventory[0].stackSize = this.mItemCount - this.getMaxItemCount(); - this.mItemCount = this.getMaxItemCount(); - } else { - this.mInventory[0] = null; - } - } - - if (this.mInventory[1] == null && this.mItemStack != null) { - this.mInventory[1] = this.mItemStack.copy(); - this.mInventory[1].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount); - this.mItemCount -= this.mInventory[1].stackSize; - } else if (this.mItemCount > 0 && GT_Utility.areStacksEqual(this.mInventory[1], this.mItemStack) - && this.mInventory[1].getMaxStackSize() > this.mInventory[1].stackSize) { - int tmp = Math.min( - this.mItemCount, - this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize); - this.mInventory[1].stackSize += tmp; - this.mItemCount -= tmp; - } - - if (this.mItemStack != null) { - this.mInventory[2] = this.mItemStack.copy(); - this.mInventory[2].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount); - } else { - this.mInventory[2] = null; - } - } - } - - private int getItemCount() { - return this.mItemCount; - } - - @Override - public void setItemCount(int aCount) { - this.mItemCount = aCount; - } - - @Override - public int getProgresstime() { - return this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize) - + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize); - } - - @Override - public int maxProgresstime() { - return this.getMaxItemCount(); - } - - @Override - public int getMaxItemCount() { - return (int) (Math.pow(6.0D, (double) this.mTier) * mStorageFactor - 128.0D); - } - - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { - return aIndex == 1; - } - - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { - return aIndex == 0 && (this.mInventory[0] == null || GT_Utility.areStacksEqual(this.mInventory[0], aStack)); - } - - @Override - public String[] getInfoData() { - return this.mItemStack == null - ? new String[] { "Super Storage Chest", "Stored Items:", "No Items", Integer.toString(0), - Integer.toString(this.getMaxItemCount()) } - : new String[] { "Super Storage Chest", "Stored Items:", this.mItemStack.getDisplayName(), - Integer.toString(this.mItemCount), Integer.toString(this.getMaxItemCount()) }; - } - - @Override - public boolean isGivingInformation() { - return true; - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setInteger("mItemCount", this.mItemCount); - if (this.mItemStack != null) { - aNBT.setTag("mItemStack", this.mItemStack.writeToNBT(new NBTTagCompound())); - } - aNBT.setString("mMasterCrateLocation", mMasterCrateLocation.getUniqueIdentifier()); - aNBT.setBoolean("mIsMaster", mIsMaster); - for (int y = 0; y < this.mIsConnected.length; y++) { - aNBT.setBoolean("mIsConnected" + y, mIsConnected[y]); - } - aNBT.setInteger("mConnectedCount", mConnectedCount); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - if (aNBT.hasKey("mItemCount")) { - this.mItemCount = aNBT.getInteger("mItemCount"); - } - if (aNBT.hasKey("mItemStack")) { - this.mItemStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack")); - } - if (aNBT.hasKey("mMasterCrateLocation")) { - this.mMasterCrateLocation = BlockPos.generateBlockPos(aNBT.getString("mMasterCrateLocation")); - } - if (aNBT.hasKey("mIsMaster")) { - this.mIsMaster = aNBT.getBoolean("mIsMaster"); - } - - for (int y = 0; y < this.mIsConnected.length; y++) { - if (aNBT.hasKey("mIsConnected" + y)) { - this.mIsConnected[y] = aNBT.getBoolean("mIsConnected" + y); - } - } - - if (aNBT.hasKey("mConnectedCount")) { - this.mConnectedCount = aNBT.getInteger("mConnectedCount"); - } - } - - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int aColorIndex, boolean aActive, boolean aRedstone) { - return aBaseMetaTileEntity.getFrontFacing() == ForgeDirection.DOWN && side == ForgeDirection.WEST - ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON), - new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) } - : (side == aBaseMetaTileEntity.getFrontFacing() - ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON), - new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) } - : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON) }); - } - - @Override - public ITexture[][][] getTextureSet(ITexture[] aTextures) { - return new ITexture[0][0][0]; - } - - @Override - public void onExplosion() { - // TODO Auto-generated method stub - super.onExplosion(); - } - - @Override - public void onRemoval() { - // TODO Auto-generated method stub - super.onRemoval(); - } - - @Override - public void onMachineBlockUpdate() { - // TODO Auto-generated method stub - super.onMachineBlockUpdate(); - } - - @Override - public boolean useModularUI() { - return true; - } - - @Override - public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 16).setSize(71, 45)) - .widget( - new SlotWidget(inventoryHandler, 0) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) - .setPos(79, 16)) - .widget( - new SlotWidget(inventoryHandler, 1).setAccess(true, false) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) - .setPos(79, 52)) - .widget( - SlotWidget.phantom(inventoryHandler, 2).disableInteraction() - .setBackground(GT_UITextures.TRANSPARENT).setPos(59, 42)) - .widget(new TextWidget("Item Amount").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 20)).widget( - TextWidget.dynamicString(() -> GT_Utility.parseNumberToString(mItemCount)) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 30)); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java deleted file mode 100644 index 9e7b7d03e5..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java +++ /dev/null @@ -1,77 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.storage; - -import org.apache.commons.lang3.ArrayUtils; - -import com.gtnewhorizons.modularui.api.screen.ModularWindow; -import com.gtnewhorizons.modularui.api.screen.UIBuildContext; -import com.gtnewhorizons.modularui.common.widget.ButtonWidget; -import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; -import com.gtnewhorizons.modularui.common.widget.SlotGroup; -import com.gtnewhorizons.modularui.common.widget.TextWidget; - -import gregtech.api.enums.Textures; -import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.modularui.IAddUIWidgets; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines.GregtechMetaSafeBlockBase; - -public class GregtechMetaSafeBlock extends GregtechMetaSafeBlockBase implements IAddUIWidgets { - - public GregtechMetaSafeBlock(final int aID, final String aName, final String aNameRegional, final int aTier) { - super(aID, aName, aNameRegional, aTier, 28, "Protecting your items from sticky fingers."); - } - - public GregtechMetaSafeBlock(final String aName, final int aTier, final int aInvSlotCount, - final String[] aDescription, final ITexture[][][] aTextures) { - super(aName, aTier, aInvSlotCount, aDescription, aTextures); - } - - @Override - public String[] getDescription() { - return ArrayUtils.add(this.mDescriptionArray, CORE.GT_Tooltip.get()); - } - - @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaSafeBlock( - this.mName, - this.mTier, - this.mInventory.length, - this.mDescriptionArray, - this.mTextures); - } - - @Override - public ITexture getOverlayIcon() { - return new GT_RenderedTexture(Textures.BlockIcons.VOID); - } - - @Override - public boolean isValidSlot(final int aIndex) { - return aIndex < (this.mInventory.length - 1); - } - - @Override - public boolean useModularUI() { - return true; - } - - @Override - public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 9).endAtSlot(26).build().setPos(7, 4)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> bUnbreakable = !bUnbreakable) - .setBackground(GT_UITextures.BUTTON_STANDARD, GTPP_UITextures.OVERLAY_BUTTON_LOCK) - .setPos(43, 62).setSize(18, 18)) - .widget(new TextWidget("Safe Status").setPos(76, 61)) - .widget( - TextWidget.dynamicString(() -> bUnbreakable ? "Locked" : "Unlocked").setSynced(false) - .setPos(82, 73)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> bUnbreakable, val -> bUnbreakable = val)); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java deleted file mode 100644 index aeea5b33e8..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java +++ /dev/null @@ -1,365 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; - -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; - -import org.apache.commons.lang3.ArrayUtils; - -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Utility; -import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.core.util.sys.KeyboardUtils; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; - -public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { - - public byte mType = 0; - public boolean mLocked = false; - protected byte mIndex = (byte) MathUtils.randInt(1, 3); - public static GT_RenderedTexture texBottom = new GT_RenderedTexture( - new CustomIcon("TileEntities/gt4/machine_bottom")); - public static GT_RenderedTexture texTop = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_top")); - public static GT_RenderedTexture texSide = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_side")); - public static GT_RenderedTexture texSideCabinet = new GT_RenderedTexture( - new CustomIcon("TileEntities/gt4/machine_side_cabinet")); - - public GT4Entity_Shelf(final int aID, final String aName, final String aNameRegional, final String aDescription) { - super(aID, aName, aNameRegional, 0, aDescription); - } - - public GT4Entity_Shelf(final String aName, final String[] aDescription, final ITexture[][][] aTextures) { - super(aName, 0, aDescription, aTextures); - } - - @Override - public boolean isSimpleMachine() { - return true; - } - - @Override - public boolean isFacingValid(ForgeDirection facing) { - return facing.offsetY == 0; - } - - @Override - public boolean isAccessAllowed(EntityPlayer aPlayer) { - if (this.getBaseMetaTileEntity().getOwnerName().equalsIgnoreCase(aPlayer.getDisplayName())) { - return true; - } - PlayerUtils.messagePlayer( - aPlayer, - "This container belongs to " + this.getBaseMetaTileEntity().getOwnerName() + "."); - return false; - } - - @Override - public boolean ownerControl() { - return false; - } - - @Override - public boolean isEnetOutput() { - return false; - } - - @Override - public boolean isEnetInput() { - return false; - } - - @Override - public boolean isOutputFacing(final ForgeDirection side) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); - } - - @Override - public boolean isInputFacing(ForgeDirection side) { - return false; - } - - @Override - public boolean onRightclick(IGregTechTileEntity aTile, EntityPlayer aPlayer) { - if (aTile.isClientSide()) { - return true; - } - ItemStack tStack = aPlayer.inventory.getStackInSlot(aPlayer.inventory.currentItem); - if (tStack == null) { - if (KeyboardUtils.isCtrlKeyDown()) { - if (this.mInventory[0] != null) { - PlayerUtils.messagePlayer( - aPlayer, - "Contains " + this.mInventory[0].getDisplayName() - + " x" - + this.mInventory[0].stackSize - + "."); - } - return false; - } else { - if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) { - if (!this.mLocked) { - PlayerUtils.messagePlayer( - aPlayer, - "Removed " + this.mInventory[0].getDisplayName() - + " x" - + this.mInventory[0].stackSize - + "."); - aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, this.mInventory[0]); - getBaseMetaTileEntity().setInventorySlotContents(0, null); - this.mType = 0; - return true; - } else { - PlayerUtils.messagePlayer( - aPlayer, - "This container is locked. It belongs to " + aTile.getOwnerName() + "."); - return false; - } - } - return false; - } - } else if (tStack != null && this.mInventory[0] == null) { - - if (KeyboardUtils.isCtrlKeyDown() || GT_MetaGenerated_Tool_01.class.isInstance(tStack.getItem())) { - return false; - } - PlayerUtils.messagePlayer(aPlayer, "Stored " + tStack.getDisplayName() + " x" + tStack.stackSize + "."); - aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, null); - getBaseMetaTileEntity().setInventorySlotContents(0, tStack); - this.mType = (byte) MathUtils.randInt(1, 3); - return true; - } else { - if (this.mInventory[0] == null) { - this.mType = 0; - } - return super.onRightclick(aTile, aPlayer); - } - } - - @Override - public void onLeftclick(IGregTechTileEntity aTile, EntityPlayer aPlayer) { - if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) { - ItemStack tOutput = GT_Utility.copy(new Object[] { this.mInventory[0] }); - if (!aPlayer.isSneaking()) { - tOutput.stackSize = 1; - } - getBaseMetaTileEntity().decrStackSize(0, tOutput.stackSize); - EntityItem tEntity = new EntityItem( - getBaseMetaTileEntity().getWorld(), - getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, - getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, - getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1) + 0.5D, - tOutput); - tEntity.motionX = 0.0D; - tEntity.motionY = 0.0D; - tEntity.motionZ = 0.0D; - getBaseMetaTileEntity().getWorld().spawnEntityInWorld(tEntity); - if (this.mInventory[0] == null) { - this.mType = 0; - } - } - super.onLeftclick(aTile, aPlayer); - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf(this.mName, this.mDescriptionArray, this.mTextures); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { // mLocked - aNBT.setInteger("mType", this.mType); - aNBT.setBoolean("mLocked", this.mLocked); - aNBT.setByte("mIndex", this.mIndex); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - if (aNBT.hasKey("mIndex")) { - this.mType = ((byte) aNBT.getInteger("mType")); - } - if (aNBT.hasKey("mIndex")) { - this.mLocked = (aNBT.getBoolean("mLocked")); - } - if (aNBT.hasKey("mIndex")) { - this.mIndex = aNBT.getByte("mIndex"); - } - } - - @Override - public void onValueUpdate(byte aValue) { - this.mType = aValue; - } - - @Override - public byte getUpdateData() { - return this.mType; - } - - @Override - public String[] getDescription() { - return ArrayUtils.addAll( - mDescriptionArray, - "Decorative Item Storage", - "Right click to store/remove something", - "Ctrl + Rmb to check contents", - "Ctrl + Rmb with a screwdriver to lock"); - } - - @Override - public byte getTileEntityBaseType() { - return 0; - } - - @Override - public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aStack) { - // return side != getBaseMetaTileEntity().getFrontFacing(); - return false; - } - - @Override - public boolean allowPullStack(IGregTechTileEntity p0, int p1, ForgeDirection side, ItemStack p3) { - return true; - } - - @Override - public boolean allowPutStack(IGregTechTileEntity p0, int p1, ForgeDirection side, ItemStack p3) { - return false; - } - - @Override - public ITexture[][][] getTextureSet(ITexture[] aTextures) { - ITexture[][][] rTextures = new ITexture[7][17][]; - for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = { this.getBottom((byte) 0)[0] }; - rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = { this.getTop((byte) 0)[0] }; - rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = { this.getSides((byte) 0)[0] }; - rTextures[2][(i + 1)] = tmp2; - ITexture[] tmp4 = { this.getSides((byte) 0)[0] }; - rTextures[3][(i + 1)] = tmp4; - ITexture[] tmp5 = { this.getSides((byte) 0)[0], getFront((byte) 0)[0] }; - rTextures[4][(i + 1)] = tmp5; - ITexture[] tmp6 = { this.getSides((byte) 0)[0], getFront((byte) 1)[0] }; - rTextures[5][(i + 1)] = tmp6; - ITexture[] tmp7 = { this.getSides((byte) 0)[0], getFront((byte) 2)[0] }; - rTextures[6][(i + 1)] = tmp7; - } - return rTextures; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - - ITexture[] tmp = this.mTextures[(side.offsetY == 0) - ? ((side != facing) ? 2 - : ((byte) this.mType == 0 ? 4 - : this.mType == 1 || this.mType == 2 ? 5 : this.mType == 3 ? 6 : 0)) - : side.ordinal()][aColorIndex + 1]; - if (side != facing && tmp.length == 2) { - tmp = new ITexture[] { tmp[0] }; - } - return tmp; - } - - private static GT_RenderedTexture x1 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_FRONT); - private static GT_RenderedTexture x2 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_PAPER_FRONT); - private static GT_RenderedTexture x3 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_CANS_FRONT); - - public ITexture[] getFrontNormal() { - return new ITexture[] { x1 }; - } - - public ITexture[] getFrontActive() { - return new ITexture[] { x2 }; - } - - public ITexture[] getFrontAlternative() { - return new ITexture[] { x3 }; - } - - public ITexture[] getBack(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; - } - - public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Acacia_Log) }; - } - - public ITexture[] getTop(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; - } - - public ITexture[] getSides(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; - } - - public ITexture[] getFrontActive(final byte aColor) { - return this.getFrontNormal(); - } - - public ITexture[] getBackActive(final byte aColor) { - return this.getBack(aColor); - } - - public ITexture[] getBottomActive(final byte aColor) { - return this.getBottom(aColor); - } - - public ITexture[] getTopActive(final byte aColor) { - return this.getTop(aColor); - } - - public ITexture[] getSidesActive(final byte aColor) { - return this.getSides(aColor); - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - } - - public ITexture[] getFront(byte aColour) { - if (aColour == 1) { - return getFrontActive(); - } else if (aColour == 2) { - return getFrontAlternative(); - } - return getFrontNormal(); - } - - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (KeyboardUtils.isCtrlKeyDown()) { - if (!aPlayer.getDisplayName().equalsIgnoreCase(this.getBaseMetaTileEntity().getOwnerName())) { - PlayerUtils.messagePlayer(aPlayer, "Container is not yours to lock."); - } else { - this.mLocked = Utils.invertBoolean(this.mLocked); - if (this.mLocked) { - PlayerUtils.messagePlayer(aPlayer, "Container is now locked."); - } else { - PlayerUtils.messagePlayer(aPlayer, "Container is now unlocked."); - } - } - } else { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); - } - } - - @Override - public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPreTick(aBaseMetaTileEntity, aTick); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java deleted file mode 100644 index fec96cbdd4..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java +++ /dev/null @@ -1,40 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf { - - public GT4Entity_Shelf_Compartment(final int aID, final String aName, final String aNameRegional, - final String aDescription) { - super(aID, aName, aNameRegional, aDescription); - } - - public GT4Entity_Shelf_Compartment(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { - super(mName, mDescriptionArray, mTextures); - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_Compartment(this.mName, this.mDescriptionArray, this.mTextures); - } - - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (side == getBaseMetaTileEntity().getFrontFacing()) { - this.mType = ((byte) ((this.mType + 1) % 16)); - PlayerUtils.messagePlayer(aPlayer, "Set type to " + this.mType + "."); - } - } - - @Override - public ITexture[] getFront(final byte aColor) { - return new ITexture[] { TexturesGtBlock.OVERLAYS_COMPARTMENT_FRONT[this.mType < 16 ? this.mType : 0] }; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java deleted file mode 100644 index e486292995..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java +++ /dev/null @@ -1,49 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; - -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GT4Entity_Shelf_Desk extends GT4Entity_Shelf { - - public GT4Entity_Shelf_Desk(final int aID, final String aName, final String aNameRegional, - final String aDescription) { - super(aID, aName, aNameRegional, aDescription); - } - - public GT4Entity_Shelf_Desk(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { - super(mName, mDescriptionArray, mTextures); - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_Desk(this.mName, this.mDescriptionArray, this.mTextures); - } - - @Override - public ITexture[] getFront(final byte aColor) { - return new ITexture[] { TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0] }; - } - - @Override - public ITexture[] getBack(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; - } - - @Override - public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; - } - - @Override - public ITexture[] getTop(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; - } - - @Override - public ITexture[] getSides(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java deleted file mode 100644 index 60fc4d511e..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java +++ /dev/null @@ -1,60 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GT4Entity_Shelf_FileCabinet extends GT4Entity_Shelf { - - public GT4Entity_Shelf_FileCabinet(final int aID, final String aName, final String aNameRegional, - final String aDescription) { - super(aID, aName, aNameRegional, aDescription); - } - - public GT4Entity_Shelf_FileCabinet(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { - super(mName, mDescriptionArray, mTextures); - } - - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (side == getBaseMetaTileEntity().getFrontFacing()) { - this.mType = ((byte) ((this.mType + 1) % 16)); - PlayerUtils.messagePlayer(aPlayer, "Set type to " + this.mType + "."); - } - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_FileCabinet(this.mName, this.mDescriptionArray, this.mTextures); - } - - @Override - public ITexture[] getFront(final byte aColor) { - return new ITexture[] { TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0] }; - } - - @Override - public ITexture[] getBack(final byte aColor) { - return new ITexture[] { texSide }; - } - - @Override - public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { texBottom }; - } - - @Override - public ITexture[] getTop(final byte aColor) { - return new ITexture[] { texTop }; - } - - @Override - public ITexture[] getSides(final byte aColor) { - return new ITexture[] { texSide }; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java deleted file mode 100644 index e870113951..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java +++ /dev/null @@ -1,47 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; - -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; - -public class GT4Entity_Shelf_Iron extends GT4Entity_Shelf { - - public GT4Entity_Shelf_Iron(final int aID, final String aName, final String aNameRegional, - final String aDescription) { - super(aID, aName, aNameRegional, aDescription); - } - - public GT4Entity_Shelf_Iron(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { - super(mName, mDescriptionArray, mTextures); - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_Iron(this.mName, this.mDescriptionArray, this.mTextures); - } - - @Override - public ITexture[] getFront(final byte aColor) { - return new ITexture[] { texSideCabinet }; - } - - @Override - public ITexture[] getBack(final byte aColor) { - return new ITexture[] { texSide }; - } - - @Override - public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { texBottom }; - } - - @Override - public ITexture[] getTop(final byte aColor) { - return new ITexture[] { texTop }; - } - - @Override - public ITexture[] getSides(final byte aColor) { - return new ITexture[] { texSide }; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java deleted file mode 100644 index c2fd2674d8..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java +++ /dev/null @@ -1,276 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; - -import com.gtnewhorizons.modularui.api.screen.ModularWindow; -import com.gtnewhorizons.modularui.api.screen.UIBuildContext; -import com.gtnewhorizons.modularui.common.widget.DrawableWidget; -import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import com.gtnewhorizons.modularui.common.widget.TextWidget; - -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.core.util.sys.KeyboardUtils; - -public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { - - private final int mSize; - public int mItemCount; - public ItemStack mItemStack; - - public GT4Entity_Shelf_Large(final int aID, final String aName, final String aNameRegional, - final String aDescription, final int aSize) { - super(aID, aName, aNameRegional, aDescription); - this.mSize = aSize; - this.mItemCount = 0; - this.mItemStack = null; - } - - public GT4Entity_Shelf_Large(String mName, String[] mDescriptionArray, final int aSize, ITexture[][][] mTextures) { - super(mName, mDescriptionArray, mTextures); - this.mSize = aSize; - this.mItemCount = 0; - this.mItemStack = null; - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_Large(this.mName, this.mDescriptionArray, mSize, this.mTextures); - } - - @Override - public boolean isGivingInformation() { - return true; - } - - @Override - public boolean isDigitalChest() { - return true; - } - - @Override - public boolean isValidSlot(final int aIndex) { - return true; - } - - @Override - public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } - if (KeyboardUtils.isCtrlKeyDown()) { - String itemName = (this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing."); - String itemAmount = (this.mItemCount > 0 ? "" + this.mItemCount : "bad"); - String itemMessage = "This container currently holds " - + (itemAmount.equalsIgnoreCase("bad") ? "nothing." : itemName + " x" + itemAmount + "."); - PlayerUtils.messagePlayer(aPlayer, itemMessage); - } else { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); - } - return true; - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setInteger("mItemCount", this.mItemCount); - if (this.mItemStack != null) { - aNBT.setTag("mItemStack", (NBTBase) this.mItemStack.writeToNBT(new NBTTagCompound())); - } - super.saveNBTData(aNBT); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - if (aNBT.hasKey("mItemCount")) { - this.mItemCount = aNBT.getInteger("mItemCount"); - } - if (aNBT.hasKey("mItemStack")) { - this.mItemStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack")); - } - super.loadNBTData(aNBT); - } - - @Override - public void onOpenGUI() { - super.onOpenGUI(); - } - - @Override - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) { - if (this.getBaseMetaTileEntity().isServerSide() && this.getBaseMetaTileEntity().isAllowedToWork()) { - try { - if (this.mInventory[0] != null) { - this.mType = (byte) this.mIndex; - } else { - this.mType = 0; - } - - if (this.getItemCount() <= 0) { - this.mItemStack = null; - this.mItemCount = 0; - } - if (this.mItemStack == null && this.mInventory[0] != null) { - this.mItemStack = this.mInventory[0].copy(); - } - if (this.mInventory[0] != null && this.mItemCount < this.getMaxItemCount() - && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) { - this.mItemCount += this.mInventory[0].stackSize; - if (this.mItemCount > this.getMaxItemCount()) { - this.mInventory[0].stackSize = this.mItemCount - this.getMaxItemCount(); - this.mItemCount = this.getMaxItemCount(); - } else { - this.mInventory[0] = null; - } - } - if (this.mInventory[1] == null && this.mItemStack != null) { - this.mInventory[1] = this.mItemStack.copy(); - this.mInventory[1].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount); - this.mItemCount -= this.mInventory[1].stackSize; - } else if (this.mItemCount > 0 && GT_Utility.areStacksEqual(this.mInventory[1], this.mItemStack) - && this.mInventory[1].getMaxStackSize() > this.mInventory[1].stackSize) { - final int tmp = Math.min( - this.mItemCount, - this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize); - final ItemStack itemStack = this.mInventory[1]; - itemStack.stackSize += tmp; - this.mItemCount -= tmp; - } - if (this.mItemStack != null) { - this.mInventory[2] = this.mItemStack.copy(); - this.mInventory[2].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount); - } else { - this.mInventory[2] = null; - } - } catch (Throwable t) { - if (t instanceof ArrayIndexOutOfBoundsException) {} - } - } - } - - private int getItemCount() { - return this.mItemCount; - } - - @Override - public void setItemCount(final int aCount) { - this.mItemCount = aCount; - } - - @Override - public int getProgresstime() { - try { - return this.mItemCount + ((this.mInventory[0] == null) ? 0 : this.mInventory[0].stackSize) - + ((this.mInventory[1] == null) ? 0 : this.mInventory[1].stackSize); - } catch (Throwable t) { - return 0; - } - } - - @Override - public int maxProgresstime() { - return this.getMaxItemCount(); - } - - @Override - public int getMaxItemCount() { - return this.mSize; - } - - @Override - public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return aIndex == 1; - } - - @Override - public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return aIndex == 0 && ((this.mInventory[0] == null && this.mItemStack == null) - || GT_Utility.areStacksEqual(this.mInventory[0], aStack) - || (this.mItemStack != null && GT_Utility.areStacksEqual(this.mItemStack, aStack))); - } - - @Override - public String[] getInfoData() { - if (this.mItemStack == null) { - return new String[] { this.getLocalName(), "No Items Stored", - "Free Space: " + Integer.toString(this.getMaxItemCount()) }; - } - return new String[] { this.getLocalName(), - "Storing: " + this.mItemStack.getDisplayName() + " x" + Integer.toString(this.mItemCount), - "Space Remaining: " + Integer.toString(this.getMaxItemCount() - this.getItemCount()) - + "/" - + Integer.toString(this.getMaxItemCount()) }; - } - - @Override - public String[] getDescription() { - String[] mSuper = super.getDescription(); - String[] desc = new String[mSuper.length + 1]; - for (int i = 0; i > mSuper.length; i++) { - desc[i] = mSuper[i]; - } - desc[desc.length - 1] = "Control + Rmb block to check contents"; - return desc; - } - - @Override - public boolean isItemValidForSlot(int aIndex, ItemStack aStack) { - Logger.INFO("1:" + aIndex); - if (aIndex == 2) { - if (ItemStack.areItemStacksEqual(aStack, mItemStack)) { - return true; - } else { - if (mItemStack == null) { - return true; - } - return false; - } - } - return super.isItemValidForSlot(aIndex, aStack); - } - - @Override - public boolean canInsertItem(int aIndex, ItemStack aStack, int ordinalSide) { - Logger.INFO("2:" + aIndex); - if (aIndex == 0) { - if (ItemStack.areItemStacksEqual(aStack, mItemStack)) { - return true; - } else { - if (mItemStack == null) { - return true; - } - return false; - } - } - return super.canInsertItem(aIndex, aStack, ordinalSide); - } - - @Override - public boolean useModularUI() { - return true; - } - - @Override - public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 16).setSize(71, 45)) - .widget( - new SlotWidget(inventoryHandler, 0) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) - .setPos(79, 16)) - .widget(new TextWidget("Item Amount").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 20)).widget( - TextWidget.dynamicString(() -> GT_Utility.parseNumberToString(mItemCount)) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 30)); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java deleted file mode 100644 index be943cd398..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java +++ /dev/null @@ -1,231 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tools; - -import java.util.Arrays; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.monster.EntityIronGolem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import net.minecraftforge.event.world.BlockEvent; - -import gregtech.GT_Mod; -import gregtech.api.enums.SoundResource; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.common.tools.GT_Tool; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; -import gtPlusPlus.xmod.gregtech.common.items.behaviours.Behaviour_Choocher; - -public class TOOL_Gregtech_Choocher extends GT_Tool { - - public static final List mEffectiveList = Arrays - .asList(new String[] { EntityIronGolem.class.getName(), "EntityTowerGuardian" }); - - @Override - public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, - final EntityPlayer aPlayer) { - String tName = aEntity.getClass().getName(); - tName = tName.substring(tName.lastIndexOf(".") + 1); - return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; - } - - @Override - public int getToolDamagePerBlockBreak() { - return 50; - } - - @Override - public int getToolDamagePerDropConversion() { - return 100; - } - - @Override - public int getToolDamagePerContainerCraft() { - return 400; - } - - @Override - public int getToolDamagePerEntityAttack() { - return 100; - } - - @Override - public int getBaseQuality() { - return 0; - } - - @Override - public float getBaseDamage() { - return 4.0F; - } - - @Override - public float getSpeedMultiplier() { - return 0.85F; - } - - @Override - public float getMaxDurabilityMultiplier() { - return 1.2F; - } - - @Override - public String getCraftingSound() { - return SoundResource.RANDOM_ANVIL_USE.toString(); - } - - @Override - public String getEntityHitSound() { - return SoundResource.RANDOM_ANVIL_BREAK.toString(); - } - - @Override - public String getMiningSound() { - return null; - } - - @Override - public boolean canBlock() { - return true; - } - - @Override - public boolean isWrench() { - return true; - } - - @Override - public boolean isCrowbar() { - return false; - } - - @Override - public boolean isWeapon() { - return true; - } - - @Override - public boolean isMinableBlock(final Block aBlock, final byte aMetaData) { - final String tTool = aBlock.getHarvestTool(aMetaData); - return ((tTool != null) && ((tTool.equals("sword")) || (tTool.equals("wrench")) - || (tTool.equals("hammer")) - || (tTool.equals("pickaxe")))) || (aBlock.getMaterial() == Material.rock) - || (aBlock.getMaterial() == Material.glass) - || (aBlock.getMaterial() == Material.piston) - || (aBlock == Blocks.hopper) - || (aBlock == Blocks.dispenser) - || (aBlock == Blocks.dropper) - || (aBlock.getMaterial() == Material.ice) - || (aBlock.getMaterial() == Material.packedIce) - || (GT_Recipe.GT_Recipe_Map.sHammerRecipes.containsInput(new ItemStack(aBlock, 1, aMetaData))) - || (aBlock.getMaterial() == Material.sand) - || (aBlock.getMaterial() == Material.grass) - || (aBlock.getMaterial() == Material.ground) - || (aBlock.getMaterial() == Material.snow) - || (aBlock.getMaterial() == Material.clay) - || (aBlock.getMaterial() == Material.leaves) - || (aBlock.getMaterial() == Material.vine) - || (aBlock.getMaterial() == Material.wood) - || (aBlock.getMaterial() == Material.cactus) - || (aBlock.getMaterial() == Material.circuits) - || (aBlock.getMaterial() == Material.gourd) - || (aBlock.getMaterial() == Material.web) - || (aBlock.getMaterial() == Material.cloth) - || (aBlock.getMaterial() == Material.carpet) - || (aBlock.getMaterial() == Material.plants) - || (aBlock.getMaterial() == Material.cake) - || (aBlock.getMaterial() == Material.tnt) - || (aBlock.getMaterial() == Material.sponge); - } - - @Override - public int convertBlockDrops(final List aDrops, final ItemStack aStack, final EntityPlayer aPlayer, - final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, - final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) { - int rConversions = 0; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes - .findRecipe(null, true, 2147483647L, null, new ItemStack[] { new ItemStack(aBlock, 1, aMetaData) }); - if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { - for (final ItemStack tDrop : aDrops) { - tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe( - null, - true, - 2147483647L, - null, - new ItemStack[] { GT_Utility.copyAmount(1L, new Object[] { tDrop }) }); - if (tRecipe != null) { - final ItemStack tHammeringOutput = tRecipe.getOutput(0); - if (tHammeringOutput != null) { - rConversions += tDrop.stackSize; - tDrop.stackSize *= tHammeringOutput.stackSize; - tHammeringOutput.stackSize = tDrop.stackSize; - GT_Utility.setStack(tDrop, tHammeringOutput); - } - } - } - } else { - aDrops.clear(); - aDrops.add(tRecipe.getOutput(0)); - rConversions++; - } - return rConversions; - } - - @Override - public ItemStack getBrokenItem(final ItemStack aStack) { - return null; - } - - @Override - public IIconContainer getIcon(final boolean aIsToolHead, final ItemStack aStack) { - // Utils.LOG_INFO("Texture: "+TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile()); - return TexturesGtTools.SKOOKUM_CHOOCHER; - } - - @Override - public short[] getRGBa(final boolean aIsToolHead, final ItemStack aStack) { - return GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa; - } - - @Override - public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) { - super.onToolCrafted(aStack, aPlayer); - aPlayer.triggerAchievement(AchievementList.buildSword); - try { - GT_Mod.achievements.issueAchievement(aPlayer, "tools"); - GT_Mod.achievements.issueAchievement(aPlayer, "unitool"); - } catch (final Exception e) {} - } - - @Override - public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) { - return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() - + EnumChatFormatting.WHITE - + " has been Choochered by " - + EnumChatFormatting.GREEN - + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); - } - - @Override - public void onStatsAddedToTool(final GT_MetaGenerated_Tool aItem, final int aID) { - aItem.addItemBehavior(aID, new Behaviour_Choocher()); - } - - @Override - public boolean isGrafter() { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java deleted file mode 100644 index 6a0339e043..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java +++ /dev/null @@ -1,124 +0,0 @@ -package gtPlusPlus.xmod.gregtech.loaders; - -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; -import gregtech.api.enums.ToolDictNames; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.RecipeUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; -import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; - -public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrator, Runnable { - - public ProcessingToolHeadChoocher() { - GregtechOrePrefixes.toolSkookumChoocher.add(this); - } - - @Override - public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, - final String aModName, final ItemStack aStack) { - if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) { - if (aMaterial != Materials.Rubber) { - if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) - && (!aMaterial.contains(SubTag.NO_SMASHING))) { - GT_ModHandler.addCraftingRecipe( - MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(16, 1, aMaterial, aMaterial, null), - GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "IhI", "III", " I ", Character.valueOf('I'), - OrePrefixes.ingot.get(aMaterial) }); - } - } - } - } - - @Override - public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName, - final String aModName, final ItemStack aStack) { - // TODO Auto-generated method stub - - } - - public void materialsLoops() { - final Materials[] i = Materials.values(); - final int size = i.length; - Logger.WARNING("Materials to attempt tool gen. with: " + size); - int used = 0; - Materials aMaterial = null; - for (int r = 0; r < size; r++) { - aMaterial = i[r]; - if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) - && (aMaterial != Materials.Rubber) - && (aMaterial != Materials._NULL)) { - if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) - && (!aMaterial.contains(SubTag.NO_SMASHING)) - && (!aMaterial.contains(SubTag.TRANSPARENT)) - && (!aMaterial.contains(SubTag.FLAMMABLE)) - && (!aMaterial.contains(SubTag.MAGICAL)) - && (!aMaterial.contains(SubTag.NO_SMELTING))) { - Logger.WARNING("Found " + aMaterial.mName + " as a valid Skookum Choocher Material."); - // Input 1 - final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L); - final ItemStack ingot = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L); - final ItemStack screw = GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L); - final ItemStack longrod = GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L); - final ItemStack hammerhead = GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, aMaterial, 1L); - - if ((null != plate) && (null != ingot) - && (null != hammerhead) - && (null != longrod) - && (null != screw)) { - RecipeUtils.addShapedRecipe( - hammerhead, - ToolDictNames.craftingToolScrewdriver.name(), - plate, - ingot, - plate, - plate, - longrod, - screw, - null, - MetaGeneratedGregtechTools.INSTANCE.getToolWithStats( - MetaGeneratedGregtechTools.SKOOKUM_CHOOCHER, - 1, - aMaterial, - null, - null)); - used++; - } else { - Logger.WARNING( - aMaterial.mName + " could not be used for all input compoenents. [3x" - + aMaterial.mName - + " plates, 2x" - + aMaterial.mName - + " ingots, 1x" - + aMaterial.mName - + " Hard Hammer Head."); - } - // GT_ModHandler.addCraftingRecipe(, GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | - // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ", Character.valueOf('I'), - // OrePrefixes.ingot.get(aMaterial), Character.valueOf('P'), OrePrefixes.plate.get(aMaterial), - // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)}); - } else { - Logger.WARNING(aMaterial.mName + " was not a valid Skookum Choocher Material."); - } - } else { - Logger.WARNING(aMaterial.mName + " was not a valid Skookum Choocher Material."); - } - } - - Logger.INFO("Materials used for tool gen: " + used); - } - - @Override - public void run() { - Logger.INFO("Generating Skookum Choochers of all GT Materials."); - this.materialsLoops(); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java index 9e4c665a1e..fe52e69097 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java @@ -488,27 +488,12 @@ private static void fusionChainRecipes() { .duration(3 * SECONDS + 4 * TICKS).eut(TierEU.RECIPE_LuV).metadata(FUSION_THRESHOLD, 100000000) .addTo(sFusionRecipes); - GT_Values.RA.stdBuilder().noItemInputs().noItemOutputs() - .fluidInputs( - new FluidStack(ELEMENT.getInstance().NEON.getPlasma(), 144), - Materials.Bedrockium.getMolten(144)) - .fluidOutputs(new FluidStack(ELEMENT.STANDALONE.FORCE.getPlasma(), 1000)) - .duration(3 * SECONDS + 4 * TICKS).eut(TierEU.RECIPE_LuV).metadata(FUSION_THRESHOLD, 100000000) - .addTo(sFusionRecipes); - // Mk2 GT_Values.RA.stdBuilder().noItemInputs().noItemOutputs() .fluidInputs(Materials.Niobium.getPlasma(144), Materials.Zinc.getPlasma(144)) .fluidOutputs(new FluidStack(ELEMENT.getInstance().KRYPTON.getPlasma(), 144)).duration(32 * TICKS) .eut(TierEU.RECIPE_ZPM).metadata(FUSION_THRESHOLD, 300000000).addTo(sFusionRecipes); - GT_Values.RA.stdBuilder().noItemInputs().noItemOutputs() - .fluidInputs( - new FluidStack(ELEMENT.getInstance().KRYPTON.getPlasma(), 144), - new FluidStack(ELEMENT.STANDALONE.FORCE.getPlasma(), 1000)) - .fluidOutputs(new FluidStack(ELEMENT.STANDALONE.ASTRAL_TITANIUM.getPlasma(), 1000)).duration(32 * TICKS) - .eut(TierEU.RECIPE_ZPM).metadata(FUSION_THRESHOLD, 300000000).addTo(sFusionRecipes); - GT_Values.RA.stdBuilder().noItemInputs().noItemOutputs() .fluidInputs( new FluidStack(ELEMENT.STANDALONE.ASTRAL_TITANIUM.getPlasma(), 144), diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index a84d5bdde0..dcb2624c18 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -28,9 +28,7 @@ import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy_RTG; import gtPlusPlus.xmod.gregtech.common.helpers.FlotationRecipeHandler; -import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntity_RTG; public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @@ -1109,9 +1107,6 @@ public boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage) 0, aVoltage, aFuelDays); - long eu = GregtechMetaTileEntity_RTG - .getTotalEUGenerated(GregtechMetaTileEntity_RTG.convertDaysToTicks(aFuelDays), aVoltage); - GT_MetaTileEntity_Hatch_Energy_RTG.registerPelletForHatch(aFuelPellet, eu); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java index bc03c53089..19f6f42f64 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java @@ -18,12 +18,6 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.redstone.GT_MetaTileEntity_RedstoneStrengthScale; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_AdvancedCraftingTable; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_BronzeCraftingTable; -import gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving.GT4Entity_Shelf; -import gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving.GT4Entity_Shelf_Compartment; -import gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving.GT4Entity_Shelf_Desk; -import gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving.GT4Entity_Shelf_FileCabinet; -import gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving.GT4Entity_Shelf_Iron; -import gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving.GT4Entity_Shelf_Large; public class Gregtech4Content { @@ -35,7 +29,6 @@ public static void run() { thermalBoiler(); multiCrafter(); tesseracts(); - shelves(); basic(); automation(); redstone(); @@ -160,37 +153,6 @@ private static void tesseracts() { .getStackForm(1L)); } - private static void shelves() { - // Gregtech 4 Shelves - Logger.INFO("Gregtech 4 Content | Registering Shelves."); - GregtechItemList.GT4_Shelf.set( - new GT4Entity_Shelf(870, "gtplusplus.shelf.wooden", "Wooden Shelf", "Usually used for books") - .getStackForm(1L)); - GregtechItemList.GT4_Shelf_Iron.set( - new GT4Entity_Shelf_Iron(871, "gtplusplus.shelf.iron", "Metal Shelf", "A heavy duty shelf") - .getStackForm(1L)); - GregtechItemList.GT4_Shelf_FileCabinet.set( - new GT4Entity_Shelf_FileCabinet( - 872, - "gtplusplus.shelf.filecabinet", - "File Cabinet", - "Could look nice in your office").getStackForm(1L)); - GregtechItemList.GT4_Shelf_Desk.set( - new GT4Entity_Shelf_Desk(873, "gtplusplus.shelf.desk", "Metal encased Desk", "A place to study") - .getStackForm(1L)); - GregtechItemList.GT4_Shelf_Compartment.set( - new GT4Entity_Shelf_Compartment( - 874, - "gtplusplus.shelf.compartment", - "Compartment", - "Stores Books & Things").getStackForm(1L)); - - // Custom Storage - GregtechItemList.GT4_Shelf_Large.set( - new GT4Entity_Shelf_Large(966, "gtplusplus.shelf.large", "Large Shelf", "A spacious shelf", 2048) - .getStackForm(1L)); - } - private static void thermalBoiler() { // Gregtech 4 Thermal Boiler if (CORE.ConfigSwitches.enableMultiblock_ThermalBoiler) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java index 25694ac385..6c05c6e79f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java @@ -192,17 +192,11 @@ private static void generateFluidMultiPipes(Constructor private static void run1() { - if (EnderIO.isModLoaded()) { - wireFactory("RedstoneAlloy", 32, BaseWireID + 45, 0, 2, 1, new short[] { 178, 34, 34, 0 }); - } + wireFactory("RedstoneAlloy", 32, BaseWireID + 45, 0, 2, 1, new short[] { 178, 34, 34, 0 }); // need to go back id because fluid pipes already occupy makeCustomWires(ELEMENT.STANDALONE.HYPOGEN, BaseWireID - 15, 0, 0, 8, GT_Values.V[11], false, true); - // superConductorFactory(GT_Materials.Superconductor, 524288, 30660, 0, 0, 8); - if (Thaumcraft.isModLoaded()) { - // superConductorFactory(GT_Materials.Void, 512, 30661, 0, 0, 8); - } } private static void run2() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java index da757cf677..7878709095 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java @@ -8,8 +8,6 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ChiselBus; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake_Extreme; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy_RTG; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler_Adv; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Naquadah; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Reservoir; @@ -27,7 +25,6 @@ public static void run() { run2(); } run3(); - run4(); run5(); // Chisel buses } @@ -73,11 +70,6 @@ private static void run1() { "Turbine Housing", // Local name 8).getStackForm(1L)); - // Multiblock Control Core Bus - GregtechItemList.Hatch_Control_Core.set( - (new GT_MetaTileEntity_Hatch_ControlCore(30020, "hatch.control.adv", "Control Core Module", 1)) - .getStackForm(1L)); - // Multiblock Air Intake Hatch GregtechItemList.Hatch_Air_Intake.set( new GT_MetaTileEntity_Hatch_AirIntake(861, "hatch.air.intake.tier.00", "Air Intake Hatch", 5) @@ -250,33 +242,6 @@ private static GT_MetaTileEntity_SuperBus_Output makeOutputBus(int id, String un return new GT_MetaTileEntity_SuperBus_Output(id, unlocalizedName, localizedName, tier); } - private static void run4() { - int aID = 31060; - // 41, "hatch.energy.tier.01", "LV Energy Hatch", 1 - GT_MetaTileEntity_Hatch_Energy_RTG aHatch1 = new GT_MetaTileEntity_Hatch_Energy_RTG( - aID++, - "hatch.energy.rtg.tier.01", - "RTG Power Unit [LV]", - 1, - 9); - GT_MetaTileEntity_Hatch_Energy_RTG aHatch2 = new GT_MetaTileEntity_Hatch_Energy_RTG( - aID++, - "hatch.energy.rtg.tier.02", - "RTG Power Unit [MV]", - 2, - 9); - GT_MetaTileEntity_Hatch_Energy_RTG aHatch3 = new GT_MetaTileEntity_Hatch_Energy_RTG( - aID++, - "hatch.energy.rtg.tier.03", - "RTG Power Unit [HV]", - 3, - 9); - - GregtechItemList.Hatch_RTG_LV.set(aHatch1.getStackForm(1L)); - GregtechItemList.Hatch_RTG_MV.set(aHatch2.getStackForm(1L)); - GregtechItemList.Hatch_RTG_HV.set(aHatch3.getStackForm(1L)); - } - private static GT_MetaTileEntity_ChiselBus makeChiselBus(int id, String unlocalizedName, String localizedName, int tier) { return new GT_MetaTileEntity_ChiselBus(id, unlocalizedName, localizedName, tier); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java index 1495e6e282..08a0b6fcf5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java @@ -11,7 +11,6 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOreDictNames; import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GT_MetaTileEntity_RfConvertor; -import gtPlusPlus.xmod.gregtech.common.tileentities.generators.creative.GregtechMetaCreativeEnergyBuffer; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer; public class GregtechEnergyBuffer { @@ -66,15 +65,6 @@ private static void run1() { GregtechItemList.Energy_Buffer_1by1_MAX.set( new GregtechMetaEnergyBuffer(779, "energybuffer.tier.09", "MAX Voltage Energy Buffer", 9, "", 1) .getStackForm(1L)); - // Creative Buffer Has Special ID - GregtechItemList.Energy_Buffer_CREATIVE.set( - new GregtechMetaCreativeEnergyBuffer( - 750, - "energybuffer.tier.xx", - "512V Creative Energy Buffer", - 3, - "", - 0).getStackForm(1L)); if (COFHCore.isModLoaded() && CORE.ConfigSwitches.enableMachine_RF_Convetor) { // RF Convertor Buffer Has Special ID diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java deleted file mode 100644 index b341f867b9..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java +++ /dev/null @@ -1,137 +0,0 @@ -package gtPlusPlus.xmod.gregtech.registration.gregtech; - -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OreDictNames; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_ModHandler; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaSafeBlock; - -public class GregtechSafeBlock { - - public static void run() { - Logger.INFO("Gregtech5u Content | Registering Lockable Safe Blocks."); - if (CORE.ConfigSwitches.enableMachine_Safes) { - run1(); - } - } - - private static void run1() { - - GregtechItemList.GT_Safe_ULV.set( - new GregtechMetaSafeBlock(780, "protection.playersafe.tier.00", "Ultra Low Voltage Player Safe", 0) - .getStackForm(1L)); - GregtechItemList.GT_Safe_LV.set( - new GregtechMetaSafeBlock(781, "protection.playersafe.tier.01", "Low Voltage Player Safe", 1) - .getStackForm(1L)); - GregtechItemList.GT_Safe_MV.set( - new GregtechMetaSafeBlock(782, "protection.playersafe.tier.02", "Medium Voltage Player Safe", 2) - .getStackForm(1L)); - GregtechItemList.GT_Safe_HV.set( - new GregtechMetaSafeBlock(783, "protection.playersafe.tier.03", "High Voltage Player Safe", 3) - .getStackForm(1L)); - GregtechItemList.GT_Safe_EV.set( - new GregtechMetaSafeBlock(784, "protection.playersafe.tier.04", "Extreme Voltage Player Safe", 4) - .getStackForm(1L)); - GregtechItemList.GT_Safe_IV.set( - new GregtechMetaSafeBlock(785, "protection.playersafe.tier.05", "Insane Voltage Player Safe", 5) - .getStackForm(1L)); - GregtechItemList.GT_Safe_LuV.set( - new GregtechMetaSafeBlock(786, "protection.playersafe.tier.06", "Ludicrous Voltage Player Safe", 6) - .getStackForm(1L)); - GregtechItemList.GT_Safe_ZPM.set( - new GregtechMetaSafeBlock(787, "protection.playersafe.tier.07", "ZPM Voltage Player Safe", 7) - .getStackForm(1L)); - GregtechItemList.GT_Safe_UV.set( - new GregtechMetaSafeBlock(788, "protection.playersafe.tier.08", "Ultimate Voltage Player Safe", 8) - .getStackForm(1L)); - GregtechItemList.GT_Safe_MAX.set( - new GregtechMetaSafeBlock(789, "protection.playersafe.tier.09", "MAX Voltage Player Safe", 9) - .getStackForm(1L)); - - // To-Do Change Recipes - GT_ModHandler.addCraftingRecipe( - GregtechItemList.GT_Safe_ULV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('C'), OreDictNames.craftingChest, - Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic) }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.GT_Safe_LV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('C'), OreDictNames.craftingChest, - Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Good) }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.GT_Safe_MV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Good), Character.valueOf('C'), OreDictNames.craftingChest, - Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Good) }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.GT_Safe_HV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Good), Character.valueOf('C'), OreDictNames.craftingChest, - Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced) }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.GT_Safe_EV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('C'), OreDictNames.craftingChest, - Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Elite) }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.GT_Safe_IV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('C'), OreDictNames.craftingChest, - Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Master) }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.GT_Safe_LuV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('C'), OreDictNames.craftingChest, - Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Master) }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.GT_Safe_ZPM.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('C'), OreDictNames.craftingChest, - Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Master) }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.GT_Safe_UV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Master), Character.valueOf('C'), OreDictNames.craftingChest, - Character.valueOf('X'), OrePrefixes.circuit.get(Materials.SuperconductorUHV) }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.GT_Safe_MAX.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Master), Character.valueOf('C'), OreDictNames.craftingChest, - Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Infinite) }); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java index 03c600eda5..ccd7d6cbf7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java @@ -2,7 +2,6 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_ConnectableCrate; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest; public class GregtechSuperChests { @@ -35,12 +34,5 @@ public static void run() { ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_EV.get(1L)); ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_IV.get(1L)); - // Test Thing - GregtechItemList.CrateStorage.set( - (new GT_MetaTileEntity_ConnectableCrate( - GT_MetaTileEntity_ConnectableCrate.mCrateID, - "crate.tier.01", - "Interconnecting Storage Crate", - 0)).getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/sc2/HANDLER_SC2.java b/src/main/java/gtPlusPlus/xmod/sc2/HANDLER_SC2.java deleted file mode 100644 index 759afb3f17..0000000000 --- a/src/main/java/gtPlusPlus/xmod/sc2/HANDLER_SC2.java +++ /dev/null @@ -1,14 +0,0 @@ -package gtPlusPlus.xmod.sc2; - -import static gregtech.api.enums.Mods.StevesCarts2; - -import vswe.stevescarts.ModuleData.GppModuleData; - -public class HANDLER_SC2 { - - public static synchronized void preInit() { - if (StevesCarts2.isModLoaded()) { - GppModuleData.loadGpp(); - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java b/src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java deleted file mode 100644 index 5abce3888b..0000000000 --- a/src/main/java/gtPlusPlus/xmod/sc2/modules/ModuleExoticSeeds.java +++ /dev/null @@ -1,108 +0,0 @@ -package gtPlusPlus.xmod.sc2.modules; - -import static gregtech.api.enums.Mods.Forestry; -import static net.minecraft.init.Blocks.farmland; - -import java.lang.reflect.Field; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockCrops; -import net.minecraft.item.Item; -import net.minecraft.item.ItemSeeds; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import vswe.stevescarts.Carts.MinecartModular; -import vswe.stevescarts.Modules.Addons.ModuleAddon; -import vswe.stevescarts.Modules.ICropModule; - -public class ModuleExoticSeeds extends ModuleAddon implements ICropModule { - - public ModuleExoticSeeds(MinecartModular cart) { - super(cart); - } - - private synchronized Block getBlockFromItemSeeds(ItemStack seed) { - try { - - Item seedItem = seed.getItem(); - if (!(seedItem instanceof ItemSeeds)) return null; - - Block cropBlock = (Block) ReflectionUtils.getField(ItemSeeds.class, "field_150925_a").get(seedItem); - - return cropBlock; - } catch (Throwable t) { - - } - return null; - } - - @Override - public boolean isSeedValid(ItemStack seed) { - return getBlockFromItemSeeds(seed) != null; - } - - @Override - public Block getCropFromSeed(ItemStack seed) { - return getBlockFromItemSeeds(seed); - } - - @Override - public boolean isReadyToHarvest(int x, int y, int z) { - World world = getCart().worldObj; - Block b = world.getBlock(x, y, z); - int m = world.getBlockMetadata(x, y, z); - - // If Forestry is loaded, let's make this upgrade convert farmland to Humus. - /* - * if (Forestry.isModLoaded()) { Block mFarmLand = world.getBlock(x, y-1, z); if (mFarmLand == farmland) { Block - * h = tryGetHumus(); if (h != farmland) { world.setBlock(x, y-1, z, h); } } } - */ - - return b instanceof BlockCrops && m == 7; - } - - /** - * Static Class & Block References for Forestry content. Stops Forestry being a hard requirement for this feature - * without having to make @Optional annotations. - */ - private static Class mForestryHumusBlockClass; - - private static Class mForestryBlockRegistryCoreClass; - private static Block mForestryHumusBlock; - - private synchronized Block tryGetHumus() { - if (!Forestry.isModLoaded()) { - return farmland; - } - - if (mForestryHumusBlockClass == null || mForestryHumusBlock == null) { - try { - mForestryHumusBlockClass = ReflectionUtils.getClass("forestry.plugins.PluginCore"); - Field blocks = ReflectionUtils.getField(mForestryHumusBlockClass, "blocks"); - if (blocks != null) { - Object blockRegistryCoreObject = blocks.get(null); - mForestryBlockRegistryCoreClass = ReflectionUtils - .getClass("forestry.core.blocks.BlockRegistryCore"); - if (mForestryBlockRegistryCoreClass != null && blockRegistryCoreObject != null) { - Field soil = ReflectionUtils.getField(mForestryBlockRegistryCoreClass, "soil"); - if (soil != null) { - Block testHumus = (Block) soil.get(blockRegistryCoreObject); - if (testHumus != null) { - mForestryHumusBlock = testHumus; - } - } - } - } - } catch (Throwable t) { - t.printStackTrace(); - } - } - if (mForestryHumusBlock != null) { - return mForestryHumusBlock; - } - - return farmland; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/sol/HANDLER_SpiceOfLife.java b/src/main/java/gtPlusPlus/xmod/sol/HANDLER_SpiceOfLife.java deleted file mode 100644 index 26952bd657..0000000000 --- a/src/main/java/gtPlusPlus/xmod/sol/HANDLER_SpiceOfLife.java +++ /dev/null @@ -1,49 +0,0 @@ -package gtPlusPlus.xmod.sol; - -import static gregtech.api.enums.Mods.SpiceOfLife; - -import java.lang.reflect.Constructor; - -import net.minecraft.item.Item; - -import cpw.mods.fml.common.registry.GameRegistry; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.reflect.ReflectionUtils; - -public class HANDLER_SpiceOfLife { - - public static final void preInit() { - if (SpiceOfLife.isModLoaded()) { - // Add a new Lunch Box with a reasonable amount of slots - tryRegisterNewLunchBox("foodcrate", 12); - } - } - - private static boolean tryRegisterNewLunchBox(String aItemName, int aSlots) { - Item aNewBox = getNewLunchBox(aItemName, aSlots); - if (aNewBox != null) { - GameRegistry.registerItem(aNewBox, aItemName); - Logger.INFO("[Spice of Life] Registered " + aItemName + " as a new food container."); - return true; - } - return false; - } - - private static Item getNewLunchBox(String aItemName, int aSlots) { - Class aItemFoodContainer = ReflectionUtils.getClass("squeek.spiceoflife.items.ItemFoodContainer"); - if (aItemFoodContainer != null) { - Constructor aItemFoodContainerConstructor = ReflectionUtils - .getConstructor(aItemFoodContainer, new Class[] { String.class, int.class }); - if (aItemFoodContainerConstructor != null) { - Object aNewObject = ReflectionUtils.createNewInstanceFromConstructor( - aItemFoodContainerConstructor, - new Object[] { aItemName, aSlots }); - if (aNewObject instanceof Item) { - Item aNewInstance = (Item) aNewObject; - return aNewInstance; - } - } - } - return null; - } -} diff --git a/src/main/java/vswe/stevescarts/ModuleData/GppModuleData.java b/src/main/java/vswe/stevescarts/ModuleData/GppModuleData.java deleted file mode 100644 index def671eff1..0000000000 --- a/src/main/java/vswe/stevescarts/ModuleData/GppModuleData.java +++ /dev/null @@ -1,50 +0,0 @@ -package vswe.stevescarts.ModuleData; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.init.Items; - -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.xmod.sc2.modules.ModuleExoticSeeds; -import vswe.stevescarts.Helpers.ComponentTypes; -import vswe.stevescarts.Items.ModItems; -import vswe.stevescarts.Modules.ModuleBase; - -public class GppModuleData extends ModuleData { - - static byte ID_ExoticSeedAddon = 105; - public static ArrayList moduleListCustom = new ArrayList<>(); - - public GppModuleData(int id, String name, Class moduleClass, int modularCost) { - super(id, name, moduleClass, modularCost); - } - - @SuppressWarnings("unchecked") - public static void loadGpp() { - try { - HashMap moduleList = (HashMap) (ReflectionUtils - .getField(ModuleData.class, "moduleList").get(ModuleData.class)); - ModuleData netherWartModule = moduleList.get((byte) 58); - - ModuleDataGroup farmerGroup = netherWartModule.getRequirement().get(0); - - ModuleData exoticSeedModule = new ModuleData( - ID_ExoticSeedAddon, - "Crop: Exotic Seeds", - ModuleExoticSeeds.class, - 20).addRequirement(farmerGroup).addRecipe( - new Object[][] { { Items.wheat_seeds }, { ComponentTypes.EMPTY_DISK.getItemStack() } }); - - moduleListCustom.add(exoticSeedModule); - - HashMap validModules = (HashMap) (ReflectionUtils - .getField(ModItems.class, "validModules").get(ModItems.class)); - - validModules.put(ID_ExoticSeedAddon, true); - - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } -} diff --git a/src/main/resources/assets/miscutils/textures/blocks/net.png b/src/main/resources/assets/miscutils/textures/blocks/net.png deleted file mode 100644 index e885ed12db..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/blocks/net.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/IndustrialDiamondExquisite.png b/src/main/resources/assets/miscutils/textures/items/IndustrialDiamondExquisite.png deleted file mode 100644 index 5427f66858..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/IndustrialDiamondExquisite.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/101.png b/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/101.png deleted file mode 100644 index 1ebe9648e6..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/101.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/102.png b/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/102.png deleted file mode 100644 index c73159e9da..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/102.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/103.png b/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/103.png deleted file mode 100644 index 5e2e56f927..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/103.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/104.png b/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/104.png deleted file mode 100644 index 8ad5f2ee31..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/104.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/60.png b/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/60.png deleted file mode 100644 index 08122e5042..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/MU-metaitem.01/60.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/StoneStatue.png b/src/main/resources/assets/miscutils/textures/items/StoneStatue.png deleted file mode 100644 index 36ab6ccd56..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/StoneStatue.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/baubles/itemFireProtectGlovesBetter.png b/src/main/resources/assets/miscutils/textures/items/baubles/itemFireProtectGlovesBetter.png deleted file mode 100644 index 8576ae1b7a..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/baubles/itemFireProtectGlovesBetter.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/bucket.generic.overlay.png b/src/main/resources/assets/miscutils/textures/items/bucket.generic.overlay.png deleted file mode 100644 index 1597a9cc4a..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/bucket.generic.overlay.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_0.png b/src/main/resources/assets/miscutils/textures/items/controlcore/Core_0.png deleted file mode 100644 index a35084d087..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_0.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_1.png b/src/main/resources/assets/miscutils/textures/items/controlcore/Core_1.png deleted file mode 100644 index 93c1d6fd31..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_1.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_2.png b/src/main/resources/assets/miscutils/textures/items/controlcore/Core_2.png deleted file mode 100644 index 7eb734b97d..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_2.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_3.png b/src/main/resources/assets/miscutils/textures/items/controlcore/Core_3.png deleted file mode 100644 index 7613641938..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_3.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_4.png b/src/main/resources/assets/miscutils/textures/items/controlcore/Core_4.png deleted file mode 100644 index 83fe4225c8..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_4.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_5.png b/src/main/resources/assets/miscutils/textures/items/controlcore/Core_5.png deleted file mode 100644 index 15f0e28421..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_5.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_6.png b/src/main/resources/assets/miscutils/textures/items/controlcore/Core_6.png deleted file mode 100644 index da59694ac6..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_6.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_7.png b/src/main/resources/assets/miscutils/textures/items/controlcore/Core_7.png deleted file mode 100644 index 2055a6cb57..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_7.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_8.png b/src/main/resources/assets/miscutils/textures/items/controlcore/Core_8.png deleted file mode 100644 index 3f8a60db8d..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_8.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_9.png b/src/main/resources/assets/miscutils/textures/items/controlcore/Core_9.png deleted file mode 100644 index 15046c1fbb..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/controlcore/Core_9.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/10.png b/src/main/resources/assets/miscutils/textures/items/ion/10.png deleted file mode 100644 index 8e3348f582..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/10.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/100.png b/src/main/resources/assets/miscutils/textures/items/ion/100.png deleted file mode 100644 index 3d92a39004..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/100.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/101.png b/src/main/resources/assets/miscutils/textures/items/ion/101.png deleted file mode 100644 index 85b8f58ad9..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/101.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/102.png b/src/main/resources/assets/miscutils/textures/items/ion/102.png deleted file mode 100644 index 6993d5e4cf..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/102.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/103.png b/src/main/resources/assets/miscutils/textures/items/ion/103.png deleted file mode 100644 index a3faa8a260..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/103.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/104.png b/src/main/resources/assets/miscutils/textures/items/ion/104.png deleted file mode 100644 index 9c80b9d1f0..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/104.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/105.png b/src/main/resources/assets/miscutils/textures/items/ion/105.png deleted file mode 100644 index 2633689df4..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/105.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/106.png b/src/main/resources/assets/miscutils/textures/items/ion/106.png deleted file mode 100644 index c368411d12..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/106.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/107.png b/src/main/resources/assets/miscutils/textures/items/ion/107.png deleted file mode 100644 index fc8e4c2844..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/107.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/108.png b/src/main/resources/assets/miscutils/textures/items/ion/108.png deleted file mode 100644 index d2b271526a..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/108.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/109.png b/src/main/resources/assets/miscutils/textures/items/ion/109.png deleted file mode 100644 index 585321db38..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/109.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/11.png b/src/main/resources/assets/miscutils/textures/items/ion/11.png deleted file mode 100644 index 72baf3d9e9..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/11.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/110.png b/src/main/resources/assets/miscutils/textures/items/ion/110.png deleted file mode 100644 index 82d73b7aca..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/110.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/111.png b/src/main/resources/assets/miscutils/textures/items/ion/111.png deleted file mode 100644 index 869435fd75..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/111.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/112.png b/src/main/resources/assets/miscutils/textures/items/ion/112.png deleted file mode 100644 index bb14befcfe..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/112.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/113.png b/src/main/resources/assets/miscutils/textures/items/ion/113.png deleted file mode 100644 index 5aae8d7814..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/113.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/114.png b/src/main/resources/assets/miscutils/textures/items/ion/114.png deleted file mode 100644 index ea4897286d..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/114.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/115.png b/src/main/resources/assets/miscutils/textures/items/ion/115.png deleted file mode 100644 index 815acfb339..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/115.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/116.png b/src/main/resources/assets/miscutils/textures/items/ion/116.png deleted file mode 100644 index a335c2bb70..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/116.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/117.png b/src/main/resources/assets/miscutils/textures/items/ion/117.png deleted file mode 100644 index f3d46e4bb6..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/117.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/12.png b/src/main/resources/assets/miscutils/textures/items/ion/12.png deleted file mode 100644 index c2698ef286..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/12.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/13.png b/src/main/resources/assets/miscutils/textures/items/ion/13.png deleted file mode 100644 index d9f17334f7..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/13.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/14.png b/src/main/resources/assets/miscutils/textures/items/ion/14.png deleted file mode 100644 index 0640a05827..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/14.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/15.png b/src/main/resources/assets/miscutils/textures/items/ion/15.png deleted file mode 100644 index 8b9a6c872e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/15.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/16.png b/src/main/resources/assets/miscutils/textures/items/ion/16.png deleted file mode 100644 index 3e0dbe1143..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/16.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/17.png b/src/main/resources/assets/miscutils/textures/items/ion/17.png deleted file mode 100644 index dfcb224a3e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/17.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/18.png b/src/main/resources/assets/miscutils/textures/items/ion/18.png deleted file mode 100644 index 910712afc5..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/18.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/19.png b/src/main/resources/assets/miscutils/textures/items/ion/19.png deleted file mode 100644 index 63627d13a3..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/19.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/2.png b/src/main/resources/assets/miscutils/textures/items/ion/2.png deleted file mode 100644 index ab4474425e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/2.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/20.png b/src/main/resources/assets/miscutils/textures/items/ion/20.png deleted file mode 100644 index c4c2b0da40..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/20.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/21.png b/src/main/resources/assets/miscutils/textures/items/ion/21.png deleted file mode 100644 index ad8c2b6dbf..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/21.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/22.png b/src/main/resources/assets/miscutils/textures/items/ion/22.png deleted file mode 100644 index ce4fcd3ff2..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/22.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/23.png b/src/main/resources/assets/miscutils/textures/items/ion/23.png deleted file mode 100644 index fe75b049ce..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/23.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/24.png b/src/main/resources/assets/miscutils/textures/items/ion/24.png deleted file mode 100644 index bb256ca2bb..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/24.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/25.png b/src/main/resources/assets/miscutils/textures/items/ion/25.png deleted file mode 100644 index 6d413674c2..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/25.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/26.png b/src/main/resources/assets/miscutils/textures/items/ion/26.png deleted file mode 100644 index c93c306f5a..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/26.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/27.png b/src/main/resources/assets/miscutils/textures/items/ion/27.png deleted file mode 100644 index f822d7a4bb..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/27.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/28.png b/src/main/resources/assets/miscutils/textures/items/ion/28.png deleted file mode 100644 index 1b65383965..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/28.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/29.png b/src/main/resources/assets/miscutils/textures/items/ion/29.png deleted file mode 100644 index a3c412094e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/29.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/3.png b/src/main/resources/assets/miscutils/textures/items/ion/3.png deleted file mode 100644 index 59ad76340c..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/3.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/30.png b/src/main/resources/assets/miscutils/textures/items/ion/30.png deleted file mode 100644 index 3ae749cc91..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/30.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/31.png b/src/main/resources/assets/miscutils/textures/items/ion/31.png deleted file mode 100644 index 6bb1f6c61f..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/31.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/32.png b/src/main/resources/assets/miscutils/textures/items/ion/32.png deleted file mode 100644 index c8bc92a688..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/32.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/33.png b/src/main/resources/assets/miscutils/textures/items/ion/33.png deleted file mode 100644 index 5062c0c109..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/33.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/34.png b/src/main/resources/assets/miscutils/textures/items/ion/34.png deleted file mode 100644 index bd1e33c191..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/34.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/35.png b/src/main/resources/assets/miscutils/textures/items/ion/35.png deleted file mode 100644 index c2a42ac980..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/35.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/36.png b/src/main/resources/assets/miscutils/textures/items/ion/36.png deleted file mode 100644 index 403d45a66c..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/36.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/37.png b/src/main/resources/assets/miscutils/textures/items/ion/37.png deleted file mode 100644 index 89f011e548..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/37.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/38.png b/src/main/resources/assets/miscutils/textures/items/ion/38.png deleted file mode 100644 index b00ab7f5fc..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/38.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/39.png b/src/main/resources/assets/miscutils/textures/items/ion/39.png deleted file mode 100644 index 9fc883c731..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/39.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/4.png b/src/main/resources/assets/miscutils/textures/items/ion/4.png deleted file mode 100644 index 122cd9e837..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/4.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/40.png b/src/main/resources/assets/miscutils/textures/items/ion/40.png deleted file mode 100644 index 371171fe61..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/40.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/41.png b/src/main/resources/assets/miscutils/textures/items/ion/41.png deleted file mode 100644 index acc8d4df0b..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/41.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/42.png b/src/main/resources/assets/miscutils/textures/items/ion/42.png deleted file mode 100644 index 0f8432ea59..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/42.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/43.png b/src/main/resources/assets/miscutils/textures/items/ion/43.png deleted file mode 100644 index 1f62a1a4f9..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/43.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/44.png b/src/main/resources/assets/miscutils/textures/items/ion/44.png deleted file mode 100644 index f26b23050a..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/44.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/45.png b/src/main/resources/assets/miscutils/textures/items/ion/45.png deleted file mode 100644 index e2d6413dee..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/45.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/46.png b/src/main/resources/assets/miscutils/textures/items/ion/46.png deleted file mode 100644 index 50920e75b5..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/46.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/47.png b/src/main/resources/assets/miscutils/textures/items/ion/47.png deleted file mode 100644 index c31a2ad43d..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/47.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/48.png b/src/main/resources/assets/miscutils/textures/items/ion/48.png deleted file mode 100644 index 90b6ab544e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/48.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/49.png b/src/main/resources/assets/miscutils/textures/items/ion/49.png deleted file mode 100644 index 1c1ed02d40..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/49.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/5.png b/src/main/resources/assets/miscutils/textures/items/ion/5.png deleted file mode 100644 index 0f33a3363c..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/5.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/50.png b/src/main/resources/assets/miscutils/textures/items/ion/50.png deleted file mode 100644 index c47f4a297e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/50.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/51.png b/src/main/resources/assets/miscutils/textures/items/ion/51.png deleted file mode 100644 index 606a1e8ef4..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/51.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/52.png b/src/main/resources/assets/miscutils/textures/items/ion/52.png deleted file mode 100644 index 0a535c6158..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/52.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/53.png b/src/main/resources/assets/miscutils/textures/items/ion/53.png deleted file mode 100644 index 1fef4e5f2f..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/53.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/54.png b/src/main/resources/assets/miscutils/textures/items/ion/54.png deleted file mode 100644 index 663170c84d..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/54.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/55.png b/src/main/resources/assets/miscutils/textures/items/ion/55.png deleted file mode 100644 index 4519b12d97..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/55.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/56.png b/src/main/resources/assets/miscutils/textures/items/ion/56.png deleted file mode 100644 index 926b37bc80..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/56.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/57.png b/src/main/resources/assets/miscutils/textures/items/ion/57.png deleted file mode 100644 index c80a29d94e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/57.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/58.png b/src/main/resources/assets/miscutils/textures/items/ion/58.png deleted file mode 100644 index e33f90d6bc..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/58.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/59.png b/src/main/resources/assets/miscutils/textures/items/ion/59.png deleted file mode 100644 index 14b48b0c39..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/59.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/6.png b/src/main/resources/assets/miscutils/textures/items/ion/6.png deleted file mode 100644 index a8a9b906d2..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/6.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/60.png b/src/main/resources/assets/miscutils/textures/items/ion/60.png deleted file mode 100644 index 4d77e6d779..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/60.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/61.png b/src/main/resources/assets/miscutils/textures/items/ion/61.png deleted file mode 100644 index 42e2669011..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/61.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/62.png b/src/main/resources/assets/miscutils/textures/items/ion/62.png deleted file mode 100644 index 5b0ce84ee4..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/62.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/63.png b/src/main/resources/assets/miscutils/textures/items/ion/63.png deleted file mode 100644 index 372d256a0e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/63.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/64.png b/src/main/resources/assets/miscutils/textures/items/ion/64.png deleted file mode 100644 index 61b6521d64..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/64.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/65.png b/src/main/resources/assets/miscutils/textures/items/ion/65.png deleted file mode 100644 index 66129d8bab..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/65.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/66.png b/src/main/resources/assets/miscutils/textures/items/ion/66.png deleted file mode 100644 index 5ec0a6c747..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/66.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/67.png b/src/main/resources/assets/miscutils/textures/items/ion/67.png deleted file mode 100644 index 09c9dd8b12..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/67.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/68.png b/src/main/resources/assets/miscutils/textures/items/ion/68.png deleted file mode 100644 index d809bd3646..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/68.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/69.png b/src/main/resources/assets/miscutils/textures/items/ion/69.png deleted file mode 100644 index 9e0d0b0d75..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/69.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/7.png b/src/main/resources/assets/miscutils/textures/items/ion/7.png deleted file mode 100644 index 6d1f5c229c..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/7.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/70.png b/src/main/resources/assets/miscutils/textures/items/ion/70.png deleted file mode 100644 index 5bf9df2778..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/70.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/71.png b/src/main/resources/assets/miscutils/textures/items/ion/71.png deleted file mode 100644 index f052e1c772..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/71.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/72.png b/src/main/resources/assets/miscutils/textures/items/ion/72.png deleted file mode 100644 index 044e445356..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/72.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/73.png b/src/main/resources/assets/miscutils/textures/items/ion/73.png deleted file mode 100644 index 24bf977862..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/73.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/74.png b/src/main/resources/assets/miscutils/textures/items/ion/74.png deleted file mode 100644 index 7768bd6f4e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/74.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/75.png b/src/main/resources/assets/miscutils/textures/items/ion/75.png deleted file mode 100644 index ed9961e54f..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/75.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/76.png b/src/main/resources/assets/miscutils/textures/items/ion/76.png deleted file mode 100644 index 9010680490..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/76.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/77.png b/src/main/resources/assets/miscutils/textures/items/ion/77.png deleted file mode 100644 index 007497b931..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/77.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/78.png b/src/main/resources/assets/miscutils/textures/items/ion/78.png deleted file mode 100644 index 36c2031937..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/78.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/79.png b/src/main/resources/assets/miscutils/textures/items/ion/79.png deleted file mode 100644 index 144e55beae..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/79.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/8.png b/src/main/resources/assets/miscutils/textures/items/ion/8.png deleted file mode 100644 index 0249fbcf3b..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/8.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/80.png b/src/main/resources/assets/miscutils/textures/items/ion/80.png deleted file mode 100644 index ec7de9fda2..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/80.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/81.png b/src/main/resources/assets/miscutils/textures/items/ion/81.png deleted file mode 100644 index 9e19f0dbde..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/81.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/82.png b/src/main/resources/assets/miscutils/textures/items/ion/82.png deleted file mode 100644 index f321ff1073..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/82.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/83.png b/src/main/resources/assets/miscutils/textures/items/ion/83.png deleted file mode 100644 index c219309000..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/83.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/84.png b/src/main/resources/assets/miscutils/textures/items/ion/84.png deleted file mode 100644 index c7be4342ad..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/84.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/85.png b/src/main/resources/assets/miscutils/textures/items/ion/85.png deleted file mode 100644 index f0d9995742..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/85.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/86.png b/src/main/resources/assets/miscutils/textures/items/ion/86.png deleted file mode 100644 index df5da1cc2e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/86.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/87.png b/src/main/resources/assets/miscutils/textures/items/ion/87.png deleted file mode 100644 index ec37e331ff..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/87.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/88.png b/src/main/resources/assets/miscutils/textures/items/ion/88.png deleted file mode 100644 index 9c53cfa885..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/88.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/89.png b/src/main/resources/assets/miscutils/textures/items/ion/89.png deleted file mode 100644 index 1e7f46a245..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/89.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/9.png b/src/main/resources/assets/miscutils/textures/items/ion/9.png deleted file mode 100644 index 946246b360..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/9.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/90.png b/src/main/resources/assets/miscutils/textures/items/ion/90.png deleted file mode 100644 index 023364b0fb..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/90.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/91.png b/src/main/resources/assets/miscutils/textures/items/ion/91.png deleted file mode 100644 index 44f463ff62..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/91.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/92.png b/src/main/resources/assets/miscutils/textures/items/ion/92.png deleted file mode 100644 index ef1d21c530..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/92.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/93.png b/src/main/resources/assets/miscutils/textures/items/ion/93.png deleted file mode 100644 index 175f6bf84e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/93.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/94.png b/src/main/resources/assets/miscutils/textures/items/ion/94.png deleted file mode 100644 index 544749b556..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/94.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/95.png b/src/main/resources/assets/miscutils/textures/items/ion/95.png deleted file mode 100644 index a2d38fa96e..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/95.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/96.png b/src/main/resources/assets/miscutils/textures/items/ion/96.png deleted file mode 100644 index 12e545a65f..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/96.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/97.png b/src/main/resources/assets/miscutils/textures/items/ion/97.png deleted file mode 100644 index ee9ed016dc..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/97.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/98.png b/src/main/resources/assets/miscutils/textures/items/ion/98.png deleted file mode 100644 index aa8a1bf7ce..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/98.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/ion/99.png b/src/main/resources/assets/miscutils/textures/items/ion/99.png deleted file mode 100644 index b5ba289886..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/ion/99.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemAmulet.png b/src/main/resources/assets/miscutils/textures/items/itemAmulet.png deleted file mode 100644 index 0009e340ec..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemAmulet.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemBackpack.png b/src/main/resources/assets/miscutils/textures/items/itemBackpack.png deleted file mode 100644 index 99add96c2b..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemBackpack.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemBelt.png b/src/main/resources/assets/miscutils/textures/items/itemBelt.png deleted file mode 100644 index 93474d12e1..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemBelt.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemBigEgg.png b/src/main/resources/assets/miscutils/textures/items/itemBigEgg.png deleted file mode 100644 index 54db66b4c5..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemBigEgg.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemBoots.png b/src/main/resources/assets/miscutils/textures/items/itemBoots.png deleted file mode 100644 index 9cd07048cd..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemBoots.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemBread.png b/src/main/resources/assets/miscutils/textures/items/itemBread.png deleted file mode 100644 index 332b994342..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemBread.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemDebugShapeSpawner.png b/src/main/resources/assets/miscutils/textures/items/itemDebugShapeSpawner.png deleted file mode 100644 index 3fa59812e9..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemDebugShapeSpawner.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemFireStarter.png b/src/main/resources/assets/miscutils/textures/items/itemFireStarter.png deleted file mode 100644 index e3027edff8..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemFireStarter.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemFoodCurriedSausages.png b/src/main/resources/assets/miscutils/textures/items/itemFoodCurriedSausages.png deleted file mode 100644 index 55a9e7c912..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemFoodCurriedSausages.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemFoodRaisinToast.png b/src/main/resources/assets/miscutils/textures/items/itemFoodRaisinToast.png deleted file mode 100644 index 12a1962cd3..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemFoodRaisinToast.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemHotIngotRaisinBread.png b/src/main/resources/assets/miscutils/textures/items/itemHotIngotRaisinBread.png deleted file mode 100644 index 332b994342..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemHotIngotRaisinBread.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemIngotRaisinBread.png b/src/main/resources/assets/miscutils/textures/items/itemIngotRaisinBread.png deleted file mode 100644 index 332b994342..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemIngotRaisinBread.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemKeyBig.png b/src/main/resources/assets/miscutils/textures/items/itemKeyBig.png deleted file mode 100644 index abfefc9aba..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemKeyBig.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemKeyGold.png b/src/main/resources/assets/miscutils/textures/items/itemKeyGold.png deleted file mode 100644 index 289dac1df6..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemKeyGold.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemKeyGoldBoss.png b/src/main/resources/assets/miscutils/textures/items/itemKeyGoldBoss.png deleted file mode 100644 index 11e8312714..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemKeyGoldBoss.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemMushroom.png b/src/main/resources/assets/miscutils/textures/items/itemMushroom.png deleted file mode 100644 index d63f079f45..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemMushroom.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemMushroomRed.png b/src/main/resources/assets/miscutils/textures/items/itemMushroomRed.png deleted file mode 100644 index 2bbf1bcb00..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemMushroomRed.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemNugget.png b/src/main/resources/assets/miscutils/textures/items/itemNugget.png deleted file mode 100644 index e4d3e0c89c..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemNugget.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemPLACEHOLDER_Circuit.png b/src/main/resources/assets/miscutils/textures/items/itemPLACEHOLDER_Circuit.png deleted file mode 100644 index aba5bf6850..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemPLACEHOLDER_Circuit.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemPickaxe.png b/src/main/resources/assets/miscutils/textures/items/itemPickaxe.png deleted file mode 100644 index d21440bd11..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemPickaxe.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemPineapple.png b/src/main/resources/assets/miscutils/textures/items/itemPineapple.png deleted file mode 100644 index 1185738eb8..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemPineapple.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemPlatebody.png b/src/main/resources/assets/miscutils/textures/items/itemPlatebody.png deleted file mode 100644 index ec472a86a0..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemPlatebody.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemPlatelegs.png b/src/main/resources/assets/miscutils/textures/items/itemPlatelegs.png deleted file mode 100644 index bcaa1338e6..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemPlatelegs.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemRingWearable.png b/src/main/resources/assets/miscutils/textures/items/itemRingWearable.png deleted file mode 100644 index 4601dbbe13..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemRingWearable.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemRope.png b/src/main/resources/assets/miscutils/textures/items/itemRope.png deleted file mode 100644 index 061938234d..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemRope.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemSandstoneHammer.png b/src/main/resources/assets/miscutils/textures/items/itemSandstoneHammer.png deleted file mode 100644 index ae8fc32267..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemSandstoneHammer.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemStaballoyAxe.png b/src/main/resources/assets/miscutils/textures/items/itemStaballoyAxe.png deleted file mode 100644 index d7f8ed262f..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemStaballoyAxe.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemStaballoyPickaxe.png b/src/main/resources/assets/miscutils/textures/items/itemStaballoyPickaxe.png deleted file mode 100644 index 024f4f384c..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemStaballoyPickaxe.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/itemStickyRubber.png b/src/main/resources/assets/miscutils/textures/items/itemStickyRubber.png deleted file mode 100644 index c95353c892..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/itemStickyRubber.png and /dev/null differ diff --git a/src/main/resources/assets/miscutils/textures/items/science/Atom.png b/src/main/resources/assets/miscutils/textures/items/science/Atom.png deleted file mode 100644 index eec0344eda..0000000000 Binary files a/src/main/resources/assets/miscutils/textures/items/science/Atom.png and /dev/null differ