From 203ab692e1f4e1bde347353f9c3759a0426822c3 Mon Sep 17 00:00:00 2001 From: IntegerLimit <103940576+IntegerLimit@users.noreply.github.com> Date: Mon, 1 May 2023 21:00:49 +1000 Subject: [PATCH] 1.0.4: Remove Config + Remove TOP Fixes TOP fixes will be implemented a different way into base SD Drawers. --- README.md | 9 ++- build.gradle | 1 - .../java/io/github/nomiceu/GTDConfig.java | 14 ----- .../java/io/github/nomiceu/GTDrawers.java | 14 ----- .../nomiceu/integration/TOP/TOPCompat.java | 12 ---- .../TOP/provider/DrawerLogoProvider.java | 61 ------------------- .../java/io/github/nomiceu/type/Mods.java | 13 ---- 7 files changed, 7 insertions(+), 117 deletions(-) delete mode 100644 src/main/java/io/github/nomiceu/GTDConfig.java delete mode 100644 src/main/java/io/github/nomiceu/integration/TOP/TOPCompat.java delete mode 100644 src/main/java/io/github/nomiceu/integration/TOP/provider/DrawerLogoProvider.java diff --git a/README.md b/README.md index e88d846..1f8bcc2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ It adds drawers for rubber and treated wood types found in [GTCEu](https://www.c This mod requires GTCEu 2.6+, Storage Drawers, and their dependencies (Chameleon & CodeChickenLib) -This mod is a fork of JOB10's [Storage Drawers Kappa Addon](https://www.curseforge.com/minecraft/mc-mods/storagedrawerskappa), and uses its main code. This removes all of the integrations there, and replaces it with GT integration. The code there is very flexible, and can be used to create other drawer types. Go there for more information. +This mod is a fork of JOB10's [Storage Drawers Kappa Addon](https://www.curseforge.com/minecraft/mc-mods/storagedrawerskappa), and uses its main code. This removes all the integrations there, and replaces it with GT integration. The code there is very flexible, and can be used to create other drawer types. Go there for more information. Please note that JOB10's repo is itself a fork of Raptor's [Storage Drawers Unlimited](https://www.curseforge.com/minecraft/mc-mods/storage-drawers-unlimited). We have used JOB10's fork, as it has some fixes over the original mod. Both mods are amazing. @@ -16,4 +16,9 @@ Please note that JOB10's repo is itself a fork of Raptor's [Storage Drawers Unli #### Added Drawers / Trims * Rubber Wood -* Treated Wood \ No newline at end of file +* Treated Wood + +#### Removed All Config (No longer needed for GT Drawers) + +#### New Buildscript + diff --git a/build.gradle b/build.gradle index 539514a..0cf21fb 100644 --- a/build.gradle +++ b/build.gradle @@ -77,7 +77,6 @@ dependencies { } deobfCompile "curse.maven:storage-drawers-223852:2952606" deobfCompile "curse.maven:chameleon-230497:2450900" - deobfCompile "curse.maven:the-one-probe-245211:2667280" } sourceSets { diff --git a/src/main/java/io/github/nomiceu/GTDConfig.java b/src/main/java/io/github/nomiceu/GTDConfig.java deleted file mode 100644 index ab857b9..0000000 --- a/src/main/java/io/github/nomiceu/GTDConfig.java +++ /dev/null @@ -1,14 +0,0 @@ -package io.github.nomiceu; - -import net.minecraftforge.common.config.Config; -import net.minecraftforge.common.config.Config.Comment; -import net.minecraftforge.common.config.Config.Name; -import net.minecraftforge.common.config.Config.RequiresMcRestart; - -@Config(modid = GTDrawers.MODID) -public class GTDConfig { - @Name("Fix TOP Displaying Taped Drawers") - @Comment("Fix a bug where TOP would display a taped drawer if the drawer contained items, if the [Keep Contents on Break] storage drawer config was enabled.") - @RequiresMcRestart - public static boolean fixTOPTaped = true; -} diff --git a/src/main/java/io/github/nomiceu/GTDrawers.java b/src/main/java/io/github/nomiceu/GTDrawers.java index bdd59bf..a439428 100644 --- a/src/main/java/io/github/nomiceu/GTDrawers.java +++ b/src/main/java/io/github/nomiceu/GTDrawers.java @@ -1,9 +1,5 @@ package io.github.nomiceu; -import java.io.File; - -import io.github.nomiceu.integration.TOP.TOPCompat; -import net.minecraftforge.fml.common.Loader; import org.apache.logging.log4j.Logger; import io.github.nomiceu.proxy.CommonProxy; @@ -37,25 +33,15 @@ public class GTDrawers { public static CommonProxy proxy; public static Logger logger; - - public static File configFolder; - @EventHandler public void preInit(FMLPreInitializationEvent event) { logger = event.getModLog(); - configFolder = new File(event.getModConfigurationDirectory(), "gregtechdrawers"); - if(!configFolder.isDirectory()) - configFolder.mkdirs(); proxy.preInit(event); } @EventHandler public void init(FMLInitializationEvent event) { proxy.init(event); - if (Loader.isModLoaded("theoneprobe")) { - logger.info("Detected The One Probe. Enabling custom handlers."); - TOPCompat.registerProviders(); - } } @EventHandler diff --git a/src/main/java/io/github/nomiceu/integration/TOP/TOPCompat.java b/src/main/java/io/github/nomiceu/integration/TOP/TOPCompat.java deleted file mode 100644 index cc76edc..0000000 --- a/src/main/java/io/github/nomiceu/integration/TOP/TOPCompat.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.github.nomiceu.integration.TOP; - -import io.github.nomiceu.integration.TOP.provider.DrawerLogoProvider; -import mcjty.theoneprobe.TheOneProbe; -import mcjty.theoneprobe.api.ITheOneProbe; - -public class TOPCompat { - public static void registerProviders() { - ITheOneProbe TOP = TheOneProbe.theOneProbeImp; - TOP.registerBlockDisplayOverride(new DrawerLogoProvider()); - } -} diff --git a/src/main/java/io/github/nomiceu/integration/TOP/provider/DrawerLogoProvider.java b/src/main/java/io/github/nomiceu/integration/TOP/provider/DrawerLogoProvider.java deleted file mode 100644 index 7ba4e65..0000000 --- a/src/main/java/io/github/nomiceu/integration/TOP/provider/DrawerLogoProvider.java +++ /dev/null @@ -1,61 +0,0 @@ -package io.github.nomiceu.integration.TOP.provider; - -import com.jaquadro.minecraft.storagedrawers.block.BlockDrawers; -import com.jaquadro.minecraft.storagedrawers.block.tile.TileEntityDrawers; -import io.github.nomiceu.GTDConfig; -import mcjty.theoneprobe.Tools; -import mcjty.theoneprobe.api.*; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import mcjty.theoneprobe.config.Config; - -import java.util.Objects; - -import static com.jaquadro.minecraft.storagedrawers.StorageDrawers.config; -import static mcjty.theoneprobe.api.TextStyleClass.MODNAME; - -public class DrawerLogoProvider implements IBlockDisplayOverride { - @Override - public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer entityPlayer, World world, IBlockState blockState, IProbeHitData probeHitData) { - Block block = blockState.getBlock(); - if (!(block instanceof BlockDrawers) || !GTDConfig.fixTOPTaped) - return false; - - String modid = Tools.getModName(block); - - TileEntityDrawers tile = (TileEntityDrawers) Objects.requireNonNull(world.getTileEntity(probeHitData.getPos())); - - if (!config.cache.keepContentsOnBreak || tile.isSealed()) - return false; - - ItemStack pickBlock = probeHitData.getPickBlock(); - - if (pickBlock == null || pickBlock.isEmpty()) - return false; - - if (pickBlock.hasTagCompound() && pickBlock.getTagCompound() != null) { - if (pickBlock.getTagCompound().hasKey("tile")){ - NBTTagCompound compound = pickBlock.getTagCompound(); - compound.removeTag("tile"); - pickBlock.setTagCompound(compound); - } - } - - if (Tools.show(mode, Config.getRealConfig().getShowModName())) - probeInfo.horizontal() - .item(pickBlock) - .vertical() - .itemLabel(pickBlock) - .text(MODNAME + modid); - else - probeInfo.horizontal(probeInfo.defaultLayoutStyle() - .alignment(ElementAlignment.ALIGN_CENTER)) - .item(pickBlock); - - return true; - } -} diff --git a/src/main/java/io/github/nomiceu/type/Mods.java b/src/main/java/io/github/nomiceu/type/Mods.java index 12a7010..1020d9b 100644 --- a/src/main/java/io/github/nomiceu/type/Mods.java +++ b/src/main/java/io/github/nomiceu/type/Mods.java @@ -1,7 +1,5 @@ package io.github.nomiceu.type; -import java.io.File; -import java.io.FileNotFoundException; import java.util.Map; import java.util.Scanner; import java.util.stream.Collectors; @@ -9,9 +7,7 @@ import io.github.nomiceu.GTDrawers; import io.github.nomiceu.block.BlockGTDrawers; import io.github.nomiceu.block.BlockGTTrim; -import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; -import org.apache.logging.log4j.Level; import io.github.nomiceu.item.ItemGTDrawers; import io.github.nomiceu.item.ItemGTTrim; @@ -625,15 +621,6 @@ public class Mods { } } - // load user-defined mods - for(File modList : GTDrawers.configFolder.listFiles(file -> file.isFile() && StringUtils.endsWithIgnoreCase(file.getName(), ".sdmods"))) { - try(Scanner scan = new Scanner(modList)) { - ModListParser.parseModList(modList.getName(), scan); - } catch(ModListParser.ModListSyntaxException | FileNotFoundException e) { - GTDrawers.logger.log(Level.ERROR, e); - } - } - MODS = StreamableFilterableIterable.wrap(Mod.internal_modlist); ENABLED_MODS = MODS.filter(Mod::isEnabled); BY_ID = MODS.stream()