diff --git a/src/main/java/de/florianmichael/viafabricplus/fixes/entity/EntityDimensionReplacements.java b/src/main/java/de/florianmichael/viafabricplus/fixes/entity/EntityDimensionReplacements.java index f75e7794..89304b28 100644 --- a/src/main/java/de/florianmichael/viafabricplus/fixes/entity/EntityDimensionReplacements.java +++ b/src/main/java/de/florianmichael/viafabricplus/fixes/entity/EntityDimensionReplacements.java @@ -29,9 +29,15 @@ import java.util.Map; import static de.florianmichael.viafabricplus.util.MapUtil.linkedHashMap; +/** + * Data dump for entity dimension changes between versions. + */ public class EntityDimensionReplacements { - private static final Map, Map> ENTITY_DIMENSIONS = linkedHashMap( + /** + * A map of entity types to a map of versions to dimensions. + */ + public static final Map, Map> ENTITY_DIMENSIONS = linkedHashMap( EntityType.WITHER, linkedHashMap( VersionEnum.r1_7_6tor1_7_10, EntityDimensions.changing(0.9F, 4.0F), VersionEnum.r1_8, EntityType.WITHER.getDimensions() @@ -136,7 +142,7 @@ public class EntityDimensionReplacements { ) ); - public static void init() { + static { ChangeProtocolVersionCallback.EVENT.register((oldVersion, newVersion) -> MinecraftClient.getInstance().execute(() -> ENTITY_DIMENSIONS.forEach((entityType, dimensionMap) -> { for (Map.Entry entry : dimensionMap.entrySet()) { final VersionEnum version = entry.getKey(); @@ -152,4 +158,8 @@ public class EntityDimensionReplacements { }))); } + public static void init() { + // Loads the class and triggers the static initializer. + } + }