Astral Sorcery

Astral Sorcery

63M Downloads

[MC 1.12.2]Registry DataSerializers with Forge registry

ginyai opened this issue ยท 3 comments

commented

public static void registerSerializers() {
DataSerializers.registerSerializer(VECTOR);
DataSerializers.registerSerializer(FLUID);
DataSerializers.registerSerializer(LONG);
}

MinecraftForge/MinecraftForge#5245

Disconnected from the server with the following message:
https://gist.github.com/ginyai/d7b08bd499a30f333cfc19a54ad375f3

Testing code:

        StringBuilder s = new StringBuilder();
        for (int i = 0 ; i < 256; i++) {
            DataSerializer<?> dataSerializer = DataSerializers.getSerializer(i);
            if (dataSerializer != null) {
                s.append(String.format("%03d: ", i)).append(dataSerializer.getClass().toString()).append("\n");
            } else {
                break;
            }
        }
        TestMod.logger.info(s.toString());

Output in server:

000: class net.minecraft.network.datasync.DataSerializers$1
001: class net.minecraft.network.datasync.DataSerializers$2
002: class net.minecraft.network.datasync.DataSerializers$3
003: class net.minecraft.network.datasync.DataSerializers$4
004: class net.minecraft.network.datasync.DataSerializers$5
005: class net.minecraft.network.datasync.DataSerializers$6
006: class net.minecraft.network.datasync.DataSerializers$8
007: class net.minecraft.network.datasync.DataSerializers$9
008: class net.minecraft.network.datasync.DataSerializers$10
009: class net.minecraft.network.datasync.DataSerializers$11
010: class net.minecraft.network.datasync.DataSerializers$12
011: class net.minecraft.network.datasync.DataSerializers$13
012: class net.minecraft.network.datasync.DataSerializers$7
013: class net.minecraft.network.datasync.DataSerializers$14
014: class hellfirepvp.astralsorcery.common.util.ASDataSerializers$2
015: class hellfirepvp.astralsorcery.common.util.ASDataSerializers$3
016: class hellfirepvp.astralsorcery.common.util.ASDataSerializers$1
017: class forestry.core.owner.GameProfileDataSerializer

In client:

...
014: class forestry.core.owner.GameProfileDataSerializer
015: class hellfirepvp.astralsorcery.common.util.ASDataSerializers$2
016: class hellfirepvp.astralsorcery.common.util.ASDataSerializers$3
017: class hellfirepvp.astralsorcery.common.util.ASDataSerializers$1

The order changed.

I made to fix it by dependencies = "after:forestry;before:astralsorcery"
But I think the best way is to update forge to 14.23.5.2826+, and use forge registry to sync the data serializers added by mods.

commented

where am I supposed to stick this code?

commented

@SBON-CORP you don't. You use a release of Astral sorcery that's 1.10.26 or later and it's already in there.

commented

Fixed with #1358