diff --git a/dependencies.gradle b/dependencies.gradle index 26b5a59..49dff4f 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -9,13 +9,17 @@ dependencies { compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.14.6-GTNH:dev") {transitive = false} compileOnly("com.github.GTNewHorizons:BloodMagic:1.8.5") {transitive = false} compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.2:dev") {transitive = false} - compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.11:dev") {transitive = false} - compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.97:dev") {transitive = false} + compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.2:dev") {transitive = false} + compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.46:dev") { + exclude module: "Avaritia" + } + compileOnly("com.github.GTNewHorizons:ModularUI2:2.3.25-1.7.10:dev") + compileOnly("com.github.GTNewHorizons:GTNHLib:0.9.0:dev") compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false} compileOnly("curse.maven:cofh-lib-220333:2388748") {transitive = false} compileOnly("curse.maven:cofh-core-69162:2388751") {transitive = false} compileOnly("curse.maven:witchery-69673:2234410") {transitive = false} - runtimeOnly("com.github.GTNewHorizons:GTNHLib:0.7.7:dev") + runtimeOnly("com.github.GTNewHorizons:GTNHLib:0.7.0:dev") } diff --git a/src/main/java/fox/spiteful/avaritia/Mods.java b/src/main/java/fox/spiteful/avaritia/Mods.java new file mode 100644 index 0000000..ced1052 --- /dev/null +++ b/src/main/java/fox/spiteful/avaritia/Mods.java @@ -0,0 +1,640 @@ +package fox.spiteful.avaritia; + +import java.util.Locale; + +import net.minecraft.util.ResourceLocation; + +import org.jetbrains.annotations.NotNull; + +import com.gtnewhorizon.gtnhlib.util.data.IMod; +import com.gtnewhorizon.gtnhmixins.builders.ITargetMod; +import com.gtnewhorizon.gtnhmixins.builders.TargetModBuilder; + +import cpw.mods.fml.common.Loader; + +@SuppressWarnings("unused") +public enum Mods implements IMod, ITargetMod { + + AE2FluidCraft(Names.A_E2_FLUID_CRAFT), + AFSU(Names.A_F_S_U), + AdventureBackpack(Names.ADVENTURE_BACKPACK), + AkashicTome(Names.AKASHIC_TOME), + AlchemyGrate(Names.ALCHEMY_GRATE), + AmazingTrophies(Names.AMAZING_TROPHIES), + Angelica(Names.ANGELICA), + AngerMod(Names.ANGER_MOD), + AppleCore(Names.APPLE_CORE), + AppliedEnergistics2(Names.APPLIED_ENERGISTICS2), + ArchitectureCraft(Names.ARCHITECTURE_CRAFT), + AsieLib(Names.ASIE_LIB), + Avaritia(Names.AVARITIA), + AvaritiaAddons(Names.AVARITIA_ADDONS), + MineAndBladeBattleGear2(Names.MINE_AND_BLADE_BATTLE_GEAR2), + Baubles(Names.BAUBLES), + BeeBetterAtBees(Names.BEE_BETTER_AT_BEES), + BetterAchievements(Names.BETTER_ACHIEVEMENTS), + BetterBuildersWands(Names.BETTER_BUILDERS_WANDS), + BetterCrashes(Names.BETTER_CRASHES), + BetterLoadingScreen(Names.BETTER_LOADING_SCREEN), + BetterP2P(Names.BETTER_P_2_P), + BetterQuesting(Names.BETTER_QUESTING), + BinnieCore(Names.BINNIE_CORE), + Botany(Names.BOTANY), + ExtraBees(Names.EXTRA_BEES), + ExtraTrees(Names.EXTRA_TREES), + Genetics(Names.GENETICS), + BlockLimiter(Names.BLOCK_LIMITER), + BlockRenderer6343(Names.BLOCK_RENDERER_6343), + BloodArsenal(Names.BLOOD_ARSENAL), + BloodMagic(Names.BLOOD_MAGIC), + Botania(Names.BOTANIA), + BotanicHorizons(Names.BOTANIC_HORIZONS), + BrandonsCore(Names.BRANDONS_CORE), + BuildCraftCore(Names.BUILD_CRAFT_CORE), + BuildCraftBuilders(Names.BUILD_CRAFT_BUILDERS), + BuildCraftFactory(Names.BUILD_CRAFT_FACTORY), + BuildCraftRobotics(Names.BUILD_CRAFT_ROBOTICS), + BuildCraftSilicon(Names.BUILD_CRAFT_SILICON), + BuildCraftTransport(Names.BUILD_CRAFT_TRANSPORT), + BuildCraftCompat(Names.BUILD_CRAFT_COMPAT), + BuildCraftOilTweak(Names.BUILD_CRAFT_OIL_TWEAK), + CarpentersBlocks(Names.CARPENTERS_BLOCKS), + CatWalks(Names.CAT_WALKS), + Chisel(Names.CHISEL), + ChiselTones(Names.CHISEL_TONES), + CodeChickenCore(Names.CODE_CHICKEN_CORE), + Computronics(Names.COMPUTRONICS), + Controlling(Names.CONTROLLING), + CookingForBlockheads(Names.COOKING_FOR_BLOCKHEADS), + CoreTweaks(Names.CORE_TWEAKS), + CraftTweaker(Names.CRAFT_TWEAKER), + MineTweaker(Names.MINE_TWEAKER), + CreativeCore(Names.CREATIVE_CORE), + CropLoadCore(Names.CROP_LOAD_CORE), + CropsPlusPlus(Names.CROPS_PLUS_PLUS), + CustomMainMenu(Names.CUSTOM_MAIN_MENU), + Darkerer(Names.DARKERER), + DefaultConfigs(Names.DEFAULT_CONFIGS), + DefaultServerList(Names.DEFAULT_SERVER_LIST), + DefaultWorldGenerator(Names.DEFAULT_WORLD_GENERATOR), + DraconicEvolution(Names.DRACONIC_EVOLUTION), + DummyCore(Names.DUMMY_CORE), + DuraDisplay(Names.DURA_DISPLAY), + ElectroMagicTools(Names.ELECTRO_MAGIC_TOOLS), + EnderCore(Names.ENDER_CORE), + EnderIO(Names.ENDER_I_O), + EnderStorage(Names.ENDER_STORAGE), + EnderZoo(Names.ENDER_ZOO), + EnhancedLootBags(Names.ENHANCED_LOOT_BAGS), + EtFuturumRequiem(Names.ET_FUTURUM_REQUIEM), + EternalSingularity(Names.ETERNAL_SINGULARITY), + FindIt(Names.FIND_IT), + FloodLights(Names.FLOOD_LIGHTS), + ForbiddenMagic(Names.FORBIDDEN_MAGIC), + Forestry(Names.FORESTRY), + ForgeMicroblocks(Names.FORGE_MICROBLOCKS), + ForgeRelocation(Names.FORGE_RELOCATION), + Forgelin(Names.FORGELIN), + GregTech(Names.GREG_TECH) { + + @Override + protected String getEffectiveModID() { + return Names.GREG_TECH_NH; + } + }, + BartWorks(Names.BART_WORKS), + DetravScannerMod(Names.DETRAV_SCANNER_MOD), + GalactiGreg(Names.GALACTI_GREG), + GGFab(Names.G_G_FAB), + GoodGenerator(Names.GOOD_GENERATOR), + GTNHLanthanides(Names.G_T_N_H_LANTHANIDES), + GTPlusPlus(Names.G_T_PLUS_PLUS), + GTPlusPlusEverglades(Names.G_T_PLUS_PLUS_EVERGLADES), + KekzTech(Names.KEKZ_TECH), + KubaTech(Names.KUBA_TECH), + NEIOrePlugin(Names.N_E_I_ORE_PLUGIN), + TecTech(Names.TECTECH), + GTNHIntergalactic(Names.G_T_N_H_INTERGALACTIC), + GTNHTCWands(Names.G_T_N_H_T_C_WANDS), + GTNHLib(Names.G_T_N_H_LIB), + Gadomancy(Names.GADOMANCY), + GalacticraftCore(Names.GALACTICRAFT_CORE), + GalacticraftMars(Names.GALACTICRAFT_MARS), + GalaxySpace(Names.GALAXY_SPACE), + GraviSuiteNEO(Names.GRAVI_SUITE_NEO), + HardcoreEnderExpansion(Names.HARDCORE_ENDER_EXPANSION), + HelpFixer(Names.HELP_FIXER), + HodgePodge(Names.HODGE_PODGE), + HoloInventory(Names.HOLO_INVENTORY), + HydroEnergy(Names.HYDRO_ENERGY), + IWillFindYou(Names.I_WILL_FIND_YOU), + IguanaTweaksTinkerConstruct(Names.IGUANA_TWEAKS_TINKER_CONSTRUCT), + InGameInfoXML(Names.IN_GAME_INFO_X_M_L), + InfernalMobs(Names.INFERNAL_MOBS), + InventoryBogoSorter(Names.INVENTORY_BOGO_SORTER), + IronChestsMinecarts(Names.IRON_CHESTS_MINECARTS), + IronTanksMinecarts(Names.IRON_TANKS_MINECARTS), + IronTanks(Names.IRON_TANKS), + JABBA(Names.J_A_B_B_A), + LittleTiles(Names.LITTLE_TILES), + LogisticsPipes(Names.LOGISTICS_PIPES), + LootGames(Names.LOOT_GAMES), + LunatriusCore(Names.LUNATRIUS_CORE), + MagicBees(Names.MAGIC_BEES), + MalisisDoors(Names.MALISIS_DOORS), + Mantle(Names.MANTLE), + MatterManipulator(Names.MATTER_MANIPULATOR), + Backpack(Names.BACKPACK), + MinetweakerGT5Addon(Names.MINETWEAKER_G_T_5_ADDON), + MobsInfo(Names.MOBS_INFO), + ModTweaker(Names.MOD_TWEAKER), + ModularUI(Names.MODULAR_U_I), + ModularUI2(Names.MODULAR_U_I_2), + MrTJPCore(Names.MR_TJP_CORE), + NEIIntegration(Names.N_E_I_INTEGRATION), + Natura(Names.NATURA), + NaturesCompass(Names.NATURES_COMPASS), + Navigator(Names.NAVIGATOR), + NetherPortalFix(Names.NETHER_PORTAL_FIX), + NewHorizonsCoreMod(Names.NEW_HORIZONS_CORE_MOD), + NodalMechanics(Names.NODAL_MECHANICS), + NotEnoughEnergistics(Names.NOT_ENOUGH_ENERGISTICS), + NotEnoughIDs(Names.NOT_ENOUGH_I_DS), + NotEnoughItems(Names.NOT_ENOUGH_ITEMS), + IC2NuclearControl(Names.I_C2_NUCLEAR_CONTROL), + Nutrition(Names.NUTRITION), + OpenGlasses(Names.OPEN_GLASSES), + OpenBlocks(Names.OPEN_BLOCKS), + OpenComputers(Names.OPEN_COMPUTERS), + OpenModsLib(Names.OPEN_MODS_LIB), + OpenModularTurrets(Names.OPEN_MODULAR_TURRETS), + OpenPrinters(Names.OPEN_PRINTERS), + OpenSecurity(Names.OPEN_SECURITY), + Opis(Names.OPIS), + OverloadedArmorBar(Names.OVERLOADED_ARMOR_BAR), + PersonalSpace(Names.PERSONAL_SPACE), + PlayerAPI(Names.PLAYER_API), + Postea(Names.POSTEA), + ProjectBlue(Names.PROJECT_BLUE), + ProjectRedCore(Names.PROJECT_RED_CORE), + ProjectRedExpansion(Names.PROJECT_RED_EXPANSION), + ProjectRedExploration(Names.PROJECT_RED_EXPLORATION), + ProjectRedFabrication(Names.PROJECT_RED_FABRICATION), + ProjectRedIllumination(Names.PROJECT_RED_ILLUMINATION), + ProjectRedIntegration(Names.PROJECT_RED_INTEGRATION), + ProjectRedTransmission(Names.PROJECT_RED_TRANSMISSION), + ProjectRedTransportation(Names.PROJECT_RED_TRANSPORTATION), + Railcraft(Names.RAILCRAFT), + RandomThings(Names.RANDOM_THINGS), + RWG(Names.RWG), + RemoteIO(Names.REMOTE_IO), + RoguelikeDungeons(Names.ROGUELIKE_DUNGEONS), + StevesCarts2(Names.STEVES_CARTS2), + SGCraft(Names.S_G_CRAFT), + SalisArcana(Names.SALIS_ARCANA), + Schematica(Names.SCHEMATICA), + ServerUtilities(Names.SERVER_UTILITIES), + ShareWhereIAm(Names.SHARE_WHERE_I_AM), + SleepingBags(Names.SLEEPING_BAGS), + SpecialMobs(Names.SPECIAL_MOBS), + SpiceOfLife(Names.SPICE_OF_LIFE), + StevesFactoryManager(Names.STEVES_FACTORY_MANAGER), + StevesAddons(Names.STEVES_ADDONS), + StorageDrawers(Names.STORAGE_DRAWERS), + StructureCompat(Names.STRUCTURE_COMPAT), + StructureLib(Names.STRUCTURE_LIB), + SuperTiC(Names.SUPER_T_I_C), + TCNEIAdditions(Names.T_C_N_E_I_ADDITIONS), + TCNodeTracker(Names.T_C_NODE_TRACKER), + TXLoader(Names.T_X_LOADER), + TaintedMagic(Names.TAINTED_MAGIC), + ThaumcraftMobAspects(Names.THAUMCRAFT_MOB_ASPECTS), + ThaumicBases(Names.THAUMIC_BASES), + ThaumicBoots(Names.THAUMIC_BOOTS), + ThaumicEnergistics(Names.THAUMIC_ENERGISTICS), + ThaumicHorizons(Names.THAUMIC_HORIZONS), + ThaumicTinkerer(Names.THAUMIC_TINKERER), + ThaumicExploration(Names.THAUMIC_EXPLORATION), + TiCTooltips(Names.T_I_C_TOOLTIPS), + TinkersDefence(Names.TINKERS_DEFENCE), + TinkerConstruct(Names.TINKER_CONSTRUCT), + TinkersMechworks(Names.TINKERS_MECHWORKS), + TooMuchLoot(Names.TOO_MUCH_LOOT), + ToroHealth(Names.TORO_HEALTH), + Translocator(Names.TRANSLOCATOR), + UniversalSingularities(Names.UNIVERSAL_SINGULARITIES), + VisualProspecting(Names.VISUAL_PROSPECTING), + WailaPlugins(Names.WAILA_PLUGINS), + WailaHarvestability(Names.WAILA_HARVESTABILITY), + WanionLib(Names.WANION_LIB), + WarpTheory(Names.WARP_THEORY), + AE2WCT(Names.AE2WCT), + WirelessRedstoneCBECore(Names.WIRELESS_REDSTONE_CBE_CORE), + WirelessRedstoneCBEAddons(Names.WIRELESS_REDSTONE_CBE_ADDONS), + WirelessRedstoneCBELogic(Names.WIRELESS_REDSTONE_CBE_LOGIC), + WitcheryExtras(Names.WITCHERY_EXTRAS), + WitchingGadgets(Names.WITCHING_GADGETS), + YAMCore(Names.YAM_CORE), + + AE2Stuff(Names.AE2STUFF), + GalacticraftAmunRa(Names.GALACTICRAFT_AMUN_RA), + BDLib(Names.B_D_LIB), + Gendustry(Names.GENDUSTRY), + PamsHarvestCraft(Names.PAMS_HARVEST_CRAFT), + IronChests(Names.IRON_CHESTS), + LWJGL3ify(Names.L_W_J_G_L_3IFY), + NEICustomDiagrams(Names.N_E_I_CUSTOM_DIAGRAMS), + NEIAddons(Names.N_E_I_ADDONS), + OAuth(Names.OAUTH), + SuperSolarPanels(Names.SUPER_SOLAR_PANELS), + ThaumcraftResearchTweaks(Names.THAUMCRAFT_RESEARCH_TWEAKS), + ThaumicInsurgence(Names.THAUMIC_INSURGENCE), + TwilightForest(Names.TWILIGHT_FOREST), + Waila(Names.WAILA), + + AdvancedSolarPanel(Names.ADVANCED_SOLAR_PANEL), + ArchaicFix(Names.ARCHAIC_FIX), + Automagy(Names.AUTOMAGY), + BiblioCraft(Names.BIBLIO_CRAFT), + BiblioWoodsBoPEdition(Names.BIBLIO_WOODS_BO_P_EDITION), + BiblioWoodsForestryEdition(Names.BIBLIO_WOODS_FORESTRY_EDITION), + BiblioWoodsNaturaEdition(Names.BIBLIO_WOODS_NATURA_EDITION), + BiomesOPlenty(Names.BIOMES_O_PLENTY), + BugTorch(Names.BUG_TORCH), + COFHCore(Names.C_O_F_H_CORE), + CompactKineticGenerators(Names.COMPACT_KINETIC_GENERATORS), + CraftPresence(Names.CRAFT_PRESENCE), + ExtraUtilities(Names.EXTRA_UTILITIES), + GraviSuite(Names.GRAVI_SUITE), + HungerOverhaul(Names.HUNGER_OVERHAUL), + IC2CropPlugin(Names.I_C2_CROP_PLUGIN), + IndustrialCraft2(Names.INDUSTRIAL_CRAFT2), + JourneyMap(Names.JOURNEY_MAP), + Morpheus(Names.MORPHEUS), + PamsHarvestTheNether(Names.PAMS_HARVEST_THE_NETHER), + TC4Tweaks(Names.T_C_4_TWEAKS), + ThaumcraftNEIPlugin(Names.THAUMCRAFT_N_E_I_PLUGIN), + Thaumcraft(Names.THAUMCRAFT), + ThaumicMachina(Names.THAUMIC_MACHINA), + TinkersGregworks(Names.TINKERS_GREGWORKS), + UniLib(Names.UNI_LIB), + UniMixins(Names.UNI_MIXINS), + Witchery(Names.WITCHERY), + ZTones(Names.Z_TONES), + + Minecraft(Names.MINECRAFT) { + + @Override + public boolean isModLoaded() { + return true; + } + }, + + Aroma1997Core(Names.AROMA1997_CORE), + ExtraCells2(Names.EXTRA_CELLS2), + MCFrames(Names.MC_FRAMES), + Metallurgy(Names.METALLURGY), + QuestBook(Names.QUEST_BOOK), + RotaryCraft(Names.ROTARY_CRAFT), + TravellersGear(Names.TRAVELLERS_GEAR), + UndergroundBiomes(Names.UNDERGROUND_BIOMES), + + ; + + public static class Names { + + // spotless:off + + // Ordered based on the list from DAXXL Actions. + // If a jar contains multiple mods in this list, they will be done as "one declaration" + // to preserve order vs the DAXXL Actions list. + + public static final String A_E2_FLUID_CRAFT = "ae2fc"; + public static final String A_F_S_U = "AFSU"; + public static final String ADVENTURE_BACKPACK = "adventurebackpack"; + public static final String AKASHIC_TOME = "akashictome"; + public static final String ALCHEMY_GRATE = "alchgrate"; + public static final String AMAZING_TROPHIES = "amazingtrophies"; + public static final String ANGELICA = "angelica"; + public static final String ANGER_MOD = "angermod"; + public static final String APPLE_CORE = "AppleCore"; + public static final String APPLIED_ENERGISTICS2 = "appliedenergistics2"; + public static final String ARCHITECTURE_CRAFT = "ArchitectureCraft"; + public static final String ASIE_LIB = "asielib"; + public static final String AVARITIA = "Avaritia"; + public static final String AVARITIA_ADDONS = "avaritiaddons"; + public static final String MINE_AND_BLADE_BATTLE_GEAR2 = "battlegear2"; // "Battlegear2" + public static final String BAUBLES = "Baubles"; + public static final String BEE_BETTER_AT_BEES = "beebetteratbees"; + public static final String BETTER_ACHIEVEMENTS = "BetterAchievements"; + public static final String BETTER_BUILDERS_WANDS = "betterbuilderswands"; + public static final String BETTER_CRASHES = "bettercrashes"; + public static final String BETTER_LOADING_SCREEN = "betterloadingscreen"; + public static final String BETTER_P_2_P = "betterp2p"; + public static final String BETTER_QUESTING = "betterquesting"; + public static final String BINNIE_CORE = "BinnieCore", + BOTANY = "Botany", + EXTRA_BEES = "ExtraBees", + EXTRA_TREES = "ExtraTrees", + GENETICS = "Genetics"; + public static final String BLOCK_LIMITER = "blocklimiter"; + public static final String BLOCK_RENDERER_6343 = "blockrenderer6343"; + public static final String BLOOD_ARSENAL = "BloodArsenal"; + public static final String BLOOD_MAGIC = "AWWayofTime"; + public static final String BOTANIA = "Botania"; + public static final String BOTANIC_HORIZONS = "botanichorizons"; + public static final String BRANDONS_CORE = "BrandonsCore"; + public static final String BUILD_CRAFT_CORE = "BuildCraft|Core", + BUILD_CRAFT_BUILDERS = "BuildCraft|Builders", + BUILD_CRAFT_FACTORY = "BuildCraft|Factory", + BUILD_CRAFT_ROBOTICS = "BuildCraft|Robotics", + BUILD_CRAFT_SILICON = "BuildCraft|Silicon", + BUILD_CRAFT_TRANSPORT = "BuildCraft|Transport"; + public static final String BUILD_CRAFT_COMPAT = "BuildCraft|Compat"; + public static final String BUILD_CRAFT_OIL_TWEAK = "OilTweak"; + public static final String CARPENTERS_BLOCKS = "CarpentersBlocks"; + public static final String CAT_WALKS = "catwalks"; + public static final String CHISEL = "chisel", + CHISEL_API = "ChiselAPI"; + public static final String CHISEL_TONES = "chiseltones"; + public static final String CODE_CHICKEN_CORE = "CodeChickenCore"; + public static final String COMPUTRONICS = "computronics"; + public static final String CONTROLLING = "controlling"; + public static final String COOKING_FOR_BLOCKHEADS = "cookingforblockheads"; + public static final String CORE_TWEAKS = "coretweaks"; + public static final String CRAFT_TWEAKER = "MineTweaker3", + MINE_TWEAKER = "MineTweaker3"; + public static final String CREATIVE_CORE = "creativecore"; + public static final String CROP_LOAD_CORE = "croploadcore"; + public static final String CROPS_PLUS_PLUS = "berriespp"; + public static final String CUSTOM_MAIN_MENU = "custommainmenu"; + public static final String DARKERER = "darkerer"; + public static final String DEFAULT_CONFIGS = "defaultkeys"; + public static final String DEFAULT_SERVER_LIST = "defaultserverlist"; + public static final String DEFAULT_WORLD_GENERATOR = "defaultworldgenerator"; + public static final String DRACONIC_EVOLUTION = "DraconicEvolution"; + public static final String DUMMY_CORE = "DummyCore"; + public static final String DURA_DISPLAY = "duradisplay"; + public static final String ELECTRO_MAGIC_TOOLS = "EMT"; + public static final String ENDER_CORE = "endercore"; + public static final String ENDER_I_O = "EnderIO"; + public static final String ENDER_STORAGE = "EnderStorage"; + public static final String ENDER_ZOO = "EnderZoo"; + public static final String ENHANCED_LOOT_BAGS = "enhancedlootbags"; + public static final String ET_FUTURUM_REQUIEM = "etfuturum"; + public static final String ETERNAL_SINGULARITY = "eternalsingularity"; + public static final String FIND_IT = "findit"; + public static final String FLOOD_LIGHTS = "FloodLights"; + public static final String FORBIDDEN_MAGIC = "ForbiddenMagic"; + public static final String FORESTRY = "Forestry"; + public static final String FORGE_MICROBLOCKS = "ForgeMicroblock"; + public static final String FORGE_RELOCATION = "ForgeRelocation"; + public static final String FORGELIN = "forgelin"; + public static final String GREG_TECH = "gregtech", + GREG_TECH_NH = "gregtech_nh", + BART_WORKS = "bartworks", + DETRAV_SCANNER_MOD = "detravscannermod", + GALACTI_GREG = "galacticgreg", + G_G_FAB = "ggfab", + GOOD_GENERATOR = "GoodGenerator", + G_T_N_H_LANTHANIDES = "gtnhlanth", + G_T_PLUS_PLUS = "miscutils", + G_T_PLUS_PLUS_EVERGLADES = "ToxicEverglades", + KEKZ_TECH = "kekztech", + KUBA_TECH = "kubatech", + N_E_I_ORE_PLUGIN = "gtneioreplugin", + TECTECH = "tectech"; + public static final String G_T_N_H_INTERGALACTIC = "gtnhintergalactic"; + public static final String G_T_N_H_T_C_WANDS = "gtnhtcwands"; + public static final String G_T_N_H_LIB = "gtnhlib"; + public static final String GADOMANCY = "gadomancy"; + public static final String GALACTICRAFT_CORE = "GalacticraftCore", + GALACTICRAFT_MARS = "GalacticraftMars"; + public static final String GALAXY_SPACE = "GalaxySpace"; + public static final String GRAVI_SUITE_NEO = "gravisuiteneo"; + public static final String HARDCORE_ENDER_EXPANSION = "HardcoreEnderExpansion"; + public static final String HELP_FIXER = "HelpFixer"; + public static final String HODGE_PODGE = "hodgepodge"; + public static final String HOLO_INVENTORY = "holoinventory"; + public static final String HYDRO_ENERGY = "hydroenergy"; + public static final String I_WILL_FIND_YOU = "ifu"; // "IFU" + public static final String IGUANA_TWEAKS_TINKER_CONSTRUCT = "IguanaTweaksTConstruct"; + public static final String IN_GAME_INFO_X_M_L = "InGameInfoXML"; + public static final String INFERNAL_MOBS = "InfernalMobs"; + public static final String INVENTORY_BOGO_SORTER = "bogosorter"; + public static final String IRON_CHESTS_MINECARTS = "ironchestminecarts"; + public static final String IRON_TANKS_MINECARTS = "irontankminecarts"; + public static final String IRON_TANKS = "irontank"; + public static final String J_A_B_B_A = "JABBA"; + public static final String LITTLE_TILES = "littletiles"; + public static final String LOGISTICS_PIPES = "LogisticsPipes"; + public static final String LOOT_GAMES = "lootgames"; + public static final String LUNATRIUS_CORE = "LunatriusCore"; + public static final String MAGIC_BEES = "MagicBees"; + public static final String MALISIS_DOORS = "malisisdoors"; + public static final String MANTLE = "Mantle"; + public static final String MATTER_MANIPULATOR = "matter-manipulator"; + public static final String BACKPACK = "Backpack"; // "Minecraft Backpack Mod" + public static final String MINETWEAKER_G_T_5_ADDON = "GTTweaker"; + public static final String MOBS_INFO = "mobsinfo"; + public static final String MOD_TWEAKER = "modtweaker2"; + public static final String MODULAR_U_I = "modularui"; + public static final String MODULAR_U_I_2 = "modularui2"; + public static final String MR_TJP_CORE = "MrTJPCoreMod"; + public static final String N_E_I_INTEGRATION = "neiintegration"; + public static final String NATURA = "Natura"; + public static final String NATURES_COMPASS = "naturescompass"; + public static final String NAVIGATOR = "navigator"; + public static final String NETHER_PORTAL_FIX = "netherportalfix"; + public static final String NEW_HORIZONS_CORE_MOD = "dreamcraft"; + public static final String NODAL_MECHANICS = "NodalMechanics"; + public static final String NOT_ENOUGH_ENERGISTICS = "neenergistics"; + public static final String NOT_ENOUGH_I_DS = "neid"; + public static final String NOT_ENOUGH_ITEMS = "NotEnoughItems"; + public static final String I_C2_NUCLEAR_CONTROL = "IC2NuclearControl"; // "Nuclear-Control" + public static final String NUTRITION = "nutrition"; + public static final String OPEN_GLASSES = "openglasses"; // "OCGlasses" + public static final String OPEN_BLOCKS = "OpenBlocks"; + public static final String OPEN_COMPUTERS = "OpenComputers"; + public static final String OPEN_MODS_LIB = "OpenMods"; + public static final String OPEN_MODULAR_TURRETS = "openmodularturrets"; + public static final String OPEN_PRINTERS = "openprinter"; + public static final String OPEN_SECURITY = "opensecurity"; + public static final String OPIS = "Opis"; + public static final String OVERLOADED_ARMOR_BAR = "overloadedarmorbar"; + public static final String PERSONAL_SPACE = "personalspace"; + public static final String PLAYER_API = "PlayerAPI"; + public static final String POSTEA = "postea"; + public static final String PROJECT_BLUE = "ProjectBlue"; + public static final String PROJECT_RED_CORE = "ProjRed|Core", + PROJECT_RED_EXPANSION = "ProjRed|Expansion", + PROJECT_RED_EXPLORATION = "ProjRed|Exploration", + PROJECT_RED_FABRICATION = "ProjRed|Fabrication", + PROJECT_RED_ILLUMINATION = "ProjRed|Illumination", + PROJECT_RED_INTEGRATION = "ProjRed|Integration", + PROJECT_RED_TRANSMISSION = "ProjRed|Transmission", + PROJECT_RED_TRANSPORTATION = "ProjRed|Transportation"; + public static final String RAILCRAFT = "Railcraft"; + public static final String RANDOM_THINGS = "RandomThings"; + public static final String RWG = "RWG"; + public static final String REMOTE_IO = "RIO"; + public static final String ROGUELIKE_DUNGEONS = "Roguelike"; + public static final String STEVES_CARTS2 = "StevesCarts"; // "SC2" + public static final String S_G_CRAFT = "SGCraft"; + public static final String SALIS_ARCANA = "salisarcana"; + public static final String SCHEMATICA = "Schematica"; + public static final String SERVER_UTILITIES = "serverutilities"; + public static final String SHARE_WHERE_I_AM = "sharewhereiam"; + public static final String SLEEPING_BAGS = "sleepingbag"; + public static final String SPECIAL_MOBS = "SpecialMobs"; + public static final String SPICE_OF_LIFE = "SpiceOfLife"; + public static final String STEVES_FACTORY_MANAGER = "StevesFactoryManager"; + public static final String STEVES_ADDONS = "StevesAddons"; + public static final String STORAGE_DRAWERS = "StorageDrawers"; + public static final String STRUCTURE_COMPAT = "structurecompat"; + public static final String STRUCTURE_LIB = "structurelib"; + public static final String SUPER_T_I_C = "SuperTic"; + public static final String T_C_N_E_I_ADDITIONS = "tcneiadditions"; + public static final String T_C_NODE_TRACKER = "tcnodetracker"; + public static final String T_X_LOADER = "txloader"; + public static final String TAINTED_MAGIC = "TaintedMagic"; + public static final String THAUMCRAFT_MOB_ASPECTS = "ThaumcraftMobAspects"; + public static final String THAUMIC_BASES = "thaumicbases"; + public static final String THAUMIC_BOOTS = "thaumicboots"; + public static final String THAUMIC_ENERGISTICS = "thaumicenergistics"; + public static final String THAUMIC_HORIZONS = "ThaumicHorizons"; + public static final String THAUMIC_TINKERER = "ThaumicTinkerer"; + public static final String THAUMIC_EXPLORATION = "ThaumicExploration"; + public static final String T_I_C_TOOLTIPS = "TiCTooltips"; + public static final String TINKERS_DEFENCE = "tinkersdefense"; + public static final String TINKER_CONSTRUCT = "TConstruct"; + public static final String TINKERS_MECHWORKS = "TMechworks"; + public static final String TOO_MUCH_LOOT = "TML"; + public static final String TORO_HEALTH = "torohealthmod"; + public static final String TRANSLOCATOR = "Translocator"; + public static final String UNIVERSAL_SINGULARITIES = "universalsingularities"; + public static final String VISUAL_PROSPECTING = "visualprospecting"; + public static final String WAILA_PLUGINS = "wailaplugins"; + public static final String WAILA_HARVESTABILITY = "WailaHarvestability"; + public static final String WANION_LIB = "wanionlib"; + public static final String WARP_THEORY = "WarpTheory"; + public static final String AE2WCT = "ae2wct"; // "WirelessCraftingTerminal" + public static final String WIRELESS_REDSTONE_CBE_CORE = "WR-CBE|Core", + WIRELESS_REDSTONE_CBE_ADDONS = "WR-CBE|Addons", + WIRELESS_REDSTONE_CBE_LOGIC = "WR-CBE|Logic"; + public static final String WITCHERY_EXTRAS = "WitcheryExtras"; + public static final String WITCHING_GADGETS = "WitchingGadgets"; + public static final String YAM_CORE = "YAMCore"; // "Yamcl" + + // Lowercase file names in DAXXL Actions, listed later than the above + public static final String AE2STUFF = "ae2stuff"; + public static final String GALACTICRAFT_AMUN_RA = "GalacticraftAmunRa"; // "amunra" + public static final String B_D_LIB = "bdlib"; + public static final String GENDUSTRY = "gendustry"; + public static final String PAMS_HARVEST_CRAFT = "harvestcraft"; // "harvestcraft" + public static final String IRON_CHESTS = "IronChest"; + public static final String L_W_J_G_L_3IFY = "lwjgl3ify"; + public static final String N_E_I_CUSTOM_DIAGRAMS = "neicustomdiagram"; + public static final String N_E_I_ADDONS = "NEIAddons"; + public static final String OAUTH = "oauth"; + public static final String SUPER_SOLAR_PANELS = "supersolarpanel"; + public static final String THAUMCRAFT_RESEARCH_TWEAKS = "ThaumcraftResearchTweaks"; + public static final String THAUMIC_INSURGENCE = "thaumicinsurgence"; + public static final String TWILIGHT_FOREST = "TwilightForest"; + public static final String WAILA = "Waila"; + + // "External mods" section in DAXXL Actions + public static final String ADVANCED_SOLAR_PANEL = "AdvancedSolarPanel"; + public static final String ARCHAIC_FIX = "archaicfix"; + public static final String AUTOMAGY = "Automagy"; + public static final String BIBLIO_CRAFT = "BiblioCraft"; + public static final String BIBLIO_WOODS_BO_P_EDITION = "BiblioWoodsBoP"; + public static final String BIBLIO_WOODS_FORESTRY_EDITION = "BiblioWoodsForestry"; + public static final String BIBLIO_WOODS_NATURA_EDITION = "BiblioWoodsNatura"; + public static final String BIOMES_O_PLENTY = "BiomesOPlenty"; + public static final String BUG_TORCH = "bugtorch"; + public static final String C_O_F_H_CORE = "CoFHCore"; + public static final String COMPACT_KINETIC_GENERATORS = "compactkineticgenerators"; + public static final String CRAFT_PRESENCE = "craftpresence"; + public static final String EXTRA_UTILITIES = "ExtraUtilities"; + public static final String GRAVI_SUITE = "GraviSuite"; + // "Healer" - Don't know what this is or where it comes from but it's in the list + public static final String HUNGER_OVERHAUL = "HungerOverhaul"; + public static final String I_C2_CROP_PLUGIN = "Ic2Nei"; + public static final String INDUSTRIAL_CRAFT2 = "IC2"; + // JourneyMap Server + public static final String JOURNEY_MAP = "journeymap"; + public static final String MORPHEUS = "Morpheus"; + public static final String PAMS_HARVEST_THE_NETHER = "harvestthenether"; + public static final String T_C_4_TWEAKS = "tc4tweak"; + public static final String THAUMCRAFT_N_E_I_PLUGIN = "thaumcraftneiplugin"; + public static final String THAUMCRAFT = "Thaumcraft"; + public static final String THAUMIC_MACHINA = "ThaumicMachina"; + public static final String TINKERS_GREGWORKS = "TGregworks"; + public static final String UNI_LIB = "unilib"; + public static final String UNI_MIXINS = "unimixins"; + public static final String WITCHERY = "witchery"; + public static final String Z_TONES = "Ztones"; + + // Minecraft :) + public static final String MINECRAFT = "minecraft"; + + // Misc, should eventually be removed + public static final String AROMA1997_CORE = "Aroma1997Core"; + public static final String EXTRA_CELLS2 = "extracells"; + public static final String MC_FRAMES = "MCFrames"; + public static final String METALLURGY = "Metallurgy"; + public static final String QUEST_BOOK = "questbook"; + public static final String ROTARY_CRAFT = "RotaryCraft"; + public static final String TRAVELLERS_GEAR = "TravellersGear"; + public static final String UNDERGROUND_BIOMES = "UndergroundBiomes"; + + // spotless:on + } + + public final String ID; + public final String resourceDomain; + protected boolean checkedMod, modLoaded; + protected final TargetModBuilder builder; + + Mods(String ID) { + this.ID = ID; + this.resourceDomain = ID.toLowerCase(Locale.ENGLISH); + this.builder = new TargetModBuilder().setModId(getEffectiveModID()); + } + + @Override + public @NotNull TargetModBuilder getBuilder() { + return builder; + } + + @Override + public String getID() { + return ID; + } + + protected String getEffectiveModID() { + return ID; + } + + public boolean isModLoaded() { + if (!checkedMod) { + this.modLoaded = Loader.isModLoaded(getEffectiveModID()); + checkedMod = true; + } + return this.modLoaded; + } + + @Override + public String getResourceLocation() { + return resourceDomain; + } + + public String getResourcePath(String... path) { + return this.getResourceLocation(path).toString(); + } + + public ResourceLocation getResourceLocation(String... path) { + return new ResourceLocation(this.resourceDomain, String.join("/", path)); + } +} diff --git a/src/main/java/fox/spiteful/avaritia/blocks/BlockMatterClusterOpener.java b/src/main/java/fox/spiteful/avaritia/blocks/BlockMatterClusterOpener.java new file mode 100644 index 0000000..0d8d6a5 --- /dev/null +++ b/src/main/java/fox/spiteful/avaritia/blocks/BlockMatterClusterOpener.java @@ -0,0 +1,113 @@ +package fox.spiteful.avaritia.blocks; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import com.cleanroommc.modularui.factory.GuiManager; +import com.cleanroommc.modularui.factory.PosGuiData; +import com.cleanroommc.modularui.factory.TileEntityGuiFactory; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import fox.spiteful.avaritia.items.ItemMatterClusterOpener; +import fox.spiteful.avaritia.tile.TileMatterClusterOpener; + +public class BlockMatterClusterOpener extends BlockContainer { + + public BlockMatterClusterOpener() { + super(Material.iron); + + setBlockName("cluster_opener"); + } + + public static void register() { + LudicrousBlocks.clusterOpener = new BlockMatterClusterOpener(); + GameRegistry.registerBlock(LudicrousBlocks.clusterOpener, ItemMatterClusterOpener.class, "cluster_opener"); + GameRegistry.registerTileEntity(TileMatterClusterOpener.class, "cluster_opener"); + } + + @Override + public TileEntity createNewTileEntity(World worldIn, int meta) { + return new TileMatterClusterOpener(); + } + + @Override + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, + float subY, float subZ) { + if (!worldIn.isRemote) { + PosGuiData data = new PosGuiData(player, x, y, z); + GuiManager.open(TileEntityGuiFactory.INSTANCE, data, (EntityPlayerMP) player); + } + + return true; + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) { + int l = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + world.setBlockMetadataWithNotify(x, y, z, l, 2); + } + + @Override + public void onBlockPreDestroy(World worldIn, int x, int y, int z, int meta) { + super.onBlockPreDestroy(worldIn, x, y, z, meta); + + ((TileMatterClusterOpener) worldIn.getTileEntity(x, y, z)).dropContents(); + } + + @SideOnly(Side.CLIENT) + private IIcon top, side, front; + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister reg) { + top = reg.registerIcon("avaritia:cluster_opener/top"); + side = reg.registerIcon("avaritia:cluster_opener/side"); + front = reg.registerIcon("avaritia:cluster_opener/front"); + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) { + // In-world rendering + ForgeDirection dir = ForgeDirection.getOrientation(side); + + if (dir == ForgeDirection.UP) return top; + if (dir == ForgeDirection.DOWN) return top; + + ForgeDirection front = switch (worldIn.getBlockMetadata(x, y, z)) { + case 0 -> ForgeDirection.NORTH; + case 1 -> ForgeDirection.EAST; + case 2 -> ForgeDirection.SOUTH; + case 3 -> ForgeDirection.WEST; + default -> ForgeDirection.UNKNOWN; + }; + + return dir == front ? this.front : this.side; + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(int side, int meta) { + // In-hand rendering + ForgeDirection dir = ForgeDirection.getOrientation(side); + + if (dir == ForgeDirection.UP) return top; + if (dir == ForgeDirection.DOWN) return top; + + return dir == ForgeDirection.SOUTH ? this.front : this.side; + } +} diff --git a/src/main/java/fox/spiteful/avaritia/blocks/LudicrousBlocks.java b/src/main/java/fox/spiteful/avaritia/blocks/LudicrousBlocks.java index f0cf057..c21753c 100644 --- a/src/main/java/fox/spiteful/avaritia/blocks/LudicrousBlocks.java +++ b/src/main/java/fox/spiteful/avaritia/blocks/LudicrousBlocks.java @@ -2,6 +2,7 @@ package fox.spiteful.avaritia.blocks; import net.minecraft.block.Block; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import fox.spiteful.avaritia.Config; import fox.spiteful.avaritia.tile.TileEntityCompressor; @@ -23,6 +24,8 @@ public class LudicrousBlocks { public static Block infinitato; + public static Block clusterOpener; + public static void voxelize() { double_craft = GameRegistry.registerBlock(new BlockDoubleCraft(), "Double_Craft"); triple_craft = GameRegistry.registerBlock(new BlockTripleCraft(), "Triple_Craft"); @@ -37,5 +40,9 @@ public class LudicrousBlocks { GameRegistry.registerTileEntity(TileEntityNeutron.class, "Avaritia_Neutron"); compressor = GameRegistry.registerBlock(new BlockCompressor(), "Neutronium_Compressor"); GameRegistry.registerTileEntity(TileEntityCompressor.class, "Avaritia_Compressor"); + + if (Loader.isModLoaded("gtnhlib") && Loader.isModLoaded("modularui2")) { + BlockMatterClusterOpener.register(); + } } } diff --git a/src/main/java/fox/spiteful/avaritia/crafting/Grinder.java b/src/main/java/fox/spiteful/avaritia/crafting/Grinder.java index 6a7c06b..8857947 100644 --- a/src/main/java/fox/spiteful/avaritia/crafting/Grinder.java +++ b/src/main/java/fox/spiteful/avaritia/crafting/Grinder.java @@ -483,6 +483,35 @@ public class Grinder { new ItemStack(Blocks.redstone_block, 1), 'O', new ItemStack(LudicrousBlocks.resource_block, 1, 0)); + + if (LudicrousBlocks.clusterOpener != null) { + ExtremeCraftingManager.getInstance().addRecipe( + new ItemStack(LudicrousBlocks.clusterOpener), + "IIIXIXIII", + "X X", + "E N E", + "XXXXNXXXX", + "E N E", + "X X", + "E XNNNX E", + "X X X X", + "IIIHHHIII", + 'X', + // Crystal matrix ingot + new ItemStack(LudicrousItems.resource, 1, 1), + 'N', + // Neutronium ingot + new ItemStack(LudicrousItems.resource, 1, 4), + 'I', + new ItemStack(Blocks.iron_block, 1), + 'H', + new ItemStack(Blocks.hopper, 1), + 'E', + new ItemStack(Blocks.emerald_block, 1), + 'F', + // Infinity ingot + new ItemStack(LudicrousItems.resource, 1, 6)); + } } } diff --git a/src/main/java/fox/spiteful/avaritia/items/ItemMatterClusterOpener.java b/src/main/java/fox/spiteful/avaritia/items/ItemMatterClusterOpener.java new file mode 100644 index 0000000..9f5f565 --- /dev/null +++ b/src/main/java/fox/spiteful/avaritia/items/ItemMatterClusterOpener.java @@ -0,0 +1,29 @@ +package fox.spiteful.avaritia.items; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemMatterClusterOpener extends ItemBlock { + + public ItemMatterClusterOpener(Block block) { + super(block); + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + + tooltip.add(StatCollector.translateToLocal("tooltip.matter-cluster-decompressor.line1")); + tooltip.add(StatCollector.translateToLocal("tooltip.matter-cluster-decompressor.line2")); + tooltip.add(StatCollector.translateToLocal("tooltip.matter-cluster-decompressor.line3")); + } +} diff --git a/src/main/java/fox/spiteful/avaritia/tile/TileMatterClusterOpener.java b/src/main/java/fox/spiteful/avaritia/tile/TileMatterClusterOpener.java new file mode 100644 index 0000000..1e4d8f6 --- /dev/null +++ b/src/main/java/fox/spiteful/avaritia/tile/TileMatterClusterOpener.java @@ -0,0 +1,411 @@ +package fox.spiteful.avaritia.tile; + +import java.util.Map; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import net.minecraftforge.oredict.OreDictionary; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import com.cleanroommc.modularui.api.IGuiHolder; +import com.cleanroommc.modularui.drawable.AdaptableUITexture; +import com.cleanroommc.modularui.drawable.GuiTextures; +import com.cleanroommc.modularui.drawable.UITexture; +import com.cleanroommc.modularui.factory.PosGuiData; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.screen.UISettings; +import com.cleanroommc.modularui.utils.Alignment; +import com.cleanroommc.modularui.utils.item.IItemHandlerModifiable; +import com.cleanroommc.modularui.utils.item.InvWrapper; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.cleanroommc.modularui.widgets.SlotGroupWidget; +import com.cleanroommc.modularui.widgets.TextWidget; +import com.cleanroommc.modularui.widgets.layout.Column; +import com.cleanroommc.modularui.widgets.layout.Row; +import com.cleanroommc.modularui.widgets.slot.FluidSlot; +import com.cleanroommc.modularui.widgets.slot.ItemSlot; +import com.cleanroommc.modularui.widgets.slot.ModularSlot; +import com.glodblock.github.common.item.ItemFluidDrop; +import com.gtnewhorizon.gtnhlib.capability.CapabilityProvider; +import com.gtnewhorizon.gtnhlib.capability.item.ItemSink; +import com.gtnewhorizon.gtnhlib.capability.item.ItemSource; +import com.gtnewhorizon.gtnhlib.item.InventoryItemSink; +import com.gtnewhorizon.gtnhlib.item.InventoryItemSource; +import com.gtnewhorizon.gtnhlib.util.ItemUtil; +import com.gtnewhorizon.gtnhlib.util.data.LazyItem; + +import fox.spiteful.avaritia.Mods; +import fox.spiteful.avaritia.items.ItemMatterCluster; +import fox.spiteful.avaritia.items.ItemStackWrapper; + +public class TileMatterClusterOpener extends TileEntity + implements ISidedInventory, CapabilityProvider, IGuiHolder, IFluidHandler { + + private ItemStack clusterInput, itemOutput; + private final FluidTank fluidOutput = new FluidTank(Integer.MAX_VALUE); + + private static final LazyItem FLUID_DROPS = new LazyItem( + Mods.AE2FluidCraft, + "fluid_drop", + OreDictionary.WILDCARD_VALUE); + + private static final int[] INPUT_SLOTS = { 0 }; + private static final int[] OUTPUT_SLOTS = { 1 }; + + @Override + public void updateEntity() { + super.updateEntity(); + + if (worldObj.isRemote) return; + + if (clusterInput != null && clusterInput.stackSize <= 0) { + clusterInput = null; + markDirty(); + } + + if (itemOutput != null && itemOutput.stackSize <= 0) { + itemOutput = null; + markDirty(); + } + + if (fluidOutput.getFluid() != null && fluidOutput.getFluidAmount() <= 0) { + fluidOutput.setFluid(null); + markDirty(); + } + + if (clusterInput == null) return; + if (itemOutput != null || fluidOutput.getFluid() != null) return; + + Map contents = ItemMatterCluster.getClusterData(clusterInput); + + if (contents.isEmpty()) return; + + var iter = contents.entrySet().iterator(); + + var e = iter.next(); + iter.remove(); + + if (contents.isEmpty()) { + clusterInput = null; + } else { + ItemMatterCluster.setClusterData(clusterInput, contents, contents.values().stream().mapToInt(i -> i).sum()); + } + + itemOutput = ItemUtil.copyAmount(e.getValue(), e.getKey().stack); + + if (FLUID_DROPS.isLoaded() && FLUID_DROPS.matches(itemOutput)) { + fluidOutput.setFluid(ItemFluidDrop.getFluidStack(itemOutput)); + itemOutput = null; + } + + markDirty(); + } + + @Override + public void writeToNBT(NBTTagCompound compound) { + super.writeToNBT(compound); + + if (clusterInput != null) { + compound.setTag("clusterInput", clusterInput.writeToNBT(new NBTTagCompound())); + } + + if (itemOutput != null) { + compound.setTag("itemOutput", itemOutput.writeToNBT(new NBTTagCompound())); + } + + if (fluidOutput.getFluid() != null) { + compound.setTag("fluidOutput", fluidOutput.getFluid().writeToNBT(new NBTTagCompound())); + } + } + + @Override + public void readFromNBT(NBTTagCompound compound) { + super.readFromNBT(compound); + + clusterInput = null; + itemOutput = null; + fluidOutput.setFluid(null); + + if (compound.hasKey("clusterInput")) { + clusterInput = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("clusterInput")); + } + + if (compound.hasKey("itemOutput")) { + itemOutput = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("itemOutput")); + } + + if (compound.hasKey("fluidOutput")) { + fluidOutput.setFluid(FluidStack.loadFluidStackFromNBT(compound.getCompoundTag("fluidOutput"))); + } + } + + public void dropContents() { + if (clusterInput != null) { + EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, clusterInput); + worldObj.spawnEntityInWorld(item); + clusterInput = null; + } + + if (itemOutput != null) { + ItemStack cluster = ItemMatterCluster.makeCluster(itemOutput); + itemOutput = null; + + EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, cluster); + worldObj.spawnEntityInWorld(item); + } + + if (FLUID_DROPS.isLoaded() && fluidOutput.getFluidAmount() > 0) { + ItemStack drops = ItemFluidDrop.newStack(fluidOutput.getFluid()); + assert drops != null; + ItemStack cluster = ItemMatterCluster.makeCluster(drops); + + EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, cluster); + worldObj.spawnEntityInWorld(item); + } + } + + @Override + public @Nullable T getCapability(@NotNull Class capability, @NotNull ForgeDirection side) { + if (capability == ItemSource.class) { + return capability.cast(new OutputSlotSource()); + } + + if (capability == ItemSink.class) { + return capability.cast(new InventoryItemSink(this, side)); + } + + return null; + } + + private class OutputSlotSource extends InventoryItemSource { + + public OutputSlotSource() { + super(TileMatterClusterOpener.this, ForgeDirection.UNKNOWN); + } + + @Override + protected int[] getSlots() { + return OUTPUT_SLOTS; + } + } + + @Override + public int[] getAccessibleSlotsFromSide(int side) { + return INPUT_SLOTS; + } + + @Override + public boolean canInsertItem(int slotIndex, ItemStack stack, int side) { + return slotIndex == 0; + } + + @Override + public boolean canExtractItem(int slotIndex, ItemStack stack, int side) { + return slotIndex == 0; + } + + @Override + public int getSizeInventory() { + return 2; + } + + @Override + public ItemStack getStackInSlot(int slotIn) { + if (slotIn == 0) return clusterInput; + if (slotIn == 1) return itemOutput; + + return null; + } + + @Override + public ItemStack decrStackSize(int index, int count) { + if (index != 0) return null; + if (clusterInput == null) return null; + + int removable = Math.min(count, clusterInput.stackSize); + + ItemStack out = clusterInput.splitStack(removable); + + if (ItemUtil.isStackEmpty(clusterInput)) clusterInput = null; + + markDirty(); + + return out; + } + + @Override + public ItemStack getStackInSlotOnClosing(int index) { + return decrStackSize(index, Integer.MAX_VALUE); + } + + @Override + public void setInventorySlotContents(int index, ItemStack stack) { + if (index == 0) { + clusterInput = stack; + } + + if (index == 1) { + itemOutput = stack; + } + } + + @Override + public String getInventoryName() { + return getBlockType().getLocalizedName(); + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + return true; + } + + @Override + public void openInventory() { + + } + + @Override + public void closeInventory() { + + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack) { + if (index == 0) { + return stack.getItem() instanceof ItemMatterCluster; + } else if (index == 1) { + return true; + } else { + return false; + } + } + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { + return 0; + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) { + return false; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) { + return fluidOutput.getFluid() != null && fluidOutput.getFluid().getFluid() == fluid; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { + FluidStack stored = fluidOutput.getFluid(); + + if (stored == null || stored.amount <= 0) return null; + if (stored.getFluid() != resource.getFluid()) return null; + + int removable = Math.min(stored.amount, resource.amount); + + FluidStack out = new FluidStack(stored.getFluid(), removable); + + if (doDrain) { + stored.amount -= removable; + + if (stored.amount <= 0) { + fluidOutput.setFluid(null); + } + } + + return out; + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { + FluidStack stored = fluidOutput.getFluid(); + + if (stored == null || stored.amount <= 0) return null; + + int removable = Math.min(stored.amount, maxDrain); + + FluidStack out = new FluidStack(stored.getFluid(), removable); + + if (doDrain) { + stored.amount -= removable; + + if (stored.amount <= 0) { + fluidOutput.setFluid(null); + } + + markDirty(); + } + + return out; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) { + return new FluidTankInfo[] { fluidOutput.getInfo() }; + } + + public static final UITexture CLUSTER_SLOT_BACKGROUND = AdaptableUITexture.builder() + .location("avaritia", "gui/slot/cluster_background.png").imageSize(16, 16).build(); + + @Override + public ModularPanel buildUI(PosGuiData data, PanelSyncManager syncManager, UISettings settings) { + IItemHandlerModifiable inv = new InvWrapper(this); + + syncManager.registerSlotGroup("input", 1, 150); + syncManager.registerSlotGroup("output", 1, false); + + // spotless:off + return new ModularPanel("ClusterOpener") + .size(178, 152) + .padding(8) + .child(new Column() + .sizeRel(1) + .expanded() + .child(new TextWidget<>(getInventoryName()).height(16).alignX(0.5f).align(Alignment.TopCenter)) + .child(new Row().widthRel(1) + .alignX(0.5f) + .expanded() + .child(new ItemSlot() + .alignY(0.5f) + .leftRel(0.5f, -18, 0.5f) + .slot(new ModularSlot(inv, 0).slotGroup("input")) + .background(GuiTextures.SLOT_ITEM, CLUSTER_SLOT_BACKGROUND)) + .child(new ItemSlot() + .alignY(0.5f) + .leftRel(0.5f, 18, 0.5f) + .slot(new ModularSlot(inv, 1).slotGroup("output").accessibility(false, false))) + .child(new FluidSlot() + .alignY(0.5f) + .leftRel(0.5f, 36, 0.5f) + .syncHandler(fluidOutput))) + .child(new Row() + .widthRel(1) + .height(76) + .alignX(0.5f) + .child(SlotGroupWidget.playerInventory(false)))); + // spotless:on + } +} diff --git a/src/main/resources/assets/avaritia/lang/en_US.lang b/src/main/resources/assets/avaritia/lang/en_US.lang index 701a6e0..59d9fe5 100644 --- a/src/main/resources/assets/avaritia/lang/en_US.lang +++ b/src/main/resources/assets/avaritia/lang/en_US.lang @@ -68,6 +68,7 @@ tile.alfheim_deadrock1.name=Deadrock Brick tile.alfheim_deadrock2.name=Mossy Deadrock Brick tile.alfheim_deadrock3.name=Cracked Deadrock Brick tile.alfheim_deadrock4.name=Chiselled Deadrock +tile.cluster_opener.name=Matter Cluster Decompressor # # Tooltips tooltip.armok.desc=Always contains maximum Life Essence @@ -89,6 +90,9 @@ tooltip.matter_cluster.counter=items tooltip.morvinabox.desc=Instant housing tooltip.morvinabox.subdesc=In Canada, Morvy comes in bags. tooltip.claybalance.desc=UNLIMITED BALANCE!!!! +tooltip.matter-cluster-decompressor.line1=Extracts items from Matter Clusters. +tooltip.matter-cluster-decompressor.line2=Only GT and AE can pull items from decompressors. +tooltip.matter-cluster-decompressor.line3=Fluid drops will be converted to fluids automatically. # # Achievements achievement.avaritia:crystal_matrix=The First Seal diff --git a/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/front.png b/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/front.png new file mode 100644 index 0000000..acf2cfc Binary files /dev/null and b/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/front.png differ diff --git a/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/front.png.mcmeta b/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/front.png.mcmeta new file mode 100644 index 0000000..96c0529 --- /dev/null +++ b/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/front.png.mcmeta @@ -0,0 +1,17 @@ +{ + "animation": { + "frametime": 2, + "frames": [ + 0, + 0, + 1, + 2, + 3, + 3, + 2, + 2, + 1, + 1 + ] + } +} diff --git a/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/side.png b/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/side.png new file mode 100644 index 0000000..2576c38 Binary files /dev/null and b/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/side.png differ diff --git a/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/top.png b/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/top.png new file mode 100644 index 0000000..83c9e09 Binary files /dev/null and b/src/main/resources/assets/avaritia/textures/blocks/cluster_opener/top.png differ diff --git a/src/main/resources/assets/avaritia/textures/gui/slot/cluster_background.png b/src/main/resources/assets/avaritia/textures/gui/slot/cluster_background.png new file mode 100644 index 0000000..85d5503 Binary files /dev/null and b/src/main/resources/assets/avaritia/textures/gui/slot/cluster_background.png differ