Jump to content

Custom Furnace without Fuel


mardiff

Recommended Posts

Hello Everyone,

I have successfully modeled the tutorial from http://www.minecraftforge.net/wiki/Containers_and_GUIs, but instead of making a tiny chest, I wanted to make a working furnace that only requires a redstone signal to run. I can't find any coding that has worked, and I haven't even managed to make a furnace without fuel. My current code can be found at http://pastebin.com/Y3vdBM5T. Any help would be appreciated.

Thanks,

Gmen712

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

Link to comment
Share on other sites

This is very much a shot in the dark since I'm not very familiar with Block/TileEntity modding yet, but would part of the answer be in net.minecraft.block.BlockRedstoneLight in order to do this? Redstone Lamps can only remain lit if they have power, which is similar to what you want, I think. I'm sure any other Redstone block will also be of help, but this seems to be the simplest case, since it otherwise acts like a simple lighting block.

 

After that, you'll probably have to thumb through net.minecraft.tileentity.TileEntityFurnace and net.minecraft.block.BlockFurnace to figure out how to implement the idea. By glancing at the code, BlockFurnace controls external interaction with the World and Players, while TileEntityFurnace controls the internal burning process.

Link to comment
Share on other sites

You just have to replace the isBurning() method in your furnace tile entity by something that checks if there is an redstone signal.

 

i found this in the dispenser class dont know if its working but you can give it a try.

public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
    {
    	/*your tile entity name*/ te = (/*your tile entity name*/par1World.getBlockTileEntity(par2, par3, par4);
        if (!par1World.isRemote && (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4)))
        {
            te.isPowered(true);
            
        }else{
        	te.isPowered(false);
        }
    }

 

then you just need a variable to the tile entity and add a method for the block to acces.

 

so instead of

public boolean isBurning()
    {
        return this.furnaceBurnTime > 0;
    }

 

you put

private boolean powered;
public void isPowered(boolean b)
    {
        powered = true;
    }

 

and then you just need to replace the part where it checks if the furnace is burning to check if the furnaces is beiing powered.

so replace

if (this.isBurning() && this.canSmelt())

 

with

if (this.powered == true && this.canSmelt())

 

didnt test it but i think that should work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.