diff --git a/src/main/java/io/github/apace100/apoli/access/BiomeWeatherAccess.java b/src/main/java/io/github/apace100/apoli/access/BiomeWeatherAccess.java deleted file mode 100644 index c485775a9..000000000 --- a/src/main/java/io/github/apace100/apoli/access/BiomeWeatherAccess.java +++ /dev/null @@ -1,6 +0,0 @@ -package io.github.apace100.apoli.access; - -public interface BiomeWeatherAccess { - float apoli$getDownfall(); - void apoli$setDownfall(float downfall); -} diff --git a/src/main/java/io/github/apace100/apoli/condition/type/BiomeConditionTypes.java b/src/main/java/io/github/apace100/apoli/condition/type/BiomeConditionTypes.java index 9731d52d9..e24278171 100644 --- a/src/main/java/io/github/apace100/apoli/condition/type/BiomeConditionTypes.java +++ b/src/main/java/io/github/apace100/apoli/condition/type/BiomeConditionTypes.java @@ -1,7 +1,6 @@ package io.github.apace100.apoli.condition.type; import io.github.apace100.apoli.Apoli; -import io.github.apace100.apoli.access.BiomeWeatherAccess; import io.github.apace100.apoli.condition.factory.ConditionTypeFactory; import io.github.apace100.apoli.condition.type.biome.InTagConditionType; import io.github.apace100.apoli.condition.type.biome.PrecipitationConditionType; @@ -25,7 +24,7 @@ public class BiomeConditionTypes { public static void register() { MetaConditionTypes.register(ApoliDataTypes.BIOME_CONDITION, BiomeConditionTypes::register); - register(createSimpleFactory(Apoli.identifier("high_humidity"), biomeEntry -> ((BiomeWeatherAccess) (Object) biomeEntry.value()).apoli$getDownfall() > 0.85F)); + register(createSimpleFactory(Apoli.identifier("high_humidity"), biomeEntry -> biomeEntry.value().weather.downfall() > 0.85F)); register(TemperatureConditionType.getFactory()); register(PrecipitationConditionType.getFactory()); register(InTagConditionType.getFactory()); diff --git a/src/main/java/io/github/apace100/apoli/mixin/BiomeBuilderMixin.java b/src/main/java/io/github/apace100/apoli/mixin/BiomeBuilderMixin.java deleted file mode 100644 index d59aaebc5..000000000 --- a/src/main/java/io/github/apace100/apoli/mixin/BiomeBuilderMixin.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.github.apace100.apoli.mixin; - -import io.github.apace100.apoli.access.BiomeWeatherAccess; -import net.minecraft.world.biome.Biome; -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import java.util.Objects; - -@Mixin(Biome.Builder.class) -public class BiomeBuilderMixin { - - @Nullable - @Shadow - private Float downfall; - - @Inject(method = "build", at = @At("RETURN")) - private void apoli$storeDownfall(CallbackInfoReturnable cir) { - ((BiomeWeatherAccess) (Object) cir.getReturnValue()).apoli$setDownfall(Objects.requireNonNull(downfall)); - } - -} diff --git a/src/main/java/io/github/apace100/apoli/mixin/BiomeMixin.java b/src/main/java/io/github/apace100/apoli/mixin/BiomeMixin.java deleted file mode 100644 index 86767d074..000000000 --- a/src/main/java/io/github/apace100/apoli/mixin/BiomeMixin.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.github.apace100.apoli.mixin; - -import io.github.apace100.apoli.access.BiomeWeatherAccess; -import net.minecraft.world.biome.Biome; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Unique; - -@Mixin(Biome.class) -public class BiomeMixin implements BiomeWeatherAccess { - - @Unique - private float apoli$downfall; - - @Override - public float apoli$getDownfall() { - return apoli$downfall; - } - - @Override - public void apoli$setDownfall(float downfall) { - apoli$downfall = downfall; - } -} diff --git a/src/main/resources/apoli.accesswidener b/src/main/resources/apoli.accesswidener index 89dcf5a5b..a8cc4289e 100644 --- a/src/main/resources/apoli.accesswidener +++ b/src/main/resources/apoli.accesswidener @@ -27,3 +27,5 @@ accessible class net/minecraft/registry/tag/TagGroupLoader$TagDependencies extendable method net/minecraft/text/TranslatableTextContent updateTranslations ()V accessible field net/minecraft/text/TranslatableTextContent languageCache Lnet/minecraft/util/Language; accessible field net/minecraft/text/TranslatableTextContent translations Ljava/util/List; +accessible field net/minecraft/world/biome/Biome weather Lnet/minecraft/world/biome/Biome$Weather; +accessible class net/minecraft/world/biome/Biome$Weather diff --git a/src/main/resources/apoli.mixins.json b/src/main/resources/apoli.mixins.json index 1c19cba62..8b5c24eed 100644 --- a/src/main/resources/apoli.mixins.json +++ b/src/main/resources/apoli.mixins.json @@ -12,8 +12,6 @@ "ArmorSlotMixin", "ArmorStandEntityMixin", "AttributeContainerMixin", - "BiomeBuilderMixin", - "BiomeMixin", "BlockCollisionSpliteratorMixin", "BlockItemMixin", "ComponentSubPredicateMixin",