-
Notifications
You must be signed in to change notification settings - Fork 29
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
Mapper backend refactor and texture deco improvements #280
base: master
Are you sure you want to change the base?
Conversation
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.
this was an issue prior to this PR, but what should be done about animated textures, if anything?
src/main/java/com/cleanroommc/groovyscript/mapper/AbstractObjectMapper.java
Outdated
Show resolved
Hide resolved
...om/cleanroommc/groovyscript/server/features/textureDecoration/TextureDecorationProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cleanroommc/groovyscript/mapper/TooltipEmbedding.java
Outdated
Show resolved
Hide resolved
...n/java/com/cleanroommc/groovyscript/server/features/textureDecoration/TextureDecoration.java
Outdated
Show resolved
Hide resolved
...n/java/com/cleanroommc/groovyscript/server/features/textureDecoration/TextureDecoration.java
Outdated
Show resolved
Hide resolved
|
||
public boolean hasTextureBinder() { | ||
if (this.hasTextureBinder == null) { | ||
for (Method method : getClass().getDeclaredMethods()) { |
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.
why does this need reflection?
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.
Its a default implementation to check if the method is overriden. Only then the texture binder can be defined
|
||
@Override | ||
public void provideCompletion(int index, Completions items) { | ||
if (index == 0) items.addAllOfRegistry(ForgeRegistries.BLOCKS); |
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.
is it possible to have completion for properties of blockstates?
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.
I thought about that, but we would need information about what the first param currently is
|
||
@Override | ||
public void provideCompletion(int index, Completions items) { | ||
if (index == 0) items.addAllOfRegistry(ForgeRegistries.ITEMS); |
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.
is it possible for the valid metadata of items to have autocompletion? pretty sure its a "no"
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.
It is possible, but id argue that its not worth it
|
||
public class BlockStateMapper extends AbstractObjectMapper<IBlockState> { | ||
|
||
public static final BlockStateMapper INSTANCE = new BlockStateMapper("blockstate", null); |
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.
since this is the only place you are going to init BlockStateMapper
, why pass null
here and not drop and argument and call super(name, null, IBlockState.class)
?
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.
I was doing that for item so that mods can extend that class for a template (for example gregtech metaitems). I guess its not very useful for blockstate
AbstractObjectMapper<T>
class