Modding 1.4.7: FAQ: Fire in portal frame problem

This is actually not a real problem, but is simply not in the code.
The reason why this is not in the code is that the spawning of a portal in a frame is handled in the BlockFire class. If you would like to get your portal to spawn that way you would have to edit the BlockFire class which is a very bad thing to do.
This is the code Minecraft uses for the nether portal.

public void onBlockAdded(World par1World, int par2, int par3, int par4)
    {
        if (par1World.provider.dimensionId > 0 || par1World.getBlockId(par2, par3 - 1, par4) != Block.obsidian.blockID || !Block.portal.tryToCreatePortal(par1World, par2, par3, par4))
        {
            if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !this.canNeighborBurn(par1World, par2, par3, par4))
            {
                par1World.setBlockWithNotify(par2, par3, par4, 0);
            }
            else
            {
                par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate() + par1World.rand.nextInt(10));
            }
        }
    }

If you want your frame to also work like that you would have to copy that over and change the dimensionId, obisidian and portal. However, you really shouldn't do that, because it's bad to make base edits. There are many other ways to spawn a portal and I suggest looking at them.

I hope this has fixed your problem. You can get back to the FAQ list over here.










Geen opmerkingen:

Een reactie posten