Did you modify the TileEntityFreezer or is it the same as the one in the finished code?
Currently everything is the same except for variable names, the canInteractWith method (mine just returns true always at the moment) and the getStackInSlot method, I was having null pointer exceptions when I was doing stuff with it so I changed it to this
*edit* actually, it would probably help to mention that I have my tileentity tied to a livingentity rather than a block. and it's probably caused by the living entity not writing or reading the tileentity properly from the nbt, sadly I don't know how to fix that D:
Currently everything is the same except for variable names, the canInteractWith method (mine just returns true always at the moment) and the getStackInSlot method, I was having null pointer exceptions when I was doing stuff with it so I changed it to this
*edit* actually, it would probably help to mention that I have my tileentity tied to a livingentity rather than a block. and it's probably caused by the living entity not writing or reading the tileentity properly from the nbt, sadly I don't know how to fix that D:
Could you explain how you did it because I'd love to know in case something like that happens to me in the future. Also, what do you mean it's tied to a living entity? Do you mean that your furnace is a living mob or what?
Could you explain how you did it because I'd love to know in case something like that happens to me in the future. Also, what do you mean it's tied to a living entity? Do you mean that your furnace is a living mob or what?
Exactly, I made a mob that extends entityliving, which has a tileentity has a variable so when you rightclick on the mob it brings up its own inventory/furnace setup. The problem was that when the entityliving was saved to nbt, it wasn't saving the tileentity variable, so i took the code from the tileentity's read and write functions and stuck them in the entityliving's read and write functions
Exactly, I made a mob that extends entityliving, which has a tileentity has a variable so when you rightclick on the mob it brings up its own inventory/furnace setup. The problem was that when the entityliving was saved to nbt, it wasn't saving the tileentity variable, so i took the code from the tileentity's read and write functions and stuck them in the entityliving's read and write functions
Thanks for explaining and that's a pretty good idea, a mob with it's own furnace setup.
You should add a tutorial on how to add multiple blocks, that each have multiple textures. I can add multiple blocks to my mod, and i have 1 block that has different textures, but i when i try to add a second block with more textures, it doesn't work.
hey man thanks for the tutorial :biggrin.gif: awesome but i get errors when i recompile and i dont know what to do so i was wondering if you could help me.
these are the errors i get
error 1
2011-09-24 15:12 - commands.recompile - ERROR -
2011-09-24 15:12 - commands.recompile - ERROR - warning: [options] bootstrap class path not set in conjunction with -source 1.6
2011-09-24 15:12 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_XXX.java:9: error: cannot find symbol
2011-09-24 15:12 - commands.recompile - ERROR - public static final Block Freezer;
2011-09-24 15:12 - commands.recompile - ERROR - ^
2011-09-24 15:12 - commands.recompile - ERROR -
hey man thanks for the tutorial :biggrin.gif: awesome but i get errors when i recompile and i dont know what to do so i was wondering if you could help me.
these are the errors i get
error 1
2011-09-24 15:12 - commands.recompile - ERROR -
2011-09-24 15:12 - commands.recompile - ERROR - warning: [options] bootstrap class path not set in conjunction with -source 1.6
2011-09-24 15:12 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_XXX.java:9: error: cannot find symbol
2011-09-24 15:12 - commands.recompile - ERROR - public static final Block Freezer;
2011-09-24 15:12 - commands.recompile - ERROR - ^
2011-09-24 15:12 - commands.recompile - ERROR -
because with this code you are stating that freezer is a block. What .bat file did you run to get these results because when I run recompile.bat it looks a bit different. Can you post your mod_XXX? Remember to use code tags ["code"]["/code"] (without the ") for your code and errors because it's easier to read.
So I have completed your furnace tutorial, it's fabulous, by the way, and I now need to add another slot to my newly-made furnace. You said you would do a tutorial on it another time, so can you paste the link or possibly get started on one?
Thanks for explaining and that's a pretty good idea, a mob with it's own furnace setup.
It isn't fully implemented yet, but I'm using it for my golem mod, wherein the golem is coal powered and eats up coal like the furnace does
And now I'm having a rather strange bug that I'm hoping you can help with. I added a guibutton to my whatevergui class, and when I have the initGui method in there it messes up all of the slots. It doesn't matter if initGui is empty or full of code, it always does this. What I mean when I say it messes them up, is that each slot is treated as the slot 4 slots before it (reading left to right, top to bottom), so clicking on a slot picks up whatever items are in that other slot not the one being hovered over D:
It isn't fully implemented yet, but I'm using it for my golem mod, wherein the golem is coal powered and eats up coal like the furnace does
And now I'm having a rather strange bug that I'm hoping you can help with. I added a guibutton to my whatevergui class, and when I have the initGui method in there it messes up all of the slots. It doesn't matter if initGui is empty or full of code, it always does this. What I mean when I say it messes them up, is that each slot is treated as the slot 4 slots before it (reading left to right, top to bottom), so clicking on a slot picks up whatever items are in that other slot not the one being hovered over D:
And I fixed it by taking out the initgui method and just having an updategui method thats called when the gui is first made as well as when it should be updating :tongue.gif:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
import java.util.HashMap;
import java.util.Map;
// Referenced classes of package net.minecraft.src:
// Block, ItemStack, Item
public class FreezerRecipes
{
public static final FreezerRecipes solidifying()
{
return solidifyingBase;
}
private FreezerRecipes()
{
solidifyingList = new HashMap();
addSolidifying(Item.bucketLava.shiftedIndex, new ItemStack(Block.obsidian));
addSolidifying(Item.bucketWater.shiftedIndex, new ItemStack(Block.ice));
}
public void addSolidifying(int i, ItemStack itemstack)
{
solidifyingList.put(Integer.valueOf(i), itemstack);
}
public ItemStack getSolidifyingResult(int i)
{
return (ItemStack)solidifyingList.get(Integer.valueOf(i));
}
public Map getSolidifyingList()
{
return solidifyingList;
}
private static final FreezerRecipes solidifyingBase = new FreezerRecipes();
private Map solidifyingList;
}
GuiFreezer
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
// Referenced classes of package net.minecraft.src:
// GuiContainer, ContainerFurnace, FontRenderer, RenderEngine,
// TileEntityFurnace, InventoryPlayer
public class GuiFreezer extends GuiContainer
{
public GuiFreezer(InventoryPlayer inventoryplayer, TileEntityFreezer tileentityfreezer)
{
super(new ContainerFreezer(inventoryplayer, tileentityfreezer));
freezerInventory = tileentityfreezer;
}
protected void drawGuiContainerForegroundLayer()
{
fontRenderer.drawString("Freezer", 60, 6, 0x404040);
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
}
protected void drawGuiContainerBackgroundLayer(float f)
{
int i = mc.renderEngine.getTexture("/gui/furnace.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
if(freezerInventory.isFreezing())
{
int l = freezerInventory.getFreezeTimeRemainingScaled(12);
drawTexturedModalRect(j + 56, (k + 36 + 12) - l, 176, 12 - l, 14, l + 2);
}
int i1 = freezerInventory.getCoolProgressScaled(24);
drawTexturedModalRect(j + 79, k + 34, 176, 14, i1 + 1, 16);
}
private TileEntityFreezer freezerInventory;
}
mod_XXX
public class mod_XXX extends BaseMod{
public mod_XXX()
{
ModLoader.RegisterBlock(freezer);
ModLoader.AddName(freezer, "Freezer");
ModLoader.RegisterTileEntity(net.minecraft.src.TileEntityFreezer.class, "Freezer");
}
public static final Block Freezer;
public static int freezSide = ModLoader.addOverride("/terrain.png", "/Freezer.png");
public static int freezFront = ModLoader.addOverride("/terrain.png", "/FreezerFront.png");
static
{
freezer = new BlockFreezer(165, false).setHardness(0F).setResistance(0F).setStepSound(Block.soundMetalFootstep).setBlockName("freezer");
}
}
SlotFreezer
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// Slot, EntityPlayer, ItemStack, Item,
// AchievementList, ModLoader, IInventory
public class SlotFreezer extends Slot
{
public SlotFreezer(EntityPlayer entityplayer, IInventory iinventory, int i, int j, int k)
{
super(iinventory, i, j, k);
}
public boolean isItemValid(ItemStack itemstack)
{
return false;
}
}
I think it's because you didnt put "package net.minecraft.src;" in your mod_XXX file. :3
Thanks for helping, and yes that is the reason. If you don't put the package statement the compiler doesn't know where to look for the classes that you are calling.
And I fixed it by taking out the initgui method and just having an updategui method thats called when the gui is first made as well as when it should be updating :tongue.gif:
You always seem to fix the errors before I'm even able to take a look at them :laugh.gif:
So I have completed your furnace tutorial, it's fabulous, by the way, and I now need to add another slot to my newly-made furnace. You said you would do a tutorial on it another time, so can you paste the link or possibly get started on one?
I'm starting that tutorial today, actually, but I'm not positive when I'll have it fully working.
If you are using this tutorial I assume you already have your furnace block finished and working. I will be basing this tutorial off of my first furnace tutorial, that's why I'm using the freezer as my furnace block. In this tutorial I am showing how to add another output slot, if you want more output slots you have to just add another copy of what I added.
In this file you specify the slots. The syntax for a slot goes like this:
addSlot(new SlotYOURFURNACE(inventoryplayer.player, tileentityYOURFURNACE, SLOTNUMBER /*can't be less than or equal to 2 or more than the total amount of slots - 1*/, XPOSITION, YPOSITION));
If you have 0 for the x and the y position then you are pointing at the top left corner. The position your are specifying with the x and y positions is the top left corner of the white square you see when you mouse over a slot.
I put the second output slot slightly to the left of the first.
In this file you are going to make the the adding of double output recipes work. There are a couple of methods you are going to have to copy and some code you are going to have to add. First add another hashmap at the bottom of the file like this:
private Map solidifyingList2;
then initialize it in the constructor like so:
solidifyingList2 = new HashMap();
If you forget to do this, then the game won't realize that you added any recipes. Now you have to make your addRecipes method. To do this copy the existing one and rename it. Now, you want the recipe to have two outcome items, but hashmap.put only excepts two objects, you need 3. For this I added a method called doubleItem which converts two instances of ItemStack into an ItemStack array. All the copied and added fields/methods have a 2 in them (except for the method doubleItem) so that you know which ones to copy/add. The rest I'm going to explain in code comments.
Finished code:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
import java.util.HashMap;
import java.util.Map;
// Referenced classes of package net.minecraft.src:
// Block, ItemStack, Item
public class FreezerRecipes
{
public static final FreezerRecipes solidifying()
{
return solidifyingBase;
}
private FreezerRecipes()
{
solidifyingList = new HashMap();
solidifyingList2 = new HashMap();
addSolidifying(Item.bucketLava.shiftedIndex, new ItemStack(Block.obsidian));
addSolidifying2(Item.bucketWater.shiftedIndex, new ItemStack(Block.ice), new ItemStack(mod_Tutorial.iceChunks));
}
public void addSolidifying(int i, ItemStack itemstack)
{
solidifyingList.put(Integer.valueOf(i), itemstack);
}
public void addSolidifying2(int i, ItemStack item, ItemStack item2)
{
solidifyingList2.put(Integer.valueOf(i), doubleItem(item, item2)/*add the ItemStack array into the recipe list*/);
}
public ItemStack getSolidifyingResult(int i)
{
return (ItemStack)solidifyingList.get(Integer.valueOf(i));
}
public Map getSolidifyingList()
{
return solidifyingList;
}
private ItemStack [] doubleItem(ItemStack i , ItemStack i2)
{
return new ItemStack[] {i, i2};
}
public ItemStack [] getSolidifyingResult2Out(int i)//returns an ItemStack array so it can hold 2 items
{
return (ItemStack [])solidifyingList2.get(Integer.valueOf(i));
}
private static final FreezerRecipes solidifyingBase = new FreezerRecipes();
private Map solidifyingList;
private Map solidifyingList2;
}
TileEntityYOURFURNACE
There are a couple of methods that you have to copy and one or two you have to edit in this file. One important thing you have to be aware of is this line of code in the constructor:
freezerItemStacks = new ItemStack[4];
The number is the amount of slots that your furnace has. The original furnace has 3. All the copied methods have a 2 in their names so that you know which ones to copy. I'm now going to just lay the code on you and explain in the code comments.
Finished code:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// TileEntity, IInventory, ItemStack, NBTTagCompound,
// NBTTagList, World, Item, BlockFurnace,
// FurnaceRecipes, Block, Material, ModLoader,
// EntityPlayer
public class TileEntityFreezer extends TileEntity
implements IInventory
{
public TileEntityFreezer()
{
freezerItemStacks = new ItemStack[4];
freezerFreezeTime = 0;
currentItemCoolTime = 0;
freezerCoolTime = 0;
}
public int getSizeInventory()
{
return freezerItemStacks.length;
}
public ItemStack getStackInSlot(int i)
{
return freezerItemStacks[i];
}
public ItemStack decrStackSize(int i, int j)
{
if(freezerItemStacks[i] != null)
{
if(freezerItemStacks[i].stackSize <= j)
{
ItemStack itemstack = freezerItemStacks[i];
freezerItemStacks[i] = null;
return itemstack;
}
ItemStack itemstack1 = freezerItemStacks[i].splitStack(j);
if(freezerItemStacks[i].stackSize == 0)
{
freezerItemStacks[i] = null;
}
return itemstack1;
} else
{
return null;
}
}
public void setInventorySlotContents(int i, ItemStack itemstack)
{
freezerItemStacks[i] = itemstack;
if(itemstack != null && itemstack.stackSize > getInventoryStackLimit())
{
itemstack.stackSize = getInventoryStackLimit();
}
}
public String getInvName()
{
return "Freezer";
}
public void readFromNBT(NBTTagCompound nbttagcompound)
{
super.readFromNBT(nbttagcompound);
NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
freezerItemStacks = new ItemStack[getSizeInventory()];
for(int i = 0; i < nbttaglist.tagCount(); i++)
{
NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);
byte byte0 = nbttagcompound1.getByte("SlotFreezer");
if(byte0 >= 0 && byte0 < freezerItemStacks.length)
{
freezerItemStacks[byte0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
}
}
freezerFreezeTime = nbttagcompound.getShort("FreezeTime");
freezerCoolTime = nbttagcompound.getShort("CoolTime");
currentItemCoolTime = getItemFreezeTime(freezerItemStacks[1]);
}
public void writeToNBT(NBTTagCompound nbttagcompound)
{
super.writeToNBT(nbttagcompound);
nbttagcompound.setShort("FreezeTime", (short)freezerFreezeTime);
nbttagcompound.setShort("CoolTime", (short)freezerCoolTime);
NBTTagList nbttaglist = new NBTTagList();
for(int i = 0; i < freezerItemStacks.length; i++)
{
if(freezerItemStacks[i] != null)
{
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.setByte("SlotFreezer", (byte)i);
freezerItemStacks[i].writeToNBT(nbttagcompound1);
nbttaglist.setTag(nbttagcompound1);
}
}
nbttagcompound.setTag("Items", nbttaglist);
}
public int getInventoryStackLimit()
{
return 64;
}
public int getCoolProgressScaled(int i)
{
return (freezerCoolTime * i) / 200;
}
public int getFreezeTimeRemainingScaled(int i)
{
if(currentItemCoolTime == 0)
{
currentItemCoolTime = 200;
}
return (freezerFreezeTime * i) / currentItemCoolTime;
}
public boolean isFreezing()
{
return freezerFreezeTime > 0;
}
public void updateEntity()
{
boolean flag = freezerFreezeTime > 0;
boolean flag1 = false;
if(freezerFreezeTime > 0)
{
freezerFreezeTime--;
}
if(!worldObj.multiplayerWorld)
{
if(freezerFreezeTime == 0 && (canSolidify() || canSolidify2()))//checks whether the item/block can be solidified
{
currentItemCoolTime = freezerFreezeTime = getItemFreezeTime(freezerItemStacks[1]);
if(freezerFreezeTime > 0)
{
flag1 = true;
if(freezerItemStacks[1] != null)
{
if(freezerItemStacks[1].getItem().hasContainerItem())
{
freezerItemStacks[1] = new ItemStack(freezerItemStacks[1].getItem().getContainerItem());
} else
{
freezerItemStacks[1].stackSize--;
}
if(freezerItemStacks[1].stackSize == 0)
{
freezerItemStacks[1] = null;
}
}
}
}
if(isFreezing() && canSolidify())
{
freezerCoolTime++;
if(freezerCoolTime == 200)
{
freezerCoolTime = 0;
solidifyItem();
flag1 = true;
}
}
else if(isFreezing() && canSolidify2())//checks if the item/block is of double output
{
freezerCoolTime++;
if(freezerCoolTime == 200)
{
freezerCoolTime = 0;
solidifyItem2();//solidifies the item into double output
flag1 = true;
}
}
else
{
freezerCoolTime = 0;
}
}
if(flag != (freezerFreezeTime > 0))
{
flag1 = true;
}
if(flag1)
{
onInventoryChanged();
}
}
private boolean canSolidify()
{
if(freezerItemStacks[0] == null)
{
return false;
}
ItemStack itemstack = FreezerRecipes.solidifying().getSolidifyingResult(freezerItemStacks[0].getItem().shiftedIndex);
if(itemstack == null)
{
return false;
}
if(freezerItemStacks[2] == null)
{
return true;
}
if(!freezerItemStacks[2].isItemEqual(itemstack))
{
return false;
}
if(freezerItemStacks[2].stackSize < getInventoryStackLimit() && freezerItemStacks[2].stackSize < freezerItemStacks[2].getMaxStackSize())
{
return true;
}
return freezerItemStacks[2].stackSize < itemstack.getMaxStackSize();
}
public void solidifyItem()
{
if(!canSolidify())
{
return;
}
ItemStack itemstack = FreezerRecipes.solidifying().getSolidifyingResult(freezerItemStacks[0].getItem().shiftedIndex);
if(freezerItemStacks[2] == null)
{
freezerItemStacks[2] = itemstack.copy();
} else
if(freezerItemStacks[2].itemID == itemstack.itemID)
{
freezerItemStacks[2].stackSize += itemstack.stackSize;
}
if(freezerItemStacks[0].getItem().hasContainerItem())
{
freezerItemStacks[0] = new ItemStack(freezerItemStacks[0].getItem().getContainerItem());
} else
{
freezerItemStacks[0].stackSize--;
}
if(freezerItemStacks[0].stackSize <= 0)
{
freezerItemStacks[0] = null;
}
}
private int getItemFreezeTime(ItemStack itemstack)
{
if(itemstack == null)
{
return 0;
}
int i = itemstack.getItem().shiftedIndex;
if (i == Item.redstone.shiftedIndex)
{
return 400;
}
else
{
return 0;
}
}
public boolean canInteractWith(EntityPlayer entityplayer)
{
if(worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this)
{
return false;
}
return entityplayer.getDistanceSq((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64D;
}
public void openChest()
{
}
public void closeChest()
{
}
private boolean canSolidify2()//needs to be copied so the game checks both output slots
{
if(freezerItemStacks[0] == null)
{
return false;
}
ItemStack [] itemstack = FreezerRecipes.solidifying().getSolidifyingResult2Out(freezerItemStacks[0].getItem().shiftedIndex);
if(itemstack == null)
{
return false;
}
if(freezerItemStacks[2] == null && freezerItemStacks[3] == null)
{
return true;
}
if(!freezerItemStacks[2].isItemEqual(itemstack[0]) || !freezerItemStacks[3].isItemEqual(itemstack[1]))//checks if the items in the output slots are equal to the ones that will be added
{
return false;
}
if(freezerItemStacks[2].stackSize < getInventoryStackLimit() && freezerItemStacks[2].stackSize < freezerItemStacks[2].getMaxStackSize() && freezerItemStacks[3].stackSize < getInventoryStackLimit() && freezerItemStacks[3].stackSize < freezerItemStacks[3].getMaxStackSize())//checks the stack limit of both output slots
{
return true;
}
return freezerItemStacks[2].stackSize < itemstack[0].getMaxStackSize() && freezerItemStacks[3].stackSize < itemstack[1].getMaxStackSize();
}
public void solidifyItem2()
{
if(!canSolidify2())
{
return;
}
ItemStack [] itemstack = FreezerRecipes.solidifying().getSolidifyingResult2Out(freezerItemStacks[0].getItem().shiftedIndex);
if(freezerItemStacks[2] == null)
{
freezerItemStacks[2] = itemstack[0].copy();
} else
if(freezerItemStacks[2].itemID == itemstack[0].itemID)
{
freezerItemStacks[2].stackSize += itemstack[0].stackSize;
}
if(freezerItemStacks[3] == null)//this is so that the game knows to add the solidified item in the second output slot
{
freezerItemStacks[3] = itemstack[1].copy();
} else
if(freezerItemStacks[3].itemID == itemstack[1].itemID)//so is this
{
freezerItemStacks[3].stackSize += itemstack[1].stackSize;
}
if(freezerItemStacks[0].getItem().hasContainerItem())
{
freezerItemStacks[0] = new ItemStack(freezerItemStacks[0].getItem().getContainerItem());
} else
{
freezerItemStacks[0].stackSize--;
}
if(freezerItemStacks[0].stackSize <= 0)
{
freezerItemStacks[0] = null;
}
}
private ItemStack freezerItemStacks[];
public int freezerFreezeTime;
public int currentItemCoolTime;
public int freezerCoolTime;
}
Did you modify the TileEntityFreezer or is it the same as the one in the finished code?
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Currently everything is the same except for variable names, the canInteractWith method (mine just returns true always at the moment) and the getStackInSlot method, I was having null pointer exceptions when I was doing stuff with it so I changed it to this
*edit* actually, it would probably help to mention that I have my tileentity tied to a livingentity rather than a block. and it's probably caused by the living entity not writing or reading the tileentity properly from the nbt, sadly I don't know how to fix that D:
Fixed it!
Could you explain how you did it because I'd love to know in case something like that happens to me in the future. Also, what do you mean it's tied to a living entity? Do you mean that your furnace is a living mob or what?
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Exactly, I made a mob that extends entityliving, which has a tileentity has a variable so when you rightclick on the mob it brings up its own inventory/furnace setup. The problem was that when the entityliving was saved to nbt, it wasn't saving the tileentity variable, so i took the code from the tileentity's read and write functions and stuck them in the entityliving's read and write functions
Thanks for explaining and that's a pretty good idea, a mob with it's own furnace setup.
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
these are the errors i get
error 1
2011-09-24 15:12 - commands.recompile - ERROR -
2011-09-24 15:12 - commands.recompile - ERROR - warning: [options] bootstrap class path not set in conjunction with -source 1.6
2011-09-24 15:12 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_XXX.java:9: error: cannot find symbol
2011-09-24 15:12 - commands.recompile - ERROR - public static final Block Freezer;
2011-09-24 15:12 - commands.recompile - ERROR - ^
2011-09-24 15:12 - commands.recompile - ERROR -
error 2
2011-09-24 15:12 - commands.recompile - ERROR -
2011-09-24 15:12 - commands.recompile - ERROR - symbol: class Block
2011-09-24 15:12 - commands.recompile - ERROR - location: class mod_XXX
2011-09-24 15:12 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_XXX.java:1: error: duplicate class: mod_XXX
2011-09-24 15:12 - commands.recompile - ERROR - public class mod_XXX extends BaseMod{
2011-09-24 15:12 - commands.recompile - ERROR - ^
2011-09-24 15:12 - commands.recompile - ERROR -
error 3
2011-09-24 15:12 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\BlockFreezer.java:69: error: cannot access mod_XXX
2011-09-24 15:12 - commands.recompile - ERROR - return mod_XXX.freezSide;
2011-09-24 15:12 - commands.recompile - ERROR - ^
2011-09-24 15:12 - commands.recompile - ERROR -
all the errors together
2011-09-24 15:12 - commands.recompile - ERROR - javac.exe -g -source 1.6 -target 1.6 -classpath "lib/;lib/*;jars/bin/minecraft.jar;jars/bin/jinput.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d bin/minecraft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minecraft\isom\*.java src/minecraft\net\minecraft\src\*.java conf/patches/*.java failed.
2011-09-24 15:12 - commands.recompile - ERROR - Return code : 1
2011-09-24 15:12 - commands.recompile - ERROR -
2011-09-24 15:12 - commands.recompile - ERROR - == ERRORS FOUND ==
2011-09-24 15:12 - commands.recompile - ERROR -
2011-09-24 15:12 - commands.recompile - ERROR - warning: [options] bootstrap class path not set in conjunction with -source 1.6
2011-09-24 15:12 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_XXX.java:9: error: cannot find symbol
2011-09-24 15:12 - commands.recompile - ERROR - public static final Block Freezer;
2011-09-24 15:12 - commands.recompile - ERROR - ^
2011-09-24 15:12 - commands.recompile - ERROR -
2011-09-24 15:12 - commands.recompile - ERROR - symbol: class Block
2011-09-24 15:12 - commands.recompile - ERROR - location: class mod_XXX
2011-09-24 15:12 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_XXX.java:1: error: duplicate class: mod_XXX
2011-09-24 15:12 - commands.recompile - ERROR - public class mod_XXX extends BaseMod{
2011-09-24 15:12 - commands.recompile - ERROR - ^
2011-09-24 15:12 - commands.recompile - ERROR -
2011-09-24 15:12 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\BlockFreezer.java:69: error: cannot access mod_XXX
2011-09-24 15:12 - commands.recompile - ERROR - return mod_XXX.freezSide;
2011-09-24 15:12 - commands.recompile - ERROR - ^
2011-09-24 15:12 - commands.recompile - ERROR -
2011-09-24 15:12 - commands.recompile - ERROR - bad source file: src\minecraft\net\minecraft\src\mod_XXX.java
2011-09-24 15:12 - commands.recompile - ERROR - file does not contain class net.minecraft.src.mod_XXX
2011-09-24 15:12 - commands.recompile - ERROR - Please remove or make sure it appears in the correct subdirectory of the sourcepath.
2011-09-24 15:12 - commands.recompile - ERROR - 3 errors
2011-09-24 15:12 - commands.recompile - ERROR - 1 warning
2011-09-24 15:12 - commands.recompile - ERROR - ==================
2011-09-24 15:12 - commands.recompile - ERROR -
2011-09-24 15:12 - commands.checksources - WARNING - !! Can not find server sources !!
public static final Block freezer;
to
public static final Blockfreezer;
and i got one error,
2011-09-24 15:10 - commands.recompile - ERROR - Return code : 1
2011-09-24 15:10 - commands.recompile - ERROR -
2011-09-24 15:10 - commands.recompile - ERROR - == ERRORS FOUND ==
2011-09-24 15:10 - commands.recompile - ERROR -
2011-09-24 15:10 - commands.recompile - ERROR - warning: [options] bootstrap class path not set in conjunction with -source 1.6
2011-09-24 15:10 - commands.recompile - ERROR - src\minecraft\net\minecraft\src\mod_XXX.java:9: error: <identifier> expected
2011-09-24 15:10 - commands.recompile - ERROR - public static final Blockfreezer;
2011-09-24 15:10 - commands.recompile - ERROR - ^
2011-09-24 15:10 - commands.recompile - ERROR -
2011-09-24 15:10 - commands.recompile - ERROR - 1 error
2011-09-24 15:10 - commands.recompile - ERROR - 1 warning
2011-09-24 15:10 - commands.recompile - ERROR - ==================
2011-09-24 15:10 - commands.recompile - ERROR -
2011-09-24 15:10 - commands.checksources - WARNING - !! Can not find server sources !!
please help
It has to be because with this code you are stating that freezer is a block. What .bat file did you run to get these results because when I run recompile.bat it looks a bit different. Can you post your mod_XXX? Remember to use code tags ["code"]["/code"] (without the ") for your code and errors because it's easier to read.
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Message me for custom mod/plugin requests
Bookmarked. :smile.gif:
It isn't fully implemented yet, but I'm using it for my golem mod, wherein the golem is coal powered and eats up coal like the furnace does
And now I'm having a rather strange bug that I'm hoping you can help with. I added a guibutton to my whatevergui class, and when I have the initGui method in there it messes up all of the slots. It doesn't matter if initGui is empty or full of code, it always does this. What I mean when I say it messes them up, is that each slot is treated as the slot 4 slots before it (reading left to right, top to bottom), so clicking on a slot picks up whatever items are in that other slot not the one being hovered over D:
And I fixed it by taking out the initgui method and just having an updategui method thats called when the gui is first made as well as when it should be updating :tongue.gif:
BlockFreezer
ContainerFreezer
FreezerRecipes
GuiFreezer
mod_XXX
SlotFreezer
TileEntityFreezer
Error
Thanks for helping, and yes that is the reason. If you don't put the package statement the compiler doesn't know where to look for the classes that you are calling.
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
You always seem to fix the errors before I'm even able to take a look at them :laugh.gif:
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
I'm starting that tutorial today, actually, but I'm not positive when I'll have it fully working.
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
You can do that, but I wouldn't because it would be cheating and mods like that already exist.
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
If you are using this tutorial I assume you already have your furnace block finished and working. I will be basing this tutorial off of my first furnace tutorial, that's why I'm using the freezer as my furnace block. In this tutorial I am showing how to add another output slot, if you want more output slots you have to just add another copy of what I added.
What you will need to edit:
- ContainerYOURFURNACE
- YOURFURNACERecipes
- TileEntityYOURFURNACE
ContainerYOURFURNACE
In this file you specify the slots. The syntax for a slot goes like this: If you have 0 for the x and the y position then you are pointing at the top left corner. The position your are specifying with the x and y positions is the top left corner of the white square you see when you mouse over a slot.
I put the second output slot slightly to the left of the first.
Finished code:
YOURFURNACERecipes
In this file you are going to make the the adding of double output recipes work. There are a couple of methods you are going to have to copy and some code you are going to have to add. First add another hashmap at the bottom of the file like this: then initialize it in the constructor like so: If you forget to do this, then the game won't realize that you added any recipes. Now you have to make your addRecipes method. To do this copy the existing one and rename it. Now, you want the recipe to have two outcome items, but hashmap.put only excepts two objects, you need 3. For this I added a method called doubleItem which converts two instances of ItemStack into an ItemStack array. All the copied and added fields/methods have a 2 in them (except for the method doubleItem) so that you know which ones to copy/add. The rest I'm going to explain in code comments.
Finished code:
TileEntityYOURFURNACE
There are a couple of methods that you have to copy and one or two you have to edit in this file. One important thing you have to be aware of is this line of code in the constructor: The number is the amount of slots that your furnace has. The original furnace has 3. All the copied methods have a 2 in their names so that you know which ones to copy. I'm now going to just lay the code on you and explain in the code comments.
Finished code:
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua