Modular Machinery

Modular Machinery

12M Downloads

Modular Machine throws NPEs when checking for modifier

MaxNeedsSnacks opened this issue ยท 3 comments

commented

I've been trying to make an automatic Rock Cleaning machine that uses water unless you replace one specific block with some sort of infinite water source.

The machine loads perfectly fine on my client, and doesn't actually throw errors as long as the modifier block isn't present, but when I go ahead and replace that one block with the modifier block, the machine starts spewing out NPEs and, if I didn't have VanillaFix installed, I'd assume it'd crash my game, as well.

Here's a link to one of the (many) crash reports generated: https://paste.dimdev.org/uzebugucal.mccrash

I guess the relevant bit of code in my json would be the modifier part:

{
  "registryname": "rock_cleaner",
  "localizedname": "Advanced Rock Cleaner",
  "color": "484848",

  "modifiers": [
    {
      "elements": "cookingforblockheads:sink",
      "x": 0,
      "y": 0,
      "z": 1,
      "description": "Place this between Controller and Cleaner to stop the machine from using water.",
      "modifier": {
        "io": "input",
        "target": "fluid",
        "operation": 1,
        "multiplier": 0.0
      }
    }
  ],

I'm really not sure what's going on, I may just be doing things wrong with the modifiers bit, but the crash report leads me to believe it's some sorta NBT reading error, which would be odd since I don't actually have any nbt data specified in the machine, so the machines should just be able to have whatever data they wanna have, shouldn't they?

commented

It's probably due to a different serialization/deserialization of blocks.
Did adjust that, so we'll see if the next update fixes this as i can only really act upon what i can replicate.. so the issue/crash-information you linked is fixed.
Additional/Other, i don't know of..

commented

I'm gonna try swapping out the sink for another, more "generic" block and see whether that has any effect.

For reference, the machine I was building pretty much only had Machine Casings, some Cauldrons and then a Sink in the center instead of a cauldron.

EDIT: Can confirm the machine still errors when I replace the sink with, say, a "block" of water. I'll just be waiting for the next update, thanks for trying to help out ^^

commented

Just tested the entire thing with the CI build, that fixed it, thanks a ton!