Jump to content

Blockhead2

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by Blockhead2

  1. Yes you'll have to send network packets between the server and the client to update the progress bars. Look at the furnace container for examples (see updateCraftingResults and updateProgressBar functions)
  2. Do you have the png file in the right directory. This is what I have in the code and the file structure. %MCP%/src/common/x/y/z/textures.png public static String BLOCK_PNG = "/x/y/z/textures.png";
  3. I've seen an effect like this too on a custom container. For me it happens when I exit and restart, but not when I first create the tile. One way to clear it for me is to delete the block and replace. It's definitely a good idea to remove and replace the tile if you've fixed some bugs since it was created. This makes me think it's a bug in my (and maybe your) tag write/read code. I've not debugged it yet. Post if you find the answer before I do.
  4. For the compare you'll want to compare the IDs of the items or (even better) use isItemEqual, rather than comparing the address of the new item stack against a different one in your tile. if(tile.inv[0].isItemEqual(new ItemStack(Item.wheat)) ..... or maybe if(tile.inv[0].itemID == Item.wheat.shiftedIndex).... Check TileEntityFurnace (functions canSmelt and smeltItem) for examples of checking what is where. Not sure about your texture problem.
  5. The liquid tanks in buildcraft are awesome. The source code is on github which is doubly awesome. Great to look and learn from, but please respect the guy's effort and copyright. https://github.com/SirSengir/BuildCraft/blob/master/common/buildcraft/factory/TileTank.java
  6. I'm not sure if you've seen this but there are some guidelines on how to make sure your forge mod will work in multiplayer here: http://www.minecraftforge.net/wiki/SMP_Coding_Guidelines After that I guess you just need a server running forge to host the mod.
  7. Hi folks. I'm a relative forge newbie but done a couple of complex bukkit server plugins and am looking for some guidance from more experienced forge moders. I've had a good look through the source but can't find a handy way to intercept (and possibly cancel) what bukkit would call block break, block place and craft item events. I cobbled together some block place and break control using PlayerInteractEvent and BreakSpeed but my attempts were a little clumsy. I found lots of cool hooks for controlling this on new blocks I've created, but I'd like to be able to manage any in-game block too (without changing net.minecraft). My gut tells me most things should be possible with the level of server and client control in minecraftforge. I even thought about splitting the mod into two sections, one Forge and one Bukkit and sharing the server side data somehow. That has to be mad, right? @ForgeSubscribe public void onBreakSpeed(BreakSpeed event) { if(event.block.blockID == Block.torchWood.blockID) { if(event.isCancelable()) { event.setCanceled(true); } } } @ForgeSubscribe public void onPlayerInteract(PlayerInteractEvent event) { EntityPlayer p = event.entityPlayer; if(event.action != Action.LEFT_CLICK_BLOCK) { ItemStack s = p.inventory.getCurrentItem(); if(s.itemID == Block.torchWood.blockID) { // Difficult to get the coordinates for where the new block would have // been placed. if(event.isCancelable()) { event.setCanceled(true); } } } }
×
×
  • Create New...

Important Information

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