Jump to content

zimooo2

Members
  • Posts

    7
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

zimooo2's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Solution [spoiler=TileEntity] package zimooo2.groundUp.tileEntity; import net.minecraft.block.BlockYourBlock; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.inventory.ISidedInventory; import net.minecraft.tileentity.TileEntity; public class TileEntityYourBlock extends TileEntity { int YourBlockBurnoutTime; public TileEntityYourBlock () { YourBlockBurnoutTime= -10; } public int getBurnout() { return YourBlockBurnoutTime; } public void setBurnout(int YourBlock) { YourBlockBurnoutTime = YourBlock; } public void updateEntity() { BlockYourBlock.ToNewBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord); } } [spoiler=function to put in your block] public static void ToStick( World par1World, int par2, int par3, int par4) { TileEntityYourBlock tileentityYourBlock = (TileEntityYourBlock)par1World.getBlockTileEntity(par2, par3, par4); System.out.println(tileentityYourBlock); if(tileentityYourBlock.getBurnout() == -10) { tileentityYourBlock.setBurnout(100); } if(tileentityYourBlock.getBurnout() >= 0) tileentityYourBlock.setBurnout(tileentityYourBlock.getBurnout() - 1); System.out.println(tileentityYourBlock.getBurnout()); if(tileentityYourBlock.getBurnout() <= 0) { System.out.println("tick ran"); par1World.setBlock(par2, par3, par4, Core.Stick.blockID); } }
  2. When placed manually the block will save, but when the burnout time is reached and the block tries to replace itself with the stick, it will not save. edit: I put your code in, and it didn't place the block correctly. Here is some code that I left out of the simplified code that I think would be important [spoiler=missing important code] if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true)) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2); } else if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true)) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); } else if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true)) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); } else if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true)) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); } else if (this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); }
  3. Whenever I try to place a block in the world, it will get placed, but once I hit "save and quit" and reload the game, the block returns to how it was. [spoiler=Simplified Code] public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { par1World.setBlock(par2, par3, par4, Core.Stick.blockID); [color=red]par1World.markBlockForUpdate(par2, par3, par4);[/color] } This code that I think should force the block to be saved, but is not working [spoiler=Full code] public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { int l = par1World.getBlockMetadata(par2, par3, par4); double d0 = (double)((float)par2 + 0.5F); double d1 = (double)((float)par3 + 0.7F); double d2 = (double)((float)par4 + 0.5F); double d3 = 0.2199999988079071D; double d4 = 0.27000001072883606D; TileEntityTorch tileentitytorch = (TileEntityTorch)par1World.getBlockTileEntity(par2, par3, par4); System.out.println(tileentitytorch); if(tileentitytorch.getBurnout() == -10) { tileentitytorch.setBurnout(100); } if(tileentitytorch.getBurnout() >= 0) tileentitytorch.setBurnout(tileentitytorch.getBurnout() - 1); System.out.println(tileentitytorch.getBurnout()); if(tileentitytorch.getBurnout() <= 0) { par1World.setBlock(par2, par3, par4, Core.Stick.blockID); if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true)) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2); } else if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true)) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); } else if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true)) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); } else if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true)) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); } else if (this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); } par1World.markBlockForUpdate(par2, par3, par4); par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); par1World.setblock } if (l == 1 && tileentitytorch.getBurnout() >= 0) { par1World.spawnParticle("smoke", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); par1World.spawnParticle("flame", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); } else if (l == 2 && tileentitytorch.getBurnout() >= 0) { par1World.spawnParticle("smoke", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); par1World.spawnParticle("flame", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); } else if (l == 3&& tileentitytorch.getBurnout() >= 0) { par1World.spawnParticle("smoke", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D); par1World.spawnParticle("flame", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D); } else if (l == 4&& tileentitytorch.getBurnout() >= 0) { par1World.spawnParticle("smoke", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D); par1World.spawnParticle("flame", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D); } else if(tileentitytorch.getBurnout() >= 0) { par1World.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D); par1World.spawnParticle("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D); } } thanks in advance, I will be unable to respond for a few hours as I will be going to sleep.
  4. When I use the install.cmd, I get a fatal error. I have tried to manually install and have had no luck with that.
  5. The ability to set the players max health though a function without editing base classes.
×
×
  • Create New...

Important Information

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