Jump to content

[1.12.x/1.11.x] [SOLVED] Block connections (Collision, JSON)


Recommended Posts

Posted (edited)
  On 10/3/2017 at 6:11 PM, Draco18s said:

But you've also got this:

Caused by: java.io.FileNotFoundException: justanotherenergy:models/item/plate_tin.json

 

Expand  

Yeah, this is because I never got to the point to create the JSON files for everything. I'm just writing all the code and the last thing I'm doing is adding the JSON files. Mostly this results

into the JSON files beeing added a few hours before I build a new alpha version.

 

  On 10/3/2017 at 6:11 PM, Draco18s said:

And this:

Caused by: java.io.FileNotFoundException: justanotherenergy:models/item/cable.json
Expand  

This JSON will come later. I just added the other jsons to see if it is working for the world. For the item json I have to figure out how to use the 3D model from the world for the inventory and rotate it in a good direction with some submodels beeing added.

 

  On 10/3/2017 at 6:11 PM, Draco18s said:

This is probably your main problem:

Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of 'justanotherenergy:cable' from: 'justanotherenergy:blockstates/cable.json' in resourcepack: 'FMLFileResourcePack:JustAnotherEnergy'
...
Caused by: com.google.gson.JsonParseException: transform: unknown default string: cable_side

 

Expand  

How can I fix this?

 

EDIT: I replaced the line which caused the error now with "inventory": [{ "transform": "forge:default-block" }].

But the problem with all the other errors still remains. My block is still just displayed as a normal block with a missing texture instead of the model I defined.

Edited by Bektor

Developer of Primeval Forest.

Posted
  On 10/4/2017 at 7:08 AM, Jay Avery said:

Post the full latest log, and your latest blockstates and model files.

Expand  

There you go, however I didn't posted the full latest log as there are some errors thrown out which aren't even related to the blocks this thread is about (like missing jsons for copper ingot etc.)

  Reveal hidden contents

 

I'm also wondering what's causing the JSONSyntaxException as JSONLint - The JSON Validator tells me the JSON files are correct.

 

The code:

  Reveal hidden contents

 

The texture cable.png can be found in assets.justanotherenergy.textures.blocks.

 

The source code of the block remains the same as before.

Developer of Primeval Forest.

Posted
  On 10/4/2017 at 1:05 PM, Bektor said:
    "texture": {
        "particle": "justanotherenergy:blocks/cable",
        "texture": "justanotherenergy:blocks/cable",
        "overlay": "justanotherenergy:blocks/cable"
    },

 

Expand  

This block should be "textures" not "texture" - same mistake in cable_base and cable_side.

Posted
  On 10/4/2017 at 1:51 PM, Jay Avery said:

This block should be "textures" not "texture" - same mistake in cable_base and cable_side.

Expand  
    "textures": {
        "particle": "justanotherenergy:blocks/cable",
        "texture": "justanotherenergy:blocks/cable",
        "overlay": "justanotherenergy:blocks/cable"
    },

Ok, I changed it in cable_base and cable_side, thought the errors still remain.

Developer of Primeval Forest.

Posted
  On 10/4/2017 at 6:12 PM, Jay Avery said:

Post the log again, the errors are probably not identical.

Expand  
  Reveal hidden contents

 

Developer of Primeval Forest.

Posted

Oh, I just realised the problem, your model files are missing important things.

 

      "faces": {
          "down": { "cullface": "down" },
          "up": { "cullface": "up" },
          "north": { "cullface": "north" },
          "south": { "cullface": "south" },
          "west": { "cullface": "west" },
          "east": { "cullface": "east" }
      }

Each of the faces ("down" etc) needs to contain a "texture" element - a string referring to the texture label (as defined in the "textures" section at the start of your file) and starting with #. You likely also want a "uv" element - an array of four numbers - to define which area of the texture to apply to the face. Here is a random example from a model in my mod:

    "faces": {
        "down":  { "uv": [ 15, 14, 0, 2 ], "texture": "#cotton1" },
        "up":    { "uv": [ 1, 4, 16, 16 ], "texture": "#cotton1" },
        "north": { "uv": [ 0, 15, 15, 16 ], "texture": "#cotton1" },
        "south": { "uv": [ 1, 15, 16, 16 ], "texture": "#cotton1" },
        "west":  { "uv": [ 2, 15, 14, 16 ], "texture": "#cotton1" },
        "east":  { "uv": [ 2, 15, 14, 16 ], "texture": "#cotton1" }
    }

 

Posted (edited)
  On 10/4/2017 at 7:02 PM, Jay Avery said:

Oh, I just realised the problem, your model files are missing important things.

 

      "faces": {
          "down": { "cullface": "down" },
          "up": { "cullface": "up" },
          "north": { "cullface": "north" },
          "south": { "cullface": "south" },
          "west": { "cullface": "west" },
          "east": { "cullface": "east" }
      }

Each of the faces ("down" etc) needs to contain a "texture" element - a string referring to the texture label (as defined in the "textures" section at the start of your file) and starting with #. You likely also want a "uv" element - an array of four numbers - to define which area of the texture to apply to the face. Here is a random example from a model in my mod:

    "faces": {
        "down":  { "uv": [ 15, 14, 0, 2 ], "texture": "#cotton1" },
        "up":    { "uv": [ 1, 4, 16, 16 ], "texture": "#cotton1" },
        "north": { "uv": [ 0, 15, 15, 16 ], "texture": "#cotton1" },
        "south": { "uv": [ 1, 15, 16, 16 ], "texture": "#cotton1" },
        "west":  { "uv": [ 2, 15, 14, 16 ], "texture": "#cotton1" },
        "east":  { "uv": [ 2, 15, 14, 16 ], "texture": "#cotton1" }
    }

 

Expand  

Thx, that solved the problem. :) 

Thought how am I about to let my item json render my block in the inventory with some submodels added to it?

Edited by Bektor

Developer of Primeval Forest.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

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