What is the error, and also could you post the code you have, because as I said above its easier to help if you post the code....simply saying still getting an error all the time doesnt help us help you...
Ok, so this is what the error is: Duplicate method 'isInvNameLocalized() in type TileEntityGoldOven'.
This is my complete TileEntity code:
package forestry.morefood.common;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.item.ItemTool;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ForgeDummyContainer;
public class TileEntityGoldOven extends TileEntity implements ISidedInventory
{
private ItemStack[] furnaceItemStacks = new ItemStack[3];
public int furnaceBurnTime;
private String customName;
public int currentItemBurnTime;
public int furnaceCookTime;
/**
* Returns the number of slots in the inventory.
*/
public int getSizeInventory()
{
return this.furnaceItemStacks.length;
}
/**
* Returns the stack in slot i
*/
public ItemStack getStackInSlot(int par1)
{
return this.furnaceItemStacks[par1];
}
/**
* Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a
* new stack.
*/
public ItemStack decrStackSize(int par1, int par2)
{
if (this.furnaceItemStacks[par1] != null)
{
ItemStack itemstack;
if (this.furnaceItemStacks[par1].stackSize <= par2)
{
itemstack = this.furnaceItemStacks[par1];
this.furnaceItemStacks[par1] = null;
return itemstack;
}
else
{
itemstack = this.furnaceItemStacks[par1].splitStack(par2);
if (this.furnaceItemStacks[par1].stackSize == 0)
{
this.furnaceItemStacks[par1] = null;
}
return itemstack;
}
}
else
{
return null;
}
}
/**
* When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -
* like when you close a workbench GUI.
*/
public ItemStack getStackInSlotOnClosing(int par1)
{
if (this.furnaceItemStacks[par1] != null)
{
ItemStack itemstack = this.furnaceItemStacks[par1];
this.furnaceItemStacks[par1] = null;
return itemstack;
}
else
{
return null;
}
}
/**
* Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
*/
public void setInventorySlotContents(int par1, ItemStack par2ItemStack)
{
this.furnaceItemStacks[par1] = par2ItemStack;
if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit())
{
par2ItemStack.stackSize = this.getInventoryStackLimit();
}
}
/**
* Returns the name of the inventory.
*/
public String getInvName()
{
return this.isInvNameLocalized() ? this.customName : "container.mill";
}
/**
* If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's
* language. Otherwise it will be used directly.
*/
public boolean isInvNameLocalized()
{
return this.customName != null && this.customName.length() > 0;
}
/**
* Reads a tile entity from NBT.
*/
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readFromNBT(par1NBTTagCompound);
NBTTagList var2 = par1NBTTagCompound.getTagList("Items");
this.furnaceItemStacks = new ItemStack[this.getSizeInventory()];
for (int var3 = 0; var3 < var2.tagCount(); ++var3)
{
NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);
byte var5 = var4.getByte("Slot");
if (var5 >= 0 && var5 < this.furnaceItemStacks.length)
{
this.furnaceItemStacks[var5] = ItemStack.loadItemStackFromNBT(var4);
}
}
this.furnaceBurnTime = par1NBTTagCompound.getShort("BurnTime");
this.furnaceCookTime = par1NBTTagCompound.getShort("CookTime");
this.currentItemBurnTime = getItemBurnTime(this.furnaceItemStacks[1]);
}
/**
* Writes a tile entity to NBT.
*/
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeToNBT(par1NBTTagCompound);
par1NBTTagCompound.setShort("BurnTime", (short)this.furnaceBurnTime);
par1NBTTagCompound.setShort("CookTime", (short)this.furnaceCookTime);
NBTTagList var2 = new NBTTagList();
for (int var3 = 0; var3 < this.furnaceItemStacks.length; ++var3)
{
if (this.furnaceItemStacks[var3] != null)
{
NBTTagCompound var4 = new NBTTagCompound();
var4.setByte("Slot", (byte)var3);
this.furnaceItemStacks[var3].writeToNBT(var4);
var2.appendTag(var4);
}
}
par1NBTTagCompound.setTag("Items", var2);
}
/**
* Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't
* this more of a set than a get?*
*/
public int getInventoryStackLimit()
{
return 64;
}
@SideOnly(Side.CLIENT)
/**
* Returns an integer between 0 and the passed value representing how close the current item is to being completely
* cooked
*/
public int getCookProgressScaled(int par1)
{
return this.furnaceCookTime * par1 / 200;
}
@SideOnly(Side.CLIENT)
/**
* Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel
* item, where 0 means that the item is exhausted and the passed value means that the item is fresh
*/
public int getBurnTimeRemainingScaled(int par1)
{
if (this.currentItemBurnTime == 0)
{
this.currentItemBurnTime = 200;
}
return this.furnaceBurnTime * par1 / this.currentItemBurnTime;
}
/**
* Returns true if the furnace is currently burning
*/
public boolean isBurning()
{
return this.furnaceBurnTime > 0;
}
/**
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
* ticks and creates a new spawn inside its implementation.
*/
public void updateEntity()
{
boolean flag = this.furnaceBurnTime > 0;
boolean flag1 = false;
if (this.furnaceBurnTime > 0)
{
--this.furnaceBurnTime;
}
if (!this.worldObj.isRemote)
{
if (this.furnaceBurnTime == 0 && this.canSmelt())
{
this.currentItemBurnTime = this.furnaceBurnTime = getItemBurnTime(this.furnaceItemStacks[1]);
if (this.furnaceBurnTime > 0)
{
flag1 = true;
if (this.furnaceItemStacks[1] != null)
{
--this.furnaceItemStacks[1].stackSize;
if (this.furnaceItemStacks[1].stackSize == 0)
{
this.furnaceItemStacks[1] = this.furnaceItemStacks[1].getItem().getContainerItemStack(furnaceItemStacks[1]);
}
}
}
}
if (this.isBurning() && this.canSmelt())
{
++this.furnaceCookTime;
if (this.furnaceCookTime == 200)
{
this.furnaceCookTime = 0;
this.smeltItem();
flag1 = true;
}
}
else
{
this.furnaceCookTime = 0;
}
if (flag != this.furnaceBurnTime > 0)
{
flag1 = true;
BlockGoldOven.updateFurnaceBlockState(this.furnaceBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
}
}
if (flag1)
{
this.onInventoryChanged();
}
}
/**
* Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc.
*/
private boolean canSmelt()
{
if (this.furnaceItemStacks[0] == null)
{
return false;
}
else
{
ItemStack itemstack = GoldRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
if (itemstack == null) return false;
if (this.furnaceItemStacks[2] == null) return true;
if (!this.furnaceItemStacks[2].isItemEqual(itemstack)) return false;
int result = furnaceItemStacks[2].stackSize + itemstack.stackSize;
return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
}
}
/**
* Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack
*/
public void smeltItem()
{
if (this.canSmelt())
{
ItemStack itemstack = GoldRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
if (this.furnaceItemStacks[2] == null)
{
this.furnaceItemStacks[2] = itemstack.copy();
}
else if (this.furnaceItemStacks[2].isItemEqual(itemstack))
{
furnaceItemStacks[2].stackSize += itemstack.stackSize;
}
--this.furnaceItemStacks[0].stackSize;
if (this.furnaceItemStacks[0].stackSize <= 0)
{
this.furnaceItemStacks[0] = null;
}
}
}
/**
* Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
* fuel
*/
public static int getItemBurnTime(ItemStack par0ItemStack)
{
if (par0ItemStack == null)
{
return 0;
}
else
{
int i = par0ItemStack.getItem().itemID;
Item item = par0ItemStack.getItem();
if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[i] != null)
{
Block block = Block.blocksList[i];
if (block == Block.woodSingleSlab)
{
return 150;
}
if (block.blockMaterial == Material.wood)
{
return 300;
}
if (block == Block.coalBlock)
{
return 16000;
}
}
if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 200;
if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 200;
if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) return 200;
if (i == Item.stick.itemID) return 100;
if (i == Item.coal.itemID) return 1600;
if (i == Item.bucketLava.itemID) return 20000;
if (i == Block.sapling.blockID) return 100;
if (i == Item.blazeRod.itemID) return 2400;
return GameRegistry.getFuelValue(par0ItemStack);
}
}
/**
* Return true if item is a fuel source (getItemBurnTime() > 0).
*/
public static boolean isItemFuel(ItemStack par0ItemStack)
{
return getItemBurnTime(par0ItemStack) > 0;
}
/**
* Do not make give this method the name canInteractWith because it clashes with Container
*/
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer)
{
return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
}
public void openChest() {}
public void closeChest() {}
@Override
public boolean isInvNameLocalized()
{
return (this.customName != null) && (this.customName.length() > 0);
}
public void setCustomName(String name)
{
this.customName = name;
}
@Override
public int[] getAccessibleSlotsFromSide(int var1) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean canInsertItem(int i, ItemStack itemstack, int j) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean canExtractItem(int i, ItemStack itemstack, int j) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
return false;
}
}
Rollback Post to RevisionRollBack
Check out SpaceAge, a new futuristic themed mod on GitHub: Link
That's because you have the method twice, just like it says. Remove one of them. Did you even read your own code?
Nuff said.....honestly I have learned how vital is to proof read your code more than once this very evening... Finally got a furnace working that was not due to misreading my own code.... Take your time and verify what you have. Also eclipse is a very powerful editor, and is handy with its built in tool tips. It will in many cases tell you your errors. If not, it will when you run it with the crash log. Thanks for posting the code skylord, as I am sure it helped coolAlias spot the mistake, same as he did for me.
But which one do I remove (sorry if this wasn't clear earlier)?
The one with @Override or the other one?
Since the method is duplicate, it doesn't matter which you remove, just remove one of them.
@Override is an annotation that tells Eclipse there is a method with the same name in the parent class, which allows it to do extra error-checking so you don't make a mistake spelling the name or using incorrect parameters. I suggest using @Override on every method that you can, just for this extra error checking benefit, even though in the recompiled code it doesn't have any functionality.
Since the method is duplicate, it doesn't matter which you remove, just remove one of them.
@Override is an annotation that tells Eclipse there is a method with the same name in the parent class, which allows it to do extra error-checking so you don't make a mistake spelling the name or using incorrect parameters. I suggest using @Override on every method that you can, just for this extra error checking benefit, even though in the recompiled code it doesn't have any functionality.
Ah. Thank you. I will remove the one without @Override.
Rollback Post to RevisionRollBack
Check out SpaceAge, a new futuristic themed mod on GitHub: Link
Right, happy to hear its closer to complete for you. Just remember to utilize eclipse features, many times this has helped me solve issues I had with out needing extra help from others. Good luck and let us know if you need anything else...
Right, happy to hear its closer to complete for you. Just remember to utilize eclipse features, many times this has helped me solve issues I had with out needing extra help from others. Good luck and let us know if you need anything else...
Just a question, about the
public Icon getIcon(int side, int metadata)
{
return side == 1 ? this.slicerIconTop : (side == 2 ? this.slicerIconBack : (side == 0 ? this.slicerIconTop : (side != metadata ? this.blockIcon : this.slicerIconFront)));
}
@SideOnly(Side.CLIENT)
/**
* Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
*/
public void registerIcons(IconRegister par1IconRegister)
{
//this.blockIcon = par1IconRegister.registerIcon("modid:furnaceSide");
this.slicerIconBack = par1IconRegister.registerIcon("modid:slicerBack");
this.slicerIconLeft = par1IconRegister.registerIcon("modid:slicerLeft");
this.slicerIconRight = par1IconRegister.registerIcon("modid:slicerRight");
this.slicerIconFront = par1IconRegister.registerIcon(this.isActive ? "modid:slicerActive" : "modid:slicerIdle");
this.slicerIconTop = par1IconRegister.registerIcon("modid:slicerTop");
}
, which side numbers are which?Also how do you use the new ISidedInventory?
Rollback Post to RevisionRollBack
Check out SpaceAge, a new futuristic themed mod on GitHub: Link
Okay, for the side textures, I just leave the base of the code for the icons the same as vanilla and call my own texture instead. Other than the front all my side textures are the same (custom) texture. I try not to mess with the way the furnace or crafting tables are, mostly because it can lead to issues I dont feel like trying to work out.
As for the ISidedInventory, what is the issue you have. Is it the import or something else?
Okay, for the side textures, I just leave the base of the code for the icons the same as vanilla and call my own texture instead. Other than the front all my side textures are the same (custom) texture. I try not to mess with the way the furnace or crafting tables are, mostly because it can lead to issues I dont feel like trying to work out.
As for the ISidedInventory, what is the issue you have. Is it the import or something else?
Hey I'm having trouble with having the furnace turning active when fuel is put in. The texture doesn't change nor do the particles come out so I'm guessing the block isn't changing but here is my furnace code:
package wintercraft.blocks;
import java.util.Random;
import wintercraft.Wintercraft;
import wintercraft.helper.gui.TileEntityFreezer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class BlockFreezer extends BlockContainer
{
/**
* Is the random generator used by furnace to drop the inventory contents in random directions.
*/
private final Random furnaceRand = new Random();
/** True if this is an active furnace, false if idle */
private final boolean isActive;
/**
* This flag is used to prevent the furnace inventory to be dropped upon block removal, is used internally when the
* furnace block changes from idle to active and vice-versa.
*/
private static boolean keepFurnaceInventory;
@SideOnly(Side.CLIENT)
private Icon furnaceIconTop;
@SideOnly(Side.CLIENT)
private Icon furnaceIconFront;
protected BlockFreezer(int par1, boolean par2)
{
super(par1, Material.rock);
this.isActive = par2;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return Blocks.freezer.blockID;
}
/**
* Called whenever the block is added into the world. Args: world, x, y, z
*/
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
super.onBlockAdded(par1World, par2, par3, par4);
this.setDefaultDirection(par1World, par2, par3, par4);
}
/**
* set a blocks direction
*/
private void setDefaultDirection(World par1World, int par2, int par3, int par4)
{
if (!par1World.isRemote)
{
int l = par1World.getBlockId(par2, par3, par4 - 1);
int i1 = par1World.getBlockId(par2, par3, par4 + 1);
int j1 = par1World.getBlockId(par2 - 1, par3, par4);
int k1 = par1World.getBlockId(par2 + 1, par3, par4);
byte b0 = 3;
if (Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[i1])
{
b0 = 3;
}
if (Block.opaqueCubeLookup[i1] && !Block.opaqueCubeLookup[l])
{
b0 = 2;
}
if (Block.opaqueCubeLookup[j1] && !Block.opaqueCubeLookup[k1])
{
b0 = 5;
}
if (Block.opaqueCubeLookup[k1] && !Block.opaqueCubeLookup[j1])
{
b0 = 4;
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2);
}
}
@SideOnly(Side.CLIENT)
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public Icon getIcon(int par1, int par2)
{
return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != par2 ? this.blockIcon : this.furnaceIconFront));
}
@SideOnly(Side.CLIENT)
/**
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
* is the only chance you get to register icons.
*/
public void registerIcons(IconRegister par1IconRegister)
{
this.blockIcon = par1IconRegister.registerIcon(Wintercraft.modid + ":" + "freezerSide");
this.furnaceIconFront = par1IconRegister.registerIcon(this.isActive ? Wintercraft.modid + ":" + "freezerActive" : Wintercraft.modid + ":" + "freezerIdle");
this.furnaceIconTop = par1IconRegister.registerIcon(Wintercraft.modid + ":" + "freezerTop");
}
/**
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par1World.isRemote)
{
return true;
}
else
{
TileEntityFreezer tileentityFreezer = (TileEntityFreezer)par1World.getBlockTileEntity(par2, par3, par4);
if (tileentityFreezer != null)
{
par5EntityPlayer.openGui(Wintercraft.instance, 0, par1World, par2, par3, par4);
}
return true;
}
}
/**
* Update which block ID the furnace is using depending on whether or not it is burning
*/
public static void updateFurnaceBlockState(boolean par0, World par1World, int par2, int par3, int par4)
{
int l = par1World.getBlockMetadata(par2, par3, par4);
TileEntity tileentity = par1World.getBlockTileEntity(par2, par3, par4);
keepFurnaceInventory = true;
if (par0)
{
par1World.setBlock(par2, par3, par4, Blocks.freezer.blockID);
}
else
{
par1World.setBlock(par2, par3, par4, Blocks.freezerActive.blockID);
}
keepFurnaceInventory = false;
par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2);
if (tileentity != null)
{
tileentity.validate();
par1World.setBlockTileEntity(par2, par3, par4, tileentity);
}
}
@SideOnly(Side.CLIENT)
/**
* A randomly called display update to be able to add particles or other items for display
*/
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (this.isActive)
{
int l = par1World.getBlockMetadata(par2, par3, par4);
float f = (float)par2 + 0.5F;
float f1 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F;
float f2 = (float)par4 + 0.5F;
float f3 = 0.52F;
float f4 = par5Random.nextFloat() * 0.6F - 0.3F;
if (l == 4)
{
par1World.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
}
else if (l == 5)
{
par1World.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
}
else if (l == 2)
{
par1World.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D);
}
else if (l == 3)
{
par1World.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);
}
}
}
/**
* Returns a new instance of a block's tile entity class. Called on placing the block.
*/
public TileEntity createNewTileEntity(World par1World)
{
return new TileEntityFreezer();
}
/**
* Called when the block is placed in the world.
*/
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
{
int l = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if (l == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2);
}
if (l == 1)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2);
}
if (l == 2)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);
}
if (l == 3)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2);
}
if (par6ItemStack.hasDisplayName())
{
((TileEntityFreezer)par1World.getBlockTileEntity(par2, par3, par4)).setCustomName(par6ItemStack.getDisplayName());
}
}
/**
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
* metadata
*/
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
{
if (!keepFurnaceInventory)
{
TileEntityFreezer tileentityFreezer = (TileEntityFreezer)par1World.getBlockTileEntity(par2, par3, par4);
if (tileentityFreezer != null)
{
for (int j1 = 0; j1 < tileentityFreezer.getSizeInventory(); ++j1)
{
ItemStack itemstack = tileentityFreezer.getStackInSlot(j1);
if (itemstack != null)
{
float f = this.furnaceRand.nextFloat() * 0.8F + 0.1F;
float f1 = this.furnaceRand.nextFloat() * 0.8F + 0.1F;
float f2 = this.furnaceRand.nextFloat() * 0.8F + 0.1F;
while (itemstack.stackSize > 0)
{
int k1 = this.furnaceRand.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
{
k1 = itemstack.stackSize;
}
itemstack.stackSize -= k1;
EntityItem entityitem = new EntityItem(par1World, (double)((float)par2 + f), (double)((float)par3 + f1), (double)((float)par4 + f2), new ItemStack(itemstack.itemID, k1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound())
{
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
}
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.furnaceRand.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.furnaceRand.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.furnaceRand.nextGaussian() * f3);
par1World.spawnEntityInWorld(entityitem);
}
}
}
par1World.func_96440_m(par2, par3, par4, par5);
}
}
super.breakBlock(par1World, par2, par3, par4, par5, par6);
}
/**
* If this returns true, then comparators facing away from this block will use the value from
* getComparatorInputOverride instead of the actual redstone signal strength.
*/
public boolean hasComparatorInputOverride()
{
return true;
}
/**
* If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal
* strength when this block inputs to a comparator.
*/
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
{
return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4));
}
@SideOnly(Side.CLIENT)
/**
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
*/
public int idPicked(World par1World, int par2, int par3, int par4)
{
return Blocks.freezer.blockID;
}
}
I am hoping to have a video tutorial up for this tonight sometime....a lot of people miss the step in the tile that references the block update check...should reference your block not blockFurnace
I am hoping to have a video tutorial up for this tonight sometime....a lot of people miss the step in the tile that references the block update check...should reference your block not blockFurnace
In the TileEntity? I'm using the Dual Input TileEntity, I don't see that in there?
Okay....so you are using the dual input furnace....didnt know that. Anyhow for the active flames for the block, look at the blockfurnace class in the vanilla code, there have been some changes to the code since I put this up and as you are making a new type of furnace but want similar results for some things like the active block texture and flames, that is a good place to start as I will mention in the video I do tonight for the basic furnace. Everything in these tutorials is an expansion of the basic furnace....
Okay....so you are using the dual input furnace....didnt know that. Anyhow for the active flames for the block, look at the blockfurnace class in the vanilla code, there have been some changes to the code since I put this up and as you are making a new type of furnace but want similar results for some things like the active block texture and flames, that is a good place to start as I will mention in the video I do tonight for the basic furnace. Everything in these tutorials is an expansion of the basic furnace....
The videos should be up within the hour...there will be 5 parts to the basic furnace as I wanted to cover as much as I could in the 15 minutes for each part. I even cover the whys and hows somethings do what they do and why most of you are having issues with certain things...
The video is in 5 parts, I have explained everything I can possibly think of that needs explained. Please watch carefully and it may help ou to understand how all the tutorials work...when I have more time I will add videos for the rest of the furnace types...
The video is in 5 parts, I have explained everything I can possibly think of that needs explained. Please watch carefully and it may help ou to understand how all the tutorials work...when I have more time I will add videos for the rest of the furnace types...
Did you upload them already and if so, may I have a link?
Ok, so this is what the error is: Duplicate method 'isInvNameLocalized() in type TileEntityGoldOven'.
This is my complete TileEntity code:
Nuff said.....honestly I have learned how vital is to proof read your code more than once this very evening... Finally got a furnace working that was not due to misreading my own code.... Take your time and verify what you have. Also eclipse is a very powerful editor, and is handy with its built in tool tips. It will in many cases tell you your errors. If not, it will when you run it with the crash log. Thanks for posting the code skylord, as I am sure it helped coolAlias spot the mistake, same as he did for me.
Find out how I generate....coolAlias...world structure generation and rotation tool...
The one with @Override or the other one?
Since the method is duplicate, it doesn't matter which you remove, just remove one of them.
@Override is an annotation that tells Eclipse there is a method with the same name in the parent class, which allows it to do extra error-checking so you don't make a mistake spelling the name or using incorrect parameters. I suggest using @Override on every method that you can, just for this extra error checking benefit, even though in the recompiled code it doesn't have any functionality.
Ah. Thank you. I will remove the one without @Override.
Find out how I generate....coolAlias...world structure generation and rotation tool...
Just a question, about the , which side numbers are which?Also how do you use the new ISidedInventory?
As for the ISidedInventory, what is the issue you have. Is it the import or something else?
Find out how I generate....coolAlias...world structure generation and rotation tool...
I was wondering how that worked.
combustion chamber with lava bucket does not return empty bucket
You can also input as a bucket of water returns an empty bucket?
http://translate.google.de/
Find out how I generate....coolAlias...world structure generation and rotation tool...
In the TileEntity? I'm using the Dual Input TileEntity, I don't see that in there?
Find out how I generate....coolAlias...world structure generation and rotation tool...
Ah, okay. I'll just wait for that video then
Find out how I generate....coolAlias...world structure generation and rotation tool...
Find out how I generate....coolAlias...world structure generation and rotation tool...
Did you upload them already and if so, may I have a link?Nevermind, found them on the main Post Thanks!