diff --git a/build.gradle b/build.gradle index b3797a3db..03d308b69 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ buildscript { apply plugin: 'forge' apply plugin: 'maven' -version = "1.7.10-0.0.5.5" +version = "1.7.10-0.0.5.7" group = "ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" @@ -53,7 +53,7 @@ processResources{ from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' - expand 'update':project.version, 'mcversion':project.minecraft.version + expand 'version':project.version, 'mcversion':project.minecraft.version } from(sourceSets.main.resources.srcDirs) { diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockBreaker.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockBreaker.java index d4379a444..e46eb1296 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockBreaker.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockBreaker.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityBreaker; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; @@ -21,6 +22,8 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import java.util.List; + public class BlockBreaker extends BlockContainerBase implements INameableItem{ private IIcon frontIcon; @@ -117,6 +120,13 @@ public class BlockBreaker extends BlockContainerBase implements INameableItem{ return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCanolaPress.java index 167bf6a02..16ca12ff4 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCanolaPress.java @@ -100,6 +100,7 @@ public class BlockCanolaPress extends BlockContainerBase implements INameableIte @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); BlockUtil.addPowerUsageInfo(list, TileEntityCanolaPress.energyUsedPerTick); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoalGenerator.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoalGenerator.java index 030e05169..b57296420 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoalGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoalGenerator.java @@ -99,7 +99,8 @@ public class BlockCoalGenerator extends BlockContainerBase implements INameableI @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); BlockUtil.addPowerProductionInfo(list, TileEntityCoalGenerator.energyProducedPerTick); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoffeeMachine.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoffeeMachine.java index 309231119..c0dcaf928 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoffeeMachine.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoffeeMachine.java @@ -6,6 +6,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityCoffeeMachine; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -21,6 +22,8 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import java.util.List; + public class BlockCoffeeMachine extends BlockContainerBase implements INameableItem{ public BlockCoffeeMachine(){ @@ -121,6 +124,14 @@ public class BlockCoffeeMachine extends BlockContainerBase implements INameableI return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 5, ""); + BlockUtil.addPowerUsageInfo(list, TileEntityCoffeeMachine.energyUsePerTick); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java index 9fda45de0..8953a197e 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java @@ -8,6 +8,7 @@ import ellpeck.actuallyadditions.items.ItemFertilizer; import ellpeck.actuallyadditions.items.ItemMisc; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; import ellpeck.actuallyadditions.tile.TileEntityCompost; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -148,6 +149,13 @@ public class BlockCompost extends BlockContainerBase implements INameableItem{ return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockContainerBase.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockContainerBase.java index 001823ba0..d7de4dbf3 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockContainerBase.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockContainerBase.java @@ -19,27 +19,30 @@ public abstract class BlockContainerBase extends BlockContainer{ super(mat); } - public TileEntityInventoryBase dropInventory(World world, int x, int y, int z){ - TileEntityInventoryBase tileEntity = (TileEntityInventoryBase)world.getTileEntity(x, y, z); - for (int i = 0; i < tileEntity.getSizeInventory(); i++){ - ItemStack itemStack = tileEntity.getStackInSlot(i); - if (itemStack != null && itemStack.stackSize > 0) { - Random rand = new Random(); - float dX = rand.nextFloat() * 0.8F + 0.1F; - float dY = rand.nextFloat() * 0.8F + 0.1F; - float dZ = rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem = new EntityItem(world, x + dX, y + dY, z + dZ, itemStack.copy()); - if (itemStack.hasTagCompound()) - entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); - float factor = 0.05F; - entityItem.motionX = rand.nextGaussian() * factor; - entityItem.motionY = rand.nextGaussian() * factor + 0.2F; - entityItem.motionZ = rand.nextGaussian() * factor; - world.spawnEntityInWorld(entityItem); - itemStack.stackSize = 0; + public void dropInventory(World world, int x, int y, int z){ + TileEntity tile = world.getTileEntity(x, y, z); + if(tile instanceof TileEntityInventoryBase){ + TileEntityInventoryBase tileEntity = (TileEntityInventoryBase)tile; + if(tileEntity.getSizeInventory() > 0){ + for(int i = 0; i < tileEntity.getSizeInventory(); i++){ + ItemStack itemStack = tileEntity.getStackInSlot(i); + if(itemStack != null && itemStack.stackSize > 0){ + Random rand = new Random(); + float dX = rand.nextFloat()*0.8F+0.1F; + float dY = rand.nextFloat()*0.8F+0.1F; + float dZ = rand.nextFloat()*0.8F+0.1F; + EntityItem entityItem = new EntityItem(world, x+dX, y+dY, z+dZ, itemStack.copy()); + if(itemStack.hasTagCompound()) entityItem.getEntityItem().setTagCompound((NBTTagCompound)itemStack.getTagCompound().copy()); + float factor = 0.05F; + entityItem.motionX = rand.nextGaussian()*factor; + entityItem.motionY = rand.nextGaussian()*factor+0.2F; + entityItem.motionZ = rand.nextGaussian()*factor; + world.spawnEntityInWorld(entityItem); + itemStack.stackSize = 0; + } + } } } - return tileEntity; } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockDropper.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockDropper.java index d4737dfdb..7779a84eb 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockDropper.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockDropper.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityDropper; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; @@ -21,6 +22,8 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import java.util.List; + public class BlockDropper extends BlockContainerBase implements INameableItem{ private IIcon frontIcon; @@ -114,6 +117,13 @@ public class BlockDropper extends BlockContainerBase implements INameableItem{ return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java index a72632581..e135def6d 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityFeeder; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; @@ -18,6 +19,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import java.util.List; + public class BlockFeeder extends BlockContainerBase implements INameableItem{ private IIcon topIcon; @@ -93,6 +96,13 @@ public class BlockFeeder extends BlockContainerBase implements INameableItem{ return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFermentingBarrel.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFermentingBarrel.java index 3ac6685dc..68ab2eb43 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFermentingBarrel.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFermentingBarrel.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityFermentingBarrel; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; @@ -18,6 +19,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import java.util.List; + public class BlockFermentingBarrel extends BlockContainerBase implements INameableItem{ private IIcon iconTop; @@ -93,6 +96,13 @@ public class BlockFermentingBarrel extends BlockContainerBase implements INameab return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + } + @Override public int getMetadata(int meta){ return meta; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java index 37b3b7ca6..d6cd5edcd 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java @@ -4,10 +4,12 @@ import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.tile.TileEntityFishingNet; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemBlock; @@ -16,6 +18,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import java.util.List; + public class BlockFishingNet extends BlockContainerBase implements INameableItem{ public BlockFishingNet(){ @@ -88,6 +92,13 @@ public class BlockFishingNet extends BlockContainerBase implements INameableItem return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + } + @Override public int getMetadata(int meta){ return meta; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidCollector.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidCollector.java index 5cc8ba797..5c7ec84af 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidCollector.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityFluidCollector; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; @@ -21,6 +22,8 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import java.util.List; + public class BlockFluidCollector extends BlockContainerBase implements INameableItem{ private IIcon frontIcon; @@ -117,6 +120,13 @@ public class BlockFluidCollector extends BlockContainerBase implements INameable return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidFlowing.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidFlowing.java index 02b11aff4..c60c1f7a4 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidFlowing.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidFlowing.java @@ -2,11 +2,13 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -16,6 +18,8 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; +import java.util.List; + public class BlockFluidFlowing extends BlockFluidClassic implements INameableItem{ private String name; @@ -84,6 +88,13 @@ public class BlockFluidFlowing extends BlockFluidClassic implements INameableIte return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java index 958d16555..a0986d1c9 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityFurnaceDouble; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; @@ -21,6 +22,7 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import java.util.List; import java.util.Random; public class BlockFurnaceDouble extends BlockContainerBase implements INameableItem{ @@ -164,6 +166,14 @@ public class BlockFurnaceDouble extends BlockContainerBase implements INameableI return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + BlockUtil.addPowerUsageInfo(list, TileEntityFurnaceDouble.energyUsePerTick); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java index 071b520e1..36949cd77 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java @@ -95,7 +95,8 @@ public class BlockFurnaceSolar extends BlockContainerBase implements INameableIt @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); BlockUtil.addPowerProductionInfo(list, TileEntityFurnaceSolar.energyProducedPerTick); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java index 2238fed2a..509dca6fe 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityGiantChest; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; @@ -18,6 +19,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import java.util.List; + public class BlockGiantChest extends BlockContainerBase implements INameableItem{ private IIcon topIcon; @@ -95,6 +98,13 @@ public class BlockGiantChest extends BlockContainerBase implements INameableItem return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGreenhouseGlass.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGreenhouseGlass.java index a2699b179..60f0291cf 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGreenhouseGlass.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGreenhouseGlass.java @@ -3,11 +3,13 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.tile.TileEntityGreenhouseGlass; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -17,6 +19,8 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import java.util.List; + public class BlockGreenhouseGlass extends BlockContainerBase implements INameableItem{ public BlockGreenhouseGlass(){ @@ -96,6 +100,13 @@ public class BlockGreenhouseGlass extends BlockContainerBase implements INameabl return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java index 0a159ad7e..1c63f53f6 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java @@ -3,8 +3,10 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; +import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityGrinder; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; @@ -19,6 +21,7 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import java.util.List; import java.util.Random; public class BlockGrinder extends BlockContainerBase implements INameableItem{ @@ -127,6 +130,14 @@ public class BlockGrinder extends BlockContainerBase implements INameableItem{ return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, ((BlockGrinder)theBlock).isDouble ? 3 : 4, ""); + BlockUtil.addPowerUsageInfo(list, ((BlockGrinder)theBlock).isDouble ? ConfigIntValues.GRINDER_DOUBLE_ENERGY_USED.getValue() : ConfigIntValues.GRINDER_ENERGY_USED.getValue()); + } + @Override public int getMetadata(int meta){ return meta; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java index 2b5cf366a..c026c01dd 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java @@ -83,7 +83,8 @@ public class BlockHeatCollector extends BlockContainerBase implements INameableI @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 3, ""); BlockUtil.addPowerProductionInfo(list, TileEntityHeatCollector.energyProducedPerTick); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java index 5030fe972..5f9495cde 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java @@ -5,8 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityInputter; -import ellpeck.actuallyadditions.util.INameableItem; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -19,6 +18,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import java.util.List; import java.util.Random; public class BlockInputter extends BlockContainerBase implements INameableItem{ @@ -115,6 +115,20 @@ public class BlockInputter extends BlockContainerBase implements INameableItem{ return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocalFormatted("tooltip." + ModUtil.MOD_ID_LOWER + ".blockInputter.desc." + 1, StringUtil.OBFUSCATED, StringUtil.LIGHT_GRAY)); + for(int i = 1; i < 6; i++){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".blockInputter.desc." + (i + 1))); + } + if((((BlockInputter)theBlock).isAdvanced)) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc")); + } + else list.add(ItemUtil.shiftForInfo()); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java index 81db9ff99..10be6b9a1 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java @@ -121,6 +121,7 @@ public class BlockItemRepairer extends BlockContainerBase implements INameableIt @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); BlockUtil.addPowerUsageInfo(list, TileEntityItemRepairer.energyUsePerTick); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java index 55fde2db3..782eb30f2 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java @@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.tile.TileEntityLavaFactoryController; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -18,6 +20,8 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import java.util.List; + public class BlockLavaFactoryController extends BlockContainerBase implements INameableItem{ private IIcon topIcon; @@ -96,6 +100,16 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IN return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 3, ""); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".uses.desc") + " " + TileEntityLavaFactoryController.energyNeededToProduceLava + " RF/B"); + } + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java index 5fa59a537..513a52bcc 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java @@ -3,12 +3,14 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; 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.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; @@ -85,6 +87,13 @@ public class BlockMisc extends Block implements INameableItem{ return this.getUnlocalizedName() + (stack.getItemDamage() >= allMiscBlocks.length ? " ERROR!" : allMiscBlocks[stack.getItemDamage()].getName()); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, allMiscBlocks[stack.getItemDamage()].getName()); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockOilGenerator.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockOilGenerator.java index 3af1ded7e..28e8d6568 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockOilGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockOilGenerator.java @@ -99,7 +99,8 @@ public class BlockOilGenerator extends BlockContainerBase implements INameableIt @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); BlockUtil.addPowerProductionInfo(list, TileEntityOilGenerator.energyProducedPerTick); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomBooster.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomBooster.java index ae6835f3c..268276d99 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomBooster.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomBooster.java @@ -4,10 +4,12 @@ import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.tile.TileEntityPhantomBooster; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemBlock; @@ -16,6 +18,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import java.util.List; + public class BlockPhantomBooster extends BlockContainerBase implements INameableItem{ public BlockPhantomBooster(){ @@ -90,6 +94,13 @@ public class BlockPhantomBooster extends BlockContainerBase implements INameable return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 2, ""); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java index 148a9a573..06b5c994f 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantomface.java @@ -7,8 +7,7 @@ import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityPhantomPlacer; import ellpeck.actuallyadditions.tile.TileEntityPhantomface; -import ellpeck.actuallyadditions.util.INameableItem; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -156,8 +155,15 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + ((BlockPhantomface)theBlock).range); + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 2, ""); + if(KeyUtil.isShiftPressed()){ + if(((BlockPhantomface)this.theBlock).type == LIQUIFACE){ + list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.3")); + list.add(StringUtil.ORANGE+StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomLiquiface.desc.4")); + } + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + ((BlockPhantomface)theBlock).range); + } } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java index ea2402abb..f9298b9ac 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java @@ -3,11 +3,13 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.ItemSeed; +import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockCrops; 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.ItemBlock; @@ -131,6 +133,13 @@ public class BlockPlant extends BlockCrops implements INameableItem, IFactoryHar return this.getUnlocalizedName(); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + BlockUtil.addInformation(theBlock, list, 1, ""); + } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java b/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java index 7b20e5acf..6044ab5df 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java @@ -1,5 +1,6 @@ package ellpeck.actuallyadditions.blocks; +import ellpeck.actuallyadditions.config.values.ConfigBoolValues; import ellpeck.actuallyadditions.util.BlockUtil; import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.Util; @@ -184,7 +185,7 @@ public class InitBlocks{ public static void registerFluids(){ String canolaOil = "canolaoil"; - if(!FluidRegistry.isFluidRegistered(canolaOil)){ + if(!FluidRegistry.isFluidRegistered(canolaOil) || ConfigBoolValues.PREVENT_CANOLA_OVERRIDE.isEnabled()){ fluidCanolaOil = new FluidAA(canolaOil).setDensity(1200).setViscosity(1500).setTemperature(300).setRarity(EnumRarity.uncommon); FluidRegistry.registerFluid(fluidCanolaOil); } @@ -193,7 +194,7 @@ public class InitBlocks{ } fluidCanolaOil = FluidRegistry.getFluid(canolaOil); - if(fluidCanolaOil.getBlock() == null){ + if(fluidCanolaOil.getBlock() == null || ConfigBoolValues.PREVENT_CANOLA_BLOCK_OVERRIDE.isEnabled()){ blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil"); BlockUtil.register(blockCanolaOil, BlockFluidFlowing.TheItemBlock.class, false); } @@ -203,7 +204,7 @@ public class InitBlocks{ blockCanolaOil = fluidCanolaOil.getBlock(); String oil = "oil"; - if(!FluidRegistry.isFluidRegistered(oil)){ + if(!FluidRegistry.isFluidRegistered(oil) || ConfigBoolValues.PREVENT_OIL_OVERRIDE.isEnabled()){ fluidOil = new FluidAA(oil).setDensity(1200).setViscosity(1500).setTemperature(300).setRarity(EnumRarity.uncommon); FluidRegistry.registerFluid(fluidOil); } @@ -212,7 +213,7 @@ public class InitBlocks{ } fluidOil = FluidRegistry.getFluid(oil); - if(fluidOil.getBlock() == null){ + if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){ blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil"); BlockUtil.register(blockOil, BlockFluidFlowing.TheItemBlock.class, false); } @@ -223,6 +224,6 @@ public class InitBlocks{ } public static void errorAlreadyRegistered(String str){ - ModUtil.LOGGER.log(Level.WARN, str + " from Actually Additions is not getting used as it has already been registered by another Mod! Issues may (but shouldn't) occur!"); + ModUtil.LOGGER.log(Level.WARN, str + " from Actually Additions is not getting used as it has already been registered by another Mod! If this causes Issues (which it shouldn't!), you can turn this off in the Config File!"); } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/config/ConfigCategories.java b/src/main/java/ellpeck/actuallyadditions/config/ConfigCategories.java index eab30ea58..fac93403a 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/ConfigCategories.java +++ b/src/main/java/ellpeck/actuallyadditions/config/ConfigCategories.java @@ -11,7 +11,8 @@ public enum ConfigCategories{ MOB_DROPS("mob drops"), WORLD_GEN("world gen"), POTION_RING_CRAFTING("ring crafting"), - OTHER("other"); + OTHER("other"), + FLUIDS("fluids"); public final String name; diff --git a/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java b/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java index 735f1ce90..dd9ff7cf2 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java @@ -7,6 +7,8 @@ import java.io.File; public class ConfigurationHandler{ + public static final String ISSUES_WARNING = " [THIS COULD CAUSE ISSUES, CHANGE AT YOUR OWN RISK!]"; + public static void init(File configFile){ Util.logInfo("Grabbing Configurations..."); Configuration config = new Configuration(configFile); diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java index 260536f75..b33a7f454 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigBoolValues.java @@ -2,6 +2,7 @@ package ellpeck.actuallyadditions.config.values; import ellpeck.actuallyadditions.config.ConfigCategories; import ellpeck.actuallyadditions.config.ConfigValues; +import ellpeck.actuallyadditions.config.ConfigurationHandler; public enum ConfigBoolValues{ @@ -20,15 +21,21 @@ public enum ConfigBoolValues{ PEARL_SHARD_DROP("Ender Pearl Shard", ConfigCategories.MOB_DROPS, true, "If the Ender Pearl Shard drops from Mobs"), EMERALD_SHARD_CROP("Emerald Shard", ConfigCategories.MOB_DROPS, true, "If the Emerald Shard drops from Mobs"), + DO_WAILA_INFO("Waila Display Info", ConfigCategories.OTHER, true, "If the Shift Description should display in Waila too"), + DO_UPDATE_CHECK("Do Update Check", ConfigCategories.OTHER, true, "If Actually Additions should check for an Update on joining a World"), DO_CRUSHER_SPAM("Crusher Debug", ConfigCategories.OTHER, false, "Print out Crusher Recipe Initializing Debug"), DO_CAT_DROPS("Do Cat Drops", ConfigCategories.OTHER, true, "If Cats drop Hairy Balls on Occasion"), - DO_WAILA_INFO("Waila Display Info", ConfigCategories.OTHER, true, "If the Shift Description should display in Waila too"), DO_RICE_GEN("Rice Gen", ConfigCategories.WORLD_GEN, true, "If Rice should generate in the World"), DO_CANOLA_GEN("Canola Gen", ConfigCategories.WORLD_GEN, true, "If Canola should generate in the World"), DO_FLAX_GEN("Flax Gen", ConfigCategories.WORLD_GEN, true, "If Flax should generate in the World"), - DO_COFFEE_GEN("Coffee Gen", ConfigCategories.WORLD_GEN, true, "If Coffee should generate in the World"); + DO_COFFEE_GEN("Coffee Gen", ConfigCategories.WORLD_GEN, true, "If Coffee should generate in the World"), + + PREVENT_OIL_OVERRIDE("Oil Fluid Override", ConfigCategories.FLUIDS, false, "If not registering Oil Fluids from Actually Additions if other Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING), + PREVENT_CANOLA_OVERRIDE("Canola Oil Fluid Override", ConfigCategories.FLUIDS, false, "If not registering Canola Oil Fluids from Actually Additions if other Canola Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING), + PREVENT_OIL_BLOCK_OVERRIDE("Oil Block Override", ConfigCategories.FLUIDS, false, "If not registering Oil Blocks from Actually Additions if other Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING), + PREVENT_CANOLA_BLOCK_OVERRIDE("Canola Oil Block Override", ConfigCategories.FLUIDS, false, "If not registering Canola Oil Blocks from Actually Additions if other Canola Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING); public final String name; public final String category; diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/InitCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/InitCrafting.java index e52c97ae2..9697c3a98 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/InitCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/InitCrafting.java @@ -12,7 +12,6 @@ public class InitCrafting { MiscCrafting.init(); FoodCrafting.init(); ToolCrafting.init(); - } } diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java index ecbfd8be2..5cde60751 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java @@ -35,7 +35,7 @@ public class ItemCrafting{ 'B', new ItemStack(Items.potionitem))); } - //Leaf Blower + //Leaf Blower if(ConfigCrafting.LEAF_BLOWER.isEnabled()) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLeafBlower), " F", "IP", "IC", diff --git a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java index 9a718cc65..156f8d699 100644 --- a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java +++ b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java @@ -61,7 +61,7 @@ public class CreativeTab extends CreativeTabs{ addBlock(InitBlocks.blockCanolaPress); addBlock(InitBlocks.blockFermentingBarrel); - addItem(InitItems.itemDrill); + //addItem(InitItems.itemDrill); addItem(InitItems.itemPhantomConnector); addItem(InitItems.itemBucketCanolaOil); addItem(InitItems.itemBucketOil); diff --git a/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java b/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java index 64d78776f..638251ebc 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java +++ b/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java @@ -1,6 +1,5 @@ package ellpeck.actuallyadditions.event; -import ellpeck.actuallyadditions.manual.InventoryEvents; import ellpeck.actuallyadditions.util.Util; public class InitEvents{ @@ -16,8 +15,6 @@ public class InitEvents{ Util.registerEvent(new EntityLivingEvent()); Util.registerEvent(new WorldDecorationEvent()); Util.registerEvent(new BucketFillEvent()); - Util.registerEvent(new InventoryEvents.InitGuiEvent()); - Util.registerEvent(new InventoryEvents.ButtonPressedEvent()); } } diff --git a/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentJamHouse.java b/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentJamHouse.java index e2fda48a1..7241492df 100644 --- a/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentJamHouse.java +++ b/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentJamHouse.java @@ -50,7 +50,7 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{ for (int i = 0; i < xSize; i++){ for(int j = 0; j < zSize; j++){ this.clearCurrentPositionBlocksUpwards(world, j, ySize, i, sbb); - this.func_151554_b(world, Blocks.cobblestone, 0, j, -1, i, sbb); + this.func_151554_b(world, Blocks.cobblestone, 0, j, 0, i, sbb); } } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java b/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java index fc898626e..ef5d7ad73 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java @@ -4,8 +4,6 @@ import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.gui.*; -import ellpeck.actuallyadditions.manual.ContainerManual; -import ellpeck.actuallyadditions.manual.GuiManual; import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.util.Util; import net.minecraft.entity.player.EntityPlayer; @@ -16,7 +14,7 @@ public class GuiHandler implements IGuiHandler{ @Override public Object getServerGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z){ TileEntityBase tile = null; - if(id != CRAFTER_ID && id != DRILL_ID && id != MANUAL_ID){ + if(id != CRAFTER_ID && id != DRILL_ID){ tile = (TileEntityBase)world.getTileEntity(x, y, z); } switch(id){ @@ -56,8 +54,6 @@ public class GuiHandler implements IGuiHandler{ return new ContainerFluidCollector(entityPlayer.inventory, tile); case COFFEE_MACHINE_ID: return new ContainerCoffeeMachine(entityPlayer.inventory, tile); - case MANUAL_ID: - return new ContainerManual(); default: return null; } @@ -66,7 +62,7 @@ public class GuiHandler implements IGuiHandler{ @Override public Object getClientGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z){ TileEntityBase tile = null; - if(id != CRAFTER_ID && id != DRILL_ID && id != MANUAL_ID){ + if(id != CRAFTER_ID && id != DRILL_ID){ tile = (TileEntityBase)world.getTileEntity(x, y, z); } switch(id){ @@ -106,8 +102,6 @@ public class GuiHandler implements IGuiHandler{ return new GuiFluidCollector(entityPlayer.inventory, tile); case COFFEE_MACHINE_ID: return new GuiCoffeeMachine(entityPlayer.inventory, tile, x, y, z, world); - case MANUAL_ID: - return new GuiManual(); default: return null; } @@ -132,7 +126,6 @@ public class GuiHandler implements IGuiHandler{ public static final int FLUID_COLLECTOR_ID = 16; public static final int COFFEE_MACHINE_ID = 17; public static final int DRILL_ID = 18; - public static final int MANUAL_ID = 19; public static void init(){ Util.logInfo("Initializing GuiHandler..."); diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java index ead653068..1f48e906a 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -69,13 +69,13 @@ public class InitItems{ public static Item emeraldPaxel; public static Item obsidianPaxel; - public static Item itemDrill; + //public static Item itemDrill; public static void init(){ Util.logInfo("Initializing Items..."); - itemDrill = new ItemDrill(); - ItemUtil.register(itemDrill); + //itemDrill = new ItemDrill(); + //ItemUtil.register(itemDrill); itemBucketOil = new ItemBucketAA(InitBlocks.blockOil, "itemBucketOil"); ItemUtil.register(itemBucketOil); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemBucketAA.java b/src/main/java/ellpeck/actuallyadditions/items/ItemBucketAA.java index ac429ce64..6c106c564 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemBucketAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemBucketAA.java @@ -3,15 +3,19 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemBucket; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import java.util.List; + public class ItemBucketAA extends ItemBucket implements INameableItem{ private String name; @@ -27,6 +31,12 @@ public class ItemBucketAA extends ItemBucket implements INameableItem{ return EnumRarity.uncommon; } + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + ItemUtil.addInformation(this, list, 1, ""); + } + @Override public IIcon getIcon(ItemStack stack, int pass){ return this.itemIcon; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java index 9c9b80818..17c36aaf2 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java @@ -5,6 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -201,17 +203,22 @@ public class ItemCoffee extends ItemFood implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+this.func_150905_g(stack)); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+this.func_150906_h(stack)); - list.add(""); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.1")); + list.add(StatCollector.translateToLocalFormatted("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.2", this.getMaxDamage()+1)); + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+this.func_150905_g(stack)); + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+this.func_150906_h(stack)); + list.add(""); - PotionEffect[] effects = getEffectsFromStack(stack); - if(effects != null && effects.length > 0){ - for(PotionEffect effect : effects){ - list.add(StatCollector.translateToLocal(effect.getEffectName())+" "+(effect.getAmplifier()+1)+ " (" + Potion.getDurationString(new PotionEffect(0, effect.getDuration()*20, 0)) + ")"); + PotionEffect[] effects = getEffectsFromStack(stack); + if(effects != null && effects.length > 0){ + for(PotionEffect effect : effects){ + list.add(StatCollector.translateToLocal(effect.getEffectName())+" "+(effect.getAmplifier()+1)+ " (" + Potion.getDurationString(new PotionEffect(0, effect.getDuration()*20, 0)) + ")"); + } } + else list.add("No Effects"); } - else list.add("No Effects"); + else list.add(ItemUtil.shiftForInfo()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffeeBean.java b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffeeBean.java index 1deb06518..08a55cd57 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffeeBean.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffeeBean.java @@ -3,13 +3,17 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import java.util.List; + public class ItemCoffeeBean extends ItemFood implements INameableItem{ public ItemCoffeeBean(){ @@ -27,6 +31,13 @@ public class ItemCoffeeBean extends ItemFood implements INameableItem{ return EnumRarity.rare; } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + ItemUtil.addInformation(this, list, 1, ""); + } + @Override @SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int pass){ diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java b/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java index ed99912d9..04e43ba5d 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -14,12 +15,21 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import java.util.List; + public class ItemCrafterOnAStick extends Item implements INameableItem{ public ItemCrafterOnAStick(){ this.setMaxStackSize(1); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + ItemUtil.addInformation(this, list, 1, ""); + } + @Override public IIcon getIcon(ItemStack stack, int pass){ return this.itemIcon; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java index ef7b9baae..1e7923346 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java @@ -8,10 +8,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.items.tools.ItemAllToolAA; -import ellpeck.actuallyadditions.util.INameableItem; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; -import ellpeck.actuallyadditions.util.WorldUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -48,14 +45,14 @@ public class ItemDrill extends ItemEnergyContainer implements INameableItem{ } public ItemDrill(){ - super(3000000); + super(500000); this.setMaxStackSize(1); this.setHasSubtypes(true); } public static float defaultEfficiency = 8.0F; + public static int energyUsePerBlockOrHit = 100; - public int energyUsePerBlockOrHit = 100; public float efficiency = defaultEfficiency; @Override @@ -77,23 +74,29 @@ public class ItemDrill extends ItemEnergyContainer implements INameableItem{ @Override public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){ - boolean hasSilkTouch = this.hasEnchantment(stack, Enchantment.silkTouch) >= 0; - if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SILK_TOUCH)){ - if(!hasSilkTouch){ - //TODO Add more Energy Use as Variable Change (Like Efficiency!) - stack.addEnchantment(Enchantment.silkTouch, 1); - } - } - else if(hasSilkTouch) this.removeEnchantment(stack, Enchantment.silkTouch); + this.addEnchantFromUpgrade(Enchantment.silkTouch, ItemDrillUpgrade.UpgradeType.SILK_TOUCH, stack, 1); + this.addEnchantFromUpgrade(Enchantment.fortune, ItemDrillUpgrade.UpgradeType.FORTUNE, stack, this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE_II) ? 3 : 1); + } - boolean hasFortune = this.hasEnchantment(stack, Enchantment.fortune) >= 0; - if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE)){ - if(!hasFortune){ - //TODO Add more Energy Use as Variable Change (Like Efficiency!) - stack.addEnchantment(Enchantment.fortune, this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE_II) ? 3 : 1); + public void addEnchantFromUpgrade(Enchantment enchantment, ItemDrillUpgrade.UpgradeType upgrade, ItemStack stack, int level){ + boolean hasEnchant = this.hasEnchantment(stack, enchantment) >= 0; + if(this.getHasUpgrade(stack, upgrade)){ + if(!hasEnchant){ + stack.addEnchantment(enchantment, level); } } - else if(hasFortune) this.removeEnchantment(stack, Enchantment.fortune); + else if(hasEnchant) this.removeEnchantment(stack, enchantment); + } + + public int getEnergyUsePerBlock(ItemStack stack){ + int use = energyUsePerBlockOrHit; + ItemDrillUpgrade.UpgradeType[] types = ItemDrillUpgrade.UpgradeType.values(); + for(ItemDrillUpgrade.UpgradeType type : types){ + if(this.getHasUpgrade(stack, type)){ + use += type.extraEnergy; + } + } + return use; } public void removeEnchantment(ItemStack stack, Enchantment ench){ @@ -132,8 +135,8 @@ public class ItemDrill extends ItemEnergyContainer implements INameableItem{ } public boolean getHasUpgrade(ItemStack stack, ItemDrillUpgrade.UpgradeType upgrade){ - if(upgrade == ItemDrillUpgrade.UpgradeType.SILK_TOUCH) return true; if(upgrade == ItemDrillUpgrade.UpgradeType.THREE_BY_THREE) return true; + if(upgrade == ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE) return true; NBTTagCompound compound = stack.getTagCompound(); if(compound == null) return false; @@ -224,7 +227,7 @@ public class ItemDrill extends ItemEnergyContainer implements INameableItem{ int yRange = radius; int zRange = 0; - MovingObjectPosition pos = WorldUtil.raytraceEntity(world, entity, 4.5D); + MovingObjectPosition pos = WorldUtil.raytraceBlocksFromEntity(world, entity, 4.5D); if(pos != null){ int side = pos.sideHit; if(side == 0 || side == 1){ @@ -239,11 +242,12 @@ public class ItemDrill extends ItemEnergyContainer implements INameableItem{ for(int xPos = x-xRange; xPos <= x+xRange; xPos++){ for(int yPos = y-yRange; yPos <= y+yRange; yPos++){ for(int zPos = z-zRange; zPos <= z+zRange; zPos++){ - if(this.getEnergyStored(stack) >= this.energyUsePerBlockOrHit){ + int use = this.getEnergyUsePerBlock(stack); + if(this.getEnergyStored(stack) >= use){ Block block = world.getBlock(xPos, yPos, zPos); float hardness = block.getBlockHardness(world, xPos, yPos, zPos); if(!(xPos == x && yPos == y && zPos == z) && hardness > -1.0F && this.canHarvestBlock(block, stack)){ - this.extractEnergy(stack, this.energyUsePerBlockOrHit, false); + this.extractEnergy(stack, use, false); ArrayList drops = new ArrayList(); int meta = world.getBlockMetadata(xPos, yPos, zPos); @@ -282,8 +286,9 @@ public class ItemDrill extends ItemEnergyContainer implements INameableItem{ @Override public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase living){ - if(this.getEnergyStored(stack) >= this.energyUsePerBlockOrHit){ - this.extractEnergy(stack, this.energyUsePerBlockOrHit, false); + int use = this.getEnergyUsePerBlock(stack); + if(this.getEnergyStored(stack) >= use){ + this.extractEnergy(stack, use, false); if(!world.isRemote){ if(!living.isSneaking()){ if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){ @@ -300,15 +305,16 @@ public class ItemDrill extends ItemEnergyContainer implements INameableItem{ @Override public float func_150893_a(ItemStack stack, Block block){ - if(this.getEnergyStored(stack) < this.energyUsePerBlockOrHit) return 0.0F; + if(this.getEnergyStored(stack) < this.getEnergyUsePerBlock(stack)) return 0.0F; if(block.getMaterial() == Material.iron || block.getMaterial() == Material.anvil || block.getMaterial() == Material.rock || allSet.contains(block)) return efficiency; else return super.func_150893_a(stack, block); } @Override public boolean hitEntity(ItemStack stack, EntityLivingBase entity1, EntityLivingBase entity2){ - if(this.getEnergyStored(stack) >= this.energyUsePerBlockOrHit){ - this.extractEnergy(stack, this.energyUsePerBlockOrHit, false); + int use = this.getEnergyUsePerBlock(stack); + if(this.getEnergyStored(stack) >= use){ + this.extractEnergy(stack, use, false); } return true; } @@ -348,12 +354,13 @@ public class ItemDrill extends ItemEnergyContainer implements INameableItem{ if(KeyUtil.isShiftPressed()){ list.add(this.getEnergyStored(stack) + "/" + this.getMaxEnergyStored(stack) + " RF"); } + else list.add(ItemUtil.shiftForInfo()); } @Override public Multimap getAttributeModifiers(ItemStack stack){ Multimap map = super.getAttributeModifiers(stack); - map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", this.getEnergyStored(stack) >= this.energyUsePerBlockOrHit ? 8.0F : 0.0F, 0)); + map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", this.getEnergyStored(stack) >= energyUsePerBlockOrHit ? 8.0F : 0.0F, 0)); return map; } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java index 9afd3848a..9d355c990 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java @@ -12,16 +12,22 @@ import net.minecraft.util.IIcon; public class ItemDrillUpgrade extends Item implements INameableItem{ public enum UpgradeType{ - SPEED, - SPEED_II, - SPEED_III, - SILK_TOUCH, //Done - FORTUNE, //Done - FORTUNE_II, //Done - THREE_BY_THREE, //Done - FIVE_BY_FIVE, //Done - VEIN, - PLACER + SPEED(10), + SPEED_II(20), + SPEED_III(30), + SILK_TOUCH(20), //Done + FORTUNE(40), //Done + FORTUNE_II(60), //Done + THREE_BY_THREE(5), //Done + FIVE_BY_FIVE(5), //Done + VEIN(30), + PLACER(0); + + public int extraEnergy; + + UpgradeType(int extraEnergy){ + this.extraEnergy = extraEnergy; + } } public UpgradeType type; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java index 321f8126b..d81f4d634 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java @@ -4,9 +4,11 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheDusts; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -55,6 +57,13 @@ public class ItemDust extends Item implements INameableItem{ return this.getUnlocalizedName() + (stack.getItemDamage() >= allDusts.length ? " ERROR!" : allDusts[stack.getItemDamage()].getName()); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + if(stack.getItemDamage() < allDusts.length) ItemUtil.addInformation(this, list, 1, allDusts[stack.getItemDamage()].getName()); + } + @Override public IIcon getIcon(ItemStack stack, int pass){ return this.itemIcon; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java b/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java index 33495fe50..6d535bc9d 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java @@ -3,6 +3,7 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -13,6 +14,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import java.util.List; + public class ItemFertilizer extends Item implements INameableItem{ @Override @@ -29,6 +32,13 @@ public class ItemFertilizer extends Item implements INameableItem{ return EnumRarity.rare; } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + ItemUtil.addInformation(this, list, 1, ""); + } + @Override public IIcon getIcon(ItemStack stack, int pass){ return this.itemIcon; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java index 6991d913f..5f1578bb6 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java @@ -4,6 +4,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheFoods; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -97,8 +99,12 @@ public class ItemFoods extends ItemFood implements INameableItem{ @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ if(stack.getItemDamage() < allFoods.length){ - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+allFoods[stack.getItemDamage()].healAmount); - list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+allFoods[stack.getItemDamage()].saturation); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+allFoods[stack.getItemDamage()].getName()+".desc")); + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+allFoods[stack.getItemDamage()].healAmount); + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+allFoods[stack.getItemDamage()].saturation); + } + else list.add(ItemUtil.shiftForInfo()); } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemHairyBall.java b/src/main/java/ellpeck/actuallyadditions/items/ItemHairyBall.java index f67c61872..8ce79fdd3 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemHairyBall.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemHairyBall.java @@ -4,6 +4,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.recipe.HairyBallHandler; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.item.EntityItem; @@ -15,6 +16,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.WeightedRandom; import net.minecraft.world.World; +import java.util.List; import java.util.Random; public class ItemHairyBall extends Item implements INameableItem{ @@ -43,6 +45,13 @@ public class ItemHairyBall extends Item implements INameableItem{ return EnumRarity.epic; } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + ItemUtil.addInformation(this, list, 2, ""); + } + @Override public IIcon getIcon(ItemStack stack, int pass){ return this.itemIcon; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java b/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java index 60d06c079..5a98848a4 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java @@ -4,6 +4,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheJams; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -16,6 +18,7 @@ import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -96,6 +99,22 @@ public class ItemJams extends ItemFood implements INameableItem{ return stackToReturn; } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + if(stack.getItemDamage() < allJams.length){ + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.1")); + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+allJams[stack.getItemDamage()].getName()+".desc")); + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getName()+".desc.2")); + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".hunger.desc")+": "+allJams[stack.getItemDamage()].healAmount); + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".saturation.desc")+": "+allJams[stack.getItemDamage()].saturation); + } + else list.add(ItemUtil.shiftForInfo()); + } + } + @Override @SideOnly(Side.CLIENT) public IIcon getIconFromDamageForRenderPass(int damage, int pass){ diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java b/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java index 63d86a0e3..a73b250a2 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java @@ -4,6 +4,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -49,8 +51,13 @@ public class ItemKnife extends Item implements INameableItem{ @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + } + else list.add(ItemUtil.shiftForInfo()); + } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java index 4cd3e93f3..945a1ae9b 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java @@ -4,8 +4,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.config.values.ConfigBoolValues; import ellpeck.actuallyadditions.config.values.ConfigIntValues; -import ellpeck.actuallyadditions.util.INameableItem; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.block.Block; import net.minecraft.block.BlockBush; import net.minecraft.block.BlockLeavesBase; @@ -18,9 +17,11 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.ArrayList; +import java.util.List; public class ItemLeafBlower extends Item implements INameableItem{ @@ -100,6 +101,18 @@ public class ItemLeafBlower extends Item implements INameableItem{ return this.isAdvanced ? EnumRarity.epic : EnumRarity.rare; } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc." + 1)); + list.add(StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemLeafBlower.desc.2")); + list.add(StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemLeafBlower.desc.3")); + } + else list.add(ItemUtil.shiftForInfo()); + } + @Override public IIcon getIcon(ItemStack stack, int pass){ return this.itemIcon; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java b/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java index 28835adaa..fd77272e5 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java @@ -4,9 +4,11 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -56,6 +58,13 @@ public class ItemMisc extends Item implements INameableItem{ return this.getUnlocalizedName() + (stack.getItemDamage() >= allMiscItems.length ? " ERROR!" : allMiscItems[stack.getItemDamage()].getName()); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + if(stack.getItemDamage() < allMiscItems.length) ItemUtil.addInformation(this, list, 1, allMiscItems[stack.getItemDamage()].getName()); + } + @Override public IIcon getIconFromDamage(int par1){ return par1 >= textures.length ? null : textures[par1]; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java b/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java index ffcdfd9e9..04a3e66f9 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.tile.TileEntityPhantomPlacer; import ellpeck.actuallyadditions.tile.TileEntityPhantomface; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; @@ -143,6 +144,7 @@ public class ItemPhantomConnector extends Item implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + ItemUtil.addInformation(this, list, 2, ""); ChunkCoordinates coords = this.getStoredPosition(stack); World world = this.getStoredWorld(stack); if(coords != null && world != null){ diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java b/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java index 8ee3b8566..db3fe422c 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java @@ -4,6 +4,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.ThePotionRings; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -88,6 +89,15 @@ public class ItemPotionRing extends Item implements INameableItem{ return this.getUnlocalizedName() + (stack.getItemDamage() >= allRings.length ? " ERROR!" : allRings[stack.getItemDamage()].getName()); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + if(stack.getItemDamage() < allRings.length){ + ItemUtil.addInformation(this, list, 2, ""); + } + } + @Override public IIcon getIcon(ItemStack stack, int pass){ return this.itemIcon; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java b/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java index 6350b6db8..79e956b5a 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java @@ -2,15 +2,18 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.actuallyadditions.util.INameableItem; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; 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.IIcon; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.List; public class ItemResonantRice extends Item implements INameableItem{ @@ -28,6 +31,14 @@ public class ItemResonantRice extends Item implements INameableItem{ return EnumRarity.epic; } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + ItemUtil.addInformation(this, list, 1, ""); + if(KeyUtil.isShiftPressed() && OreDictionary.getOres("nuggetEnderium").size() == 0) list.add(StringUtil.RED + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemResonantRice.uncraftable.desc")); + } + @Override public IIcon getIcon(ItemStack stack, int pass){ return this.itemIcon; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemSeed.java b/src/main/java/ellpeck/actuallyadditions/items/ItemSeed.java index b52c6f05d..7f5d1c7d6 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemSeed.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemSeed.java @@ -4,6 +4,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.blocks.BlockPlant; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -24,6 +25,8 @@ import net.minecraftforge.event.ForgeEventFactory; import powercrystals.minefactoryreloaded.api.IFactoryPlantable; import powercrystals.minefactoryreloaded.api.ReplacementBlock; +import java.util.List; + public class ItemSeed extends ItemSeeds implements INameableItem, IFactoryPlantable{ public Block plant; @@ -86,6 +89,12 @@ public class ItemSeed extends ItemSeeds implements INameableItem, IFactoryPlanta return EnumRarity.rare; } + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + ItemUtil.addInformation(this, list, 1, ""); + } + @Override public IIcon getIcon(ItemStack stack, int pass){ return this.itemIcon; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java b/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java index 29935517a..22a758de4 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java @@ -4,6 +4,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -78,6 +79,13 @@ public class ItemSpecialDrop extends Item implements INameableItem{ return this.getUnlocalizedName() + (stack.getItemDamage() >= allDrops.length ? " ERROR!" : allDrops[stack.getItemDamage()].getName()); } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + if(stack.getItemDamage() < allDrops.length) ItemUtil.addInformation(this, list, stack.getItemDamage() == TheSpecialDrops.SOLIDIFIED_EXPERIENCE.ordinal() ? 2 : 1, allDrops[stack.getItemDamage()].getName()); + } + @Override public IIcon getIconFromDamage(int par1){ return par1 >= textures.length ? null : textures[par1]; diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java index 500f39c3d..a5818d41e 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java @@ -1,10 +1,11 @@ package ellpeck.actuallyadditions.items.tools; - import com.google.common.collect.Sets; import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -20,7 +21,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.UseHoeEvent; -import java.util.HashSet; import java.util.List; import java.util.Set; @@ -68,12 +68,16 @@ public class ItemAllToolAA extends ItemTool implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip."+ModUtil.MOD_ID_LOWER+".paxel.desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + } + else list.add(ItemUtil.shiftForInfo()); } @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ){ - if(!player.canPlayerEdit(x, y, z, side, stack)) return false; + if (!player.canPlayerEdit(x, y, z, side, stack)) return false; else{ UseHoeEvent event = new UseHoeEvent(player, stack, world, x, y, z); if(MinecraftForge.EVENT_BUS.post(event)) return false; @@ -82,10 +86,10 @@ public class ItemAllToolAA extends ItemTool implements INameableItem{ return true; } Block block = world.getBlock(x, y, z); - if(side != 0 && world.getBlock(x, y+1, z).isAir(world, x, y+1, z) && (block == Blocks.grass || block == Blocks.dirt)){ + if(side != 0 && world.getBlock(x, y + 1, z).isAir(world, x, y + 1, z) && (block == Blocks.grass || block == Blocks.dirt)){ Block block1 = Blocks.farmland; - world.playSoundEffect((double)((float)x+0.5F), (double)((float)y+0.5F), (double)((float)z+0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume()+1.0F)/2.0F, block1.stepSound.getPitch()*0.8F); - if(world.isRemote) return true; + world.playSoundEffect((double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F); + if (world.isRemote) return true; else{ world.setBlock(x, y, z, block1); stack.damageItem(1, player); @@ -126,13 +130,4 @@ public class ItemAllToolAA extends ItemTool implements INameableItem{ public String getOredictName(){ return oredictName; } - - @Override - public Set getToolClasses(ItemStack stack){ - HashSet hashSet = new HashSet(); - hashSet.add("pickaxe"); - hashSet.add("shovel"); - hashSet.add("axe"); - return hashSet; - } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java index 7d993bb59..6287b62f6 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java @@ -3,12 +3,18 @@ package ellpeck.actuallyadditions.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; +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.IIcon; +import net.minecraft.util.StatCollector; + +import java.util.List; public class ItemAxeAA extends ItemAxe implements INameableItem{ @@ -25,6 +31,17 @@ public class ItemAxeAA extends ItemAxe implements INameableItem{ this.oredictName = name; } + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + } + else list.add(ItemUtil.shiftForInfo()); + } + @Override public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ return stack.getItem() == repairItem.getItem(); diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java index a7c6f8ca4..4adf9cf67 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java @@ -3,6 +3,8 @@ package ellpeck.actuallyadditions.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -33,7 +35,11 @@ public class ItemHoeAA extends ItemHoe implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + } + else list.add(ItemUtil.shiftForInfo()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java index 0307eb6ff..04bf68c14 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java @@ -3,6 +3,8 @@ package ellpeck.actuallyadditions.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -33,7 +35,11 @@ public class ItemPickaxeAA extends ItemPickaxe implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + } + else list.add(ItemUtil.shiftForInfo()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java index 0ebf051c9..f805278c0 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java @@ -3,6 +3,8 @@ package ellpeck.actuallyadditions.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -33,7 +35,11 @@ public class ItemShovelAA extends ItemSpade implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + } + else list.add(ItemUtil.shiftForInfo()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java index 482c1d442..2b4a84b32 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java @@ -3,6 +3,8 @@ package ellpeck.actuallyadditions.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -33,7 +35,11 @@ public class ItemSwordAA extends ItemSword implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + } + else list.add(ItemUtil.shiftForInfo()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/manual/ContainerManual.java b/src/main/java/ellpeck/actuallyadditions/manual/ContainerManual.java deleted file mode 100644 index c7d6f0f14..000000000 --- a/src/main/java/ellpeck/actuallyadditions/manual/ContainerManual.java +++ /dev/null @@ -1,232 +0,0 @@ -package ellpeck.actuallyadditions.manual; - -import cpw.mods.fml.relauncher.ReflectionHelper; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; - -import java.util.ArrayList; -import java.util.List; - -public class ContainerManual extends Container{ - - TheInventory inventory = new TheInventory(); - - public ContainerManual(){ - this.addSlotToContainer(new SlotImmovable(this.inventory, 0, 199, 41)); - - for(int i = 0; i < 13; i++){ - for(int j = 0; j < 4; j++){ - this.addSlotToContainer(new SlotImmovable(this.inventory, 1+j+(i*4), 5+j*18, 5+i*18)); - } - } - for(int i = 0; i < 3; i++){ - for(int j = 0; j < 3; j++){ - this.addSlotToContainer(new SlotImmovable(this.inventory, 1+13*4+j+(i*3), 105+j*18, 23+i*18)); - } - } - - for(int i = 1; i < ManualItems.list.size()+1; i++){ - if(i < 1+13*4){ - this.inventory.setInventorySlotContents(i, ManualItems.list.get(i-1).stack.copy()); - } - } - } - - public void scrollTo(float f){ - if(this.needsScrollBars()){ - int i = ManualItems.list.size()/4-13; - int j = (int)((double)(f*(float)i)+0.5D); - - if(j < 0) j = 0; - for(int k = 0; k < 13; ++k){ - for(int l = 0; l < 4; ++l){ - int i1 = l+(k+j)*4; - - if(i1 >= 0 && i1 < ManualItems.list.size()){ - this.inventory.setInventorySlotContents(1+l+k*4, ManualItems.list.get(i1).stack.copy()); - } - else this.inventory.setInventorySlotContents(1+l+k*4, null); - } - } - } - } - - public boolean needsScrollBars(){ - return ManualItems.list.size() > 9*13; - } - - @Override - @SuppressWarnings("unchecked") - public ItemStack slotClick(int slot, int par2, int par3, EntityPlayer player){ - if(slot > 0 && slot < 1+13*4){ - Slot theSlot = this.getSlot(slot); - if(theSlot.getStack() != null){ - this.inventory.setInventorySlotContents(0, theSlot.getStack().copy()); - - for(int i = 0; i < 9; i++) this.inventory.setInventorySlotContents(1+13*4+i, null); - List list = CraftingManager.getInstance().getRecipeList(); - for(IRecipe iRec: list){ - if(iRec instanceof ShapedOreRecipe){ - ShapedOreRecipe recipe = (ShapedOreRecipe)iRec; - if(theSlot.getStack().isItemEqual(recipe.getRecipeOutput())){ - - int width = ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, recipe, 4); - int height = ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, recipe, 5); - for(int x = 0; x < width; x++){ - for(int y = 0; y < height; y++){ - int i = y*width+x; - ItemStack stack = null; - Object input = recipe.getInput()[i]; - if(input instanceof ItemStack) stack = ((ItemStack)input).copy(); - if(input instanceof ItemStack[]) stack = ((ItemStack[])input)[0]; - if(input instanceof List) stack = ((List)input).get(0); - - int k = 0; - if(x == 0){ - if(y == 0) k = 0; - if(y == 1) k = 3; - if(y == 2) k = 6; - } - if(x == 1){ - if(y == 0) k = 1; - if(y == 1) k = 4; - if(y == 2) k = 7; - } - if(x == 2){ - if(y == 0) k = 2; - if(y == 1) k = 5; - if(y == 2) k = 8; - } - this.inventory.setInventorySlotContents(1+13*4+k, stack); - } - } - break; - } - } - if(iRec instanceof ShapelessOreRecipe){ - ShapelessOreRecipe recipe = (ShapelessOreRecipe)iRec; - if(theSlot.getStack().isItemEqual(recipe.getRecipeOutput())){ - ArrayList ingredients = recipe.getInput(); - for(int i = 0; i < ingredients.size(); i++){ - ItemStack stack = null; - if(ingredients.get(i) instanceof ItemStack) stack = ((ItemStack)ingredients.get(i)).copy(); - if(ingredients.get(i) instanceof ItemStack[]) stack = ((ItemStack[])ingredients.get(i))[0]; - if(ingredients.get(i) instanceof List) stack = ((List)ingredients.get(i)).get(0); - - this.inventory.setInventorySlotContents(1+13*4+i, stack); - } - break; - } - } - } - } - } - return null; - } - - @Override - public boolean canInteractWith(EntityPlayer player){ - return this.inventory.isUseableByPlayer(player); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - return null; - } - - public static class TheInventory implements IInventory{ - - public ItemStack[] slots = new ItemStack[13*4+10]; - - @Override - public void setInventorySlotContents(int i, ItemStack stack){ - this.slots[i] = stack; - this.markDirty(); - } - - @Override - public int getSizeInventory(){ - return slots.length; - } - - @Override - public ItemStack getStackInSlot(int i){ - if(i < this.getSizeInventory()){ - return slots[i]; - } - return null; - } - - @Override - public ItemStack decrStackSize(int i, int j){ - if (slots[i] != null){ - ItemStack stackAt; - if(slots[i].stackSize <= j){ - stackAt = slots[i]; - slots[i] = null; - this.markDirty(); - return stackAt; - } - else{ - stackAt = slots[i].splitStack(j); - if (slots[i].stackSize == 0) slots[i] = null; - this.markDirty(); - return stackAt; - } - } - return null; - } - - @Override - public ItemStack getStackInSlotOnClosing(int i){ - return getStackInSlot(i); - } - - @Override - public String getInventoryName(){ - return "Actually Additions Manual"; - } - - @Override - public boolean hasCustomInventoryName(){ - return false; - } - - @Override - public int getInventoryStackLimit(){ - return 1; - } - - @Override - public void markDirty(){ - - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player){ - return true; - } - - @Override - public void openInventory(){ - - } - - @Override - public void closeInventory(){ - - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return false; - } - } -} \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/manual/GuiManual.java b/src/main/java/ellpeck/actuallyadditions/manual/GuiManual.java deleted file mode 100644 index 58a120c70..000000000 --- a/src/main/java/ellpeck/actuallyadditions/manual/GuiManual.java +++ /dev/null @@ -1,115 +0,0 @@ -package ellpeck.actuallyadditions.manual; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.actuallyadditions.util.AssetUtil; -import ellpeck.actuallyadditions.util.ModUtil; -import ellpeck.actuallyadditions.util.StringUtil; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - -@SideOnly(Side.CLIENT) -public class GuiManual extends GuiContainer{ - - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiManual"); - - private FontRenderer infoTextRenderer; - - private float currentScroll; - private boolean isScrolling; - private boolean wasClicking; - - public GuiManual(){ - super(new ContainerManual()); - - this.xSize = 256; - this.ySize = 244; - } - - @Override - public void drawScreen(int x, int y, float f){ - if(((ContainerManual)this.inventorySlots).needsScrollBars()){ - boolean flag = Mouse.isButtonDown(0); - int k = this.guiLeft; - int l = this.guiTop; - int i1 = k+78; - int j1 = l+5; - int k1 = i1+12; - int l1 = j1+232; - - if(!this.wasClicking && flag && x >= i1 && y >= j1 && x < k1 && y < l1) this.isScrolling = true; - if(!flag) this.isScrolling = false; - this.wasClicking = flag; - - if(this.isScrolling){ - this.currentScroll = ((float)(y-j1)-7.5F)/((float)(l1-j1)-15.0F); - if(this.currentScroll < 0.0F){ - this.currentScroll = 0.0F; - } - if(this.currentScroll > 1.0F){ - this.currentScroll = 1.0F; - } - ((ContainerManual)this.inventorySlots).scrollTo(this.currentScroll); - } - } - super.drawScreen(x, y, f); - } - - @Override - public void handleMouseInput(){ - super.handleMouseInput(); - if(((ContainerManual)this.inventorySlots).needsScrollBars()){ - int i = Mouse.getEventDWheel(); - - if(i != 0){ - int j = ((ContainerManual)this.inventorySlots).inventory.slots.length/4-13; - - if(i > 0) i = 1; - if(i < 0) i = -1; - 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; - ((ContainerManual)this.inventorySlots).scrollTo(this.currentScroll); - } - } - } - - @Override - public void initGui(){ - super.initGui(); - this.infoTextRenderer = new FontRenderer(this.mc.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.mc.renderEngine, true); - } - - @Override - public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, "container."+ModUtil.MOD_ID_LOWER+".manual"); - - ManualItems.InfoTab tab = ManualItems.getTabFromStack(this.inventorySlots.getSlot(0).getStack()); - if(tab != null){ - this.drawCenterString(tab.title, 160, 8); - this.fontRendererObj.drawSplitString(tab.extraForRecipe, 95, 80, 155, StringUtil.DECIMAL_COLOR_GRAY_TEXT); - - this.infoTextRenderer.drawSplitString(tab.text, 95, (tab.extraForRecipe == null || tab.extraForRecipe.length() <= 0 ? 80 : 100), 155, StringUtil.DECIMAL_COLOR_GRAY_TEXT); - } - } - - private void drawCenterString(String text, int xPos, int yPos){ - this.fontRendererObj.drawString(text, xPos - this.fontRendererObj.getStringWidth(text)/2, yPos, StringUtil.DECIMAL_COLOR_GRAY_TEXT); - } - - @Override - public void drawGuiContainerBackgroundLayer(float f, int x, int y){ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(resLoc); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - - this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tabs.png")); - this.drawTexturedModalRect(this.guiLeft+78, this.guiTop+5 + (int)((float)(this.guiTop+5+232-this.guiTop+5-25) * this.currentScroll), 232+(((ContainerManual)this.inventorySlots).needsScrollBars() ? 0 : 12), 0, 12, 15); - } -} \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/manual/InventoryEvents.java b/src/main/java/ellpeck/actuallyadditions/manual/InventoryEvents.java deleted file mode 100644 index 79eb9352c..000000000 --- a/src/main/java/ellpeck/actuallyadditions/manual/InventoryEvents.java +++ /dev/null @@ -1,56 +0,0 @@ -package ellpeck.actuallyadditions.manual; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import ellpeck.actuallyadditions.inventory.gui.GuiInputter; -import ellpeck.actuallyadditions.network.PacketHandler; -import ellpeck.actuallyadditions.util.ModUtil; -import ellpeck.actuallyadditions.util.StringUtil; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiInventory; -import net.minecraft.util.StatCollector; -import net.minecraftforge.client.event.GuiScreenEvent; - -public class InventoryEvents{ - - private static final int MANUAL_BUTTON_ID = 123782; - - public static class InitGuiEvent{ - @SubscribeEvent - @SuppressWarnings("unchecked") - public void onInitGuiEvent(GuiScreenEvent.InitGuiEvent.Post event){ - if(event.gui instanceof GuiInventory && !Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode){ - int k = (event.gui.width-176)/2; - int l = (event.gui.height-166)/2; - - ManualButton button = new ManualButton(MANUAL_BUTTON_ID, k+160, l+166, "!"); - event.buttonList.add(button); - } - } - } - - public static class ButtonPressedEvent{ - @SubscribeEvent - public void onButtonPressedEvent(GuiScreenEvent.ActionPerformedEvent.Post event){ - if(event.gui instanceof GuiInventory && event.button.id == MANUAL_BUTTON_ID){ - PacketHandler.theNetwork.sendToServer(new PacketOpenManual()); - } - } - } - - public static class ManualButton extends GuiInputter.SmallerButton{ - - public ManualButton(int id, int x, int y, String display){ - super(id, x, y, display); - } - - @Override - public void drawButton(Minecraft mc, int x, int y){ - super.drawButton(mc, x, y); - boolean hovering = x >= this.xPosition && y >= this.yPosition && x < this.xPosition + this.width && y < this.yPosition + this.height; - if(this.getHoverState(hovering) == 2){ - String manual = StatCollector.translateToLocal("container." + ModUtil.MOD_ID_LOWER + ".manual.name"); - mc.fontRenderer.drawString(manual, this.xPosition+this.width/2-mc.fontRenderer.getStringWidth(manual)/2 , this.yPosition+this.height+5, StringUtil.DECIMAL_COLOR_WHITE); - } - } - } -} diff --git a/src/main/java/ellpeck/actuallyadditions/manual/ManualItems.java b/src/main/java/ellpeck/actuallyadditions/manual/ManualItems.java deleted file mode 100644 index 76cc79bf9..000000000 --- a/src/main/java/ellpeck/actuallyadditions/manual/ManualItems.java +++ /dev/null @@ -1,77 +0,0 @@ -package ellpeck.actuallyadditions.manual; - -import ellpeck.actuallyadditions.blocks.InitBlocks; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import java.util.ArrayList; - -public class ManualItems{ - - public static ArrayList list = new ArrayList(); - - static{ - addBlock(InitBlocks.blockPhantomface, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch", "OreDictionary!"); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockBreaker, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockCoalGenerator, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomPlacer, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockFeeder, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockCanolaPress, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockFluidCollector, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomLiquiface, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockBreaker, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - addBlock(InitBlocks.blockPhantomBooster, "The Phantomface is a Block that is very nice and amazing and can transmit stuff if you connect it with stuff this is a text message so I don't care anyways bla bla bla bla bla Penis ficken arsch also das hier ist eine echt lange Message und ich weiß nicht was ich hier weiter schrieben soll das kommt eh späüter alles in die Lang datei", ""); - - } - - private static void addItem(Item item, String text, String extraForRecipe){ - addStack(new ItemStack(item), text, extraForRecipe); - } - - private static void addBlock(Block block, String text, String extraForRecipe){ - addStack(new ItemStack(block), text, extraForRecipe); - } - - private static void addStack(ItemStack stack, String text, String extraForRecipe){ - list.add(new InfoTab(stack.copy(), text, extraForRecipe)); - } - - public static InfoTab getTabFromStack(ItemStack stack){ - for(InfoTab tab : list){ - if(stack != null && tab.stack != null && stack.isItemEqual(tab.stack)) return tab; - } - return null; - } - - public static class InfoTab{ - public ItemStack stack; - public String text; - public String title; - public String extraForRecipe; - - public InfoTab(ItemStack stack, String text, String extraForRecipe){ - this.stack = stack; - this.title = stack.getDisplayName(); - this.text = text; - this.extraForRecipe = extraForRecipe; - } - } -} diff --git a/src/main/java/ellpeck/actuallyadditions/manual/PacketOpenManual.java b/src/main/java/ellpeck/actuallyadditions/manual/PacketOpenManual.java deleted file mode 100644 index b94c9fab4..000000000 --- a/src/main/java/ellpeck/actuallyadditions/manual/PacketOpenManual.java +++ /dev/null @@ -1,35 +0,0 @@ -package ellpeck.actuallyadditions.manual; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import ellpeck.actuallyadditions.ActuallyAdditions; -import ellpeck.actuallyadditions.inventory.GuiHandler; -import io.netty.buffer.ByteBuf; - -public class PacketOpenManual implements IMessage{ - - @SuppressWarnings("unused") - public PacketOpenManual(){ - - } - - @Override - public void fromBytes(ByteBuf buf){ - - } - - @Override - public void toBytes(ByteBuf buf){ - - } - - public static class Handler implements IMessageHandler{ - - @Override - public IMessage onMessage(PacketOpenManual message, MessageContext ctx){ - ctx.getServerHandler().playerEntity.openGui(ActuallyAdditions.instance, GuiHandler.MANUAL_ID, ctx.getServerHandler().playerEntity.worldObj, (int)ctx.getServerHandler().playerEntity.posX, (int)ctx.getServerHandler().playerEntity.posY, (int)ctx.getServerHandler().playerEntity.posZ); - return null; - } - } -} diff --git a/src/main/java/ellpeck/actuallyadditions/manual/SlotImmovable.java b/src/main/java/ellpeck/actuallyadditions/manual/SlotImmovable.java deleted file mode 100644 index 651cd5024..000000000 --- a/src/main/java/ellpeck/actuallyadditions/manual/SlotImmovable.java +++ /dev/null @@ -1,23 +0,0 @@ -package ellpeck.actuallyadditions.manual; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class SlotImmovable extends Slot{ - - public SlotImmovable(IInventory inventory, int id, int x, int y){ - super(inventory, id, x, y); - } - - @Override - public boolean isItemValid(ItemStack stack){ - return false; - } - - @Override - public boolean canTakeStack(EntityPlayer player){ - return false; - } -} diff --git a/src/main/java/ellpeck/actuallyadditions/network/PacketHandler.java b/src/main/java/ellpeck/actuallyadditions/network/PacketHandler.java index ce741d06b..23daabe01 100644 --- a/src/main/java/ellpeck/actuallyadditions/network/PacketHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/network/PacketHandler.java @@ -3,7 +3,6 @@ package ellpeck.actuallyadditions.network; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; -import ellpeck.actuallyadditions.manual.PacketOpenManual; import ellpeck.actuallyadditions.network.gui.PacketGuiButton; import ellpeck.actuallyadditions.util.ModUtil; @@ -17,6 +16,5 @@ public class PacketHandler{ theNetwork.registerMessage(PacketTileEntityFeeder.Handler.class, PacketTileEntityFeeder.class, 0, Side.CLIENT); theNetwork.registerMessage(PacketGuiButton.Handler.class, PacketGuiButton.class, 1, Side.SERVER); theNetwork.registerMessage(PacketFluidCollectorToClient.Handler.class, PacketFluidCollectorToClient.class, 2, Side.CLIENT); - theNetwork.registerMessage(PacketOpenManual.Handler.class, PacketOpenManual.class, 3, Side.SERVER); } } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java index cdd0f7364..9dbe59b54 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java @@ -2,7 +2,6 @@ package ellpeck.actuallyadditions.tile; import ellpeck.actuallyadditions.config.values.ConfigIntValues; import net.minecraft.block.Block; -import net.minecraft.block.BlockAir; import net.minecraft.block.BlockGrass; import net.minecraft.block.IGrowable; import net.minecraft.util.ChunkCoordinates; @@ -37,7 +36,7 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{ public ChunkCoordinates blockToFertilize(){ for(int i = yCoord-1; i > 0; i--){ Block block = worldObj.getBlock(xCoord, i, zCoord); - if(block != null && !(block instanceof BlockAir)){ + if(block != null && !(worldObj.isAirBlock(xCoord, i, zCoord))){ if(block instanceof IGrowable && !(block instanceof BlockGrass)){ return new ChunkCoordinates(xCoord, i, zCoord); } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java index 339fab3b8..7ebae8bde 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java @@ -2,11 +2,10 @@ package ellpeck.actuallyadditions.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; -import ellpeck.actuallyadditions.blocks.BlockMisc; +import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; import ellpeck.actuallyadditions.config.values.ConfigIntValues; import net.minecraft.block.Block; -import net.minecraft.block.BlockAir; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; @@ -24,9 +23,7 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I @SuppressWarnings("unchecked") public void updateEntity(){ if(!worldObj.isRemote){ - int isMulti = this.isMultiblock(); - - if(isMulti == HAS_AIR && this.storage.getEnergyStored() >= energyNeededToProduceLava){ + if(this.storage.getEnergyStored() >= energyNeededToProduceLava && this.isMultiblock() == HAS_AIR){ this.currentWorkTime++; if(this.currentWorkTime >= this.maxWorkTime){ this.currentWorkTime = 0; @@ -49,12 +46,12 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I int metaWest = worldObj.getBlockMetadata(xCoord+ForgeDirection.WEST.offsetX, yCoord+1, zCoord+ForgeDirection.WEST.offsetZ); int metaNeeded = TheMiscBlocks.LAVA_FACTORY_CASE.ordinal(); - if(blockNorth instanceof BlockMisc && blockEast instanceof BlockMisc && blockSouth instanceof BlockMisc && blockWest instanceof BlockMisc){ + if(blockNorth == InitBlocks.blockMisc && blockEast == InitBlocks.blockMisc && blockSouth == InitBlocks.blockMisc && blockWest == InitBlocks.blockMisc){ if(metaNorth == metaNeeded && metaEast == metaNeeded && metaSouth == metaNeeded && metaWest == metaNeeded){ if(worldObj.getBlock(xCoord, yCoord+1, zCoord) == Blocks.lava || worldObj.getBlock(xCoord, yCoord+1, zCoord) == Blocks.flowing_lava){ return HAS_LAVA; } - if(worldObj.getBlock(xCoord, yCoord+1, zCoord) == null || worldObj.getBlock(xCoord, yCoord+1, zCoord) instanceof BlockAir){ + if(worldObj.getBlock(xCoord, yCoord+1, zCoord) == null || worldObj.isAirBlock(xCoord, yCoord+1, zCoord)){ return HAS_AIR; } } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomface.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomface.java index b0bb6e74b..8dc80323f 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomface.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomface.java @@ -155,7 +155,7 @@ public class TileEntityPhantomface extends TileEntityInventoryBase{ private void pushFluid(ForgeDirection side){ TileEntity tile = WorldUtil.getTileEntityFromSide(side, worldObj, xCoord, yCoord, zCoord); - if(tile != null && tile instanceof IFluidHandler){ + if(tile != null && tile instanceof IFluidHandler && this.getTankInfo(side) != null && this.getTankInfo(side).length > 0 && ((IFluidHandler)tile).getTankInfo(side.getOpposite()) != null && ((IFluidHandler)tile).getTankInfo(side.getOpposite()).length > 0){ for(FluidTankInfo myInfo : this.getTankInfo(side)){ for(FluidTankInfo hisInfo : ((IFluidHandler)tile).getTankInfo(side.getOpposite())){ if(myInfo != null && hisInfo != null && myInfo.fluid != null && myInfo.fluid.getFluid() != null){ diff --git a/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java b/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java index 966e20dc5..ff35bbba2 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java @@ -17,6 +17,16 @@ public class BlockUtil{ return ModUtil.MOD_ID_LOWER + "." + ((INameableItem)block).getName(); } + @SuppressWarnings("unchecked") + public static void addInformation(Block block, List list, int lines, String extraName){ + if(KeyUtil.isShiftPressed()){ + for(int i = 0; i < lines; i++){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)block).getName() + extraName + ".desc" + (lines > 1 ? "." +(i+1) : ""))); + } + } + else list.add(ItemUtil.shiftForInfo()); + } + @SuppressWarnings("unchecked") public static void addPowerUsageInfo(List list, int usage){ if(KeyUtil.isShiftPressed()){ @@ -26,7 +36,9 @@ public class BlockUtil{ @SuppressWarnings("unchecked") public static void addPowerProductionInfo(List list, int produce){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".produces.desc") + " " + produce + " RF/t"); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".produces.desc") + " " + produce + " RF/t"); + } } public static final ArrayList wailaRegisterList = new ArrayList(); diff --git a/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java b/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java index 19473d002..b38dd0e51 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java @@ -4,10 +4,23 @@ import cpw.mods.fml.common.registry.GameRegistry; import ellpeck.actuallyadditions.creative.CreativeTab; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import net.minecraftforge.oredict.OreDictionary; +import java.util.List; + public class ItemUtil{ + @SuppressWarnings("unchecked") + public static void addInformation(Item item, List list, int lines, String extraName){ + if(KeyUtil.isShiftPressed()){ + for(int i = 0; i < lines; i++){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)item).getName() + extraName + ".desc" + (lines > 1 ? "." +(i+1) : ""))); + } + } + else list.add(shiftForInfo()); + } + public static void registerItems(Item[] items){ for(Item item : items){ register(item); @@ -37,4 +50,8 @@ public class ItemUtil{ public static String createUnlocalizedName(Item item){ return ModUtil.MOD_ID_LOWER + "." + ((INameableItem)item).getName(); } + + public static String shiftForInfo(){ + return StringUtil.GREEN + StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".shiftForInfo.desc"); + } } diff --git a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java index 886a6a91e..4f213e233 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java @@ -5,7 +5,7 @@ import org.apache.logging.log4j.Logger; public class ModUtil{ - public static final String VERSION = "1.7.10-0.0.5.5"; + public static final String VERSION = "1.7.10-0.0.5.7"; public static final String MOD_ID = "ActuallyAdditions"; public static final String NAME = "Actually Additions"; diff --git a/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java b/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java index 788a79906..5da1c84d1 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java @@ -28,28 +28,7 @@ public class WorldUtil{ return new ChunkCoordinates(x+side.offsetX, y+side.offsetY, z+side.offsetZ); } - public static void breakBlockAtSide(ForgeDirection side, World world, int x, int y, int z){ - if(side == ForgeDirection.UNKNOWN){ - world.setBlockToAir(x, y, z); - return; - } - ChunkCoordinates c = getCoordsFromSide(side, x, y, z); - if(c != null){ - world.setBlockToAir(c.posX, c.posY, c.posZ); - } - } - - public static void pushEnergy(World world, int x, int y, int z, ForgeDirection side, EnergyStorage storage){ - TileEntity tile = getTileEntityFromSide(side, world, x, y, z); - if(tile != null && tile instanceof IEnergyReceiver && storage.getEnergyStored() > 0){ - if(((IEnergyReceiver)tile).canConnectEnergy(side.getOpposite())){ - int receive = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), Math.min(storage.getMaxExtract(), storage.getEnergyStored()), false); - storage.extractEnergy(receive, false); - } - } - } - - public static MovingObjectPosition raytraceEntity(World world, Entity player, double range){ + public static MovingObjectPosition raytraceBlocksFromEntity(World world, Entity player, double range){ float f1 = player.prevRotationPitch+(player.rotationPitch-player.prevRotationPitch)*1.0F; float f2 = player.prevRotationYaw+(player.rotationYaw-player.prevRotationYaw)*1.0F; double d0 = player.prevPosX+(player.posX-player.prevPosX)*1.0D; @@ -69,12 +48,35 @@ public class WorldUtil{ return world.func_147447_a(vec3, vec31, false, true, false); } + public static void breakBlockAtSide(ForgeDirection side, World world, int x, int y, int z){ + if(side == ForgeDirection.UNKNOWN){ + world.setBlockToAir(x, y, z); + return; + } + ChunkCoordinates c = getCoordsFromSide(side, x, y, z); + if(c != null){ + world.setBlockToAir(c.posX, c.posY, c.posZ); + } + } + + public static void pushEnergy(World world, int x, int y, int z, ForgeDirection side, EnergyStorage storage){ + TileEntity tile = getTileEntityFromSide(side, world, x, y, z); + if(tile != null && tile instanceof IEnergyReceiver && storage.getEnergyStored() > 0){ + if(((IEnergyReceiver)tile).canConnectEnergy(side.getOpposite())){ + int receive = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), Math.min(storage.getMaxExtract(), storage.getEnergyStored()), false); + storage.extractEnergy(receive, false); + world.markBlockForUpdate(x+side.offsetX, y+side.offsetY, z+side.offsetZ); + } + } + } + public static void pushFluid(World world, int x, int y, int z, ForgeDirection side, FluidTank tank){ TileEntity tile = getTileEntityFromSide(side, world, x, y, z); if(tile != null && tank.getFluid() != null && tile instanceof IFluidHandler){ if(((IFluidHandler)tile).canFill(side.getOpposite(), tank.getFluid().getFluid())){ int receive = ((IFluidHandler)tile).fill(side.getOpposite(), tank.getFluid(), true); tank.drain(receive, true); + world.markBlockForUpdate(x+side.offsetX, y+side.offsetY, z+side.offsetZ); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/waila/WailaDataProvider.java b/src/main/java/ellpeck/actuallyadditions/waila/WailaDataProvider.java index 880ac2225..2ef1ef830 100644 --- a/src/main/java/ellpeck/actuallyadditions/waila/WailaDataProvider.java +++ b/src/main/java/ellpeck/actuallyadditions/waila/WailaDataProvider.java @@ -60,4 +60,4 @@ public class WailaDataProvider implements IWailaDataProvider{ registrar.registerHeadProvider(provider, theBlock.getClass()); } } -} \ No newline at end of file +} diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index edfb1c215..308f4baf9 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -134,7 +134,7 @@ tooltip.actuallyadditions.itemResonantRice.uncraftable.desc=Uncraftable because tile.actuallyadditions.blockCanolaPress.name=Canola Press tooltip.actuallyadditions.blockCanolaPress.desc=Makes Canola Oil from Canola tile.actuallyadditions.blockFermentingBarrel.name=Fermenting Barrel -tooltip.actuallyadditions.blockFermentingBarrel.desc=Ferments Canola Oil made in a Press to Oil +tooltip.actuallyadditions.blockFermentingBarrel.desc=Ferments Canola Oil made in a Press to Canola tile.actuallyadditions.blockCanolaOil.name=Canola Oil tooltip.actuallyadditions.blockCanolaOil.desc=Oil made from Canola @@ -264,8 +264,7 @@ item.actuallyadditions.itemDustQuartz.name=Crushed Quartz item.actuallyadditions.itemDustCoal.name=Crushed Coal item.actuallyadditions.itemDustQuartzBlack.name=Crushed Black Quartz -tooltip.actuallyadditions.moreInfo.desc.1=Open the Actually Additions Manual -tooltip.actuallyadditions.moreInfo.desc.2=with the Button in your Inventory! +tooltip.actuallyadditions.shiftForInfo.desc=Press Shift for Info tooltip.actuallyadditions.hunger.desc=Fills tooltip.actuallyadditions.saturation.desc=Saturation tooltip.actuallyadditions.durability.desc=Durability @@ -451,7 +450,6 @@ container.actuallyadditions.energyface.name=Energyface container.actuallyadditions.fluidPlacer.name=Fluid Placer container.actuallyadditions.fluidCollector.name=Fluid Collector container.actuallyadditions.coffeeMachine.name=Coffee Machine -container.actuallyadditions.manual.name=Actually Additions Manual container.nei.actuallyadditions.crushing.name=Crusher container.nei.actuallyadditions.ballOfHair.name=Ball Of Hair Usage diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiManual.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiManual.png index 2c18e2191..8e9d776c0 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/guiManual.png and b/src/main/resources/assets/actuallyadditions/textures/gui/guiManual.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/diamondPaxel.png b/src/main/resources/assets/actuallyadditions/textures/items/diamondPaxel.png index a4732da14..6c809a312 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/diamondPaxel.png and b/src/main/resources/assets/actuallyadditions/textures/items/diamondPaxel.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/emeraldPaxel.png b/src/main/resources/assets/actuallyadditions/textures/items/emeraldPaxel.png index ffd4c58c5..e184b2400 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/emeraldPaxel.png and b/src/main/resources/assets/actuallyadditions/textures/items/emeraldPaxel.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/goldPaxel.png b/src/main/resources/assets/actuallyadditions/textures/items/goldPaxel.png index 6fd40009d..c0750f43d 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/goldPaxel.png and b/src/main/resources/assets/actuallyadditions/textures/items/goldPaxel.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/ironPaxel.png b/src/main/resources/assets/actuallyadditions/textures/items/ironPaxel.png index c3729110c..7cea9949f 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/ironPaxel.png and b/src/main/resources/assets/actuallyadditions/textures/items/ironPaxel.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/obsidianPaxel.png b/src/main/resources/assets/actuallyadditions/textures/items/obsidianPaxel.png index f063951aa..4915838bb 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/obsidianPaxel.png and b/src/main/resources/assets/actuallyadditions/textures/items/obsidianPaxel.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/stonePaxel.png b/src/main/resources/assets/actuallyadditions/textures/items/stonePaxel.png index cbe99d046..449737ee1 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/stonePaxel.png and b/src/main/resources/assets/actuallyadditions/textures/items/stonePaxel.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/woodenPaxel.png b/src/main/resources/assets/actuallyadditions/textures/items/woodenPaxel.png index 9fbf1f372..d80876661 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/woodenPaxel.png and b/src/main/resources/assets/actuallyadditions/textures/items/woodenPaxel.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/logo.png b/src/main/resources/assets/actuallyadditions/textures/logo.png index 4c278518b..08cf37077 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/logo.png and b/src/main/resources/assets/actuallyadditions/textures/logo.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/logoBig.png b/src/main/resources/assets/actuallyadditions/textures/logoBig.png index 4931ee359..6059f0e6a 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/logoBig.png and b/src/main/resources/assets/actuallyadditions/textures/logoBig.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/logoSquare.png b/src/main/resources/assets/actuallyadditions/textures/logoSquare.png index f0d7e8095..6b5cce0a0 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/logoSquare.png and b/src/main/resources/assets/actuallyadditions/textures/logoSquare.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index c3fd7d4bb..97204162e 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -2,15 +2,13 @@ { "modid": "ActuallyAdditions", "name": "Actually Additions", - "description": "Actually Additions is a Mod that offers a bunch of things from Machines for Automation and tons of food to advanced Hopper Mechanisms and Effect Rings!", - "version": "0.0.5.5", - "mcversion": "1.7.10", - "url": "https://github.com/Ellpeck/ActuallyAdditions", + "description": "Do you want Automation? Wireless Transport? Better Machines? A cup o' Coffee? Chests? Better Hoppers? Leaf Blowers? Faster Growth? Plants? Well, Actually Additions has all that and a lot more!", + "version": "${version}", + "mcversion": "${mcversion}", + "url": "http://github.com/Ellpeck/ActuallyAdditions", "updateUrl": "", - "authorList": [ - "Ellpeck" - ], - "credits": "xdqmhose, GlenthorLP, Lordhallo, canitzp", + "authorList": [ "Ellpeck" ], + "credits": "Author: Ellpeck; Thanks to: xdqmhose, GlenthorLP, Lordhallo, canitzp", "logoFile": "assets/actuallyadditions/textures/logo.png", "screenshots": [ ], diff --git a/update/changelog.txt b/update/changelog.txt index eb24747a5..bc3039296 100644 --- a/update/changelog.txt +++ b/update/changelog.txt @@ -1 +1 @@ -Fixed a Bug with the Phantom Liquiface crashing with missing TankInfos \ No newline at end of file +Fixed a Bug caused by fixing the last Bug... Whoops... \ No newline at end of file diff --git a/update/newestVersion.txt b/update/newestVersion.txt index c7e9f866a..f5e6e48fe 100644 --- a/update/newestVersion.txt +++ b/update/newestVersion.txt @@ -1 +1 @@ -1.7.10-0.0.5.6 \ No newline at end of file +1.7.10-0.0.5.7 \ No newline at end of file