Fixed Mixins that were targeting the wrong class/methods.

This commit is contained in:
Sebastian Hartte
2020-09-19 02:48:59 +02:00
parent d8e5f4fed5
commit 5be0adbc89
3 changed files with 7 additions and 7 deletions
@@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.RegistryKey; import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeKeys; import net.minecraft.world.biome.BuiltinBiomes;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
@@ -23,21 +23,21 @@ import appeng.spatial.SpatialStorageDimensionIds;
* This only needs to be here because the server-side will create a dynamic * This only needs to be here because the server-side will create a dynamic
* registry manager long before our mod is initialized. * registry manager long before our mod is initialized.
*/ */
@Mixin(BiomeKeys.class) @Mixin(BuiltinBiomes.class)
public class BiomeKeysMixin { public class BuiltinBiomesMixin {
@Unique @Unique
private static final Logger LOGGER = LogManager.getLogger(); private static final Logger LOGGER = LogManager.getLogger();
@Shadow @Shadow
private static Int2ObjectMap<RegistryKey<Biome>> BIOMES; private static Int2ObjectMap<RegistryKey<Biome>> BY_RAW_ID;
@Inject(method = "<clinit>", at = @At("TAIL")) @Inject(method = "<clinit>", at = @At("TAIL"))
private static void registerBiomes(CallbackInfo ci) { private static void registerBiomes(CallbackInfo ci) {
BuiltinRegistries.add(BuiltinRegistries.BIOME, SpatialStorageDimensionIds.BIOME_KEY.getValue(), BuiltinRegistries.add(BuiltinRegistries.BIOME, SpatialStorageDimensionIds.BIOME_KEY.getValue(),
SpatialStorageBiome.INSTANCE); SpatialStorageBiome.INSTANCE);
int rawId = BuiltinRegistries.BIOME.getRawId(SpatialStorageBiome.INSTANCE); int rawId = BuiltinRegistries.BIOME.getRawId(SpatialStorageBiome.INSTANCE);
RegistryKey<Biome> prev = BIOMES.put(rawId, SpatialStorageDimensionIds.BIOME_KEY); RegistryKey<Biome> prev = BY_RAW_ID.put(rawId, SpatialStorageDimensionIds.BIOME_KEY);
if (prev != null) { if (prev != null) {
LOGGER.warn("Biome with raw-id {} was already registered: {}", rawId, prev); LOGGER.warn("Biome with raw-id {} was already registered: {}", rawId, prev);
} }
@@ -49,7 +49,7 @@ public class DimensionTypeMixin {
dimensionType); dimensionType);
} }
@Inject(method = "method_28517", at = @At("RETURN")) @Inject(method = "createDefaultDimensionOptions", at = @At("RETURN"))
private static void buildDimensionRegistry(Registry<DimensionType> dimensionTypes, Registry<Biome> biomes, private static void buildDimensionRegistry(Registry<DimensionType> dimensionTypes, Registry<Biome> biomes,
Registry<ChunkGeneratorSettings> chunkGeneratorSettings, long seed, Registry<ChunkGeneratorSettings> chunkGeneratorSettings, long seed,
CallbackInfoReturnable<SimpleRegistry<DimensionOptions>> cir) { CallbackInfoReturnable<SimpleRegistry<DimensionOptions>> cir) {
@@ -7,7 +7,7 @@
"spatial.DimensionTypeMixin", "spatial.DimensionTypeMixin",
"spatial.DimensionOptionMixin", "spatial.DimensionOptionMixin",
"spatial.EntityMixin", "spatial.EntityMixin",
"spatial.BiomesMixin", "spatial.BuiltinBiomesMixin",
"structure.StructuresConfigMixin", "structure.StructuresConfigMixin",
"structure.ConfiguredStructureFeaturesAccessor", "structure.ConfiguredStructureFeaturesAccessor",
"structure.StructureFeatureAccessor", "structure.StructureFeatureAccessor",