-
Notifications
You must be signed in to change notification settings - Fork 20
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
Registry sync v2 - API #167
base: feature/registry-sync-v2/main
Are you sure you want to change the base?
Registry sync v2 - API #167
Conversation
- differentiate "synced" Index-Key-Value registries from simple Key-Value registries - start preparing registry remapping
… missing when it should.
… missing when it should. (again)
…ween their numerical ids.
d9996b3
to
3a74c69
Compare
|
||
@Override | ||
public PacketByteBuf writeCompound(NbtCompound compound) { | ||
return this.writeNbtCompound(compound); | ||
public PacketByteBuf writeCompound(NbtCompound tag) { |
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.
tag -> nbt / compound
@@ -71,6 +71,10 @@ public String toString() { | |||
return this.namespace + ':' + this.path; | |||
} | |||
|
|||
public String toTranslationKey() { | |||
return this.namespace + "." + this.path; |
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.
unused - any reason why we need this? items, blocks and such have their own format for translation keys
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's used later in the registry implementation to set the translation key automatically, which was something already done in registry sync v1 previously.
public PacketByteBuf writeCompound(NbtCompound compound) { | ||
this.writeNbtCompound(compound); | ||
public PacketByteBuf writeCompound(NbtCompound tag) { | ||
this.writeNbtCompound(tag); |
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.
tag -> nbt / compound
public PacketByteBuf writeCompound(NbtCompound compound) { | ||
this.writeNbtCompound(compound); | ||
public PacketByteBuf writeCompound(NbtCompound tag) { | ||
this.writeNbtCompound(tag); |
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.
ditto
@@ -20,6 +20,7 @@ | |||
import net.legacyfabric.fabric.api.util.Identifier; | |||
import net.legacyfabric.fabric.api.util.SinceMC; | |||
|
|||
@Deprecated |
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.
could add a javadoc comment here, stating what should be used instead
@@ -20,6 +20,7 @@ | |||
import net.legacyfabric.fabric.api.util.Identifier; | |||
import net.legacyfabric.fabric.api.util.SinceMC; | |||
|
|||
@Deprecated |
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.
ditto, same for the rest of the v1 api
import net.legacyfabric.fabric.api.registry.v2.event.RegistryEntryAddedCallback; | ||
import net.legacyfabric.fabric.api.util.Identifier; | ||
|
||
public interface Registry<T> extends Iterable<T> { |
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.
Registry -> RegistryExtensions? I don't think its a good idea to keep it as the same name as an existing minecraft 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.
RegistryExtensions
doesn't fit in this case as this interface can be used to implement a custom registry implementation.
However maybe we should prefix those classes with either Fabric
, LF
or LegacyFabric
to differentiate them from vanilla classes as you've said.
New registry api, more extensible, only handles registry infrastructure (remapping included).
Individual registries for content are moved to their own module in other pr depending on this one.