Jump to content

MINERGUY67880

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by MINERGUY67880

  1. Thank you so much! Im such an idiot
  2. How do I do that? event.entityPlayer.getHeldItem() returns an itemstack.
  3. FMLCommonHandler.instance().bus().register(eventHandler); MinecraftForge.EVENT_BUS.register(eventHandler); That is in pre init. Also, I just did the println test and the event fires but it only works under if(event.action != null && event.action == Action.RIGHT_CLICK_BLOCK) if(event.entityPlayer.getHeldItem() != null && event.entityPlayer.getHeldItem() == new ItemStack(MinerCore.debugItem)) doesn't work though.
  4. So, I'm trying to make a debug item that tells you information about the block you right click with it. I check if the player right clicks a block, then I check if the player is holding the debug item. It is supposed to say the unlocalized name of the item that I right click with the item in chat but it doesn't. My event handler: ChatHandler is a class I made just to make adding chat easier. The event handler is registered too.
  5. How can I change that to make it work?
  6. Will this be sufficient? @EventHandler public void load(EntityJoinWorldEvent EntityPlayer){ System.out.println("A PLAYER JUST JOINED!"); }
  7. What is it called and what class is it from?
  8. Hi, I need my mod to detect if a player just spawned into the world for the very first time so that I could do something like: if (playerJustSpawned = true) { System.out.println("Hey, A player just spawned!") } Is there one that is in the source code or do I have to make one? Please help me out with dis!
  9. Im not sure why I did the +1 for the CurrentY. Heres my new code: //Smoke Spawning Method public void updateTick(World world, int x, int y, int z, Random rand) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity instanceof TileEntityStoneCrusher) { TileEntityStoneCrusher crusher = (TileEntityStoneCrusher) tileEntity; if (crusher.active) { world.setBlock(x, y + 1, z, TechnicCraftCommon.SmokeGasBlock.blockID ); } } }
  10. i put in a system.out.println and it didnt write it in the console. It isn't getting called.
  11. Hi, I am trying to make my stone crusher machine make my smoke gas when it is activated. I am trying to use this code: //Smoke Spawning Method public void updateTick(World world, int x, int y, int z, Random rand) { int CurrentY = y + 1; TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity instanceof TileEntityStoneCrusher) { TileEntityStoneCrusher crusher = (TileEntityStoneCrusher) tileEntity; if (crusher.active) { world.setBlock(x, CurrentY + 1, z, TechnicCraftCommon.SmokeGasBlock.blockID ); } } } But it doesn't work, what am I doing wrong?
  12. That is exactly what I want!
  13. Heres my code for the Gas Block file: package miner.miner.technicraft.oceans.blocks; import java.util.Random; import miner.miner.technicraft.oceans.client.gui.creativetabs.TCOceansCreativeTabs; import miner.miner.technicraft.oceans.TechnicCraftOceans; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.EntityLiving; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.BlockFluidFinite; import net.minecraftforge.fluids.Fluid; public class BlockGasSteam extends BlockFluidFinite { public String texture; public BlockGasSteam(int id, String key, Fluid fluid) { super(id, fluid, Material.water); this.texture = key; this.setCreativeTab(TCOceansCreativeTabs.blocksTab); fluid.setBlockID(this); setUnlocalizedName(key); } @Override public void registerIcons(IconRegister register) { blockIcon = register.registerIcon(TechnicCraftOceans.modID + ":" + texture); getFluid().setIcons(blockIcon); } @Override public int colorMultiplier(IBlockAccess world, int x, int y, int z) { return 0xaaaaaa; } public void updateTick() { if (par1World.getBlockId(par2, par3 + 1, par4) == 0 && par3 <= 255) { par1World.setBlock(par2, par3 + 1, par4, BlockGasSteam); par1World.setBlock(par2, par3, par4, 0); } } } I am getting errors on par1World, par2, par3, par4 then the other par3 and just about everything else! Is there anything I need to change or move? Or do i just need to add ints/variables?
  14. So do i put public void updateTick() { if (par1World.getBlockId(par2, par3 + 1, par4) == 0 && par3 <= 255) { par1World.setBlock(par2, par3 + 1, par4, BlockGasSteam); par1World.setBlock(par2, par3, par4, 0); } }
  15. Another nooby question, where do i put that code?
  16. Can anyone help me with the first question?
  17. Sorry, i have 2 more questions. 1. Is there a thing that returns the name of the block above another block? Example: C = custom block that returns the name of the above block, A = air A C It would say "air" in the eclipse console if you hooked it up to a printline thing? 2. How do I make the gas stop when the said air block is on layer 255? And can I please have some code pieces? I don't really know advanced java.
  18. Sorry to sound like a noob, but how do i do that?
  19. Does anyone know? Because i am completely stumped.
  20. Hello everybody! I am making a mod with gasses but I want them to stay in the world and not dissapear when they reach the top. I need to know how to make a block generate on 100% of layer 255?
  21. Hey everyone, i need to know how to make a fluid finite. Yes, I googled it but all i get is the finite liquids mod. If you need anyone of my code, just tell me!
×
×
  • Create New...

Important Information

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