You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
People told me on the discord that EntityData Wrappers had already been a thing. I am working on a project where I want to work with metadata a lot but it should not be version bound. This was fine until now but from 1.20.1 to 1.20.2, display entities have a new meta field and all indices are one off. I started to make wrappers for the different EntityData fields, but thought it was something many people could profit of. There are only little changes in between different versions, but it is a lot of work to initially set it up.
I can do this for some basic fields and maybe other people will contribute too until we could have a branch with wrappers for all the meta fields.
I had something like this in mind (in reality with a baseclass EntityDataWrapper that holds the server version and inherits from EntityData):
Also the following example would require one change in the EntityMeta Packet Wrapper, which is to filter all EntityData objects whose index is < 0.
publicclassRemainingAirEntityDataWrapperextendsEntityData {
privatefinalServerVersionserverVersion;
publicRemainingAirEntityDataWrapper(intticks) {
super(-1, EntityDataTypes.INT, ticks);
setIndex(versionedIndex());
this.serverVersion = PacketEvents.getAPI().getServerManager().getVersion();
}
@OverridepublicIntegergetValue() {
return (Integer) super.getValue();
}
/** * @return -1 if this field (not the index) does not exist on the current version. Otherwise, the index of the field * will be returned according to the current server version. */privateintversionedIndex() {
return1; // in this case never changed from 1.8 to 1.20.2
}
}
The only reason to add it is to make client side entities that are mostly not bound to a specific version.
The text was updated successfully, but these errors were encountered:
I would definitely support your project if you made this entity data abstraction a seperate project. It could then be seen as a packetevents addon, if its fully functional i would advocate for it.
People told me on the discord that EntityData Wrappers had already been a thing. I am working on a project where I want to work with metadata a lot but it should not be version bound. This was fine until now but from 1.20.1 to 1.20.2, display entities have a new meta field and all indices are one off. I started to make wrappers for the different EntityData fields, but thought it was something many people could profit of. There are only little changes in between different versions, but it is a lot of work to initially set it up.
I can do this for some basic fields and maybe other people will contribute too until we could have a branch with wrappers for all the meta fields.
I had something like this in mind (in reality with a baseclass EntityDataWrapper that holds the server version and inherits from EntityData):
Also the following example would require one change in the EntityMeta Packet Wrapper, which is to filter all EntityData objects whose index is < 0.
The only reason to add it is to make client side entities that are mostly not bound to a specific version.
The text was updated successfully, but these errors were encountered: