From e8d8461e1da7bd5d30d3756e4bc137392d2db028 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 28 Oct 2022 16:08:20 +0200 Subject: [PATCH] Removed unused functions --- .../mixin/client/WorldOpenFlowsMixin.java | 2 +- .../mixin/common/PrimaryLevelDataMixin.java | 43 ------------------- .../together/world/event/WorldBootstrap.java | 8 +--- .../resources/together.mixins.common.json | 1 - 4 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 src/main/java/org/betterx/worlds/together/mixin/common/PrimaryLevelDataMixin.java diff --git a/src/main/java/org/betterx/worlds/together/mixin/client/WorldOpenFlowsMixin.java b/src/main/java/org/betterx/worlds/together/mixin/client/WorldOpenFlowsMixin.java index a5be8e10..6e300b59 100644 --- a/src/main/java/org/betterx/worlds/together/mixin/client/WorldOpenFlowsMixin.java +++ b/src/main/java/org/betterx/worlds/together/mixin/client/WorldOpenFlowsMixin.java @@ -58,7 +58,7 @@ public abstract class WorldOpenFlowsMixin { Function function, CallbackInfo ci ) { - WorldsTogether.LOGGER.info("called createFreshLevel..."); + WorldsTogether.LOGGER.warning("called createFreshLevel..."); //TODO: 1.19.3 no mor dimensions at this stage... //WorldBootstrap.InFreshLevel.setupNewWorld(levelID, worldGenSettings, this.levelSource, Optional.empty()); } diff --git a/src/main/java/org/betterx/worlds/together/mixin/common/PrimaryLevelDataMixin.java b/src/main/java/org/betterx/worlds/together/mixin/common/PrimaryLevelDataMixin.java deleted file mode 100644 index 7dce4fa7..00000000 --- a/src/main/java/org/betterx/worlds/together/mixin/common/PrimaryLevelDataMixin.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.betterx.worlds.together.mixin.common; - -import org.betterx.worlds.together.world.event.WorldBootstrap; - -import com.mojang.datafixers.DataFixer; -import com.mojang.serialization.Dynamic; -import com.mojang.serialization.Lifecycle; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.nbt.Tag; -import net.minecraft.resources.RegistryOps; -import net.minecraft.world.level.LevelSettings; -import net.minecraft.world.level.levelgen.WorldOptions; -import net.minecraft.world.level.storage.LevelVersion; -import net.minecraft.world.level.storage.PrimaryLevelData; - -import org.spongepowered.asm.mixin.Mixin; -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.Optional; -import org.jetbrains.annotations.Nullable; - -@Mixin(PrimaryLevelData.class) -public class PrimaryLevelDataMixin { - @Inject(method = "parse", at = @At("HEAD")) - private static void bcl_parse( - Dynamic dynamic, - DataFixer dataFixer, - int i, - @Nullable CompoundTag compoundTag, - LevelSettings levelSettings, - LevelVersion levelVersion, - PrimaryLevelData.SpecialWorldProperty specialWorldProperty, - WorldOptions worldOptions, - Lifecycle lifecycle, - CallbackInfoReturnable cir - ) { - if (dynamic.getOps() instanceof RegistryOps regOps) { - WorldBootstrap.InGUI.registryReadyOnLoadedWorld(Optional.of(regOps)); - } - } -} diff --git a/src/main/java/org/betterx/worlds/together/world/event/WorldBootstrap.java b/src/main/java/org/betterx/worlds/together/world/event/WorldBootstrap.java index 839ccb26..a3ed1594 100644 --- a/src/main/java/org/betterx/worlds/together/world/event/WorldBootstrap.java +++ b/src/main/java/org/betterx/worlds/together/world/event/WorldBootstrap.java @@ -158,14 +158,8 @@ public class WorldBootstrap { Helpers.onRegistryReady(worldGenSettingsComponent.registryHolder()); } - public static void registryReadyOnLoadedWorld(Optional> registryOps) { -// if (registryOps.orElse(null) instanceof RegistryOpsAccessor acc) { -// Helpers.onRegistryReady(acc.bcl_getRegistryAccess()); -// } - } - public static void registryReady(RegistryAccess access) { - //Helpers.onRegistryReady(access); + Helpers.onRegistryReady(access); } public static void setupNewWorld( diff --git a/src/main/resources/together.mixins.common.json b/src/main/resources/together.mixins.common.json index 94c091a8..86a6b94b 100644 --- a/src/main/resources/together.mixins.common.json +++ b/src/main/resources/together.mixins.common.json @@ -14,7 +14,6 @@ "MinecraftServerMixinLate", "NoiseBasedChunkGeneratorMixin", "NoiseGeneratorSettingsMixin", - "PrimaryLevelDataMixin", "RegistryDataLoaderMixin", "RegistryOpsAccessor", "TagLoaderMixin",