DataWatcher idextender API

This commit is contained in:
FalsePattern committed 2024-11-14 21:22:10 +01:00
1 parent 3a4194a3ff
commit dc4879114d
2 files changed
+20 -1

No files matched your search

+4 -1
View File
@@ -25,7 +25,7 @@ If you notice any problems when opening NEID worlds with EndlessIDs, please open
| Entity IDs | 256 | 256 | 256 | 32,768 |
| Potion IDs | 32 | 32 | 32 | 65,536 |
| Enchantment IDs | 256 | 256 | 256 | 32,768 |
| DataWatcher IDs | 32 | 127 (Broken) | 127 (Broken) | 65,536 |
| DataWatcher IDs | 32 | 127 (Broken) | 127 | 65,536 |
| Dimension IDs | Theoretically unlimited, 4,294,967,295 in practice | Same | Same | Same |
## Mod compat
@@ -135,6 +135,9 @@ if (Loader.isModLoaded("idextender")){
}
```
The `idextender.DataWatcher` class also exposes the extended DataWatcher count (used for entity data syncing over network)
in a similar fashion.
Note that these values CAN be identical to the vanilla values if the ID Extension mod implementing it has a config to
toggle itself, existence of the IDExtender class does not guarantee a fixed increase, and you should check that the
returned value is large enough for your needs.
+16
View File
@@ -0,0 +1,16 @@
package idextender;
import com.falsepattern.endlessids.config.GeneralConfig;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
public class DataWatcher {
public static int maxWatchableID() {
return GeneralConfig.extendDataWatcher ? ExtendedConstants.maxWatchableID : VanillaConstants.maxWatchableID;
}
public static int watchableBits() {
return GeneralConfig.extendDataWatcher ? ExtendedConstants.watchableBits : VanillaConstants.watchableBits;
}
}