New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added model bake event, ISmartBlock/itemModel, Block.getExtendedState, IExtendedState and IUnlistedProperty #1518
Conversation
cbec820
to
e3a219c
Compare
@RainWarrior IIRC, they only accept PRs if they are 1 commit. |
0e2837c
to
963ae8b
Compare
f855b14
to
3cbc4b2
Compare
555204b
to
e20dff2
Compare
8fac288
to
2c0408d
Compare
0242229
to
b4b4fdc
Compare
8837ea9
to
613a6c8
Compare
…ch like TextureStitchEvent allows to load custom textures), ISmartBlock/ItemModel (ability form models to react to block/item states), Block.getExtendedState, support for unlisted properties in block states. Includes example implementation of http://imgur.com/a/FyyJX
613a6c8
to
134fbaa
Compare
I say this is good! I think it we definitly help the comunity. |
Needing more modders feedback on this. |
import com.google.common.primitives.Ints; | ||
|
||
@Mod(modid = ModelBakeEventDebug.MODID, version = ModelBakeEventDebug.VERSION) | ||
public class ModelBakeEventDebug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure it's required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? Every import is necessary, if that's what this is about
How will this work with stuff that has multiple or unlimited different kinds of combinations of parts like the MicroBlocks mod? If a model has to be made for each possible combination the list of models would become huge. |
@heldplayer did you look at the included example/description? Do you have any concrete questions? |
@RainWarrior Yes, but I can't make anything out of it and it doesn't look easy at all. |
The problem is his examples include everything even a custom model format. And it has no documentation it it. |
This isn't bad at all! However, I feel that the "IUnlistedProperty" name feels like a bit of a hack: why not something more akin to IRenderingProperty or IModelProperty? I also feel that adding a second, disconnected set of priorities to a BlockState is a bit of a hack. The limitation to BakedQuads might hurt a few developers, but I need feedback from those who would actually care about this. Also, we need benchmarks to see whether spamming a hundred BakedQuads doesn't create huge issues with object generation and garbage collection spam, similar to the Vec3Pool removal issues we experience in 1.7.10. EDIT: Yes, I can work with this for BuildCraft. I'll hate every bloody second of it, but I can work with this if that's what it takes. |
I say keep it. It'll be a great addition. Just listen to @asiekierka though. |
About @heldplayer's worry with microblocks... An UnlistedProperty can pass any Object through it. So, yes. |
There is no 'keep it' this is what is going in. If you modders have some valid concerns you can voice them and we can address them before pulling it in officially. Waiting on feedback is the exact reason why I haven't pulled it yet. As for the 'spamming a hundred BakedQuads' If you make your model correctly there won't be any spam. There will simply be one comprehensive set, and your smart model will select a subset of those to render. Not to hard once you think about it. As for the name, as this is intended to not explicitly be tied to models/rendering, we didn't want that in the name. This is the best we could come up with that didn't sound stupid and wasn't super long. |
GitHub for mobile is being dumb and not letting me make a line comment, so I'll just say it here: Minor detail, but I think the |
Added model bake event, ISmartBlock/itemModel, Block.getExtendedState, IExtendedState and IUnlistedProperty
Something didn't take properly, or get tested. net/minecraftforge/common/property/ExtendedBlockState.java:21: error: StateImplementation has protected access in BlockState |
@dmillerw gradle caches need to be cleaned after at/exc change |
Ya, seems @RainWarrior Didn't test the userdev setup :p |
@SubscribeEvent | ||
public void onModelBakeEvent(ModelBakeEvent event) | ||
{ | ||
TextureAtlasSprite base = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("minecraft:blocks/slime"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to get a non vanilla textures to load here? Been reading vanilla source code for about an hour but I don't see no direct way to add textures to the texture atlas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.7 way of TextureStitchEvent.Pre still works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, thanks!
There seems to be a lighting issue, the base texture renders with more brightness than normal - that is also visible in the screenshot here (slime block is much brighter) |
ModelBakeEvent allows mods to insert custom baked models, much like TextureStitchEvent allows to insert custom textures.
ISmartBlock/ItemModel allows model to get the block/item state for rendering.
IExtendedState allows to use properties that shouldn't be enumerated (IUnlistedProperty).
Example implements this: http://imgur.com/a/FyyJX