Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.10.2 / 1.12.2] Machines no longer accepting items/fluid/energy after a block type change
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
turbodiesel4598

[1.10.2 / 1.12.2] Machines no longer accepting items/fluid/energy after a block type change

By turbodiesel4598, December 8, 2017 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

turbodiesel4598    0

turbodiesel4598

turbodiesel4598    0

  • Stone Miner
  • turbodiesel4598
  • Members
  • 0
  • 66 posts
Posted December 8, 2017 (edited)

Hi there,

I have a simple issue which is that my machines stop being able to accept items/fluids/energy (or indeed have them taken out) after the block undergoes an update. I should note that for whatever reason, this issue only appears with certain conduits/ducts such as those of Thermal Dynamics and Integrated Tunnels, but since other machines from other mods don't appear to have the issue, I think the error must be on my end.

The machines will undergo a block update whenever the machine turns on or off, and this happens if it can run or can't run. All of my machines effectively follow the same recipe, so the solution for one of them should almost certainly be the same for the others, but for the purpose of showing the source code, I'll pick one of them:

Tile Entity class (and superclasses if required):

Processors.java
TileEnergyItemProcessor.java

TileEnergySidedInventory.java

TileEnergyInventory.java

TileEnergy.java

NCTile.java

 

Block class (and superclasses if required):

BlockManufactory.java

BlockProcessor.java

BlockSidedInventoryGui.java

BlockSidedInventory.java

BlockInventory.java

Thanks in advance :)

Edited December 8, 2017 by turbodiesel4598
  • Quote

Share this post


Link to post
Share on other sites

Matryoshika    116

Matryoshika

Matryoshika    116

  • Dragon Slayer
  • Matryoshika
  • Forge Modder
  • 116
  • 518 posts
Posted December 8, 2017

If the update changes IBlockStates, then by default, the TileEntity is removed.

Does this issue still happen after overriding TileEntity::shouldRefresh to return oldState .getBlock() != newState.getBlock()?

  • Quote

Share this post


Link to post
Share on other sites

turbodiesel4598    0

turbodiesel4598

turbodiesel4598    0

  • Stone Miner
  • turbodiesel4598
  • Members
  • 0
  • 66 posts
Posted December 8, 2017 (edited)

I did not know changing the block removes the tile entity. Unfortunately your suggestion does not fix the issue, and I imagine that would be because the idle and inactive blocks are indeed different blocks.

I realise now that I should have been more clear - the machine doesn't have its block's state change - the block type changes, e.g. blockMachineIdle -> blockMachineActive.

In fact, setting the method to return flat out true or false doesn't solve the issue in either case, so I don't think the issue is there.

Edited December 8, 2017 by turbodiesel4598
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6687

diesieben07

diesieben07    6687

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6687
  • 45711 posts
Posted December 8, 2017

For one, that is a bad idea, why are you doing that? There is no point using two blocks for that.

If you must though, you can still adjust the shouldRefresh method so that it does not remove the TE when the block changes between those two.

  • Quote

Share this post


Link to post
Share on other sites

turbodiesel4598    0

turbodiesel4598

turbodiesel4598    0

  • Stone Miner
  • turbodiesel4598
  • Members
  • 0
  • 66 posts
Posted December 8, 2017

The only reason is probably because the tutorials that I originally watched when first learning how to mod set up their 'custom furnaces' or whatever in that way. When I updated to 1.10.2 and above I guess I didn't know enough about what block states were to realise how I could just use one block. Perhaps I will do that some day, if you recommend doing so.

Anyway, this doesn't fix the problem either.
After a bit more testing, I noticed something a little peculiar. If the machine is off, and then is switched on by, say, adding an item to the input slot, the machine turns on and runs correctly - the energy buffer is kept full and the output is removed as expected. If the machine is then turned off, the output is no longer taken out, and if turned back on again, energy is no longer accepted either. Also, if an adjacent duct undergoes an update (for example, using the crescent hammer on an adjacent duct), then the input/output through that duct alone starts to work again.

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2093

Draco18s

Draco18s    2093

  • Reality Controller
  • Draco18s
  • Members
  • 2093
  • 14029 posts
Posted December 8, 2017

I have a feeling most of your issues stem from the fact that you're using two blocks.

  • Quote

Share this post


Link to post
Share on other sites

turbodiesel4598    0

turbodiesel4598

turbodiesel4598    0

  • Stone Miner
  • turbodiesel4598
  • Members
  • 0
  • 66 posts
Posted December 8, 2017 (edited)

I think you are right about that - it just seems that, by some happy accident, some mods' pipes/cables/conduits are built with the possibility of a machine using two blocks in mind. I'm almost certain at this point that these issues would disappear if I changed that up.

Thank you all for the help :)

Edited December 8, 2017 by turbodiesel4598
  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Professional Derp
      Server frequently crashes

      By Professional Derp · Posted 11 minutes ago

      Hello. I am running a 1.12.2 forge server on google compute engine with 3 GB of ram and the server frequently crashes. The crashes are not frequent enough to stop us from playing but they are just annoying. I'd say they happen once every day or two if there is people on, if no one is logged in it can stay running forever.   Here is the latest.log: https://pastebin.com/KgVvkmAw   Here is the list of mods: https://pastebin.com/sJbNWd1N   I am assuming the crashes are due to lack of memory since they only happen when someone is on but the interesting thing is we don't get any lag right before it crashes.   Any help would be appreciated. Thanks.
    • DaemonUmbra
      problema con el heap space

      By DaemonUmbra · Posted 21 minutes ago

      User was banned for piracy. Buy the game.
    • lockedlol9
      problema con el heap space

      By lockedlol9 · Posted 22 minutes ago

    • JMAS
      net.minecraftforge.oredict.OreDictionary missing from 1.14.4 MDK

      By JMAS · Posted 38 minutes ago

      Thank you for the answer and for the constructive instruction.  Officially, I started learning Java about three weeks ago.  I completed the SoloLearn program last week, and am 82% of the way done re-viewing it to confirm that what I learned did stick.  I'm reading the Oracle tutorials at their website and am up to Controlling Access to Members of a Class.  Completed the first seven Mr Crayfish modding tutorials, and devoured Jorrit Tyberghein's "Modding Tutorial 1.14: Episode 1 (IDEA setup, basic mod and first block)" after being excoriated by Daemon Umbra for asking questions about 1.7.10. I've jumped in and started with the Minecraft mods as the review code because I can't learn in a vacuum.  I set up the Procyon decompiler and have been reviewing my son's favorite mods and attempting to recompile them for 1.14.4 (per D.U.), which is why my questions are oriented as they are; its the jump from 1.12.2 to 1.14.4 (which would be JDK 7 to JDK 8, I gather). I suspect that Daemon Umbra has lots of experience in coding but very little in human interaction and forgets that his position isn't aiding experts but is aiding newcomers. I thank you again for your instruction and for your good-natured demeanor. Respectfully, JMAS  
    • DaemonUmbra
      problema con el heap space

      By DaemonUmbra · Posted 39 minutes ago

      This crash report says you're in 1.13.2 What launcher are you using? Please provide a screenshot
  • Topics

    • Professional Derp
      0
      Server frequently crashes

      By Professional Derp
      Started 11 minutes ago

    • lockedlol9
      5
      problema con el heap space

      By lockedlol9
      Started 1 hour ago

    • JMAS
      7
      net.minecraftforge.oredict.OreDictionary missing from 1.14.4 MDK

      By JMAS
      Started 7 hours ago

    • Barca
      6
      cant use mods in survival 1.12.2

      By Barca
      Started 4 hours ago

    • JMAS
      5
      pointing to MCP folder instead of MDK ???

      By JMAS
      Started 2 hours ago

  • Who's Online (See full list)

    • MarioAndWeegee3
    • Machinarose
    • ericgolde555
    • Ronaldi2001
    • thevortex
    • thedarkcolour
    • JMAS
    • DaemonUmbra
    • Professional Derp
    • blender dog
    • lockedlol9
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.10.2 / 1.12.2] Machines no longer accepting items/fluid/energy after a block type change
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community