Jump to content

chrisps89

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by chrisps89

  1. Hm, that should not happen... I noticed you're registering your TileEntity in init. Try to do it in preInit after you've initialized your block. Also try to set a breakpoint on the shouldRefresh return and see if it even gets called. Could the problem be because I set my variable 'private ItemStack[] pyrolysisChamberItemStacks = new ItemStack[39];' At the top of my tile entity, so every time the tile entity runs it is resetting the itemstackvariable back to 0 and in the process resetting the slots ? Just theorising based on what I am seeing and reading in my code, I am trying to test the theory now.
  2. I tried moving the tile entity to the pre initialize and I put a print into the shouldRefresh to print the result of newBlock != ModBlocks.pyrolysisChamber && newBlock != ModBlocks.pyrolysisChamberActive, which does seem to be working as planned, for true and false. I tried it commenting out the if (tileentity != null) { code like you said in your previous post but got the same thing with the gui just closing itself and all items falling on the floor. And I tried it with that code in but same original problem prevails sadly. An extra thing I noticed is that if i say shift click 3 coal in and then shift click 3 ore in, it spits both out not just either, except for the 1 ore its processing and 1 coal remains in the fuel slot, however that coal cannot be shift clicked back to my inventory, although it can be dragged in. Not sure if this changes anything but thought I would mention it. I have been looking at trying to save and refresh the inventory when the new block is created but no luck just yet. Edit: I managed to figure out that the 1 coal that gets left in the machine is kind of a ghost item, I printed out the contents of the itemstack in that slot and it prints out 3xcoal etc. but after spitting out items it changes to 0xcoal, even though one shows inside the slot. Still working on it but thought I would update this.
  3. Still trying to work this one out, if anyone has any ideas, would really help, thanks.
  4. Taking that part out causes the gui to close and spit the item i am placing in onto the floor. It only does that when placing the second part in either the fuel or the ore. Thanks for your time and help so far !
  5. Ah of course, another silly mistake that. So hopefully 3rd times the charm? @Override public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) { return newBlock != ModBlocks.pyrolysisChamber && newBlock != ModBlocks.pyrolysisChamberActive; } so now its checking if it is not pc and not pca, and returning true, if it isn't equal to either of them, otherwise it's false. Which is what you mentioned I believe...hopefully. However it has no effect, although it is equal to false, at least when the block updates as I tracked it with a print. Should there be a point where my block is neither of them ?
  6. Yeah made some silly mistakes formatting that originally. I have it like this now, which I believe is okay. @Override public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) { return newBlock != ModBlocks.pyrolysisChamber || newBlock != ModBlocks.pyrolysisChamberActive; } However if that is correct, it sadly made no difference, items still get chucked out the same way.
  7. Thanks for the response, and I tried what you said to the best of my knowledge but I am a little new to modding, coding I'm okay with but still learning some of the ins and outs with forge. I tried it like this: public boolean shouldRefresh(int oldID, int newID, int oldMeta, int newMeta, World world, int x, int y, int z) { Block check = world.getBlock(x, y, z); if(check != blockRefresh || check != blockRefresh2){ return true; } else { return false; } } But I get the impression I likely did it wrong since it didn't make a difference. I created two variable in my tile entity and had them equal to my blocks in my ModBlocks Class then inside the shouldRefresh method you mentioned I got the block and tried comparing it to my blocks. But I think I either got confused or just misunderstood. By second block parameter did you mean what the block was set to once it changed? Sorry if I am asking some stupid questions here, still learning like I said. Edit: It suddenly occurred to me after posting that I make no call to shouldRefresh anywhere. Also I couldn't override the method because I had to overide or implement a supertype method. Edit2: I had my method paramaters messed up fixed that, might be able to get it to work, will update shortly
  8. I have a custom furnace type block I am working on and I am most of the way there, the problem I have at the moment is focused around the two input slots, When the furnace is inactive and focusing on the inactive block, placing several fuel then placing several ore forces the fuel to be spat out except for 1 of the fuel item. And placing the ore then the fuel forces the ore to be spat out except one item. I guess technically it is two since it sucks 1 of each into the machine for processing too. I used breakpoints to find out when it does this and it is during my updatePyrolysisChamber method in my PyrolysisChamber class, it seems when it picks the new block when the furnace becomes active that it does it, but I cannot track down what part of the code is spitting it out. It spits it quite a bit further than when the block is broken and the items drop out too. This is my PyrolysisChamber Class, and I will post a link to my github with all the files below too, any help is greatly appreciated thanks. https://github.com/chrisps89/chrisps
×
×
  • Create New...

Important Information

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