Any ideas on how to render a meter type-thing on a GUI (sorta like a furnace fire charge bit)? I need to create a charge meter and whilst doing so I need to render part of my GUI image onto the GUI. What code do I use and where?
EDIT: I'm using the following code to work out charge level in pixels based on a percentage value then rendering it, but it keeps returning 0.
int barHeight = 32;
int chargeMeter = 50; //Charge %
int chargePx = Math.round(barHeight * (chargeMeter / 100));
this.drawTexturedModalRect(x + 20, y + 16, 176, 16, 16, chargePx);
This charge level (50%) should return 16 but it just doesn't.
Any ideas?
Any ideas on how to render a meter type-thing on a GUI (sorta like a furnace fire charge bit)? I need to create a charge meter and whilst doing so I need to render part of my GUI image onto the GUI. What code do I use and where?
EDIT: I'm using the following code to work out charge level in pixels based on a percentage value then rendering it, but it keeps returning 0.
int barHeight = 32;
int chargeMeter = 50; //Charge %
int chargePx = Math.round(barHeight * (chargeMeter / 100));
this.drawTexturedModalRect(x + 20, y + 16, 176, 16, 16, chargePx);
This charge level (50%) should return 16 but it just doesn't.
Any ideas?
That actually looks like it should at least display, except try changing chargePx to a float. I think you're having a deprecation issue.
Rollback Post to RevisionRollBack
Learn some Java before you mod, and skip over the chapter on ModLoader, straight to MinecraftForge. It's better. Trust me.
I'm wondering if someone can help me with a coding problem.
I have been through the GUI tutorial here, other's tutorials both written and video, and I have looked through the code to compare against stuff like the "Sign" Block to try and get this working.
Before Minecraft 1.3.2, I had this working fine with ModLoader. People using Forge would have a similar problem to what I'll explain but it was working for ModLoader before Minecraft 1.3.2. At that point, I couldn't get it to work for either ModLoader or Forge. I have since basically done a conversion over to Forge but I still cannot get this one portion to work (currently attempting with Minecraft 1.4.2 code).
The problem is that I have my own version of "Wireless Redstone" Blocks but I can no longer get the "Frequency" to be "remembered" when the block is either activated or deactivated or after exiting the world.
I can get the GUI to come up and I can change the frequency. If I go back into the GUI, that frequency is still there unless I activated/deactivated the block.
I do use two separate Block IDs to represents both the Idle and Active states of the blocks. And, note that I do not implement an actual "container" anywhere since I don't need (at least, I haven't in the past) to store something like an item list.
And, yes, I am using an NBT Tag to try and store the frequency.
This second version seemed to work better as I can use a "System.out" that shows it made it to that method. But, it doesn't seem to get there with the first version. Either way, the same general problem exists.
" Class">
public class mod_CircuitCubes
{
@Instance( "Spencer_Circuit_Cubes" )
public static mod_CircuitCubes instance = new mod_CircuitCubes();
@SidedProxy( clientSide = "net.minecraft.src.CCubeClientProxy", serverSide = "net.minecraft.src.CCubeCommonProxy" )
public static CCubeCommonProxy proxy = new CCubeCommonProxy();
private static CCubeGUIHandler ccubeGUIHandler = new CCubeGUIHandler();
The blocks themselves are all registered just fine and have their names and textures, etc, etc, etc. It's just the "frequency" stuff I'm struggling with.
I have also tried removing the "getDescriptionPacket" method with no luck.
Server Packet Handler ("CCubeServerPacketHandler"; Does Nothing):
public class CCubeServerPacketHandler implements IPacketHandler
{
@Override
public void onPacketData( INetworkManager manager, Packet250CustomPayload packet, Player player )
{
DataInputStream data = new DataInputStream(new ByteArrayInputStream( packet.data ) );
EntityPlayer sender = (EntityPlayer)player;
// System.out.println( "Made It To onPacketData in CCubeServerPacketHander!" );
return;
}
}
")">
public class CCubeClientPacketHandler implements IPacketHandler
{
@Override
public void onPacketData( INetworkManager manager, Packet250CustomPayload packet, Player player )
{
DataInputStream inputStream = new DataInputStream( new ByteArrayInputStream( packet.data ) );
System.out.println( "Made It To onPacketData in CCubeClientPacketHander!" );
return;
}
}
")">
public class CCubeGUIHandler implements IGuiHandler
{
@Override
public Object getServerGuiElement( int ID, EntityPlayer player, World world, int x, int y, int z )
{
return null;
}
@Override
public Object getClientGuiElement( int ID, EntityPlayer player, World world, int x, int y, int z )
{
TileEntityCircuitCube tecc = (TileEntityCircuitCube)world.getBlockTileEntity( x, y, z );
if ( tecc instanceof TileEntityCircuitCube )
{
// return new GuiEditCCubeWireless( (TileEntityCircuitCube)te );
return new GuiEditCCubeWireless( tecc );
}
return null;
}
}
But, again, the GUI itself appears to work fine. Except when wanting to save the frequency.
")">
public class CCubeCommonProxy
{
public static String CIRCUIT_CUBES_PNG = "/Circuit Cubes/Circuit Cubes.png";
public void registerRenderers(){}; // Circuit Cubes
}
")">
public class CCubeClientProxy extends CCubeCommonProxy
{
@Override
public void registerRenderers()
{
MinecraftForgeClient.preloadTexture( CIRCUIT_CUBES_PNG );
}
}
public class BlockCBlockWireless extends BlockContainer
{
private static Class circuitCubeEntityClass;
public static enum WirelessTypes { NONWIRELESS, TRANSMITTER, RECEIVER, TRANSCEIVER };
public WirelessTypes wirelessType = WirelessTypes.NONWIRELESS;
protected BlockCBlockWireless( int i, Material material, WirelessTypes chosenType )
{
super( i, material );
wirelessType = chosenType;
circuitCubeEntityClass = net.minecraft.src.TileEntityCircuitCube.class;
}
protected BlockCBlockWireless( int i, Material material, Class teClass, WirelessTypes chosenType )
{
super( i, material );
wirelessType = chosenType;
circuitCubeEntityClass = teClass;
}
@Override
public String getTextureFile()
{
return this.currentTexture;
}
@Override
public int getBlockTextureFromSide( int par1 )
{
return blockIndexInTexture;
}
@Override
public boolean hasTileEntity()
{
return true;
}
@Override
public TileEntityCircuitCube createNewTileEntity( World world )
{
try
{
return new TileEntityCircuitCube();
}
catch (Exception exception)
{
throw new RuntimeException( exception );
}
}
@Override
public boolean onBlockActivated( World world, int x, int y, int z, EntityPlayer ep, int par6, float par7, float par8, float par9 )
{
TileEntityCircuitCube tecc = (TileEntityCircuitCube)world.getBlockTileEntity( x, y, z );
if ( tecc == null || ep.isSneaking() )
{
return false;
}
if ( ep != null)
{
System.out.println( "Block Activated Freq. ID (1): " + tecc.freqID );
ep.openGui( mod_CircuitCubes.instance, 0, world, x, y, z );
tecc = (TileEntityCircuitCube)world.getBlockTileEntity( x, y, z );
System.out.println( "Block Activated Freq. ID (2): " + tecc.freqID );
}
return true;
}
}
One thing to note is that it appears to always do the "onBlockActivated" method twice. It will display the before and after frequency and then display them again but this time display nothing.
I appreciate any time and help that can be given and I thank you in advance.
I will be out of town (and away from my code etc) for a bit because of the Thanksgiving holiday. But, I should still be able to read and respond to any replies.
I'm wondering if someone can help me with a coding problem.
I have been through the GUI tutorial here, other's tutorials both written and video, and I have looked through the code to compare against stuff like the "Sign" Block to try and get this working.
Before Minecraft 1.3.2, I had this working fine with ModLoader. People using Forge would have a similar problem to what I'll explain but it was working for ModLoader before Minecraft 1.3.2. At that point, I couldn't get it to work for either ModLoader or Forge. I have since basically done a conversion over to Forge but I still cannot get this one portion to work (currently attempting with Minecraft 1.4.2 code).
The problem is that I have my own version of "Wireless Redstone" Blocks but I can no longer get the "Frequency" to be "remembered" when the block is either activated or deactivated or after exiting the world.
I can get the GUI to come up and I can change the frequency. If I go back into the GUI, that frequency is still there unless I activated/deactivated the block.
I do use two separate Block IDs to represents both the Idle and Active states of the blocks. And, note that I do not implement an actual "container" anywhere since I don't need (at least, I haven't in the past) to store something like an item list.
And, yes, I am using an NBT Tag to try and store the frequency.
This second version seemed to work better as I can use a "System.out" that shows it made it to that method. But, it doesn't seem to get there with the first version. Either way, the same general problem exists.
" Class">
public class mod_CircuitCubes
{
@Instance( "Spencer_Circuit_Cubes" )
public static mod_CircuitCubes instance = new mod_CircuitCubes();
@SidedProxy( clientSide = "net.minecraft.src.CCubeClientProxy", serverSide = "net.minecraft.src.CCubeCommonProxy" )
public static CCubeCommonProxy proxy = new CCubeCommonProxy();
private static CCubeGUIHandler ccubeGUIHandler = new CCubeGUIHandler();
The blocks themselves are all registered just fine and have their names and textures, etc, etc, etc. It's just the "frequency" stuff I'm struggling with.
I have also tried removing the "getDescriptionPacket" method with no luck.
Server Packet Handler ("CCubeServerPacketHandler"; Does Nothing):
public class CCubeServerPacketHandler implements IPacketHandler
{
@Override
public void onPacketData( INetworkManager manager, Packet250CustomPayload packet, Player player )
{
DataInputStream data = new DataInputStream(new ByteArrayInputStream( packet.data ) );
EntityPlayer sender = (EntityPlayer)player;
// System.out.println( "Made It To onPacketData in CCubeServerPacketHander!" );
return;
}
}
")">
public class CCubeClientPacketHandler implements IPacketHandler
{
@Override
public void onPacketData( INetworkManager manager, Packet250CustomPayload packet, Player player )
{
DataInputStream inputStream = new DataInputStream( new ByteArrayInputStream( packet.data ) );
System.out.println( "Made It To onPacketData in CCubeClientPacketHander!" );
return;
}
}
")">
public class CCubeGUIHandler implements IGuiHandler
{
@Override
public Object getServerGuiElement( int ID, EntityPlayer player, World world, int x, int y, int z )
{
return null;
}
@Override
public Object getClientGuiElement( int ID, EntityPlayer player, World world, int x, int y, int z )
{
TileEntityCircuitCube tecc = (TileEntityCircuitCube)world.getBlockTileEntity( x, y, z );
if ( tecc instanceof TileEntityCircuitCube )
{
// return new GuiEditCCubeWireless( (TileEntityCircuitCube)te );
return new GuiEditCCubeWireless( tecc );
}
return null;
}
}
But, again, the GUI itself appears to work fine. Except when wanting to save the frequency.
")">
public class CCubeCommonProxy
{
public static String CIRCUIT_CUBES_PNG = "/Circuit Cubes/Circuit Cubes.png";
public void registerRenderers(){}; // Circuit Cubes
}
")">
public class CCubeClientProxy extends CCubeCommonProxy
{
@Override
public void registerRenderers()
{
MinecraftForgeClient.preloadTexture( CIRCUIT_CUBES_PNG );
}
}
public class BlockCBlockWireless extends BlockContainer
{
private static Class circuitCubeEntityClass;
public static enum WirelessTypes { NONWIRELESS, TRANSMITTER, RECEIVER, TRANSCEIVER };
public WirelessTypes wirelessType = WirelessTypes.NONWIRELESS;
protected BlockCBlockWireless( int i, Material material, WirelessTypes chosenType )
{
super( i, material );
wirelessType = chosenType;
circuitCubeEntityClass = net.minecraft.src.TileEntityCircuitCube.class;
}
protected BlockCBlockWireless( int i, Material material, Class teClass, WirelessTypes chosenType )
{
super( i, material );
wirelessType = chosenType;
circuitCubeEntityClass = teClass;
}
@Override
public String getTextureFile()
{
return this.currentTexture;
}
@Override
public int getBlockTextureFromSide( int par1 )
{
return blockIndexInTexture;
}
@Override
public boolean hasTileEntity()
{
return true;
}
@Override
public TileEntityCircuitCube createNewTileEntity( World world )
{
try
{
return new TileEntityCircuitCube();
}
catch (Exception exception)
{
throw new RuntimeException( exception );
}
}
@Override
public boolean onBlockActivated( World world, int x, int y, int z, EntityPlayer ep, int par6, float par7, float par8, float par9 )
{
TileEntityCircuitCube tecc = (TileEntityCircuitCube)world.getBlockTileEntity( x, y, z );
if ( tecc == null || ep.isSneaking() )
{
return false;
}
if ( ep != null)
{
System.out.println( "Block Activated Freq. ID (1): " + tecc.freqID );
ep.openGui( mod_CircuitCubes.instance, 0, world, x, y, z );
tecc = (TileEntityCircuitCube)world.getBlockTileEntity( x, y, z );
System.out.println( "Block Activated Freq. ID (2): " + tecc.freqID );
}
return true;
}
}
One thing to note is that it appears to always do the "onBlockActivated" method twice. It will display the before and after frequency and then display them again but this time display nothing.
I appreciate any time and help that can be given and I thank you in advance.
I will be out of town (and away from my code etc) for a bit because of the Thanksgiving holiday. But, I should still be able to read and respond to any replies.
I officially give this tutorial to drrinfernoo like I am never on this anymore but its still a hot topic, and it needs to be monitored for people that need help.. and I trust drinfernoo enough that I am doing this, so basically ask him for help not me... although I might be on here every once and a while to help out.. drinfernoo if your not willing to do this, just message me
I officially give this tutorial to drrinfernoo like I am never on this anymore but its still a hot topic, and it needs to be monitored for people that need help.. and I trust drinfernoo enough that I am doing this, so basically ask him for help not me... although I might be on here every once and a while to help out.. drinfernoo if your not willing to do this, just message me
Well, I can help I suppose I'm not perfect, butI'll do what I can
Rollback Post to RevisionRollBack
Learn some Java before you mod, and skip over the chapter on ModLoader, straight to MinecraftForge. It's better. Trust me.
I officially give this tutorial to drrinfernoo like I am never on this anymore but its still a hot topic, and it needs to be monitored for people that need help.. and I trust drinfernoo enough that I am doing this, so basically ask him for help not me... although I might be on here every once and a while to help out.. drinfernoo if your not willing to do this, just message me
Ugh, but drinfernoo just stated that he's not sure either!
alright its going up today, sorry about yesterday something came up....but im sick today so its going up today
Hi sorry about the post yesterday I meant drinfernoo. really sorry I'm new at posting and I forgot to leave in his comment before I replied again I'm really sorry for the confusion.
and the sever name is japura.net
Hi sorry about the post yesterday I meant drinfernoo. really sorry I'm new at posting and I forgot to leave in his comment before I replied again I'm really sorry for the confusion.
and the sever name is japura.net
Oh, nope. I have only played on one server, once, and it was a pirate server from when I was first trying the game before I bought it legitimately.
Rollback Post to RevisionRollBack
Learn some Java before you mod, and skip over the chapter on ModLoader, straight to MinecraftForge. It's better. Trust me.
Sorry for the late post, but I have an issue with a part of the code:
This line:
public boolean isUseableByPlayer(EntityPlayer player){
gets this error in eclipse:
Multiple markers at this line
- implements net.minecraft.inventory.IInventory.isUseableByPlayer
- Duplicate method isUseableByPlayer(EntityPlayer) in type
TileEntityBoiler
Any ideas?
My package is
package flaxbeard.steamcraft.common:
does that matter?
Rollback Post to RevisionRollBack
I mod things. Check me out on twitter or on Espernet IRC at #TheSteamTank
Sorry for the late post, but I have an issue with a part of the code:
This line:
public boolean isUseableByPlayer(EntityPlayer player){
gets this error in eclipse:
Multiple markers at this line
- implements net.minecraft.inventory.IInventory.isUseableByPlayer
- Duplicate method isUseableByPlayer(EntityPlayer) in type
TileEntityBoiler
Any ideas?
My package is
package flaxbeard.steamcraft.common:
does that matter?
It shouldn't matter that your package is different, as long as your imports are all good. It sort of looks like you have the method defined twice, or possibly it isn't overriding it for some reason...
Any way you could post your code, or link to it? If you post it, please use code tags and spoilers.
Rollback Post to RevisionRollBack
Learn some Java before you mod, and skip over the chapter on ModLoader, straight to MinecraftForge. It's better. Trust me.
It shouldn't matter that your package is different, as long as your imports are all good. It sort of looks like you have the method defined twice, or possibly it isn't overriding it for some reason...
Any way you could post your code, or link to it? If you post it, please use code tags and spoilers.
Well, I sort of gave up on that and I'm trying a hybrid approach, I changed everything to the furnace code but now I'm having trouble getting my gui to open. The furnace also switches to the actual furnace and disregards my code when I start to smelt something. Here's my code (I have to import everything for some reason, not bad, just annoying):
TheBlock
package tutorials;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TheBlock extends BlockContainer
{
/**
* Is the random generator used by furnace to drop the inventory contents in random directions.
*/
private 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 = false;
protected TheBlock(int par1, boolean par2)
{
super(par1, Material.rock);
this.isActive = par2;
this.blockIndexInTexture = 45;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return TutorialMod.tutorialBlock.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 var5 = par1World.getBlockId(par2, par3, par4 - 1);
int var6 = par1World.getBlockId(par2, par3, par4 + 1);
int var7 = par1World.getBlockId(par2 - 1, par3, par4);
int var8 = par1World.getBlockId(par2 + 1, par3, par4);
byte var9 = 3;
if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6])
{
var9 = 3;
}
if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5])
{
var9 = 2;
}
if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8])
{
var9 = 5;
}
if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7])
{
var9 = 4;
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, var9);
}
}
@SideOnly(Side.CLIENT)
/**
* Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
*/
public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
if (par5 == 1)
{
return this.blockIndexInTexture + 17;
}
else if (par5 == 0)
{
return this.blockIndexInTexture + 17;
}
else
{
int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
return par5 != var6 ? this.blockIndexInTexture : (this.isActive ? this.blockIndexInTexture + 16 : this.blockIndexInTexture - 1);
}
}
@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 var6 = par1World.getBlockMetadata(par2, par3, par4);
float var7 = (float)par2 + 0.5F;
float var8 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F;
float var9 = (float)par4 + 0.5F;
float var10 = 0.52F;
float var11 = par5Random.nextFloat() * 0.6F - 0.3F;
if (var6 == 4)
{
par1World.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
}
else if (var6 == 5)
{
par1World.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
}
else if (var6 == 2)
{
par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D);
}
else if (var6 == 3)
{
par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D);
}
}
}
/**
* Returns the block texture based on the side being looked at. Args: side
*/
public int getBlockTextureFromSide(int par1)
{
return par1 == 1 ? this.blockIndexInTexture + 17 : (par1 == 0 ? this.blockIndexInTexture + 17 : (par1 == 3 ? this.blockIndexInTexture - 1 : this.blockIndexInTexture));
}
/**
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float f, float g, float t){
// Just making an instance of the TileEntity that the player clicked on
TileEntity tile_entity = world.getBlockTileEntity(x, y, z);
// Checking if the TileEntity is nothing or if the player is sneaking
if(tile_entity == null || player.isSneaking()){
// Returns false so it doesn't update anything
return false;
}
// opens the UI if the later is not met, the method player.openGui() has 6 params
// @param TutorialMod.instance, is just the instance of the TutorialMod
// @param 0, this is the UI id, this can be changed in the GUI handler, and will open a different UI if chosen to do so
// @param x, y, z, the players current player x, y, z coords
player.openGui(TutorialMod.instance, 0, world, x, y, z);
// Returns true to force an update
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 var5 = par1World.getBlockMetadata(par2, par3, par4);
TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4);
keepFurnaceInventory = true;
keepFurnaceInventory = false;
par1World.setBlockMetadataWithNotify(par2, par3, par4, var5);
if (var6 != null)
{
var6.validate();
par1World.setBlockTileEntity(par2, par3, par4, var6);
}
}
/**
* Returns a new instance of a block's tile entity class. Called on placing the block.
*/
public TileEntity createNewTileEntity(World par1World)
{
return new TileEntityFurnace();
}
/**
* Called when the block is placed in the world.
*/
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if (var6 == 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2);
}
if (var6 == 1)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 5);
}
if (var6 == 2)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3);
}
if (var6 == 3)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4);
}
}
/**
* ejects contained items into the world, and notifies neighbours of an update, as appropriate
*/
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
{
if (!keepFurnaceInventory)
{
TileEntityFurnace var7 = (TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4);
if (var7 != null)
{
for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8)
{
ItemStack var9 = var7.getStackInSlot(var8);
if (var9 != null)
{
float var10 = this.furnaceRand.nextFloat() * 0.8F + 0.1F;
float var11 = this.furnaceRand.nextFloat() * 0.8F + 0.1F;
float var12 = this.furnaceRand.nextFloat() * 0.8F + 0.1F;
while (var9.stackSize > 0)
{
int var13 = this.furnaceRand.nextInt(21) + 10;
if (var13 > var9.stackSize)
{
var13 = var9.stackSize;
}
var9.stackSize -= var13;
EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage()));
if (var9.hasTagCompound())
{
var14.func_92014_d().setTagCompound((NBTTagCompound)var9.getTagCompound().copy());
}
float var15 = 0.05F;
var14.motionX = (double)((float)this.furnaceRand.nextGaussian() * var15);
var14.motionY = (double)((float)this.furnaceRand.nextGaussian() * var15 + 0.2F);
var14.motionZ = (double)((float)this.furnaceRand.nextGaussian() * var15);
par1World.spawnEntityInWorld(var14);
}
}
}
}
}
super.breakBlock(par1World, par2, par3, par4, par5, par6);
}
}
TutorialMod
package tutorials;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "mod", name = "The Tutorial Mod", version = "0.0")
@NetworkMod(clientSideRequired=true, serverSideRequired=false, clientPacketHandlerSpec = @SidedPacketHandler(channels = {"TutorialMod" }, packetHandler = ClientPacketHandler.class),
serverPacketHandlerSpec =@SidedPacketHandler(channels = {"TutorialMod" }, packetHandler = ServerPacketHandler.class))
public class TutorialMod {
@Instance
public static TutorialMod instance = new TutorialMod();
private GuiHandler guiHandler = new GuiHandler();
public static Block tutorialBlock;
@SidedProxy(clientSide = "tutorials.ClientProxy", serverSide = "tutorials.CommonProxy")
public static CommonProxy proxy;
@Init
public void load(FMLInitializationEvent event){
tutorialBlock = new TheBlock(243, false).setBlockName("blockTutorial");
GameRegistry.registerTileEntity(TileTutorial.class, "tileEntityTutorial");
GameRegistry.registerBlock(tutorialBlock);
GameRegistry.addRecipe(new ItemStack(this.tutorialBlock, 1), new Object[]{
" ", " X ", " ", Character.valueOf('X'), Block.obsidian
});
proxy.registerRenderThings();
LanguageRegistry.addName(tutorialBlock, "Tutorial Block");
NetworkRegistry.instance().registerGuiHandler(this, guiHandler);
}
}
TileTutorial
package tutorials;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFurnace;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
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.tileentity.TileEntity;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ISidedInventory;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TileTutorial extends TileEntity implements IInventory, ISidedInventory
{
/**
* The ItemStacks that hold the items currently being used in the furnace
*/
private ItemStack[] furnaceItemStacks = new ItemStack[3];
/** The number of ticks that the furnace will keep burning */
public int furnaceBurnTime = 0;
/**
* The number of ticks that a fresh copy of the currently-burning item would keep the furnace burning for
*/
public int currentItemBurnTime = 0;
/** The number of ticks that the current item has been cooking for */
public int furnaceCookTime = 0;
/**
* 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 var3;
if (this.furnaceItemStacks[par1].stackSize <= par2)
{
var3 = this.furnaceItemStacks[par1];
this.furnaceItemStacks[par1] = null;
return var3;
}
else
{
var3 = this.furnaceItemStacks[par1].splitStack(par2);
if (this.furnaceItemStacks[par1].stackSize == 0)
{
this.furnaceItemStacks[par1] = null;
}
return var3;
}
}
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 var2 = this.furnaceItemStacks[par1];
this.furnaceItemStacks[par1] = null;
return var2;
}
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 "container.furnace";
}
/**
* 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 var1 = this.furnaceBurnTime > 0;
boolean var2 = 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)
{
var2 = 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();
var2 = true;
}
}
else
{
this.furnaceCookTime = 0;
}
if (var1 != this.furnaceBurnTime > 0)
{
var2 = true;
//TheBlock.updateFurnaceBlockState(this.furnaceBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
}
}
if (var2)
{
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 var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
if (var1 == null) return false;
if (this.furnaceItemStacks[2] == null) return true;
if (!this.furnaceItemStacks[2].isItemEqual(var1)) return false;
int result = furnaceItemStacks[2].stackSize + var1.stackSize;
return (result <= getInventoryStackLimit() && result <= var1.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 var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
if (this.furnaceItemStacks[2] == null)
{
this.furnaceItemStacks[2] = var1.copy();
}
else if (this.furnaceItemStacks[2].isItemEqual(var1))
{
furnaceItemStacks[2].stackSize += var1.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 var1 = par0ItemStack.getItem().shiftedIndex;
Item var2 = par0ItemStack.getItem();
if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[var1] != null)
{
Block var3 = Block.blocksList[var1];
if (var3 == Block.woodSingleSlab)
{
return 150;
}
if (var3.blockMaterial == Material.wood)
{
return 300;
}
}
if (var2 instanceof ItemTool && ((ItemTool) var2).getToolMaterialName().equals("WOOD")) return 200;
if (var2 instanceof ItemSword && ((ItemSword) var2).func_77825_f().equals("WOOD")) return 200;
if (var2 instanceof ItemHoe && ((ItemHoe) var2).func_77842_f().equals("WOOD")) return 200;
if (var1 == Item.stick.shiftedIndex) return 100;
if (var1 == Item.coal.shiftedIndex) return 1600;
if (var1 == Item.bucketLava.shiftedIndex) return 20000;
if (var1 == Block.sapling.blockID) return 100;
if (var1 == Item.blazeRod.shiftedIndex) 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 int getStartInventorySide(ForgeDirection side)
{
if (side == ForgeDirection.DOWN) return 1;
if (side == ForgeDirection.UP) return 0;
return 2;
}
@Override
public int getSizeInventorySide(ForgeDirection side)
{
return 1;
}
}
GuiHandler
// This is my package declaration, do not mess with the standard (package net.minecraft.src;) like I did,
// Because I know what Im doing in this part, If you don't know what your doing keep it the normal (package net.minecraft.src;)
package tutorials;
// These are all the imports you will need
import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.src.*;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
// Create a class and implement IGuiHandler
public class GuiHandler implements IGuiHandler{
// This is a required method to open you Gui and has 6 params
// @param int id, this is the Gui Id
// @param EntityPlayer, this is the player declaration
// @param World, this is the world declaration
// @param int x, y, z this is the players current x, y, z coords
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z){
// This gets the TileEntity the player is currently activating
TileEntity tile_entity = world.getBlockTileEntity(x, y, z);
// This checks if the TileEntity is the TileTutorial
if(tile_entity instanceof TileTutorial){
// If it is it returns a new ContainerTutorial instance
return new ContainerTutorial(player.inventory, (TileTutorial) tile_entity);
}
// Returns null if not
return null;
}
// This is another required method to open the Gui and has 6 params
// @param int id, this is the Gui Id
// @param EntityPlayer, this is the player declaration
// @param World, this is the world declaration,
// @param int x, y, z this is the players current x, y, z coords
@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z){
// This gets the TIleEntity the player is currently activating
TileEntity tile_entity = world.getBlockTileEntity(x, y, z);
// This checks if the TileEntity is the TileTutorial
if(tile_entity instanceof TileTutorial){
// If it is it returns a new GuiTutorial instance
return new GuiTutorial(player.inventory, (TileTutorial) tile_entity);
}
// Returns null if not
return null;
}
}
GuiTutorial
package tutorials;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ContainerFurnace;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiTutorial extends GuiContainer
{
private TileTutorial furnaceInventory;
public GuiTutorial(InventoryPlayer par1InventoryPlayer, TileTutorial par2TileEntityFurnace)
{
super(new ContainerTutorial(par1InventoryPlayer, par2TileEntityFurnace));
this.furnaceInventory = par2TileEntityFurnace;
}
/**
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
//this.fontRenderer.drawString(StatCollector.translateToLocal("container.furnace"), 60, 6, 4210752);
//this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
/**
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int var4 = this.mc.renderEngine.getTexture("/gui/furnace.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(var4);
int var5 = (this.width - this.xSize) / 2;
int var6 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
int var7;
if (this.furnaceInventory.isBurning())
{
var7 = this.furnaceInventory.getBurnTimeRemainingScaled(12);
this.drawTexturedModalRect(var5 + 56, var6 + 36 + 12 - var7, 176, 12 - var7, 14, var7 + 2);
}
var7 = this.furnaceInventory.getCookProgressScaled(24);
this.drawTexturedModalRect(var5 + 79, var6 + 34, 176, 14, var7 + 1, 16);
}
}
Thanks for the help!
Rollback Post to RevisionRollBack
I mod things. Check me out on twitter or on Espernet IRC at #TheSteamTank
Hello I have copied this tutorial nearly word for word and I keep getting the following error everytime I try to open the Chest
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_11, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 894010464 bytes (852 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 11910 (666960 bytes; 0 MB) allocated, 3484 (195104 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63
FML: MCP v7.25 FML v4.6.17.515 Minecraft Forge 6.5.0.489 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
jwolff52_Minetopia [Minetopia] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
LWJGL: 2.4.2
OpenGL: Intel(R) HD Graphics 3000 GL version 3.1.0 - Build 9.17.10.2867, Intel
Is Modded: Definitely; Client brand changed to 'forge,fml'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: 1828 (102368 bytes; 0 MB) allocated, 560 (31360 bytes; 0 MB) used
java.lang.NullPointerException
at jwolff52.minetopia.TileEntityAlchemyChest.getStackInSlot(TileEntityAlchemyChest.java:24)
at net.minecraft.inventory.Slot.getStack(Slot.java:87)
at net.minecraft.client.gui.inventory.GuiContainer.drawSlotInventory(GuiContainer.java:315)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:107)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1004)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:882)
at net.minecraft.client.Minecraft.run(Minecraft.java:771)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT e8a4012c ----------
P.S. There is a lot more of an error report that is before this however it is just information about the world crash that the error causes, I can paste it if you like, but I dont think it is necessary.
Thanks for any help that can be given it would be much appreciated
EDIT: I'm using the following code to work out charge level in pixels based on a percentage value then rendering it, but it keeps returning 0.
This charge level (50%) should return 16 but it just doesn't.
Any ideas?
That actually looks like it should at least display, except try changing chargePx to a float. I think you're having a deprecation issue.
I have been through the GUI tutorial here, other's tutorials both written and video, and I have looked through the code to compare against stuff like the "Sign" Block to try and get this working.
Before Minecraft 1.3.2, I had this working fine with ModLoader. People using Forge would have a similar problem to what I'll explain but it was working for ModLoader before Minecraft 1.3.2. At that point, I couldn't get it to work for either ModLoader or Forge. I have since basically done a conversion over to Forge but I still cannot get this one portion to work (currently attempting with Minecraft 1.4.2 code).
The problem is that I have my own version of "Wireless Redstone" Blocks but I can no longer get the "Frequency" to be "remembered" when the block is either activated or deactivated or after exiting the world.
I can get the GUI to come up and I can change the frequency. If I go back into the GUI, that frequency is still there unless I activated/deactivated the block.
I do use two separate Block IDs to represents both the Idle and Active states of the blocks. And, note that I do not implement an actual "container" anywhere since I don't need (at least, I haven't in the past) to store something like an item list.
And, yes, I am using an NBT Tag to try and store the frequency.
Here are certain parts of the code:
Tried this:
And, alternatively, this version of "@NetworkMod":
This second version seemed to work better as I can use a "System.out" that shows it made it to that method. But, it doesn't seem to get there with the first version. Either way, the same general problem exists.
The blocks themselves are all registered just fine and have their names and textures, etc, etc, etc. It's just the "frequency" stuff I'm struggling with.
I have also tried removing the "getDescriptionPacket" method with no luck.
Server Packet Handler ("CCubeServerPacketHandler"; Does Nothing):
But, again, the GUI itself appears to work fine. Except when wanting to save the frequency.
One thing to note is that it appears to always do the "onBlockActivated" method twice. It will display the before and after frequency and then display them again but this time display nothing.
I appreciate any time and help that can be given and I thank you in advance.
I will be out of town (and away from my code etc) for a bit because of the Thanksgiving holiday. But, I should still be able to read and respond to any replies.
So, no ideas from anyone?
Sorry, man. That's a little over my head :/ My guess would be that it is something in your TileEntity, but that's mostly a shot in the dark.
Well, I can help I suppose I'm not perfect, but I'll do what I can
Ugh, but drinfernoo just stated that he's not sure either!
i dont think there should be any problems as leah is part of our team. im just making the post so the person taking over does not freak out XD
Farewell everyone o/
Me? lol No, I know what's going on
Hi sorry about the post yesterday I meant drinfernoo. really sorry I'm new at posting and I forgot to leave in his comment before I replied again I'm really sorry for the confusion.
and the sever name is japura.net
Oh, nope. I have only played on one server, once, and it was a pirate server from when I was first trying the game before I bought it legitimately.
This line:
public boolean isUseableByPlayer(EntityPlayer player){
gets this error in eclipse:
Multiple markers at this line
- implements net.minecraft.inventory.IInventory.isUseableByPlayer
- Duplicate method isUseableByPlayer(EntityPlayer) in type
TileEntityBoiler
Any ideas?
My package is
package flaxbeard.steamcraft.common:
does that matter?
I mod things. Check me out on twitter or on Espernet IRC at #TheSteamTank
It shouldn't matter that your package is different, as long as your imports are all good. It sort of looks like you have the method defined twice, or possibly it isn't overriding it for some reason...
Any way you could post your code, or link to it? If you post it, please use code tags and spoilers.
Well, I sort of gave up on that and I'm trying a hybrid approach, I changed everything to the furnace code but now I'm having trouble getting my gui to open. The furnace also switches to the actual furnace and disregards my code when I start to smelt something. Here's my code (I have to import everything for some reason, not bad, just annoying):
TheBlock
TutorialMod
TileTutorial
GuiHandler
GuiTutorial
Thanks for the help!
I mod things. Check me out on twitter or on Espernet IRC at #TheSteamTank
Secondly, That all looks fine to me, unless I overlooked something simple. What's the error that gets logged? Post the stack trace if you could.
I mod things. Check me out on twitter or on Espernet IRC at #TheSteamTank
P.S. There is a lot more of an error report that is before this however it is just information about the world crash that the error causes, I can paste it if you like, but I dont think it is necessary.
Thanks for any help that can be given it would be much appreciated