You're also registering DECAYABLE and CHECK_DECAY as variants, so htey must either be defined in the JSON or stated to be ignored by registering a custom StateMapper like this:
ModelLoader.setCustomStateMapper(log, new StateMap.Builder().ignore(new IProperty[] {TEMBLockLeaves.DECAYABLE}).ignore(new IProperty[] {TEMBLockLeaves.CHECK_DECAY}).build());
(This is 1.10 code, not sure if it's the same in 1.8.9, though. Btw you won't need to register it's render anymore)
You're also registering DECAYABLE and CHECK_DECAY as variants, so htey must either be defined in the JSON or stated to be ignored by registering a custom StateMapper like this:
ModelLoader.setCustomStateMapper(log, new StateMap.Builder().ignore(new IProperty[] {TEMBLockLeaves.DECAYABLE}).ignore(new IProperty[] {TEMBLockLeaves.CHECK_DECAY}).build());
(This is 1.10 code, not sure if it's the same in 1.8.9, though. Btw you won't need to register it's render anymore)
Move the call to ModelLoader from register() into registerRenders as it's client-only. Eventually remove the line that registers the render for the leaf block.
If that doesn't work, please provide a log so I can see what went wrong with the model.
if i use the call to ModelLoader in place of the normal rendering line, the placed model still doesn't load and the inventory model doesn't load either.
Those values are missing in the blockstates file to work (or have to be ignored using the statemapper):
[18:49:31] [Client thread/ERROR] [FML/]: Model definition for location tem:log#axis=z,variant=apple not found
[18:49:31] [Client thread/ERROR] [FML/]: Model definition for location tem:leaves#variant=apple not found
[18:49:31] [Client thread/ERROR] [FML/]: Model definition for location tem:log#axis=y,variant=apple not found
[18:49:31] [Client thread/ERROR] [FML/]: Model definition for location tem:log#axis=x,variant=apple not found
Re-implement the ModelLoader call for it to work.
Btw you also have to define them in your setDefaultState() method for the ItemBkock to render properly.
Directly extend BlockLeaves and override (not just implement your own!) methods from that class.
except doing that directly breaks getWoodType in TEMBlockLeaf due to the use of TEMBlockPlanks instead of BlockPlanks like so, otherwise i'd have done it to begin with:
except doing that directly breaks getWoodType in TEMBlockLeaf due to the use of TEMBlockPlanks instead of BlockPlanks like so, otherwise i'd have done it to begin with:
Then override getWoodType to use your type instead.
it yells at me regardless of whether i specifically put an @Override before the function or not, and i'm directly extending BlockLeaves just like you said.
you sure there isn't a way to just call TEMBlockLeafBase#setGraphicsLevel from TEM_blocks#init or somewhere similar?
ok, so i've tried calling TEMBlockLeafBase#setGraphicsLevel from like 5 different places and i've gotten a crash with every attempt, and extending BlockLeaves directly as opposed to TEMBlockLeafBase breaks TEMBlockLeaf#getWoodType as mentioned earlier.
public TEMBlockLeafBase() {
super(Material.leaves, false);
this.setTickRandomly(true);
this.setCreativeTab(CreativeTabs.tabDecorations);
this.setHardness(0.2F);
this.setLightOpacity(1);
this.setStepSound(soundTypeGrass);
this.setGraphicsLevel(true); // <-- wow i'm dumb for not remembering this worked
}
way to go, me.
what makes me even more ashamed of myself is that it actually works:
not to mention i practically said this exact thing out loud just a few posts ago..
god, i sometimes wish i could slap myself across the face from my own forgetfulness. :v
anywho, UpcraftLP, thank you for all your assistance.
i want to have the color/texture defined by a VARIANT property as with planks and logs.
here's the code...
except when attempting to test, i get a crash and can't load the game at all.
halp?
Your register() method is empty, so when you try to register your renders you register them for null.
Modify your register() method to call GameRegistry#register for each Block. Also don't forget to register an ItemBlock for each Block.
except as demonstrated here, TEMBlockPlanks and TEMBlockLog already register themselves and they work without issue.
...i'm actually surprised i didn't make the same change with the leaves. gimme a sec...
edit: well, it loads...
i've added the .json files to the gist and updated the existing files there as well, for reference.
You're also registering DECAYABLE and CHECK_DECAY as variants, so htey must either be defined in the JSON or stated to be ignored by registering a custom StateMapper like this:
(This is 1.10 code, not sure if it's the same in 1.8.9, though. Btw you won't need to register it's render anymore)
i mean...it sorta worked...?
updated everything again. did i do it right, or did i miss an important piece of info?
Move the call to ModelLoader from register() into registerRenders as it's client-only. Eventually remove the line that registers the render for the leaf block.
If that doesn't work, please provide a log so I can see what went wrong with the model.
if i use the call to ModelLoader in place of the normal rendering line, the placed model still doesn't load and the inventory model doesn't load either.
log
gist
(also there's still the issue of the sound set, which is still that of stone, oddly enough)
sorry for the double post, but...
i may or may not have changed the way the new leaves work to be like the stock leaves.
TEMBlockLeafBase = BlockLeaves
TEMBlockLeaf = BlockOldLeaf
the transparency (or rather, lack thereof) is the only issue now.
Those values are missing in the blockstates file to work (or have to be ignored using the statemapper):
Re-implement the ModelLoader call for it to work.
Btw you also have to define them in your setDefaultState() method for the ItemBkock to render properly.
the apple variant is a placeholder; it will actually be implemented. i prefer having one variant of something working before starting on the others.
also, transparency is still an issue...everything else works fine (the ModelLoader call was re-implemented already):
(yes i'm setting up an entire biome for these trees)
Are you sure that TEMBlockLeafBase#setGraphicsLevel is being called? Add printouts to see if it is.
it's...actually not. where would i add a call to it?
Directly extend BlockLeaves and override (not just implement your own!) methods from that class.
except doing that directly breaks getWoodType in TEMBlockLeaf due to the use of TEMBlockPlanks instead of BlockPlanks like so, otherwise i'd have done it to begin with:
eclipse even yells at me: "- The return type is incompatible with
BlockLeaves.getWoodType(int)"
Then override getWoodType to use your type instead.
it yells at me regardless of whether i specifically put an @Override before the function or not, and i'm directly extending BlockLeaves just like you said.
you sure there isn't a way to just call TEMBlockLeafBase#setGraphicsLevel from TEM_blocks#init or somewhere similar?
ok, so i've tried calling TEMBlockLeafBase#setGraphicsLevel from like 5 different places and i've gotten a crash with every attempt, and extending BlockLeaves directly as opposed to TEMBlockLeafBase breaks TEMBlockLeaf#getWoodType as mentioned earlier.
i am officially stumped.
Maybe just use this (didn't test if it works, maybe you have to check that this is called on the clientside only):
doesn't work either way....
eh...this is really confusing.
edit:
way to go, me.
what makes me even more ashamed of myself is that it actually works:
not to mention i practically said this exact thing out loud just a few posts ago..
god, i sometimes wish i could slap myself across the face from my own forgetfulness. :v
anywho, UpcraftLP, thank you for all your assistance.