Jump to content

[1.16.5] A few questions about various stuff


Tavi007

Recommended Posts

Hey,

Indescriptive title aside I currently need help with 2 things. The first one is most likely something easy to fix and I'm just to stupid right now. I got the famous black-purple texture displayed as my block texture, but the block itemstack is showing the correct texture tho. Here are the blockstate and model file:

Spoiler

model:
 



{
  "parent": "minecraft:block/template_glazed_terracotta",
  "textures": {
    "pattern": "minecraft:block/essence_block_darkness"
  }
}

blockstate:



{
  "variants": {
    "facing=east": {
      "model": "elementalcombat_weaponry:block/essence_block_darkness",
      "y": 270
    },
    "facing=north": {
      "model": "elementalcombat_weaponry:block/essence_block_darkness",
      "y": 180
    },
    "facing=south": {
      "model": "elementalcombat_weaponry:block/essence_block_darkness"
    },
    "facing=west": {
      "model": "elementalcombat_weaponry:block/essence_block_darkness",
      "y": 90
    }
  }
}

The block should behave the same as the glazed_terracotta. So what am I missing?
Also here is a link to directory in my git repository:
https://github.com/Tavi007/ElementalCombat-Weaponry/tree/main/src/main/resources/assets/elementalcombat_weaponry

My second problem is about the build.gradle file. I finished another mod, which is a library mod. Before I try to upload it to Maven Central, I would like to test it first by importing it into my test project. Since I got the jar locally I added

implementation fg.deobf(files('C:/Minecraft Modding/ElementalCombat/build/libs/elementalcombat-forge-1.16.5-1.1.1-api.jar'))

to the dependencies section of the build.gradle file. This does add the jar as library, but I run into a FieldNotFound exception on startup. The missing field has an obfuscated name, so I don't really know, what is missing. All I know is in which line the error occures and it's this one: https://github.com/Tavi007/ElementalCombat/blob/b562cba34d2bee7a647aa4d088372c917d67a3d4/src/main/java/Tavi007/ElementalCombat/init/EnchantmentList.java#L39

Do I get the error, because the minecraft mapping wasn't applied correctly? Or is it due to something completly different? I'm at a complete loss here. :/

And here is the link to the gradle file: https://github.com/Tavi007/ElementalCombat-Weaponry/blob/main/build.gradle
(It currently only uses the api jar, because this way I can keep working on it.)

Edited by Tavi007
Link to comment
Share on other sites

You are right. I forgot to revert it back (I was testing, if minecraft:block/stone was working, which it was not. I had the same problem: itemstack is looking fine (display a stone block), but the actual block was missing its texture). I changed the namespace to elementalcombat_weaponry, which should be the correct one. Sadly the issue with the texture persist.

Edited by Tavi007
Link to comment
Share on other sites

I believe the problem is because in your code you assign ESSENSE_BLOCK_DARKNESS to a new Block(), which does not have directionality, and so none of the variants in your blockstates definition will ever apply.

In order to fix this, you probably want to create a class for your blocks that extends HorizontalBlock (take a look at the GlazedTerracottaBlock class as an example), and in the register method, use that class instead of Block.

Edited by A Soulspark
Link to comment
Share on other sites

You are completly right. Swapping Block to GlazedTerracottaBlock fixed the problem (No need to create a new Block type, since the block should behave excatly like the terracotta block anyway). Thank you!

Edited by Tavi007
Link to comment
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.
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.