From b0b91653f2cf19beb13018eb6a361ca0bdfe7db8 Mon Sep 17 00:00:00 2001 From: MCTian-mi <35869948+MCTian-mi@users.noreply.github.com> Date: Sun, 7 Jul 2024 14:42:13 +0800 Subject: [PATCH 1/7] RecipeMapGroup --- .../api/recipes/RecipeMapGroup.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java diff --git a/src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java b/src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java new file mode 100644 index 000000000..18a340c2b --- /dev/null +++ b/src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java @@ -0,0 +1,51 @@ +package supersymmetry.api.recipes; + +import gregtech.api.recipes.Recipe; +import gregtech.api.recipes.RecipeBuilder; +import gregtech.api.recipes.RecipeMap; +import gregtech.api.recipes.builders.SimpleRecipeBuilder; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.annotation.Nonnull; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; + +public class RecipeMapGroup> extends RecipeMap { + + private final RecipeMap[] recipeMaps; + + public RecipeMapGroup(@NotNull String unlocalizedName, int maxInputs, int maxOutputs, int maxFluidInputs, int maxFluidOutputs, @NotNull R defaultRecipeBuilder, boolean isHidden, @NotNull RecipeMap[] recipeMaps) { + super(unlocalizedName, maxInputs, maxOutputs, maxFluidInputs, maxFluidOutputs, defaultRecipeBuilder, isHidden); + this.recipeMaps = recipeMaps; + } + + @Nonnull + public static RecipeMapGroup create(@NotNull String unlocalizedName, @NotNull RecipeMap[] recipeMaps) { + AtomicInteger maxInputs = new AtomicInteger(), maxOutputs = new AtomicInteger(), + maxFluidInputs = new AtomicInteger(), maxFluidOutputs = new AtomicInteger(); + Arrays.stream(recipeMaps).forEach(recipeMap -> { + maxInputs.set(Math.max(maxInputs.get(), recipeMap.getMaxInputs())); + maxOutputs.set(Math.max(maxOutputs.get(), recipeMap.getMaxOutputs())); + maxFluidInputs.set(Math.max(maxFluidInputs.get(), recipeMap.getMaxFluidInputs())); + maxFluidOutputs.set(Math.max(maxFluidOutputs.get(), recipeMap.getMaxFluidOutputs())); + }); + return new RecipeMapGroup<>(unlocalizedName, maxInputs.get(), maxOutputs.get(), maxFluidInputs.get(), maxFluidOutputs.get(), new SimpleRecipeBuilder(), true, recipeMaps); + } + + @Nullable + @Override + public Recipe findRecipe(long voltage, List inputs, List fluidInputs, boolean exactVoltage) { + AtomicReference recipe = new AtomicReference<>(); + Arrays.stream(recipeMaps) + .parallel() + .map(recipeMap -> recipeMap.findRecipe(voltage, inputs, fluidInputs, exactVoltage)) + .filter(java.util.Objects::nonNull) + .findFirst().ifPresent(recipe::set); + return recipe.get(); + } +} From 571b0f085e40d610588101ebaa10b6c6a4fcb754 Mon Sep 17 00:00:00 2001 From: MCTian-mi <35869948+MCTian-mi@users.noreply.github.com> Date: Sun, 7 Jul 2024 15:01:36 +0800 Subject: [PATCH 2/7] catalyst register --- .../api/recipes/RecipeMapGroup.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java b/src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java index 18a340c2b..2ca199fee 100644 --- a/src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java +++ b/src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java @@ -4,6 +4,8 @@ import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.RecipeMap; import gregtech.api.recipes.builders.SimpleRecipeBuilder; +import gregtech.api.recipes.category.GTRecipeCategory; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; @@ -11,7 +13,9 @@ import javax.annotation.Nonnull; import java.util.Arrays; +import java.util.Collections; import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; @@ -48,4 +52,18 @@ public Recipe findRecipe(long voltage, List inputs, List .findFirst().ifPresent(recipe::set); return recipe.get(); } + + @Nonnull + @Override + public Map> getRecipesByCategory() { + Map> res = new Object2ObjectOpenHashMap<>(); + for (RecipeMap recipeMap : recipeMaps) { + recipeMap.getRecipesByCategory().forEach((category, recipes) -> { + List list = res.getOrDefault(category, new java.util.ArrayList<>()); + list.addAll(recipes); + res.put(category, list); + }); + } + return Collections.unmodifiableMap(res); + } } From 2e31b2d25a07070a6bccd58e3e4b3085f5adcd08 Mon Sep 17 00:00:00 2001 From: MCTian-mi <35869948+MCTian-mi@users.noreply.github.com> Date: Sat, 21 Sep 2024 21:05:55 +0800 Subject: [PATCH 3/7] this better ig --- .../api/recipes/RecipeMapGroup.java | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java b/src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java index 2ca199fee..aae5ae1c3 100644 --- a/src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java +++ b/src/main/java/supersymmetry/api/recipes/RecipeMapGroup.java @@ -16,29 +16,27 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; public class RecipeMapGroup> extends RecipeMap { - private final RecipeMap[] recipeMaps; + protected final RecipeMap[] recipeMaps; - public RecipeMapGroup(@NotNull String unlocalizedName, int maxInputs, int maxOutputs, int maxFluidInputs, int maxFluidOutputs, @NotNull R defaultRecipeBuilder, boolean isHidden, @NotNull RecipeMap[] recipeMaps) { + protected RecipeMapGroup(@NotNull String unlocalizedName, int maxInputs, int maxOutputs, int maxFluidInputs, int maxFluidOutputs, @NotNull R defaultRecipeBuilder, boolean isHidden, @NotNull RecipeMap[] recipeMaps) { super(unlocalizedName, maxInputs, maxOutputs, maxFluidInputs, maxFluidOutputs, defaultRecipeBuilder, isHidden); this.recipeMaps = recipeMaps; } @Nonnull - public static RecipeMapGroup create(@NotNull String unlocalizedName, @NotNull RecipeMap[] recipeMaps) { - AtomicInteger maxInputs = new AtomicInteger(), maxOutputs = new AtomicInteger(), - maxFluidInputs = new AtomicInteger(), maxFluidOutputs = new AtomicInteger(); - Arrays.stream(recipeMaps).forEach(recipeMap -> { - maxInputs.set(Math.max(maxInputs.get(), recipeMap.getMaxInputs())); - maxOutputs.set(Math.max(maxOutputs.get(), recipeMap.getMaxOutputs())); - maxFluidInputs.set(Math.max(maxFluidInputs.get(), recipeMap.getMaxFluidInputs())); - maxFluidOutputs.set(Math.max(maxFluidOutputs.get(), recipeMap.getMaxFluidOutputs())); - }); - return new RecipeMapGroup<>(unlocalizedName, maxInputs.get(), maxOutputs.get(), maxFluidInputs.get(), maxFluidOutputs.get(), new SimpleRecipeBuilder(), true, recipeMaps); + public static RecipeMapGroup create(@NotNull String unlocalizedName, @NotNull RecipeMap... recipeMaps) { + int maxInputs = 0, maxOutputs = 0, maxFluidInputs = 0, maxFluidOutputs = 0; + for (RecipeMap recipeMap : recipeMaps) { + maxInputs = Math.max(maxInputs, recipeMap.getMaxInputs()); + maxOutputs = Math.max(maxOutputs, recipeMap.getMaxOutputs()); + maxFluidInputs = Math.max(maxFluidInputs, recipeMap.getMaxFluidInputs()); + maxFluidOutputs = Math.max(maxFluidOutputs, recipeMap.getMaxFluidOutputs()); + } + return new RecipeMapGroup<>(unlocalizedName, maxInputs, maxOutputs, maxFluidInputs, maxFluidOutputs, new SimpleRecipeBuilder(), true, recipeMaps); } @Nullable @@ -58,11 +56,7 @@ public Recipe findRecipe(long voltage, List inputs, List public Map> getRecipesByCategory() { Map> res = new Object2ObjectOpenHashMap<>(); for (RecipeMap recipeMap : recipeMaps) { - recipeMap.getRecipesByCategory().forEach((category, recipes) -> { - List list = res.getOrDefault(category, new java.util.ArrayList<>()); - list.addAll(recipes); - res.put(category, list); - }); + res.putAll(recipeMap.getRecipesByCategory()); } return Collections.unmodifiableMap(res); } From f3f67b669d02546dd75353a9b5892fd4e9be8c73 Mon Sep 17 00:00:00 2001 From: MCTian-mi <35869948+MCTian-mi@users.noreply.github.com> Date: Sun, 29 Sep 2024 13:59:47 +0800 Subject: [PATCH 4/7] better handling bdsandm drum rotation --- .../integration/bdsandm/BDSAndMModule.java | 14 ++------------ .../mixins/bdsandm/TileEntityBarrelMixin.java | 18 ++++++++++++++++++ src/main/resources/mixins.susy.bdsandm.json | 3 ++- 3 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 src/main/java/supersymmetry/mixins/bdsandm/TileEntityBarrelMixin.java diff --git a/src/main/java/supersymmetry/integration/bdsandm/BDSAndMModule.java b/src/main/java/supersymmetry/integration/bdsandm/BDSAndMModule.java index fde2c0eff..314d821ad 100644 --- a/src/main/java/supersymmetry/integration/bdsandm/BDSAndMModule.java +++ b/src/main/java/supersymmetry/integration/bdsandm/BDSAndMModule.java @@ -1,6 +1,5 @@ package supersymmetry.integration.bdsandm; -import funwayguy.bdsandm.blocks.tiles.TileEntityBarrel; import funwayguy.bdsandm.core.BDSM; import gregtech.api.GTValues; import gregtech.api.cover.CoverRayTracer; @@ -9,13 +8,10 @@ import gregtech.common.items.tool.rotation.ICustomRotationBehavior; import gregtech.integration.IntegrationSubmodule; import net.minecraft.block.BlockDirectional; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import supersymmetry.modules.SuSyModules; -import java.util.Objects; - @GregTechModule( moduleID = SuSyModules.MODULE_BDSAndM, containerID = GTValues.MODID, @@ -29,14 +25,8 @@ public class BDSAndMModule extends IntegrationSubmodule { if (gridSide == null) return false; gridSide = gridSide.getOpposite(); // IDK what's happening here, blame the original author if (gridSide != state.getValue(BlockDirectional.FACING)) { - TileEntityBarrel barrel = ((TileEntityBarrel) world.getTileEntity(pos)); - if (barrel != null) { - state = state.withProperty(BlockDirectional.FACING, gridSide); - NBTTagCompound tagCompound = barrel.writeToNBT(new NBTTagCompound()); - world.setBlockState(pos, state); - Objects.requireNonNull(world.getTileEntity(pos)).readFromNBT(tagCompound); - return true; - } + world.setBlockState(pos, state.withProperty(BlockDirectional.FACING, gridSide)); + return true; } return false; }; diff --git a/src/main/java/supersymmetry/mixins/bdsandm/TileEntityBarrelMixin.java b/src/main/java/supersymmetry/mixins/bdsandm/TileEntityBarrelMixin.java new file mode 100644 index 000000000..6d6f9acb1 --- /dev/null +++ b/src/main/java/supersymmetry/mixins/bdsandm/TileEntityBarrelMixin.java @@ -0,0 +1,18 @@ +package supersymmetry.mixins.bdsandm; + +import funwayguy.bdsandm.blocks.tiles.TileEntityBarrel; +import net.minecraft.block.state.IBlockState; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import org.jetbrains.annotations.NotNull; +import org.spongepowered.asm.mixin.Mixin; + +@Mixin(TileEntityBarrel.class) +public abstract class TileEntityBarrelMixin extends TileEntity { + + @Override + public boolean shouldRefresh(@NotNull World world, @NotNull BlockPos pos, @NotNull IBlockState oldState, @NotNull IBlockState newSate) { + return oldState.getBlock() != newSate.getBlock(); + } +} diff --git a/src/main/resources/mixins.susy.bdsandm.json b/src/main/resources/mixins.susy.bdsandm.json index 8eba3bb30..3e409716d 100644 --- a/src/main/resources/mixins.susy.bdsandm.json +++ b/src/main/resources/mixins.susy.bdsandm.json @@ -6,6 +6,7 @@ "compatibilityLevel" : "JAVA_8", "mixins" : [ "BlockBarrelBaseMixin", - "ItemBarrelMixin" + "ItemBarrelMixin", + "TileEntityBarrelMixin" ] } From 626f0e3acc07dbeccd9ae989c3f4b8009db6e7cc Mon Sep 17 00:00:00 2001 From: MCTian-mi <35869948+MCTian-mi@users.noreply.github.com> Date: Sun, 29 Sep 2024 22:03:04 +0800 Subject: [PATCH 5/7] add crt to dependencies.gradle --- dependencies.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dependencies.gradle b/dependencies.gradle index 1ee8b360b..54bb666af 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -63,4 +63,6 @@ dependencies { compileOnly rfg.deobf("curse.maven:travelers-backpack-321117:3150850") compileOnly rfg.deobf("curse.maven:barrels-drums-storage-more-319404:2708193") + + api("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.700") } From f7078e464b658572c6b3ea6487f98fb16da53195 Mon Sep 17 00:00:00 2001 From: MCTian-mi <35869948+MCTian-mi@users.noreply.github.com> Date: Mon, 30 Sep 2024 23:28:33 +0800 Subject: [PATCH 6/7] fix modules --- .../supersymmetry/common/CommonProxy.java | 9 ++++++++ .../{bubbles => baubles}/BaublesModule.java | 17 +++++++++----- .../integration/bdsandm/BDSAndMModule.java | 7 +++--- .../supersymmetry/modules/SuSyCoreModule.java | 22 +++++++++++++++++++ .../supersymmetry/modules/SuSyModules.java | 5 ++++- 5 files changed, 51 insertions(+), 9 deletions(-) rename src/main/java/supersymmetry/integration/{bubbles => baubles}/BaublesModule.java (73%) create mode 100644 src/main/java/supersymmetry/modules/SuSyCoreModule.java diff --git a/src/main/java/supersymmetry/common/CommonProxy.java b/src/main/java/supersymmetry/common/CommonProxy.java index 0cfd35adf..72163e39d 100644 --- a/src/main/java/supersymmetry/common/CommonProxy.java +++ b/src/main/java/supersymmetry/common/CommonProxy.java @@ -1,11 +1,13 @@ package supersymmetry.common; import gregtech.api.block.VariantItemBlock; +import gregtech.api.modules.ModuleContainerRegistryEvent; import gregtech.api.unification.material.event.MaterialEvent; import gregtech.api.unification.material.event.PostMaterialEvent; import gregtech.client.utils.TooltipHelper; import gregtech.common.blocks.BlockWireCoil; import gregtech.common.items.MetaItems; +import gregtech.modules.ModuleManager; import net.minecraft.block.Block; import net.minecraft.client.resources.I18n; import net.minecraft.entity.monster.EntityZombie; @@ -38,6 +40,7 @@ import supersymmetry.loaders.SuSyWorldLoader; import supersymmetry.loaders.SusyOreDictionaryLoader; import supersymmetry.loaders.recipes.SuSyRecipeLoader; +import supersymmetry.modules.SuSyModules; import java.util.Objects; import java.util.function.Function; @@ -172,6 +175,12 @@ public static void registerRecipes(RegistryEvent.Register event) { SuSyRecipeLoader.init(); } + @SubscribeEvent + public static void registerModuleContainer(ModuleContainerRegistryEvent event) { + ModuleManager.getInstance().registerContainer(new SuSyModules()); + } + + private static ItemBlock createItemBlock(T block, Function producer) { ItemBlock itemBlock = producer.apply(block); itemBlock.setRegistryName(Objects.requireNonNull(block.getRegistryName())); diff --git a/src/main/java/supersymmetry/integration/bubbles/BaublesModule.java b/src/main/java/supersymmetry/integration/baubles/BaublesModule.java similarity index 73% rename from src/main/java/supersymmetry/integration/bubbles/BaublesModule.java rename to src/main/java/supersymmetry/integration/baubles/BaublesModule.java index 51b4e54b6..0bd3270c8 100644 --- a/src/main/java/supersymmetry/integration/bubbles/BaublesModule.java +++ b/src/main/java/supersymmetry/integration/baubles/BaublesModule.java @@ -1,15 +1,17 @@ -package supersymmetry.integration.bubbles; +package supersymmetry.integration.baubles; import baubles.api.BaubleType; -import gregtech.api.GTValues; import gregtech.api.modules.GregTechModule; import gregtech.common.items.MetaItems; import gregtech.integration.IntegrationSubmodule; import net.minecraft.item.Item; import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.jetbrains.annotations.NotNull; +import supersymmetry.Supersymmetry; +import supersymmetry.api.SusyLog; import supersymmetry.common.item.behavior.ArmorBaubleBehavior; import supersymmetry.modules.SuSyModules; @@ -17,11 +19,11 @@ import java.util.List; @GregTechModule( - moduleID = SuSyModules.MODULE_BUBBLES, - containerID = GTValues.MODID, + moduleID = SuSyModules.MODULE_BAUBLES, + containerID = Supersymmetry.MODID, modDependencies = "baubles", name = "SuSy Baubles Integration", - description = "Baubles Integration Module") + description = "SuSy Baubles Integration Module") public class BaublesModule extends IntegrationSubmodule { @SubscribeEvent(priority = EventPriority.LOW) @@ -36,4 +38,9 @@ public static void registerItems(RegistryEvent.Register event) { public List> getEventBusSubscribers() { return Collections.singletonList(BaublesModule.class); } + + @Override + public void init(FMLInitializationEvent event) { + SusyLog.logger.info("Baubles found. Enabling integration..."); + } } diff --git a/src/main/java/supersymmetry/integration/bdsandm/BDSAndMModule.java b/src/main/java/supersymmetry/integration/bdsandm/BDSAndMModule.java index 314d821ad..df1365bd0 100644 --- a/src/main/java/supersymmetry/integration/bdsandm/BDSAndMModule.java +++ b/src/main/java/supersymmetry/integration/bdsandm/BDSAndMModule.java @@ -1,7 +1,6 @@ package supersymmetry.integration.bdsandm; import funwayguy.bdsandm.core.BDSM; -import gregtech.api.GTValues; import gregtech.api.cover.CoverRayTracer; import gregtech.api.modules.GregTechModule; import gregtech.common.items.tool.rotation.CustomBlockRotations; @@ -10,11 +9,13 @@ import net.minecraft.block.BlockDirectional; import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import supersymmetry.Supersymmetry; +import supersymmetry.api.SusyLog; import supersymmetry.modules.SuSyModules; @GregTechModule( moduleID = SuSyModules.MODULE_BDSAndM, - containerID = GTValues.MODID, + containerID = Supersymmetry.MODID, modDependencies = "bdsandm", name = "SuSy BDSAndM Integration", description = "BDSAndM Integration Module") @@ -33,7 +34,7 @@ public class BDSAndMModule extends IntegrationSubmodule { @Override public void init(FMLInitializationEvent event) { - getLogger().info("BDSAndM found. Enabling integration..."); + SusyLog.logger.info("BDSAndM found. Enabling integration..."); CustomBlockRotations.registerCustomRotation(BDSM.blockMetalBarrel, BDSAndM_BARREL_BEHAVIOR); CustomBlockRotations.registerCustomRotation(BDSM.blockWoodBarrel, BDSAndM_BARREL_BEHAVIOR); } diff --git a/src/main/java/supersymmetry/modules/SuSyCoreModule.java b/src/main/java/supersymmetry/modules/SuSyCoreModule.java new file mode 100644 index 000000000..7e11fe00d --- /dev/null +++ b/src/main/java/supersymmetry/modules/SuSyCoreModule.java @@ -0,0 +1,22 @@ +package supersymmetry.modules; + +import gregtech.api.modules.GregTechModule; +import gregtech.api.modules.IGregTechModule; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import supersymmetry.Supersymmetry; +import supersymmetry.api.SusyLog; + +@GregTechModule( + moduleID = SuSyModules.MODULE_CORE, + containerID = Supersymmetry.MODID, + name = "SuSy Core", + description = "Core module of SuSy Core, so this should call SuSy Core Core ngl.", + coreModule = true) +public class SuSyCoreModule implements IGregTechModule { + + @Override + public @NotNull Logger getLogger() { + return SusyLog.logger; + } +} diff --git a/src/main/java/supersymmetry/modules/SuSyModules.java b/src/main/java/supersymmetry/modules/SuSyModules.java index fa001a8d1..3924cd29a 100644 --- a/src/main/java/supersymmetry/modules/SuSyModules.java +++ b/src/main/java/supersymmetry/modules/SuSyModules.java @@ -1,12 +1,15 @@ package supersymmetry.modules; import gregtech.api.modules.IModuleContainer; +import gregtech.api.modules.ModuleContainer; import supersymmetry.Supersymmetry; +@ModuleContainer public class SuSyModules implements IModuleContainer { + public static final String MODULE_CORE = "susy_core"; public static final String MODULE_BDSAndM = "bdsandm_integration"; - public static final String MODULE_BUBBLES = "baubles_integration"; + public static final String MODULE_BAUBLES = "baubles_integration"; @Override public String getID() { From a400ee46a9263bd0a30804068cdc7a278f950e1d Mon Sep 17 00:00:00 2001 From: MCTian-mi <35869948+MCTian-mi@users.noreply.github.com> Date: Sun, 6 Oct 2024 23:00:31 +0800 Subject: [PATCH 7/7] fix drop pad re-appear when you switch to survival mode --- src/main/java/supersymmetry/common/EventHandlers.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/supersymmetry/common/EventHandlers.java b/src/main/java/supersymmetry/common/EventHandlers.java index 5476c8583..c40aca4a3 100644 --- a/src/main/java/supersymmetry/common/EventHandlers.java +++ b/src/main/java/supersymmetry/common/EventHandlers.java @@ -53,8 +53,6 @@ public class EventHandlers { @SubscribeEvent public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { - if (event.player.isCreative()) return; - NBTTagCompound playerData = event.player.getEntityData(); NBTTagCompound data = playerData.hasKey(EntityPlayer.PERSISTED_NBT_TAG) ? playerData.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG) : new NBTTagCompound(); @@ -62,6 +60,7 @@ public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { data.setBoolean(FIRST_SPAWN, true); playerData.setTag(EntityPlayer.PERSISTED_NBT_TAG, data); + if (event.player.isCreative()) return; EntityDropPod dropPod = new EntityDropPod(event.player.getEntityWorld(), event.player.posX, event.player.posY + 256, event.player.posZ);