From d618b9feb6b145605695756191b47eb6b55b515b Mon Sep 17 00:00:00 2001 From: screret <68943070+screret@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:10:15 +0300 Subject: [PATCH] remove GT config init because it broke some packs and is useless --- src/main/java/argent_matter/gcyr/GCyR.java | 5 +---- .../gcyr/api/space/satellite/Satellite.java | 9 ++++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/argent_matter/gcyr/GCyR.java b/src/main/java/argent_matter/gcyr/GCyR.java index ce8520d9..b8ae0f58 100644 --- a/src/main/java/argent_matter/gcyr/GCyR.java +++ b/src/main/java/argent_matter/gcyr/GCyR.java @@ -15,7 +15,6 @@ import com.gregtechceu.gtceu.api.machine.MachineDefinition; import com.gregtechceu.gtceu.api.recipe.GTRecipeType; import com.gregtechceu.gtceu.api.recipe.RecipeCondition; -import com.gregtechceu.gtceu.config.ConfigHolder; import com.lowdragmc.lowdraglib.gui.factory.UIFactory; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; @@ -52,7 +51,6 @@ public GCyR() { } public static void init() { - ConfigHolder.init(); // Forcefully init GT config because fabric doesn't allow dependents to load after dependencies GCyRConfig.init(); GCyRNetworking.init(); UIFactory.register(EntityUIFactory.INSTANCE); @@ -64,7 +62,6 @@ public static void init() { GCyRBlocks.init(); GCyRItems.init(); GCyRMenus.init(); - ; GCyRDatagen.init(); @@ -117,4 +114,4 @@ public void registerRecipeTypes(GTCEuAPI.RegisterEvent event) { GCyRMachines.init(); } -} \ No newline at end of file +} diff --git a/src/main/java/argent_matter/gcyr/api/space/satellite/Satellite.java b/src/main/java/argent_matter/gcyr/api/space/satellite/Satellite.java index 92a0de9f..4724d483 100644 --- a/src/main/java/argent_matter/gcyr/api/space/satellite/Satellite.java +++ b/src/main/java/argent_matter/gcyr/api/space/satellite/Satellite.java @@ -2,6 +2,8 @@ import argent_matter.gcyr.api.registries.GCyRRegistries; import argent_matter.gcyr.api.space.satellite.data.SatelliteData; +import argent_matter.gcyr.common.data.GCyRSatellites; +import argent_matter.gcyr.common.satellite.EmptySatellite; import com.mojang.datafixers.Products; import com.mojang.serialization.codecs.RecordCodecBuilder; import lombok.Getter; @@ -86,11 +88,12 @@ public CompoundTag serializeNBT() { public static Satellite deserializeNBT(CompoundTag nbt, Level level) { SatelliteType type = GCyRRegistries.SATELLITES.get(new ResourceLocation(nbt.getString("id"))); - SatelliteType.SatelliteFactory satellite = type.getFactory(); - SatelliteData data = SatelliteData.deserializeNBT(nbt.getCompound("data")); - ResourceKey levelResourceKey = ResourceKey.create(Registries.DIMENSION, new ResourceLocation(nbt.getString("level"))); + if (type == null) { + return new EmptySatellite(GCyRSatellites.EMPTY, data, levelResourceKey); + } + SatelliteType.SatelliteFactory satellite = type.getFactory(); Satellite sat = satellite.create(type, data, levelResourceKey); if (nbt.contains("extra")) sat.deserializeExtraData(nbt.get("extra"), level);