Jump to content

KeeganDeathman

Forge Modder
  • Posts

    434
  • Joined

  • Last visited

Everything posted by KeeganDeathman

  1. i was saying that does not work read the post next time.
  2. What makes you think i dodn't edit the method sig.? i meant he was wrong about me not being able to do this cause im an idiot(how it came a cross to me)
  3. Hey guess what! I fixed it, and you were, wrong! Ha, bye bye!
  4. the method signature? Im not an idiot, and you should just shut it.
  5. Okay, well get this, the @Override annotation you told me to put in, eclipse tole me to either remove it, or edit a base file! So you need to check your stuff, cause you're being the dumbest modder ever if you think the answer is to edit a base file.
  6. Okay, is i okay to have a "blank" container? and I mean that thier cant be say public void blah(parameters){ @override blahblah } so yeah, and I tried putting an override on onBlockAtivated, and it said no.
  7. , not sure if @Override can be ran inside a method but, any way, I tried to use a System.print.out("Begin") at the begining f the method and nothing showed up still, and I tried to @Override, and it threw an error.
  8. Just wondering, how do I get it to work, without the containers?
  9. okay, if your wondering why I have a modloader function its because I cant get the forge one to work for me, mainly cause i cant understand it. BlockTowerFloorBase: package codelyoko; import net.minecraft.block.*; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.src.ModLoader; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockTowerFloorBase extends BlockContainer implements ITileEntityProvider { public BlockTowerFloorBase(int id, Material par1Material) { super(id, par1Material); this.setCreativeTab(Lyoko.tabLyoko); } @Override public TileEntity createNewTileEntity(World world) { return new TileEntityTowerFloor(); //Rename to your tile entity } @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { TileEntity tile = world.getBlockTileEntity(x, y, z); // Once again rename to your tile entity. if (tile instanceof TileEntityTowerFloor && ((TileEntityTowerFloor)tile).shouldRender) { return AxisAlignedBB.getBoundingBox(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1); } return super.getCollisionBoundingBoxFromPool(world, x, y, z); } public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { par1World.setBlock(par2+1, par3, par4, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2+1, par3, par4+1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2+1, par3, par4-1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2, par3, par4+1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2, par3, par4-1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2-1, par3, par4+1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2-1, par3, par4, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2-1, par3, par4-1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); ModLoader.openGUI(par5EntityPlayer, new GUITowerFloorCreated()); System.out.print("complete"); return true; } //This will tell minecraft not to render any side of our cube. public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) { return false; } //And this tell it that you can see through this block, and neighbor blocks should be rendered. public boolean isOpaqueCube() { return false; } } BlockTowerConsole: package codelyoko; import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.src.ModLoader; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockTowerConsole extends Block implements ITileEntityProvider{ public BlockTowerConsole(int par1, Material par2Material) { super(par1, par2Material); this.setCreativeTab(Lyoko.tabLyoko); } @Override public TileEntity createNewTileEntity(World world) { return new TileEntityTowerConsoleBlock(); } public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) { return false; } //And this tell it that you can see through this block, and neighbor blocks should be rendered. public boolean isOpaqueCube() { return false; } public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5player){ ModLoader.openGUI(par5player, new GuiTowerConsole()); return true; } }
  10. Nope, i put in System.out.print("complete"); and when i right clicked the block and looked at the console nothing showed up! Need code?
  11. Okay Ill try that, maybe it's just failing.
  12. Hi again! I have some blocks with custom tile entities rendering some models, but they both have onBlockActivated booleans, but when I right click absolutely nothing happens! and I know that on one of them I have it coded right cause it worked before i implemented the TileEnity! Help?
  13. Actually got it to work on my own. Thanks anyway!
  14. Replying here instead just in case someone else runs across this needing the same answers. To your block class add (your block will need to extend BlockContainer or implement ITileEntityProvider before its available) @Override public TileEntity createNewTileEntity(World world) { return new TileEntityLargeBlock(); //Rename to your tile entity } This will create the tile entity as soon as the block is in the world, but you didn't want it to render until your right clicked so in your tile entity add public boolean shouldRender = false; Back to your block class @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int face, float posX, float posY, float posZ) { TileEntity tile = world.getBlockTileEntity(x, y, z); // Once again rename to your tile entity. if (!(tile instanceof TileEntityLargeBlock)) { return false; // If for some reason your block does not have the correct tileentity you don't want it to create the false blocks, as nothing will hide them. } // run any pre-generation code you have here. eg. making sure there is space for the false blocks. ((TileEntityLargeBlock)tile).shouldRender = true; // create your false blocks here as they are now hidden return true; } The last thing to do is in your renderer, simply check if shouldRender is true before rendering, if not leave without rendering anything. You can change the other code I gave you too, @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { TileEntity tile = world.getBlockTileEntity(x, y, z); // Once again rename to your tile entity. if (tile instanceof TileEntityLargeBlock && ((TileEntityLargeBlock)tile).shouldRender) { return AxisAlignedBB.getBoundingBox(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1); } return super.getCollisionBoundingBoxFromPool(world, x, y, z); } oh my god thank you thank you thank you! I'll edit this post if telling you if it worked! EDIT: Well now when i right click it does nothing. Heres my code: BlockTowerFloorBase: package codelyoko; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.src.ModLoader; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockTowerFloorBase extends Block { public BlockTowerFloorBase(int id, Material par1Material) { super(id, par1Material); this.setCreativeTab(Lyoko.tabLyoko); } @Override public TileEntity createTileEntity(World world, int metadata) { return new TileEntityTowerFloor(); } public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { TileEntity tile = par1World.getBlockTileEntity(par2, par3, par4); // Once again rename to your tile entity. if (!(tile instanceof TileEntityTowerFloor)) { return false; // If for some reason your block does not have the correct tileentity you don't want it to create the false blocks, as nothing will hide them. } par1World.setBlock(par2+1, par3, par4, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2+1, par3, par4+1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2+1, par3, par4-1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2, par3, par4+1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2, par3, par4-1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2-1, par3, par4+1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2-1, par3, par4, Lyoko.TowerFloorGagBlock.blockID, 0, 2); par1World.setBlock(par2-1, par3, par4-1, Lyoko.TowerFloorGagBlock.blockID, 0, 2); ModLoader.openGUI(par5EntityPlayer, new GUITowerFloorCreated()); return true; } @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { return AxisAlignedBB.getBoundingBox(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1); } //This will tell minecraft not to render any side of our cube. public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) { return false; } //And this tell it that you can see through this block, and neighbor blocks should be rendered. public boolean isOpaqueCube() { return false; } } EDIT: Opps, forgot to implement ITileEntityProvider. Hehe Now it just loads when i place the block, not even waiting for me to right click it!
  15. I want to load a tile entity, but everything i try fails! Help?
  16. Anyone know how to do this?
  17. How do I get the tile entity to load? So that it in turn loads the model?
  18. Thanks, now how about rendering the model?
  19. well i didn't EDIT: Well, I got the blocks to generate, now how do I go about rendering the model?
  20. hmmm, thanks for the tip on placing the blocks, now, for the model de-rendering, Ill look it up, think i saw it somewhere before. I might just make some more blocks, about 6, and have them have the textures of the model on them, the model isn't to special, just a box the size of the 3x3 square, with a texture. It would be take up some ids, but it would still work.
  21. Yeah sorta, So I need to make a base block, that has a render tilenetity that renders the model, and the gag blocks?
  22. Okay, so I want to make it so that when you place a block and then activate it, it places some dummy blocks around it in 1 3x3 square having the original block the center, and also having a model render over it so that it has a texture. Any help on this?
  23. Well I mean how do i edit the required structure to match the model, cause his is a bit to high. I also would like to be able to render a model, that cloaks the entire thing, any help with that?
  24. Not sure if you know how, but where do I edit the placement of the dummy blocks to fit with my mod?
  25. Not quite sure what a multi-block structure is, but ill check it out! Thanks again Mew.
×
×
  • Create New...

Important Information

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