Jump to content

ted5610

Members
  • Posts

    13
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

ted5610's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. when I changed the onBlockActivated() method to open the gui on the server side the gui opens for a fraction of a second but then immediately closes.
  2. that's not the block i'm having the problem with actually, though I expect what you say is true, since that block is only half finished. it's the dorfanvil block that is broken. I can open the gui for it just fine, but I think there is a problem with the container. the items wont move from the spots they are in when I opened the gui.
  3. repo is here: https://github.com/fingersome/dorfsvsgoblins/tree/master/main
  4. I'm creating a custom crafting table and whenever I try and move an item into from my hotbar or inventory to the blocks inventory I can't seem to pick up the items with the mouse. they will pick up for a fraction of a second but then snap back to the slot they were in..??
  5. ohhhh I get it now instead of getBlock() I use getBlockState(new BlockPos(x, y, z)) thanks for the help, sorry I'm a bit slow lol
  6. These are the methods from my guiHandler: @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch(ID) { //case 0: return new ContainerDorfAnvil(player.inventory, world, x, y, z); } if(ID == DorfsVsGoblins.guiIDDorfAnvil) { return ID == DorfsVsGoblins.guiIDDorfAnvil && world.getBlockState(x, y, z) == DorfsVsGoblins.blockDorfAnvil ? new ContainerDorfAnvil(player.inventory, world, x, y, z) : null; } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch(ID) { //case 0: return new GuiDorfAnvil(player.inventory, world, x, y, z); } if(ID == DorfsVsGoblins.guiIDDorfAnvil) { return ID == DorfsVsGoblins.guiIDDorfAnvil && world.getBlockState(x, y, z) == DorfsVsGoblins.blockDorfAnvil ? new GuiDorfAnvil(player.inventory, world, x, y, z) : null; } return null; } What am I doing wrong?
  7. I don't understand how getBlockState() works, what arguments does it need? when I swapped out getBlock() for getBlockState() I get an error telling me it needs a BlockPos but I don't understand what that is.
  8. world.getBlock() has disappeared in 1.8, so what should I use to get the block for my guihandler in place of my old code: if(ID == DorfsVsGoblins.guiIDDorfAnvil && world.getBlock(x, y, z)) { }
  9. that took care of the crash, but when I return true from the onBlockActivated method it still plays multiple sounds if I hold down the click, instead of one.
  10. today I learned a thing
  11. I have written an block which plays the anvil sound when it gets right clicked with a certain item, however I crash out of the game when I right click with an empty hand. As long as I click it with a hammer it works as intended, but if I click with nothing in my hand the client crashes with a nullpointer exception, and I can't figure out why. It's probably something simple that i've missed. Block class is here: https://github.com/fingersome/dorfsvsgoblins/blob/master/main/java/fingersome/dorfsvsgoblins/block/BlockDorfAnvil.java The block in question is an anvil and the item is a hammer. The idea for the block is to act similar to a crafting table but with the recipe only completing after you whack the anvil enough times. So my other question aside from the crash problem is this: If I hold right click it spams the onRightClick method, and plays the sound repeatedly. How would I set up a delay so you can't hold right click on the block?
  12. How would you say, remove the recipe for a glowstone block? This works for items, but i'm not sure how to get at, or what to reference to remove block recipes...?
  13. I wasn't sure where to post this at so I thought I'd post it here. Anyhow, I've been trying to use the Open to LAN feature in minecraft, using hamachi with forge and several mods. I've tried it in vanilla (no forge or mods, just the vanilla game) and the fix i'm using to allow lan play over the interwebs with hamachi works, but when I introduce forge into the mix, (no mods, just forge) the server/LAN game doesn't show up on the list of available servers. Anyone got any ideas about how to fix this? I've played with people on a server hosted on my machine before but only in vanilla, and it took ages to figure out how the balls to portforward things, and i'd rather not do that unless I have to, because it will probably tank my puny computer running the server and my client at the same time.
×
×
  • Create New...

Important Information

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