Updates! :D
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ public class BlockCoalGenerator extends BlockContainerBase implements INameableI
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
BlockUtil.addInformation(theBlock, list, 1, "");
|
||||
BlockUtil.addPowerProductionInfo(list, TileEntityCoalGenerator.energyProducedPerTick);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -19,8 +19,11 @@ 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);
|
||||
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){
|
||||
|
@ -29,8 +32,7 @@ public abstract class BlockContainerBase extends BlockContainer{
|
|||
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());
|
||||
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;
|
||||
|
@ -39,7 +41,8 @@ public abstract class BlockContainerBase extends BlockContainer{
|
|||
itemStack.stackSize = 0;
|
||||
}
|
||||
}
|
||||
return tileEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -96,6 +96,7 @@ public class BlockFurnaceSolar 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.addPowerProductionInfo(list, TileEntityFurnaceSolar.energyProducedPerTick);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -84,6 +84,7 @@ public class BlockHeatCollector extends BlockContainerBase implements INameableI
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
|
||||
BlockUtil.addInformation(theBlock, list, 3, "");
|
||||
BlockUtil.addPowerProductionInfo(list, TileEntityHeatCollector.energyProducedPerTick);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -100,6 +100,7 @@ public class BlockOilGenerator 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.addPowerProductionInfo(list, TileEntityOilGenerator.energyProducedPerTick);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
@ -157,8 +156,15 @@ public class BlockPhantomface extends BlockContainerBase implements INameableIte
|
|||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
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
|
||||
public int getMetadata(int damage){
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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!");
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -12,7 +12,6 @@ public class InitCrafting {
|
|||
MiscCrafting.init();
|
||||
FoodCrafting.init();
|
||||
ToolCrafting.init();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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...");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,6 +203,9 @@ public class ItemCoffee extends ItemFood implements INameableItem{
|
|||
@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(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("");
|
||||
|
@ -213,6 +218,8 @@ public class ItemCoffee extends ItemFood implements INameableItem{
|
|||
}
|
||||
else list.add("No Effects");
|
||||
}
|
||||
else list.add(ItemUtil.shiftForInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int par1){
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
else if(hasSilkTouch) this.removeEnchantment(stack, Enchantment.silkTouch);
|
||||
|
||||
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<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,9 +99,13 @@ 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){
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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;
|
||||
|
@ -50,8 +52,13 @@ public class ItemKnife extends Item implements INameableItem{
|
|||
@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 getShareTag(){
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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,8 +68,12 @@ public class ItemAllToolAA extends ItemTool implements INameableItem{
|
|||
@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+".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){
|
||||
|
@ -126,13 +130,4 @@ public class ItemAllToolAA extends ItemTool implements INameableItem{
|
|||
public String getOredictName(){
|
||||
return oredictName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getToolClasses(ItemStack stack){
|
||||
HashSet<String> hashSet = new HashSet<String>();
|
||||
hashSet.add("pickaxe");
|
||||
hashSet.add("shovel");
|
||||
hashSet.add("axe");
|
||||
return hashSet;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,8 +35,12 @@ public class ItemHoeAA extends ItemHoe implements INameableItem{
|
|||
@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){
|
||||
|
|
|
@ -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,8 +35,12 @@ public class ItemPickaxeAA extends ItemPickaxe implements INameableItem{
|
|||
@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){
|
||||
|
|
|
@ -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,8 +35,12 @@ public class ItemShovelAA extends ItemSpade implements INameableItem{
|
|||
@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){
|
||||
|
|
|
@ -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,8 +35,12 @@ public class ItemSwordAA extends ItemSword implements INameableItem{
|
|||
@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){
|
||||
|
|
|
@ -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<IRecipe> 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<ItemStack>)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<Object> 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<ItemStack>)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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<InfoTab> list = new ArrayList<InfoTab>();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<PacketOpenManual, IMessage>{
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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,8 +36,10 @@ public class BlockUtil{
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void addPowerProductionInfo(List list, int produce){
|
||||
if(KeyUtil.isShiftPressed()){
|
||||
list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".produces.desc") + " " + produce + " RF/t");
|
||||
}
|
||||
}
|
||||
|
||||
public static final ArrayList<Block> wailaRegisterList = new ArrayList<Block>();
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 354 B After Width: | Height: | Size: 442 B |
Before Width: | Height: | Size: 326 B After Width: | Height: | Size: 477 B |
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 486 B |
Before Width: | Height: | Size: 340 B After Width: | Height: | Size: 473 B |
Before Width: | Height: | Size: 334 B After Width: | Height: | Size: 456 B |
Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 465 B |
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 467 B |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 155 KiB After Width: | Height: | Size: 153 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 2.9 KiB |
|
@ -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": [
|
||||
],
|
||||
|
|
|
@ -1 +1 @@
|
|||
Fixed a Bug with the Phantom Liquiface crashing with missing TankInfos
|
||||
Fixed a Bug caused by fixing the last Bug... Whoops...
|
|
@ -1 +1 @@
|
|||
1.7.10-0.0.5.6
|
||||
1.7.10-0.0.5.7
|