Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

lyn mimistrobell

  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About lyn mimistrobell

  • Rank
    Tree Puncher


  • Gender
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. It seems there are a number events/methods used when a block is placed: canPlaceBlockOnSide getStateForPlacement onBlockPlacedBy Are there any more? Are these always called in this order? I have a block where I want to remember the TE against which the block was placed - let's call it targetTE - (so it can act as an interface to that targetTE). I implemented canPlaceBlockOnSide to verify that the user actually clicked a TE and not a regular block; e.g. it returns false if you try to place the block against dirt but true if you place the block (shift-click) aga
  2. Wow I totally missed that it's parsing the NBT to a new local ItemStack and then ignores it... thanks.
  3. I did add more debugging and found the issue is with ItemStack.deserializeNBT which doesn't handle the NBT (created with ItemStack.serializeNBT) properly (created a separate topic for that). I use Eclipse Neon 2 and I know how to set breakpoints (unfortunately, they didn't help for this problem) - I didn't think use the property as watchpoint but I'll do that next time. Thanks.
  4. ItemStack: public NBTTagCompound serializeNBT() { NBTTagCompound ret = new NBTTagCompound(); this.writeToNBT(ret); return ret; } public void deserializeNBT(NBTTagCompound nbt) { // TODO do this better while respecting new rules final ItemStack itemStack = new ItemStack(nbt); this.stackTagCompound = itemStack.stackTagCompound; this.capNBT = itemStack.capNBT; } So effectively, that's what those methods already do...
  5. I have an ItemStack with a single piece of e.g. coal; when I call itemStack.serializeNBT I get: {id:"minecraft:coal",Count:1b,Damage:0s} When I then try to deserialize the tag I get: 1xtile.air@0 I found that deserializeNBT calls new ItemStack(compound); it calls Item.getByNameOrId("minecraft:coal") which returns 1xitem.coal@0. For some reason, this fails and causes ItemStack to have 1xtile.air@0 : this.item = Item.getByNameOrId("minecraft:coal"); This works, however: itemStack = new ItemStack(Item.getByNameOrId("minecraft:coal")); Am I doing
  6. Hi, For my mod I created a custom Capability that handles fuel burning (initial burn time, remaining burn time, etc.): My TE calls setFuelItem with an ItemStack that has coal; the log shows that the coal was accepted: [18:32:02] [Server thread/INFO] [RadioTools]: [TileEntityFurnaceGenerator.update] fuelItemStack: 1xtile.blockCoal@0 [18:32:02] [Server thread/INFO] [RadioTools]: [FurnaceGeneratorHandler.setFuelItem] fuelItem: 1xtile.blockCoal@0 [18:32:02] [Server thread/INFO] [RadioTools]: [FurnaceGeneratorHandler.setFuelItem] this.fuelItem: 1xtile.blockCoal@0, init
  7. Hi, It's my understanding that one of the key benefits of the Capability system is that other mods can provide the Capability you designed - is that right? So far I've discovered that Forge provides Capability<IAnimationStateMachine>, Capability<IEnergyStorage>, Capability<IFluidHandler>, Capability<IFluidHandlerItem> and Capability<IItemHandler>. I suspect many people have created their own Capabilities by now and I'm sure some (almost) duplicate Capabilities exist out there. Perhaps we should be sharing and documenting Capabi
  8. I found the problem; my writeToNBT method didn't call super.writeToNBT so the TileEntity class never stored my TE's id.
  9. I've implemented: - getTileEntityClass - getTileEntity - hasTileEntity (returns true) - createTileEntity(world, state) (though deprecated) - createTileEntity(world, meta) (though deprecated) My Block and TE class have a constructor without parameters. One thing that bugs me is that all registrations happen through event.getRegistry; except for the TE registration which uses GameRegistry.registerTileEntity - seems inconsistent.
  10. I provided all the relevant code... In the log I see it does: - preInit (on Client) - RegistrationHandler.registerBlocks (on Client) - GameRegistry.registerTileEntity (on Client) - RegistrationHandler.registerItems (on Client) - RegistrationHandler.registerItems (on Client, for the models) - init (on Client) - postInit (on Client) Then when I right-click my block: - onBlockActivated (on Server) - TE.onLoad (on Server) - TE.onLoad (on Client) Anything unexpected here? The block itself is registered on Registrat
  11. I'm having the same issue and I'm wondering about the different events that are being used. My main class implements: @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) @Mod.EventHandler public void init(FMLInitializationEvent event) @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) It also defines this class @Mod.EventBusSubscriber public static class RegistrationHandler implementing these methods: @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event
  12. I want an ITickable class to keep track of and regularly update multiple blocks and possibly items; serverside. It shouldn't be dependent on things like chunk loading and actually I actually don't event want an inworld block for it. Is there a recommended way to imlement this? Can I use a TileEntity and can I just initialize this in my mod postInit? Would it be able to store NBT data?
  13. I found it to be the best way without the need to expose new methods (requiring me to cast the TE to my own TE class). I didn't feel like doing this just for the IItemHandler issue but I suspect a Progress capability can will be useful more often.
  14. I was able to get it working with the facing option (of course, it restricts me to 6 IItemHandlers but for now I just needed 3 anyway). I feel it's a hack/workaround and not a proper solution tho... I did create a custom capability for my furnace progress. The vanilla furnace uses IInventory which offers getField and setField, I feel that's missing from the standard capabilities; perhaps I'll create a generic IStorage<IProperties> capability to offer generic properties handling to any TE... For now, I created a Progress capability (with minValue, maxValue, value a
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.