From 2b7868c651e97c99d7d1eadb8064b1ec956ccd70 Mon Sep 17 00:00:00 2001 From: Prospector Date: Thu, 8 Jun 2017 19:12:58 -0700 Subject: [PATCH] More configs & start fixing cable models --- .../java/techreborn/compat/CompatConfigs.java | 17 +++ .../java/techreborn/compat/CompatManager.java | 4 +- .../buildcraft/BuildcraftBuildersCompat.java | 7 +- .../compat/buildcraft/BuildcraftCompat.java | 9 +- ...heOneProbe.java => TheOneProbeCompat.java} | 11 +- .../compat/waila/CompatModuleWaila.java | 7 +- .../dispenser/BehaviorDispenseScrapbox.java | 29 +++-- .../techreborn/events/BlockBreakHandler.java | 12 +- .../java/techreborn/events/OreUnifier.java | 10 +- src/main/java/techreborn/tiles/TileAesu.java | 24 ++-- .../techreborn/tiles/TileAlloyFurnace.java | 5 +- .../techreborn/tiles/TileAlloySmelter.java | 16 +-- .../tiles/TileAssemblingMachine.java | 22 ++-- .../java/techreborn/tiles/TileCentrifuge.java | 24 ++-- .../techreborn/tiles/TileChargeBench.java | 30 +++-- .../techreborn/tiles/TileChemicalReactor.java | 20 +++- .../techreborn/tiles/TileChunkLoader.java | 29 +++-- .../techreborn/tiles/TileDigitalChest.java | 9 +- .../tiles/TileIndustrialElectrolyzer.java | 39 ++++--- .../tiles/TileMatterFabricator.java | 33 ++++-- .../techreborn/tiles/TilePlayerDectector.java | 17 ++- .../techreborn/tiles/TileQuantumChest.java | 9 +- .../techreborn/tiles/TileQuantumTank.java | 25 ++-- .../techreborn/tiles/TileRollingMachine.java | 74 +++++++----- .../techreborn/tiles/TileScrapboxinator.java | 61 ++++++---- .../TileEntityFusionController.java | 91 ++++++++------- .../tiles/generator/TileCreativePanel.java | 2 +- .../tiles/generator/TileDieselGenerator.java | 31 +++-- .../generator/TileDragonEggSiphoner.java | 48 ++++---- .../tiles/generator/TileThermalGenerator.java | 39 ++++--- .../assets/techreborn/blockstates/cable.json | 32 ++--- .../techreborn/blockstates/cable_inv.json | 17 +++ .../techreborn/blockstates/cable_thin.json | 109 ++++++++++++++++++ .../assets/techreborn/models/block/cable.json | 37 +++--- .../block/cable_connection_alt_thin.json | 36 ++++++ .../models/block/cable_connection_thin.json | 36 ++++++ .../techreborn/models/block/cable_thin.json | 20 ++++ .../assets/techreborn/models/block/item.json | 6 + .../textures/blocks/cables/copper_cable.png | Bin 576 -> 1295 bytes .../blocks/cables/copper_insulated_cable.png | Bin 454 -> 1309 bytes .../blocks/cables/glass_fiber_cable.png | Bin 364 -> 1287 bytes .../textures/blocks/cables/gold_cable.png | Bin 417 -> 1296 bytes .../blocks/cables/gold_insulated_cable.png | Bin 459 -> 1309 bytes .../textures/blocks/cables/hv_cable.png | Bin 496 -> 1290 bytes .../blocks/cables/hv_insulated_cable.png | Bin 434 -> 1309 bytes .../textures/blocks/cables/tin_cable.png | Bin 347 -> 1310 bytes 46 files changed, 738 insertions(+), 309 deletions(-) create mode 100644 src/main/java/techreborn/compat/CompatConfigs.java rename src/main/java/techreborn/compat/theoneprobe/{CompactTheOneProbe.java => TheOneProbeCompat.java} (86%) create mode 100644 src/main/resources/assets/techreborn/blockstates/cable_inv.json create mode 100644 src/main/resources/assets/techreborn/blockstates/cable_thin.json create mode 100644 src/main/resources/assets/techreborn/models/block/cable_connection_alt_thin.json create mode 100644 src/main/resources/assets/techreborn/models/block/cable_connection_thin.json create mode 100644 src/main/resources/assets/techreborn/models/block/cable_thin.json create mode 100644 src/main/resources/assets/techreborn/models/block/item.json diff --git a/src/main/java/techreborn/compat/CompatConfigs.java b/src/main/java/techreborn/compat/CompatConfigs.java new file mode 100644 index 000000000..5c02c32b2 --- /dev/null +++ b/src/main/java/techreborn/compat/CompatConfigs.java @@ -0,0 +1,17 @@ +package techreborn.compat; + +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; + +@RebornRegistry +public class CompatConfigs { + @ConfigRegistry(config = "compat", category = "buildcraft", key = "ExpensiveQuarryRecipe", comment = "Buildcraft's quarry will require an advanced circuit and diamond drill if enabled") + public static boolean expensiveQuarry = true; + + @ConfigRegistry(config = "compat", category = "buildcraft", key = "EnableBuildcraftFuels", comment = "Allow Buildcraft fuels to be used in fuel generators") + public static boolean allowBCFuels = true; + + @ConfigRegistry(config = "compat", category = "theoneprobe", key = "EnableTOPSupport", comment = "Display machine info in The One Probe's HUD") + public static boolean enableTOP = true; + +} diff --git a/src/main/java/techreborn/compat/CompatManager.java b/src/main/java/techreborn/compat/CompatManager.java index bf2b437a5..7457b8ab7 100644 --- a/src/main/java/techreborn/compat/CompatManager.java +++ b/src/main/java/techreborn/compat/CompatManager.java @@ -32,7 +32,7 @@ import techreborn.compat.buildcraft.BuildcraftBuildersCompat; import techreborn.compat.buildcraft.BuildcraftCompat; import techreborn.compat.ic2.RecipesIC2; import techreborn.compat.crafttweaker.CraftTweakerCompat; -import techreborn.compat.theoneprobe.CompactTheOneProbe; +import techreborn.compat.theoneprobe.TheOneProbeCompat; import techreborn.compat.tinkers.CompatModuleTinkers; import techreborn.compat.waila.CompatModuleWaila; import techreborn.config.ConfigTechReborn; @@ -59,7 +59,7 @@ public class CompatManager { registerCompact(WailaMcMultiPartCompact.class, false, "reborncore-mcmultipart", "Waila", "!IC2"); register(CompatModuleWaila.class, "Waila"); register(CompatModuleTinkers.class, "tconstruct"); - register(CompactTheOneProbe.class, "theoneprobe"); + register(TheOneProbeCompat.class, "theoneprobe"); //register(CompatModulePsi.class, "Psi"); register(RecipesIC2.class, "ic2"); register(BuildcraftBuildersCompat.class, "buildcraftbuilders"); diff --git a/src/main/java/techreborn/compat/buildcraft/BuildcraftBuildersCompat.java b/src/main/java/techreborn/compat/buildcraft/BuildcraftBuildersCompat.java index e4f67fa46..07901967c 100644 --- a/src/main/java/techreborn/compat/buildcraft/BuildcraftBuildersCompat.java +++ b/src/main/java/techreborn/compat/buildcraft/BuildcraftBuildersCompat.java @@ -33,13 +33,15 @@ import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import reborncore.common.util.CraftingHelper; import reborncore.common.util.RecipeRemover; import techreborn.compat.ICompatModule; -import techreborn.config.ConfigTechReborn; import techreborn.init.ModItems; +import static techreborn.compat.CompatConfigs.expensiveQuarry; + /** * Created by Mark on 02/06/2017. */ public class BuildcraftBuildersCompat implements ICompatModule { + @Override public void preInit(FMLPreInitializationEvent event) { @@ -52,9 +54,8 @@ public class BuildcraftBuildersCompat implements ICompatModule { @Override public void postInit(FMLPostInitializationEvent event) { - if(ConfigTechReborn.ExpensiveQuarry){ + if (expensiveQuarry) { RecipeRemover.removeAnyRecipe(new ItemStack(BCBuildersBlocks.quarry)); - CraftingHelper.addShapedOreRecipe(new ItemStack(BCBuildersBlocks.quarry), "IAI", "GIG", "DED", 'I', "gearIron", diff --git a/src/main/java/techreborn/compat/buildcraft/BuildcraftCompat.java b/src/main/java/techreborn/compat/buildcraft/BuildcraftCompat.java index bf760fc73..53a054120 100644 --- a/src/main/java/techreborn/compat/buildcraft/BuildcraftCompat.java +++ b/src/main/java/techreborn/compat/buildcraft/BuildcraftCompat.java @@ -34,10 +34,13 @@ import reborncore.api.fuel.FluidPowerManager; import reborncore.common.RebornCoreConfig; import techreborn.compat.ICompatModule; +import static techreborn.compat.CompatConfigs.allowBCFuels; + /** * Created by Mark on 02/06/2017. */ public class BuildcraftCompat implements ICompatModule { + @Override public void preInit(FMLPreInitializationEvent event) { @@ -50,8 +53,10 @@ public class BuildcraftCompat implements ICompatModule { @Override public void postInit(FMLPostInitializationEvent event) { - for(IFuel fuel : FuelRegistry.INSTANCE.getFuels()){ - FluidPowerManager.fluidPowerValues.put(fuel.getFluid(), (double) fuel.getPowerPerCycle() / RebornCoreConfig.euPerFU); + if (allowBCFuels) { + for (IFuel fuel : FuelRegistry.INSTANCE.getFuels()) { + FluidPowerManager.fluidPowerValues.put(fuel.getFluid(), (double) fuel.getPowerPerCycle() / RebornCoreConfig.euPerFU); + } } } diff --git a/src/main/java/techreborn/compat/theoneprobe/CompactTheOneProbe.java b/src/main/java/techreborn/compat/theoneprobe/TheOneProbeCompat.java similarity index 86% rename from src/main/java/techreborn/compat/theoneprobe/CompactTheOneProbe.java rename to src/main/java/techreborn/compat/theoneprobe/TheOneProbeCompat.java index 2d468ad1c..4ede2ec32 100644 --- a/src/main/java/techreborn/compat/theoneprobe/CompactTheOneProbe.java +++ b/src/main/java/techreborn/compat/theoneprobe/TheOneProbeCompat.java @@ -31,10 +31,13 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import techreborn.compat.ICompatModule; +import static techreborn.compat.CompatConfigs.enableTOP; + /** * Created by Mark on 04/06/2016. */ -public class CompactTheOneProbe implements ICompatModule { +public class TheOneProbeCompat implements ICompatModule { + @Override public void preInit(FMLPreInitializationEvent event) { @@ -47,8 +50,10 @@ public class CompactTheOneProbe implements ICompatModule { @Override public void postInit(FMLPostInitializationEvent event) { - TheOneProbe.theOneProbeImp.registerProvider(new ProbeProvider()); - TheOneProbe.theOneProbeImp.registerProbeConfigProvider(new ProbeConfig()); + if (enableTOP) { + TheOneProbe.theOneProbeImp.registerProvider(new ProbeProvider()); + TheOneProbe.theOneProbeImp.registerProbeConfigProvider(new ProbeConfig()); + } } @Override diff --git a/src/main/java/techreborn/compat/waila/CompatModuleWaila.java b/src/main/java/techreborn/compat/waila/CompatModuleWaila.java index 0cba2b261..e39c95460 100644 --- a/src/main/java/techreborn/compat/waila/CompatModuleWaila.java +++ b/src/main/java/techreborn/compat/waila/CompatModuleWaila.java @@ -25,7 +25,10 @@ package techreborn.compat.waila; import mcp.mobius.waila.api.IWailaRegistrar; -import net.minecraftforge.fml.common.event.*; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import reborncore.common.tile.TileMachineBase; import techreborn.compat.ICompatModule; @@ -41,7 +44,7 @@ public class CompatModuleWaila implements ICompatModule { } public void init(FMLInitializationEvent event) { - FMLInterModComms.sendMessage("Waila", "register", getClass().getName() + ".callbackRegister"); + // FMLInterModComms.sendMessage("Waila", "register", getClass().getName() + ".callbackRegister"); } @Override diff --git a/src/main/java/techreborn/dispenser/BehaviorDispenseScrapbox.java b/src/main/java/techreborn/dispenser/BehaviorDispenseScrapbox.java index 1d3a90c6d..a1caea343 100644 --- a/src/main/java/techreborn/dispenser/BehaviorDispenseScrapbox.java +++ b/src/main/java/techreborn/dispenser/BehaviorDispenseScrapbox.java @@ -32,23 +32,32 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import techreborn.api.ScrapboxList; +import techreborn.lib.ModInfo; +@RebornRegistry(modID = ModInfo.MOD_ID) public class BehaviorDispenseScrapbox extends BehaviorDefaultDispenseItem { + @ConfigRegistry(config = "misc", category = "general", key = "DispenserScrapbox", comment = "Dispensers will open scrapboxes") + public static boolean dispenseScrapboxes = false; + @Override protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) { - int random = source.getWorld().rand.nextInt(ScrapboxList.stacks.size()); - ItemStack out = ScrapboxList.stacks.get(random).copy(); - float xOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F; - float yOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F; - float zOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F; - stack.splitStack(1); + if (dispenseScrapboxes) { + int random = source.getWorld().rand.nextInt(ScrapboxList.stacks.size()); + ItemStack out = ScrapboxList.stacks.get(random).copy(); + float xOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F; + float yOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F; + float zOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F; + stack.splitStack(1); - TileEntityDispenser tile = source.getBlockTileEntity(); - EnumFacing enumfacing = tile.getWorld().getBlockState(new BlockPos(source.getX(), source.getY(), source.getZ())).getValue(BlockDispenser.FACING); - IPosition iposition = BlockDispenser.getDispensePosition(source); - doDispense(source.getWorld(), out, 6, enumfacing, iposition); + TileEntityDispenser tile = source.getBlockTileEntity(); + EnumFacing enumfacing = tile.getWorld().getBlockState(new BlockPos(source.getX(), source.getY(), source.getZ())).getValue(BlockDispenser.FACING); + IPosition iposition = BlockDispenser.getDispensePosition(source); + doDispense(source.getWorld(), out, 6, enumfacing, iposition); + } return stack; } diff --git a/src/main/java/techreborn/events/BlockBreakHandler.java b/src/main/java/techreborn/events/BlockBreakHandler.java index 24bf0ee01..6aa6e596d 100644 --- a/src/main/java/techreborn/events/BlockBreakHandler.java +++ b/src/main/java/techreborn/events/BlockBreakHandler.java @@ -26,17 +26,21 @@ package techreborn.events; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import techreborn.items.ItemGems; +import techreborn.lib.ModInfo; import techreborn.utils.OreDictUtils; -/** - * Created by McKeever on 10/16/2016. - */ +@RebornRegistry(modID = ModInfo.MOD_ID) public class BlockBreakHandler { + @ConfigRegistry(config = "misc", category = "general", key = "RubyRedGarnetDrops", comment = "Give red garnet drops to any harvested oreRuby") + public static boolean rubyGarnetDrops = true; + @SubscribeEvent public void onBlockHarvest(BlockEvent.HarvestDropsEvent event) { - if (OreDictUtils.isOre(event.getState(), "oreRuby")) { + if (rubyGarnetDrops && OreDictUtils.isOre(event.getState(), "oreRuby")) { event.getDrops().add(ItemGems.getGemByName("red_garnet").copy()); } } diff --git a/src/main/java/techreborn/events/OreUnifier.java b/src/main/java/techreborn/events/OreUnifier.java index d61fe7a42..bd5e07e06 100644 --- a/src/main/java/techreborn/events/OreUnifier.java +++ b/src/main/java/techreborn/events/OreUnifier.java @@ -31,13 +31,19 @@ import net.minecraft.util.EnumHand; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.oredict.OreDictionary; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.ItemUtils; -import techreborn.config.ConfigTechReborn; +import techreborn.lib.ModInfo; import java.util.HashMap; +@RebornRegistry(modID = ModInfo.MOD_ID) public class OreUnifier { + @ConfigRegistry(config = "misc", category = "general", key = "OreUnifier", comment = "Convert any ore itemstacks into Tech Reborn ores") + public static boolean oreUnifier = false; + public static HashMap oreHash = new HashMap<>(); public static void registerOre(String name, ItemStack ore) { @@ -55,7 +61,7 @@ public class OreUnifier { @SubscribeEvent public void itemTick(TickEvent.PlayerTickEvent event) { - if (ConfigTechReborn.OreUnifer && !event.player.world.isRemote + if (oreUnifier && !event.player.world.isRemote && event.player.world.getTotalWorldTime() % 10 == 0) { if (event.player.getHeldItem(EnumHand.MAIN_HAND) != ItemStack.EMPTY) { int[] oreIds = OreDictionary.getOreIDs(event.player.getHeldItem(EnumHand.MAIN_HAND)); diff --git a/src/main/java/techreborn/tiles/TileAesu.java b/src/main/java/techreborn/tiles/TileAesu.java index 49aacb6e9..bae5803a1 100644 --- a/src/main/java/techreborn/tiles/TileAesu.java +++ b/src/main/java/techreborn/tiles/TileAesu.java @@ -42,15 +42,15 @@ import techreborn.lib.ModInfo; public class TileAesu extends TilePowerAcceptor implements IWrenchable { @ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxInput", comment = "AESU Max Input (Value in EU)") - public static int MAX_INPUT = 8192; + public static int maxInput = 8192; @ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxOutput", comment = "AESU Max Output (Value in EU)") - public static int MAX_OUTPUT = 8192; - @ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxStorage", comment = "AESU Max Storage (Value in EU)") - public static int MAX_STORAGE = 100000000; + public static int maxOutput = 8192; + @ConfigRegistry(config = "machines", category = "aesu", key = "AesuMaxEnergy", comment = "AESU Max Energy (Value in EU)") + public static int maxEnergy = 100000000; @ConfigRegistry(config = "machines", category = "aesu", key = "AesuTier", comment = "AESU Tier") - public static int TIER = 5; + public static int tier = 5; // @ConfigRegistry(config = "machines", category = "aesu", key = "AesuWrenchDropRate", comment = "AESU Wrench Drop Rate") - public static float WRENCH_DROP_RATE = 1.0F; + public static float wrenchDropRate = 1.0F; public Inventory inventory = new Inventory(4, "TileAesu", 64, this); private int OUTPUT = 64; // The current output @@ -59,7 +59,7 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable { private int ticks; public TileAesu() { - super(TIER); + super(tier); } @Override @@ -97,7 +97,7 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable { @Override public float getWrenchDropRate() { - return WRENCH_DROP_RATE; + return wrenchDropRate; } @Override @@ -122,8 +122,8 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable { if (id == 3) { OUTPUT -= 256; } - if (OUTPUT > MAX_OUTPUT) { - OUTPUT = MAX_OUTPUT; + if (OUTPUT > maxOutput) { + OUTPUT = maxOutput; } if (OUTPUT <= -1) { OUTPUT = 0; @@ -165,7 +165,7 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable { @Override public double getBaseMaxPower() { - return MAX_STORAGE; + return maxEnergy; } @Override @@ -185,7 +185,7 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable { @Override public double getBaseMaxInput() { - return MAX_INPUT; + return maxInput; } @Override diff --git a/src/main/java/techreborn/tiles/TileAlloyFurnace.java b/src/main/java/techreborn/tiles/TileAlloyFurnace.java index 71072ae1d..132cc7e0e 100644 --- a/src/main/java/techreborn/tiles/TileAlloyFurnace.java +++ b/src/main/java/techreborn/tiles/TileAlloyFurnace.java @@ -38,7 +38,6 @@ import reborncore.api.tile.IInventoryProvider; import reborncore.common.IWrenchable; import reborncore.common.recipes.RecipeTranslator; import reborncore.common.registration.RebornRegistry; -import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.tile.TileLegacyMachineBase; import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; @@ -55,7 +54,7 @@ public class TileAlloyFurnace extends TileLegacyMachineBase implements IWrenchable, IInventoryProvider, IContainerProvider { // @ConfigRegistry(config = "machines", category = "alloy_furnace", key = "AlloyFurnaceWrenchDropRate", comment = "Alloy Furnace Wrench Drop Rate") - public static float WRENCH_DROP_RATE = 1.0F; + public static float wrenchDropRate = 1.0F; public int tickTime; public Inventory inventory = new Inventory(4, "TileAlloyFurnace", 64, this); @@ -297,7 +296,7 @@ public class TileAlloyFurnace extends TileLegacyMachineBase @Override public float getWrenchDropRate() { - return WRENCH_DROP_RATE; + return wrenchDropRate; } @Override diff --git a/src/main/java/techreborn/tiles/TileAlloySmelter.java b/src/main/java/techreborn/tiles/TileAlloySmelter.java index 9bcefba8b..3c60461dc 100644 --- a/src/main/java/techreborn/tiles/TileAlloySmelter.java +++ b/src/main/java/techreborn/tiles/TileAlloySmelter.java @@ -53,20 +53,20 @@ public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable, IInventoryProvider, ISidedInventory, IRecipeCrafterProvider, IContainerProvider { @ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterMaxInput", comment = "Alloy Smelter Max Input (Value in EU)") - public static int MAX_INPUT = 32; - @ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterMaxStorage", comment = "Alloy Smelter Max Storage (Value in EU)") - public static int MAX_STORAGE = 1000; + public static int maxInput = 32; + @ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterMaxEnergy", comment = "Alloy Smelter Max Energy (Value in EU)") + public static int maxEnergy = 1000; @ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterTier", comment = "Alloy Smelter Tier") - public static int TIER = 1; + public static int tier = 1; // @ConfigRegistry(config = "machines", category = "alloy_smelter", key = "AlloySmelterWrenchDropRate", comment = "Alloy Smelter Wrench Drop Rate") - public static float WRENCH_DROP_RATE = 1.0F; + public static float wrenchDropRate = 1.0F; public int tickTime; public Inventory inventory = new Inventory(8, "TileAlloySmelter", 64, this); public RecipeCrafter crafter; public TileAlloySmelter() { - super(TIER); + super(tier); // Input slots final int[] inputs = new int[2]; inputs[0] = 0; @@ -163,7 +163,7 @@ public class TileAlloySmelter extends TilePowerAcceptor @Override public double getBaseMaxPower() { - return MAX_STORAGE; + return maxEnergy; } @Override @@ -183,7 +183,7 @@ public class TileAlloySmelter extends TilePowerAcceptor @Override public double getBaseMaxInput() { - return MAX_INPUT; + return maxInput; } @Override diff --git a/src/main/java/techreborn/tiles/TileAssemblingMachine.java b/src/main/java/techreborn/tiles/TileAssemblingMachine.java index 8328b513d..cf71b63a5 100644 --- a/src/main/java/techreborn/tiles/TileAssemblingMachine.java +++ b/src/main/java/techreborn/tiles/TileAssemblingMachine.java @@ -49,20 +49,20 @@ public class TileAssemblingMachine extends TilePowerAcceptor implements IWrenchable, ISidedInventory, IInventoryProvider, IRecipeCrafterProvider, IContainerProvider { @ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineMaxInput", comment = "Assembling Machine Max Input (Value in EU)") - public static int MAX_INPUT = 128; - @ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineMaxStorage", comment = "Assembling Machine Max Storage (Value in EU)") - public static int MAX_STORAGE = 10000; + public static int maxInput = 128; + @ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineMaxEnergy", comment = "Assembling Machine Max Energy (Value in EU)") + public static int maxEnergy = 10000; @ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineTier", comment = "Assembling Machine Tier") - public static int TIER = 2; - // @ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineWrenchDropRate", comment = "Assembling Machine Wrench Drop Rate") - public static float WRENCH_DROP_RATE = 1.0F; + public static int tier = 2; + // @ConfigRegistry(config = "machines", category = "assembling_machine", key = "AssemblingMachineWrenchDropRate", comment = "Assembling Machine Wrench Drop Rate") + public static float wrenchDropRate = 1.0F; public int tickTime; public Inventory inventory = new Inventory(8, "TileAssemblingMachine", 64, this); public RecipeCrafter crafter; public TileAssemblingMachine() { - super(TIER); + super(tier); // Input slots final int[] inputs = new int[2]; inputs[0] = 0; @@ -95,7 +95,7 @@ public class TileAssemblingMachine extends TilePowerAcceptor @Override public float getWrenchDropRate() { - return WRENCH_DROP_RATE; + return wrenchDropRate; } @Override @@ -126,7 +126,7 @@ public class TileAssemblingMachine extends TilePowerAcceptor @Override public double getBaseMaxPower() { - return MAX_STORAGE; + return maxEnergy; } @Override @@ -146,12 +146,12 @@ public class TileAssemblingMachine extends TilePowerAcceptor @Override public double getBaseMaxInput() { - return MAX_INPUT; + return maxInput; } @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.LOW; + return EnumPowerTier.MEDIUM; } @Override diff --git a/src/main/java/techreborn/tiles/TileCentrifuge.java b/src/main/java/techreborn/tiles/TileCentrifuge.java index 685cf180a..3ae3a4a73 100644 --- a/src/main/java/techreborn/tiles/TileCentrifuge.java +++ b/src/main/java/techreborn/tiles/TileCentrifuge.java @@ -37,28 +37,38 @@ import reborncore.common.IWrenchable; import reborncore.common.powerSystem.PoweredItem; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.recipes.RecipeCrafter; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; import techreborn.api.Reference; import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; -import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; import techreborn.items.DynamicCell; +import techreborn.lib.ModInfo; import java.util.List; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileCentrifuge extends TilePowerAcceptor implements IWrenchable, IInventoryProvider, IListInfoProvider, IRecipeCrafterProvider, IContainerProvider { + @ConfigRegistry(config = "machines", category = "centrifuge", key = "CentrifugeMaxInput", comment = "Centrifuge Max Input (Value in EU)") + public static int maxInput = 32; + @ConfigRegistry(config = "machines", category = "centrifuge", key = "CentrifugeMaxEnergy", comment = "Centrifuge Max Energy (Value in EU)") + public static int maxEnergy = 10000; + @ConfigRegistry(config = "machines", category = "centrifuge", key = "CentrifugeTier", comment = "Centrifuge Tier") + public static int tier = 2; + // @ConfigRegistry(config = "machines", category = "centrifuge", key = "CentrifugeWrenchDropRate", comment = "Centrifuge Wrench Drop Rate") + public static float wrenchDropRate = 1.0F; + public int tickTime; public Inventory inventory = new Inventory(11, "TileCentrifuge", 64, this); public RecipeCrafter crafter; - public int euTick = ConfigTechReborn.CentrifugeInputTick; - public TileCentrifuge() { - super(2); + super(tier); // Input slots final int[] inputs = new int[] { 0, 1 }; final int[] outputs = new int[4]; @@ -106,7 +116,7 @@ public class TileCentrifuge extends TilePowerAcceptor @Override public float getWrenchDropRate() { - return 1.0F; + return wrenchDropRate; } @Override @@ -163,7 +173,7 @@ public class TileCentrifuge extends TilePowerAcceptor @Override public double getBaseMaxPower() { - return 10000; + return maxEnergy; } @Override @@ -183,7 +193,7 @@ public class TileCentrifuge extends TilePowerAcceptor @Override public double getBaseMaxInput() { - return 32; + return maxInput; } @Override diff --git a/src/main/java/techreborn/tiles/TileChargeBench.java b/src/main/java/techreborn/tiles/TileChargeBench.java index ef400c989..3fd0c71f2 100644 --- a/src/main/java/techreborn/tiles/TileChargeBench.java +++ b/src/main/java/techreborn/tiles/TileChargeBench.java @@ -28,24 +28,34 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; - import reborncore.api.power.EnumPowerTier; import reborncore.api.power.IEnergyInterfaceItem; import reborncore.api.tile.IInventoryProvider; import reborncore.common.IWrenchable; import reborncore.common.powerSystem.TilePowerAcceptor; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; - import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; import techreborn.init.ModBlocks; +import techreborn.lib.ModInfo; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileChargeBench extends TilePowerAcceptor -implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider { + implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider { + + @ConfigRegistry(config = "machines", category = "charge_bench", key = "ChargeBenchMaxInput", comment = "Charge Bench Max Input (Value in EU)") + public static int maxInput = 512; + @ConfigRegistry(config = "machines", category = "charge_bench", key = "ChargeBenchMaxEnergy", comment = "Charge Bench Max Energy (Value in EU)") + public static int maxEnergy = 100000; + @ConfigRegistry(config = "machines", category = "charge_bench", key = "ChargeBenchTier", comment = "Charge Bench Tier") + public static int tier = 2; + // @ConfigRegistry(config = "machines", category = "charge_bench", key = "ChargeBenchWrenchDropRate", comment = "Charge Bench Wrench Drop Rate") + public static float wrenchDropRate = 1.0F; public Inventory inventory = new Inventory(6, "TileChargeBench", 64, this); - public int capacity = 100000; public TileChargeBench() { super(4); @@ -62,7 +72,7 @@ implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider if (stack.getItem() instanceof IEnergyInterfaceItem) { final IEnergyInterfaceItem interfaceItem = (IEnergyInterfaceItem) stack.getItem(); final double trans = Math.min(interfaceItem.getMaxPower(stack) - interfaceItem.getEnergy(stack), - Math.min(interfaceItem.getMaxTransfer(stack), this.getEnergy())); + Math.min(interfaceItem.getMaxTransfer(stack), this.getEnergy())); interfaceItem.setEnergy(trans + interfaceItem.getEnergy(stack), stack); this.useEnergy(trans); } @@ -125,7 +135,7 @@ implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider @Override public double getBaseMaxPower() { - return this.capacity; + return maxEnergy; } @Override @@ -145,12 +155,12 @@ implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider @Override public double getBaseMaxInput() { - return 512; + return maxInput; } @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.MEDIUM; + return EnumPowerTier.HIGH; } @Override @@ -161,7 +171,7 @@ implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider @Override public BuiltContainer createContainer(final EntityPlayer player) { return new ContainerBuilder("chargebench").player(player.inventory).inventory().hotbar().addInventory() - .tile(this).energySlot(0, 62, 25).energySlot(1, 98, 25).energySlot(2, 62, 45).energySlot(3, 98, 45) - .energySlot(4, 62, 65).energySlot(5, 98, 65).syncEnergyValue().addInventory().create(); + .tile(this).energySlot(0, 62, 25).energySlot(1, 98, 25).energySlot(2, 62, 45).energySlot(3, 98, 45) + .energySlot(4, 62, 65).energySlot(5, 98, 65).syncEnergyValue().addInventory().create(); } } diff --git a/src/main/java/techreborn/tiles/TileChemicalReactor.java b/src/main/java/techreborn/tiles/TileChemicalReactor.java index 016a5b13e..b4dc627ba 100644 --- a/src/main/java/techreborn/tiles/TileChemicalReactor.java +++ b/src/main/java/techreborn/tiles/TileChemicalReactor.java @@ -35,6 +35,7 @@ import reborncore.api.tile.IInventoryProvider; import reborncore.common.IWrenchable; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.recipes.RecipeCrafter; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; import techreborn.api.Reference; import techreborn.client.container.IContainerProvider; @@ -45,12 +46,21 @@ import techreborn.init.ModBlocks; public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchable, IInventoryProvider, ISidedInventory, IRecipeCrafterProvider, IContainerProvider { + @ConfigRegistry(config = "machines", category = "chemical_reactor", key = "ChemicalReactorMaxInput", comment = "Chemical Reactor Max Input (Value in EU)") + public static int maxInput = 128; + @ConfigRegistry(config = "machines", category = "chemical_reactor", key = "ChemicalReactorMaxEnergy", comment = "Chemical Reactor Max Energy (Value in EU)") + public static int maxEnergy = 10000; + @ConfigRegistry(config = "machines", category = "chemical_reactor", key = "ChemicalReactorTier", comment = "Chemical Reactor Tier") + public static int tier = 2; + // @ConfigRegistry(config = "machines", category = "chemical_reactor", key = "ChemicalReactorWrenchDropRate", comment = "Chemical Reactor Wrench Drop Rate") + public static float wrenchDropRate = 1.0F; + public int tickTime; public Inventory inventory = new Inventory(8, "TileChemicalReactor", 64, this); public RecipeCrafter crafter; public TileChemicalReactor() { - super(2); + super(tier); // Input slots final int[] inputs = new int[2]; inputs[0] = 0; @@ -84,7 +94,7 @@ public class TileChemicalReactor extends TilePowerAcceptor @Override public float getWrenchDropRate() { - return 1.0F; + return wrenchDropRate; } @Override @@ -146,7 +156,7 @@ public class TileChemicalReactor extends TilePowerAcceptor @Override public double getBaseMaxPower() { - return 10000; + return maxEnergy; } @Override @@ -166,12 +176,12 @@ public class TileChemicalReactor extends TilePowerAcceptor @Override public double getBaseMaxInput() { - return 128; + return maxInput; } @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.LOW; + return EnumPowerTier.MEDIUM; } @Override diff --git a/src/main/java/techreborn/tiles/TileChunkLoader.java b/src/main/java/techreborn/tiles/TileChunkLoader.java index db3fdf6f5..a2197f84d 100644 --- a/src/main/java/techreborn/tiles/TileChunkLoader.java +++ b/src/main/java/techreborn/tiles/TileChunkLoader.java @@ -27,29 +27,38 @@ package techreborn.tiles; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; - import reborncore.api.power.EnumPowerTier; import reborncore.api.tile.IInventoryProvider; import reborncore.common.IWrenchable; import reborncore.common.powerSystem.TilePowerAcceptor; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; - import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; import techreborn.init.ModBlocks; +import techreborn.lib.ModInfo; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, IInventoryProvider, IContainerProvider { + @ConfigRegistry(config = "machines", category = "chunk_loader", key = "ChunkLoaderMaxInput", comment = "Chunk Loader Max Input (Value in EU)") + public static int maxInput = 32; + @ConfigRegistry(config = "machines", category = "chunk_loader", key = "ChunkLoaderMaxEnergy", comment = "Chunk Loader Max Energy (Value in EU)") + public static int maxEnergy = 10000; + @ConfigRegistry(config = "machines", category = "chunk_loader", key = "ChunkLoaderTier", comment = "Chunk Loader Tier") + public static int tier = 1; + // @ConfigRegistry(config = "machines", category = "chunk_loader", key = "ChunkLoaderWrenchDropRate", comment = "Chunk Loader Wrench Drop Rate") + public static float wrenchDropRate = 1.0F; + public Inventory inventory = new Inventory(1, "TileChunkLoader", 64, this); public boolean isRunning; public int tickTime; - public int euTick = 32; - public TileChunkLoader() { - super(1); + super(tier); } @Override @@ -69,7 +78,7 @@ public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, I @Override public float getWrenchDropRate() { - return 1.0F; + return wrenchDropRate; } @Override @@ -83,7 +92,7 @@ public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, I @Override public double getBaseMaxPower() { - return 10000; + return maxEnergy; } @Override @@ -103,12 +112,12 @@ public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, I @Override public double getBaseMaxInput() { - return 32; + return maxInput; } @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.MEDIUM; + return EnumPowerTier.LOW; } @Override @@ -119,6 +128,6 @@ public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, I @Override public BuiltContainer createContainer(final EntityPlayer player) { return new ContainerBuilder("chunkloader").player(player.inventory).inventory().hotbar().addInventory() - .create(); + .create(); } } diff --git a/src/main/java/techreborn/tiles/TileDigitalChest.java b/src/main/java/techreborn/tiles/TileDigitalChest.java index ea2cd501f..36bb297ef 100644 --- a/src/main/java/techreborn/tiles/TileDigitalChest.java +++ b/src/main/java/techreborn/tiles/TileDigitalChest.java @@ -25,14 +25,21 @@ package techreborn.tiles; import net.minecraft.entity.player.EntityPlayer; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; +import techreborn.lib.ModInfo; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileDigitalChest extends TileTechStorageBase implements IContainerProvider { + @ConfigRegistry(config = "machines", category = "digital_chest", key = "DigitalChestMaxStorage", comment = "Maximum amount of items a Digital Chest can store") + public static int maxStorage = 32768; + public TileDigitalChest() { - super("TileDigitalChest", 32768); + super("TileDigitalChest", maxStorage); } @Override diff --git a/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java b/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java index da6cb113a..801daf205 100644 --- a/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java +++ b/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java @@ -29,32 +29,43 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; - import reborncore.api.power.EnumPowerTier; import reborncore.api.recipe.IRecipeCrafterProvider; import reborncore.api.tile.IInventoryProvider; import reborncore.common.IWrenchable; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.recipes.RecipeCrafter; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; - import techreborn.api.Reference; import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; import techreborn.init.ModBlocks; import techreborn.items.DynamicCell; +import techreborn.lib.ModInfo; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileIndustrialElectrolyzer extends TilePowerAcceptor - implements IWrenchable, IInventoryProvider, ISidedInventory, IRecipeCrafterProvider, IContainerProvider { + implements IWrenchable, IInventoryProvider, ISidedInventory, IRecipeCrafterProvider, IContainerProvider { + + @ConfigRegistry(config = "machines", category = "industrial_electrolyzer", key = "IndustrialElectrolyzerMaxInput", comment = "Industrial Electrolyzer Max Input (Value in EU)") + public static int maxInput = 128; + @ConfigRegistry(config = "machines", category = "industrial_electrolyzer", key = "IndustrialElectrolyzerMaxEnergy", comment = "Industrial Electrolyzer Max Energy (Value in EU)") + public static int maxEnergy = 1000; + @ConfigRegistry(config = "machines", category = "industrial_electrolyzer", key = "IndustrialElectrolyzerTier", comment = "Industrial Electrolyzer Tier") + public static int tier = 2; + // @ConfigRegistry(config = "machines", category = "industrial_electrolyzer", key = "IndustrialElectrolyzerWrenchDropRate", comment = "Industrial Electrolyzer Wrench Drop Rate") + public static float wrenchDropRate = 1.0F; public int tickTime; public Inventory inventory = new Inventory(8, "TileIndustrialElectrolyzer", 64, this); public RecipeCrafter crafter; public TileIndustrialElectrolyzer() { - super(2); + super(tier); // Input slots final int[] inputs = new int[2]; inputs[0] = 0; @@ -91,7 +102,7 @@ public class TileIndustrialElectrolyzer extends TilePowerAcceptor @Override public float getWrenchDropRate() { - return 1.0F; + return wrenchDropRate; } @Override @@ -136,7 +147,7 @@ public class TileIndustrialElectrolyzer extends TilePowerAcceptor public boolean canInsertItem(final int slotIndex, final ItemStack stack, final EnumFacing side) { if (slotIndex > 1) return false; - if(slotIndex == 1) + if (slotIndex == 1) return ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true); return !ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true); } @@ -155,7 +166,7 @@ public class TileIndustrialElectrolyzer extends TilePowerAcceptor @Override public double getBaseMaxPower() { - return 1000; + return maxEnergy; } @Override @@ -175,12 +186,12 @@ public class TileIndustrialElectrolyzer extends TilePowerAcceptor @Override public double getBaseMaxInput() { - return 128; + return maxInput; } @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.LOW; + return EnumPowerTier.MEDIUM; } @Override @@ -196,10 +207,10 @@ public class TileIndustrialElectrolyzer extends TilePowerAcceptor @Override public BuiltContainer createContainer(final EntityPlayer player) { return new ContainerBuilder("industrialelectrolyzer").player(player.inventory).inventory(8, 84).hotbar(8, 142) - .addInventory().tile(this) - .filterSlot(1, 50, 51, stack -> ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true)) - .filterSlot(0, 80, 51, stack -> !ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true)) - .outputSlot(2, 50, 19).outputSlot(3, 70, 19).outputSlot(4, 90, 19).outputSlot(5, 110, 19) - .energySlot(6, 18, 51).syncEnergyValue().syncCrafterValue().addInventory().create(); + .addInventory().tile(this) + .filterSlot(1, 50, 51, stack -> ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true)) + .filterSlot(0, 80, 51, stack -> !ItemUtils.isItemEqual(stack, DynamicCell.getEmptyCell(1), true, true)) + .outputSlot(2, 50, 19).outputSlot(3, 70, 19).outputSlot(4, 90, 19).outputSlot(5, 110, 19) + .energySlot(6, 18, 51).syncEnergyValue().syncCrafterValue().addInventory().create(); } } diff --git a/src/main/java/techreborn/tiles/TileMatterFabricator.java b/src/main/java/techreborn/tiles/TileMatterFabricator.java index e1732ce6a..b4b893dc6 100644 --- a/src/main/java/techreborn/tiles/TileMatterFabricator.java +++ b/src/main/java/techreborn/tiles/TileMatterFabricator.java @@ -27,14 +27,14 @@ package techreborn.tiles; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; - import reborncore.api.power.EnumPowerTier; import reborncore.api.tile.IInventoryProvider; import reborncore.common.IWrenchable; import reborncore.common.powerSystem.TilePowerAcceptor; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; - import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; @@ -42,17 +42,28 @@ import techreborn.init.IC2Duplicates; import techreborn.init.ModBlocks; import techreborn.init.ModItems; import techreborn.items.ItemParts; +import techreborn.lib.ModInfo; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchable, IInventoryProvider, IContainerProvider { - public int fabricationRate = 10000; - public int tickTime; + @ConfigRegistry(config = "machines", category = "matter_fabricator", key = "MatterFabricatorMaxInput", comment = "Matter Fabricator Max Input (Value in EU)") + public static int maxInput = 8192; + @ConfigRegistry(config = "machines", category = "matter_fabricator", key = "MatterFabricatorMaxEnergy", comment = "Matter Fabricator Max Energy (Value in EU)") + public static int maxEnergy = 100000000; + @ConfigRegistry(config = "machines", category = "matter_fabricator", key = "MatterFabricatorFabricationRate", comment = "Matter Fabricator Fabrication Rate") + public static int fabricationRate = 10000; + @ConfigRegistry(config = "machines", category = "matter_fabricator", key = "MatterFabricatorTier", comment = "Matter Fabricator Tier") + public static int tier = 6; + // @ConfigRegistry(config = "machines", category = "matter_fabricator", key = "MatterFabricatorWrenchDropRate", comment = "Matter Fabricator Wrench Drop Rate") + public static float wrenchDropRate = 1.0F; + public Inventory inventory = new Inventory(11, "TileMatterFabricator", 64, this); private int amplifier = 0; public TileMatterFabricator() { - super(6); + super(tier); // TODO configs } @@ -73,7 +84,7 @@ public class TileMatterFabricator extends TilePowerAcceptor @Override public float getWrenchDropRate() { - return 1.0F; + return wrenchDropRate; } @Override @@ -131,7 +142,7 @@ public class TileMatterFabricator extends TilePowerAcceptor private boolean spaceForOutput() { for (int i = 6; i < 11; i++) { - if(spaceForOutput(i)){ + if (spaceForOutput(i)) { return true; } } @@ -146,7 +157,7 @@ public class TileMatterFabricator extends TilePowerAcceptor private void addOutputProducts() { for (int i = 6; i < 11; i++) { - if(spaceForOutput(i)){ + if (spaceForOutput(i)) { addOutputProducts(i); break; } @@ -193,7 +204,7 @@ public class TileMatterFabricator extends TilePowerAcceptor @Override public double getBaseMaxPower() { - return 100000000; + return maxEnergy; } @Override @@ -213,12 +224,12 @@ public class TileMatterFabricator extends TilePowerAcceptor @Override public double getBaseMaxInput() { - return 4096; + return maxInput; } @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.EXTREME; + return EnumPowerTier.INSANE; } @Override diff --git a/src/main/java/techreborn/tiles/TilePlayerDectector.java b/src/main/java/techreborn/tiles/TilePlayerDectector.java index e8c2c2b12..a67461330 100644 --- a/src/main/java/techreborn/tiles/TilePlayerDectector.java +++ b/src/main/java/techreborn/tiles/TilePlayerDectector.java @@ -30,22 +30,33 @@ import net.minecraft.util.EnumFacing; import reborncore.api.power.EnumPowerTier; import reborncore.common.blocks.BlockMachineBase; import reborncore.common.powerSystem.TilePowerAcceptor; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.WorldUtils; +import techreborn.lib.ModInfo; import java.util.Iterator; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TilePlayerDectector extends TilePowerAcceptor { + @ConfigRegistry(config = "machines", category = "player_detector", key = "PlayerDetectorMaxInput", comment = "Player Detector Max Input (Value in EU)") + public static int maxInput = 32; + @ConfigRegistry(config = "machines", category = "player_detector", key = "PlayerDetectorMaxEnergy", comment = "Player Detector Max Energy (Value in EU)") + public static int maxEnergy = 10000; + @ConfigRegistry(config = "machines", category = "player_detector", key = "PlayerDetectorTier", comment = "Player Detector Tier") + public static int tier = 1; + public String owenerUdid = ""; boolean redstone = false; public TilePlayerDectector() { - super(1); + super(tier); } @Override public double getBaseMaxPower() { - return 10000; + return maxEnergy; } @Override @@ -65,7 +76,7 @@ public class TilePlayerDectector extends TilePowerAcceptor { @Override public double getBaseMaxInput() { - return 32; + return maxInput; } @Override diff --git a/src/main/java/techreborn/tiles/TileQuantumChest.java b/src/main/java/techreborn/tiles/TileQuantumChest.java index 306d5bfea..b428fb0ba 100644 --- a/src/main/java/techreborn/tiles/TileQuantumChest.java +++ b/src/main/java/techreborn/tiles/TileQuantumChest.java @@ -25,14 +25,21 @@ package techreborn.tiles; import net.minecraft.entity.player.EntityPlayer; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; +import techreborn.lib.ModInfo; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileQuantumChest extends TileTechStorageBase implements IContainerProvider { + @ConfigRegistry(config = "machines", category = "quantum_chest", key = "QuantumChestMaxStorage", comment = "Maximum amount of items a Quantum Chest can store") + public static int maxStorage = Integer.MAX_VALUE; + public TileQuantumChest() { - super("TileQuantumChest", Integer.MAX_VALUE); + super("TileQuantumChest", maxStorage); } @Override diff --git a/src/main/java/techreborn/tiles/TileQuantumTank.java b/src/main/java/techreborn/tiles/TileQuantumTank.java index fb094dd02..e976bf6d3 100644 --- a/src/main/java/techreborn/tiles/TileQuantumTank.java +++ b/src/main/java/techreborn/tiles/TileQuantumTank.java @@ -32,26 +32,33 @@ import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; - import reborncore.api.IListInfoProvider; import reborncore.api.tile.IInventoryProvider; import reborncore.common.IWrenchable; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.tile.TileLegacyMachineBase; import reborncore.common.util.FluidUtils; import reborncore.common.util.Inventory; import reborncore.common.util.Tank; - import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; import techreborn.init.ModBlocks; +import techreborn.lib.ModInfo; import java.util.List; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileQuantumTank extends TileLegacyMachineBase -implements IInventoryProvider, IWrenchable, IListInfoProvider, IContainerProvider { + implements IInventoryProvider, IWrenchable, IListInfoProvider, IContainerProvider { - public Tank tank = new Tank("TileQuantumTank", Integer.MAX_VALUE, this); + @ConfigRegistry(config = "machines", category = "quantum_tank", key = "QuantumTankMaxStorage", comment = "Maximum amount of millibuckets a Quantum Tankcan store") + public static int maxStorage = Integer.MAX_VALUE; + // @ConfigRegistry(config = "machines", category = "quantum_tank", key = "QuantumTankWrenchDropRate", comment = "Quantum Tank Wrench Drop Rate") + public static float wrenchDropRate = 1.0F; + + public Tank tank = new Tank("TileQuantumTank", maxStorage, this); public Inventory inventory = new Inventory(3, "TileQuantumTank", 64, this); @Override @@ -79,7 +86,7 @@ implements IInventoryProvider, IWrenchable, IListInfoProvider, IContainerProvide @Override public void onDataPacket(final NetworkManager net, final SPacketUpdateTileEntity packet) { this.world.markBlockRangeForRenderUpdate(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), - this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); + this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); this.readFromNBT(packet.getNbtCompound()); } @@ -88,7 +95,7 @@ implements IInventoryProvider, IWrenchable, IListInfoProvider, IContainerProvide super.updateEntity(); if (!this.world.isRemote) { if (FluidUtils.drainContainers(this.tank, this.inventory, 0, 1) - || FluidUtils.fillContainers(this.tank, this.inventory, 0, 1, this.tank.getFluidType())) + || FluidUtils.fillContainers(this.tank, this.inventory, 0, 1, this.tank.getFluidType())) this.syncWithAll(); if (this.tank.getFluidType() != null && this.getStackInSlot(2) == ItemStack.EMPTY) { @@ -132,7 +139,7 @@ implements IInventoryProvider, IWrenchable, IListInfoProvider, IContainerProvide @Override public float getWrenchDropRate() { - return 1F; + return wrenchDropRate; } @Override @@ -170,7 +177,7 @@ implements IInventoryProvider, IWrenchable, IListInfoProvider, IContainerProvide @Override public BuiltContainer createContainer(final EntityPlayer player) { return new ContainerBuilder("quantumtank").player(player.inventory).inventory(8, 84).hotbar(8, 142) - .addInventory().tile(this).fluidSlot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).addInventory() - .create(); + .addInventory().tile(this).fluidSlot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).addInventory() + .create(); } } diff --git a/src/main/java/techreborn/tiles/TileRollingMachine.java b/src/main/java/techreborn/tiles/TileRollingMachine.java index 658af96f9..7e9642e09 100644 --- a/src/main/java/techreborn/tiles/TileRollingMachine.java +++ b/src/main/java/techreborn/tiles/TileRollingMachine.java @@ -30,43 +30,55 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; - import reborncore.api.power.EnumPowerTier; import reborncore.api.tile.IInventoryProvider; import reborncore.common.IWrenchable; import reborncore.common.powerSystem.TilePowerAcceptor; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; - import techreborn.api.RollingMachineRecipe; import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; import techreborn.init.ModBlocks; +import techreborn.lib.ModInfo; //TODO add tick and power bars. + +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileRollingMachine extends TilePowerAcceptor - implements IWrenchable, IInventoryProvider, IContainerProvider { + implements IWrenchable, IInventoryProvider, IContainerProvider { + + @ConfigRegistry(config = "machines", category = "rolling_machine", key = "RollingMachineMaxInput", comment = "Rolling Machine Max Input (Value in EU)") + public static int maxInput = 32; + @ConfigRegistry(config = "machines", category = "rolling_machine", key = "RollingMachineEnergyPerTick", comment = "Rolling Machine Energy Per Tick (Value in EU)") + public static int energyPerTick = 5; + @ConfigRegistry(config = "machines", category = "rolling_machine", key = "RollingMachineEnergyRunTime", comment = "Rolling Machine Run Time") + public static int runTime = 250; + @ConfigRegistry(config = "machines", category = "rolling_machine", key = "RollingMachineMaxEnergy", comment = "Rolling Machine Max Energy (Value in EU)") + public static int maxEnergy = 10000; + @ConfigRegistry(config = "machines", category = "rolling_machine", key = "RollingMachineTier", comment = "Rolling Machine Tier") + public static int tier = 1; + // @ConfigRegistry(config = "machines", category = "rolling_machine", key = "RollingMachineWrenchDropRate", comment = "Rolling Machi Wrench Drop Rate") + public static float wrenchDropRate = 1.0F; public final InventoryCrafting craftMatrix = new InventoryCrafting(new RollingTileContainer(), 3, 3); public Inventory inventory = new Inventory(3, "TileRollingMachine", 64, this); public boolean isRunning; public int tickTime; - public int runTime = 250; public ItemStack currentRecipe; - private int outputSlot; - public int euTick = 5; - public TileRollingMachine() { - super(1); - outputSlot = 0; + super(tier); + outputSlot = 0; } @Override public double getBaseMaxPower() { - return 10000; + return maxEnergy; } @Override @@ -86,7 +98,7 @@ public class TileRollingMachine extends TilePowerAcceptor @Override public double getBaseMaxInput() { - return 64; + return maxInput; } @Override @@ -111,7 +123,7 @@ public class TileRollingMachine extends TilePowerAcceptor hasCrafted = true; } else { if (this.inventory.getStackInSlot(outputSlot).getCount() + this.currentRecipe.getCount() <= this.currentRecipe - .getMaxStackSize()) { + .getMaxStackSize()) { final ItemStack stack = this.inventory.getStackInSlot(outputSlot); stack.setCount(stack.getCount() + this.currentRecipe.getCount()); this.inventory.setInventorySlotContents(outputSlot, stack); @@ -129,8 +141,8 @@ public class TileRollingMachine extends TilePowerAcceptor } } if (this.currentRecipe != null) { - if (this.canUseEnergy(this.euTick) && this.tickTime < this.runTime) { - this.useEnergy(this.euTick); + if (this.canUseEnergy(energyPerTick) && this.tickTime < this.runTime) { + this.useEnergy(energyPerTick); this.tickTime++; } } @@ -168,7 +180,7 @@ public class TileRollingMachine extends TilePowerAcceptor @Override public float getWrenchDropRate() { - return 1.0F; + return wrenchDropRate; } @Override @@ -203,7 +215,7 @@ public class TileRollingMachine extends TilePowerAcceptor return new int[] { 0 }; return new int[0]; } - + @Override public boolean canInsertItem(final int Index, final ItemStack itemStack, final EnumFacing side) { return false; @@ -229,15 +241,6 @@ public class TileRollingMachine extends TilePowerAcceptor return this.inventory; } - private static class RollingTileContainer extends Container { - - @Override - public boolean canInteractWith(final EntityPlayer entityplayer) { - return true; - } - - } - public int getBurnTime() { return this.tickTime; } @@ -256,11 +259,20 @@ public class TileRollingMachine extends TilePowerAcceptor @Override public BuiltContainer createContainer(final EntityPlayer player) { return new ContainerBuilder("rollingmachine").player(player.inventory).inventory(8, 84).hotbar(8, 142) - .addInventory().tile(this.craftMatrix).slot(0, 30, 17).slot(1, 48, 17).slot(2, 66, 17).slot(3, 30, 35) - .slot(4, 48, 35).slot(5, 66, 35).slot(6, 30, 53).slot(7, 48, 53).slot(8, 66, 53) - .onCraft(inv -> this.inventory.setInventorySlotContents(1, - RollingMachineRecipe.instance.findMatchingRecipe(inv, this.world))) - .addInventory().tile(this).outputSlot(0, 124, 35).energySlot(2, 8, 51).syncEnergyValue() - .syncIntegerValue(this::getBurnTime, this::setBurnTime).addInventory().create(); + .addInventory().tile(this.craftMatrix).slot(0, 30, 17).slot(1, 48, 17).slot(2, 66, 17).slot(3, 30, 35) + .slot(4, 48, 35).slot(5, 66, 35).slot(6, 30, 53).slot(7, 48, 53).slot(8, 66, 53) + .onCraft(inv -> this.inventory.setInventorySlotContents(1, + RollingMachineRecipe.instance.findMatchingRecipe(inv, this.world))) + .addInventory().tile(this).outputSlot(0, 124, 35).energySlot(2, 8, 51).syncEnergyValue() + .syncIntegerValue(this::getBurnTime, this::setBurnTime).addInventory().create(); + } + + private static class RollingTileContainer extends Container { + + @Override + public boolean canInteractWith(final EntityPlayer entityplayer) { + return true; + } + } } diff --git a/src/main/java/techreborn/tiles/TileScrapboxinator.java b/src/main/java/techreborn/tiles/TileScrapboxinator.java index a52c22548..10266d4c5 100644 --- a/src/main/java/techreborn/tiles/TileScrapboxinator.java +++ b/src/main/java/techreborn/tiles/TileScrapboxinator.java @@ -29,50 +29,61 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; - import reborncore.api.power.EnumPowerTier; import reborncore.api.tile.IInventoryProvider; import reborncore.common.IWrenchable; import reborncore.common.blocks.BlockMachineBase; import reborncore.common.powerSystem.TilePowerAcceptor; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; - import techreborn.api.ScrapboxList; import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; import techreborn.init.ModBlocks; import techreborn.init.ModItems; +import techreborn.lib.ModInfo; import java.util.Random; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileScrapboxinator extends TilePowerAcceptor -implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider { + implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider { + + @ConfigRegistry(config = "machines", category = "scrapboxinator", key = "ScrapboxinatorMaxInput", comment = "Scrapboxinator Max Input (Value in EU)") + public static int maxInput = 32; + @ConfigRegistry(config = "machines", category = "scrapboxinator", key = "ScrapboxinatorMaxEnergy", comment = "Scrapboxinator Max Energy (Value in EU)") + public static int maxEnergy = 1000; + @ConfigRegistry(config = "machines", category = "scrapboxinator", key = "ScrapboxinatorEnergyCost", comment = "Scrapboxinator Energy Cost (Value in EU)") + public static int cost = 20; + @ConfigRegistry(config = "machines", category = "scrapboxinator", key = "ScrapboxinatorRunTime", comment = "Scrapboxinator Run Time") + public static int runTime = 200; + @ConfigRegistry(config = "machines", category = "scrapboxinator", key = "ScrapboxinatorTier", comment = "Scrapboxinator Tier") + public static int tier = 1; + // @ConfigRegistry(config = "machines", category = "scrapboxinator", key = "ScrapboxinatorWrenchDropRate", comment = "Scrapboxinator Wrench Drop Rate") + public static float wrenchDropRate = 1.0F; public Inventory inventory = new Inventory(6, "TileScrapboxinator", 64, this); - public int capacity = 1000; - public int cost = 20; + public int progress; - public int time = 200; - public int chance = 4; - public int random; public int input1 = 0; public int output = 1; public TileScrapboxinator() { - super(1); + super(tier); } public int gaugeProgressScaled(final int scale) { - return this.progress * scale / this.time; + return this.progress * scale / runTime; } @Override public void updateEntity() { final boolean burning = this.isBurning(); boolean updateInventory = false; - if (this.getEnergy() <= this.cost && this.canOpen()) { - if (this.getEnergy() > this.cost) { + if (this.getEnergy() <= cost && this.canOpen()) { + if (this.getEnergy() > cost) { updateInventory = true; } } @@ -80,7 +91,7 @@ implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider this.updateState(); this.progress++; - if (this.progress >= this.time) { + if (this.progress >= runTime) { this.progress = 0; this.recycleItems(); updateInventory = true; @@ -102,15 +113,15 @@ implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider final int random = new Random().nextInt(ScrapboxList.stacks.size()); final ItemStack out = ScrapboxList.stacks.get(random).copy(); if (this.getStackInSlot(this.output) == null) { - this.useEnergy(this.cost); + this.useEnergy(cost); this.setInventorySlotContents(this.output, out); } if (this.getStackInSlot(this.input1).getCount() > 1) { - this.useEnergy(this.cost); + this.useEnergy(cost); this.decrStackSize(this.input1, 1); } else { - this.useEnergy(this.cost); + this.useEnergy(cost); this.setInventorySlotContents(this.input1, ItemStack.EMPTY); } } @@ -121,7 +132,7 @@ implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider } public boolean isBurning() { - return this.getEnergy() > this.cost; + return this.getEnergy() > cost; } public void updateState() { @@ -150,7 +161,7 @@ implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider @Override public float getWrenchDropRate() { - return 1.0F; + return wrenchDropRate; } @Override @@ -187,7 +198,7 @@ implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider @Override public double getBaseMaxPower() { - return this.capacity; + return maxEnergy; } @Override @@ -207,12 +218,12 @@ implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider @Override public double getBaseMaxInput() { - return 32; + return maxInput; } @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.MEDIUM; + return EnumPowerTier.LOW; } @Override @@ -231,9 +242,9 @@ implements IWrenchable, IInventoryProvider, ISidedInventory, IContainerProvider @Override public BuiltContainer createContainer(final EntityPlayer player) { return new ContainerBuilder("scrapboxinator").player(player.inventory).inventory(8, 84).hotbar(8, 142) - .addInventory().tile(this).filterSlot(0, 56, 34, stack -> stack.getItem() == ModItems.SCRAP_BOX) - .outputSlot(1, 116, 34).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44) - .upgradeSlot(5, 152, 62).syncEnergyValue().syncIntegerValue(this::getProgress, this::setProgress) - .addInventory().create(); + .addInventory().tile(this).filterSlot(0, 56, 34, stack -> stack.getItem() == ModItems.SCRAP_BOX) + .outputSlot(1, 116, 34).upgradeSlot(2, 152, 8).upgradeSlot(3, 152, 26).upgradeSlot(4, 152, 44) + .upgradeSlot(5, 152, 62).syncEnergyValue().syncIntegerValue(this::getProgress, this::setProgress) + .addInventory().create(); } } diff --git a/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java b/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java index b6273f9f5..dbcde6b00 100644 --- a/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java +++ b/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java @@ -30,22 +30,35 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; - import reborncore.api.power.EnumPowerTier; import reborncore.api.tile.IInventoryProvider; import reborncore.common.powerSystem.TilePowerAcceptor; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; - import techreborn.api.reactor.FusionReactorRecipe; import techreborn.api.reactor.FusionReactorRecipeHelper; import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; import techreborn.init.ModBlocks; +import techreborn.lib.ModInfo; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileEntityFusionController extends TilePowerAcceptor implements IInventoryProvider, IContainerProvider { + @ConfigRegistry(config = "machines", category = "fusion_reactor", key = "FusionReactorMaxInput", comment = "Fusion Reactor Max Input (Value in EU)") + public static int maxInput = 8192; + @ConfigRegistry(config = "machines", category = "fusion_reactor", key = "FusionReactorMaxOutput", comment = "Fusion Reactor Max Output (Value in EU)") + public static int maxOutput = 1000000; + @ConfigRegistry(config = "machines", category = "fusion_reactor", key = "FusionReactorMaxEnergy", comment = "Fusion Reactor Max Energy (Value in EU)") + public static int maxEnergy = 100000000; + @ConfigRegistry(config = "machines", category = "fusion_reactor", key = "FusionReactorTier", comment = "Fusion Reactor Tier") + public static int tier = 4; + // @ConfigRegistry(config = "machines", category = "fusion_reactor", key = "FusionReactorWrenchDropRate", comment = "Fusion Reactor Wrench Drop Rate") + public static float wrenchDropRate = 1.0F; + public Inventory inventory = new Inventory(3, "TileEntityFusionController", 64, this); // 0= no coils, 1 = coils @@ -60,12 +73,12 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn boolean hasStartedCrafting = false; public TileEntityFusionController() { - super(4); + super(tier); } @Override public double getBaseMaxPower() { - return 100000000; + return maxEnergy; } @Override @@ -83,7 +96,7 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn if (!this.hasStartedCrafting) { return 0; } - return 1000000; + return maxOutput; } @Override @@ -91,12 +104,12 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn if (this.hasStartedCrafting) { return 0; } - return 8192; + return maxInput; } @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.EXTREME; + return EnumPowerTier.INSANE; } @Override @@ -130,29 +143,29 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn public boolean checkCoils() { if (this.isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() + 1) - && this.isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ()) - && this.isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() - 1) - && this.isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ() + 1) - && this.isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ()) - && this.isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ() - 1) - && this.isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() + 2) - && this.isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() + 1) - && this.isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() - 1) - && this.isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() - 2) - && this.isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() + 2) - && this.isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() + 1) - && this.isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() - 1) - && this.isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() - 2) - && this.isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() + 3) - && this.isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() + 2) - && this.isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() - 2) - && this.isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() - 3) - && this.isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() + 3) - && this.isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() + 2) - && this.isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 2) - && this.isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 3) - && this.isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() + 3) - && this.isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() - 3)) { + && this.isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ()) + && this.isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() - 1) + && this.isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ() + 1) + && this.isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ()) + && this.isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ() - 1) + && this.isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() + 2) + && this.isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() + 1) + && this.isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() - 1) + && this.isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() - 2) + && this.isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() + 2) + && this.isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() + 1) + && this.isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() - 1) + && this.isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() - 2) + && this.isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() + 3) + && this.isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() + 2) + && this.isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() - 2) + && this.isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() - 3) + && this.isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() + 3) + && this.isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() + 2) + && this.isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 2) + && this.isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 3) + && this.isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() + 3) + && this.isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() - 3)) { this.coilStatus = 1; return true; } @@ -179,10 +192,10 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn if (this.inventory.hasChanged || this.crafingTickTime != 0) { for (final FusionReactorRecipe reactorRecipe : FusionReactorRecipeHelper.reactorRecipes) { if (ItemUtils.isItemEqual(this.getStackInSlot(this.topStackSlot), reactorRecipe.getTopInput(), true, - true, true)) { + true, true)) { if (reactorRecipe.getBottomInput() != null) { if (!ItemUtils.isItemEqual(this.getStackInSlot(this.bottomStackSlot), - reactorRecipe.getBottomInput(), true, true, true)) { + reactorRecipe.getBottomInput(), true, true, true)) { break; } } @@ -262,7 +275,7 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn if (ItemUtils.isItemEqual(this.getStackInSlot(this.topStackSlot), this.currentRecipe.getTopInput(), true, true, true)) { if (this.currentRecipe.getBottomInput() != null) { if (!ItemUtils.isItemEqual(this.getStackInSlot(this.bottomStackSlot), this.currentRecipe.getBottomInput(), true, true, - true)) { + true)) { return false; } } @@ -350,16 +363,16 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn public int getProgressScaled() { return Math.max(0, Math.min(24, (this.getCrafingTickTime() > 0 ? 1 : 0) - + this.getCrafingTickTime() * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime))); + + this.getCrafingTickTime() * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime))); } @Override public BuiltContainer createContainer(final EntityPlayer player) { return new ContainerBuilder("fusionreactor").player(player.inventory).inventory(8, 84).hotbar(8, 142) - .addInventory().tile(this).slot(0, 88, 17).slot(1, 88, 53).outputSlot(2, 148, 35).syncEnergyValue() - .syncIntegerValue(this::getCoilStatus, this::setCoilStatus) - .syncIntegerValue(this::getCrafingTickTime, this::setCrafingTickTime) - .syncIntegerValue(this::getFinalTickTime, this::setFinalTickTime) - .syncIntegerValue(this::getNeededPower, this::setNeededPower).addInventory().create(); + .addInventory().tile(this).slot(0, 88, 17).slot(1, 88, 53).outputSlot(2, 148, 35).syncEnergyValue() + .syncIntegerValue(this::getCoilStatus, this::setCoilStatus) + .syncIntegerValue(this::getCrafingTickTime, this::setCrafingTickTime) + .syncIntegerValue(this::getFinalTickTime, this::setFinalTickTime) + .syncIntegerValue(this::getNeededPower, this::setNeededPower).addInventory().create(); } } diff --git a/src/main/java/techreborn/tiles/generator/TileCreativePanel.java b/src/main/java/techreborn/tiles/generator/TileCreativePanel.java index 91f163f1b..dc98b8bd0 100644 --- a/src/main/java/techreborn/tiles/generator/TileCreativePanel.java +++ b/src/main/java/techreborn/tiles/generator/TileCreativePanel.java @@ -87,7 +87,7 @@ public class TileCreativePanel extends TilePowerAcceptor implements IWrenchable @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.LOW; + return EnumPowerTier.INFINITE; } @Override diff --git a/src/main/java/techreborn/tiles/generator/TileDieselGenerator.java b/src/main/java/techreborn/tiles/generator/TileDieselGenerator.java index 405918369..7489274fd 100644 --- a/src/main/java/techreborn/tiles/generator/TileDieselGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileDieselGenerator.java @@ -26,21 +26,32 @@ package techreborn.tiles.generator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; - import reborncore.api.power.EnumPowerTier; - +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import techreborn.api.generator.EFluidGenerator; import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; -import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; +import techreborn.lib.ModInfo; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileDieselGenerator extends TileBaseFluidGenerator implements IContainerProvider { + @ConfigRegistry(config = "machines", category = "diesel_generator", key = "DieselGeneratorMaxOutput", comment = "Diesel Generator Max Output (Value in EU)") + public static int maxOutput = 128; + @ConfigRegistry(config = "machines", category = "diesel_generator", key = "DieselGeneratorMaxEnergy", comment = "Diesel Generator Max Energy (Value in EU)") + public static int maxEnergy = 1000000; + @ConfigRegistry(config = "machines", category = "diesel_generator", key = "DieselGeneratorTankCapacity", comment = "Diesel Generator Tank Capacity") + public static int tankCapacity = 10000; + @ConfigRegistry(config = "machines", category = "diesel_generator", key = "DieselGeneratorEnergyPerTick", comment = "Diesel Generator Energy Per Tick (Value in EU)") + public static int energyPerTick = 20; + @ConfigRegistry(config = "machines", category = "diesel_generator", key = "DieselGeneratorTier", comment = "Diesel Generator Tier") + public static int tier = 2; + public TileDieselGenerator() { - super(EFluidGenerator.DIESEL, ConfigTechReborn.ThermalGeneratorTier, "TileDieselGenerator", 1000 * 10, - ConfigTechReborn.ThermalGeneratorOutput); + super(EFluidGenerator.DIESEL, tier, "TileDieselGenerator", tankCapacity, energyPerTick); } @Override @@ -50,23 +61,23 @@ public class TileDieselGenerator extends TileBaseFluidGenerator implements ICont @Override public double getBaseMaxPower() { - return ConfigTechReborn.ThermalGeneratorCharge; + return maxEnergy; } @Override public double getBaseMaxOutput() { - return 64; + return maxOutput; } @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.LOW; + return EnumPowerTier.MEDIUM; } @Override public BuiltContainer createContainer(final EntityPlayer player) { return new ContainerBuilder("dieselgenerator").player(player.inventory).inventory(8, 84).hotbar(8, 142) - .addInventory().tile(this).slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue() - .addInventory().create(); + .addInventory().tile(this).slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue() + .addInventory().create(); } } diff --git a/src/main/java/techreborn/tiles/generator/TileDragonEggSiphoner.java b/src/main/java/techreborn/tiles/generator/TileDragonEggSiphoner.java index 73ec70c93..c2f0458bb 100644 --- a/src/main/java/techreborn/tiles/generator/TileDragonEggSiphoner.java +++ b/src/main/java/techreborn/tiles/generator/TileDragonEggSiphoner.java @@ -34,50 +34,56 @@ import reborncore.api.tile.IInventoryProvider; import reborncore.common.IWrenchable; import reborncore.common.blocks.BlockMachineBase; import reborncore.common.powerSystem.TilePowerAcceptor; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; -import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; +import techreborn.lib.ModInfo; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrenchable, IInventoryProvider { - public static final int euTick = ConfigTechReborn.DragonEggSiphonerOutput; - public Inventory inventory = new Inventory(3, "TileAlloySmelter", 64, this); + @ConfigRegistry(config = "machines", category = "dragon_egg_siphoner", key = "DragonEggSiphonerMaxOutput", comment = "Dragon Egg Siphoner Max Output (Value in EU)") + public static int maxOutput = 128; + @ConfigRegistry(config = "machines", category = "dragon_egg_siphoner", key = "DragonEggSiphonerMaxEnergy", comment = "Dragon Egg Siphoner Max Energy (Value in EU)") + public static int maxEnergy = 1000; + @ConfigRegistry(config = "machines", category = "dragon_egg_siphoner", key = "DragonEggSiphonerEnergyPerTick", comment = "Dragon Egg Siphoner Energy Per Tick (Value in EU)") + public static int energyPerTick = 4; + @ConfigRegistry(config = "machines", category = "dragon_egg_siphoner", key = "DragonEggSiphonerTier", comment = "Dragon Egg Siphoner Tier") + public static int tier = 2; + + public Inventory inventory = new Inventory(3, "TileDragonEggSiphoner", 64, this); + private long lastOutput = 0; public TileDragonEggSiphoner() { - super(2); + super(tier); } - private long lastOutput = 0; - @Override public void updateEntity() { super.updateEntity(); if (!world.isRemote) { if (world.getBlockState(new BlockPos(getPos().getX(), getPos().getY() + 1, getPos().getZ())) - .getBlock() == Blocks.DRAGON_EGG) { - if(tryAddingEnergy(euTick)) + .getBlock() == Blocks.DRAGON_EGG) { + if (tryAddingEnergy(energyPerTick)) this.lastOutput = this.world.getTotalWorldTime(); } if (this.world.getTotalWorldTime() - this.lastOutput < 30 && !this.isActive()) this.world.setBlockState(this.getPos(), - this.world.getBlockState(this.getPos()).withProperty(BlockMachineBase.ACTIVE, true)); + this.world.getBlockState(this.getPos()).withProperty(BlockMachineBase.ACTIVE, true)); else if (this.world.getTotalWorldTime() - this.lastOutput > 30 && this.isActive()) this.world.setBlockState(this.getPos(), - this.world.getBlockState(this.getPos()).withProperty(BlockMachineBase.ACTIVE, false)); + this.world.getBlockState(this.getPos()).withProperty(BlockMachineBase.ACTIVE, false)); } } - - private boolean tryAddingEnergy(int amount) - { - if(this.getMaxPower() - this.getEnergy() >= amount) - { + + private boolean tryAddingEnergy(int amount) { + if (this.getMaxPower() - this.getEnergy() >= amount) { addEnergy(amount); return true; - } - else if(this.getMaxPower() - this.getEnergy() > 0) - { + } else if (this.getMaxPower() - this.getEnergy() > 0) { addEnergy(this.getMaxPower() - this.getEnergy()); return true; } @@ -115,7 +121,7 @@ public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrencha @Override public double getBaseMaxPower() { - return 1000; + return maxEnergy; } @Override @@ -130,7 +136,7 @@ public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrencha @Override public double getBaseMaxOutput() { - return euTick; + return maxOutput; } @Override @@ -140,7 +146,7 @@ public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrencha @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.HIGH; + return EnumPowerTier.MEDIUM; } @Override diff --git a/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java b/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java index 38b2f8254..812af75f9 100644 --- a/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java @@ -29,22 +29,33 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; - import reborncore.api.power.EnumPowerTier; +import reborncore.common.registration.RebornRegistry; +import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.FluidUtils; - import techreborn.api.generator.EFluidGenerator; import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; -import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; +import techreborn.lib.ModInfo; +@RebornRegistry(modID = ModInfo.MOD_ID) public class TileThermalGenerator extends TileBaseFluidGenerator implements IContainerProvider { + @ConfigRegistry(config = "machines", category = "thermal_generator", key = "ThermalGeneratorMaxOutput", comment = "Thermal Generator Max Output (Value in EU)") + public static int maxOutput = 128; + @ConfigRegistry(config = "machines", category = "thermal_generator", key = "ThermalGeneratorMaxEnergy", comment = "Thermal Generator Max Energy (Value in EU)") + public static int maxEnergy = 1000000; + @ConfigRegistry(config = "machines", category = "thermal_generator", key = "ThermalGeneratorTankCapacity", comment = "Thermal Generator Tank Capacity") + public static int tankCapacity = 10000; + @ConfigRegistry(config = "machines", category = "thermal_generator", key = "ThermalGeneratorEnergyPerTick", comment = "Thermal Generator Energy Per Tick (Value in EU)") + public static int energyPerTick = 10; + @ConfigRegistry(config = "machines", category = "thermal_generator", key = "ThermalGeneratorTier", comment = "Thermal Generator Tier") + public static int tier = 2; + public TileThermalGenerator() { - super(EFluidGenerator.THERMAL, ConfigTechReborn.ThermalGeneratorTier, "TileThermalGenerator", 1000 * 10, - ConfigTechReborn.ThermalGeneratorOutput); + super(EFluidGenerator.THERMAL, tier, "TileThermalGenerator", tankCapacity, energyPerTick); } @Override @@ -61,10 +72,10 @@ public class TileThermalGenerator extends TileBaseFluidGenerator implements ICon this.syncWithAll(); for (final EnumFacing direction : EnumFacing.values()) { if (this.world - .getBlockState(new BlockPos(this.getPos().getX() + direction.getFrontOffsetX(), - this.getPos().getY() + direction.getFrontOffsetY(), - this.getPos().getZ() + direction.getFrontOffsetZ())) - .getBlock() == Blocks.LAVA) { + .getBlockState(new BlockPos(this.getPos().getX() + direction.getFrontOffsetX(), + this.getPos().getY() + direction.getFrontOffsetY(), + this.getPos().getZ() + direction.getFrontOffsetZ())) + .getBlock() == Blocks.LAVA) { if (this.tryAddingEnergy(1)) this.lastOutput = this.world.getTotalWorldTime(); } @@ -74,23 +85,23 @@ public class TileThermalGenerator extends TileBaseFluidGenerator implements ICon @Override public double getBaseMaxPower() { - return ConfigTechReborn.ThermalGeneratorCharge; + return maxEnergy; } @Override public double getBaseMaxOutput() { - return 128; + return maxOutput; } @Override public EnumPowerTier getBaseTier() { - return EnumPowerTier.LOW; + return EnumPowerTier.MEDIUM; } @Override public BuiltContainer createContainer(final EntityPlayer player) { return new ContainerBuilder("thermalgenerator").player(player.inventory).inventory(8, 84).hotbar(8, 142) - .addInventory().tile(this).slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue() - .addInventory().create(); + .addInventory().tile(this).slot(0, 80, 17).outputSlot(1, 80, 53).fakeSlot(2, 59, 42).syncEnergyValue() + .addInventory().create(); } } diff --git a/src/main/resources/assets/techreborn/blockstates/cable.json b/src/main/resources/assets/techreborn/blockstates/cable.json index 385f1b56c..b1aebb696 100644 --- a/src/main/resources/assets/techreborn/blockstates/cable.json +++ b/src/main/resources/assets/techreborn/blockstates/cable.json @@ -2,7 +2,7 @@ "forge_marker": 1, "defaults": { "transform": "forge:default-block", - "model": "techreborn:cable", + "model": "techreborn:cable_thin", "textures": { "cable": "techreborn:block/cable", "particle": "#cable" @@ -21,7 +21,7 @@ "true": { "submodel": { "pipeDown": { - "model": "techreborn:cable_connection_alt", + "model": "techreborn:cable_connection_alt_thin", "x": 270 } } @@ -31,7 +31,7 @@ }, "east": { "true": { - "submodel": "techreborn:cable_connection", + "submodel": "techreborn:cable_connection_thin", "y": 90 }, "false": { @@ -39,14 +39,14 @@ }, "north": { "true": { - "submodel": "techreborn:cable_connection" + "submodel": "techreborn:cable_connection_thin" }, "false": { } }, "south": { "true": { - "submodel": "techreborn:cable_connection_alt" + "submodel": "techreborn:cable_connection_alt_thin" }, "false": { } @@ -55,7 +55,7 @@ "true": { "submodel": { "pipeUp": { - "model": "techreborn:cable_connection", + "model": "techreborn:cable_connection_thin", "x": 270 } } @@ -65,49 +65,49 @@ }, "west": { "true": { - "submodel": "techreborn:cable_connection_alt", + "submodel": "techreborn:cable_connection_alt_thin", "y": 90 }, "false": { } }, "type": { - "copper" : { + "copper": { "textures": { "cable": "techreborn:blocks/cables/copper_cable" } }, - "tin" : { + "tin": { "textures": { "cable": "techreborn:blocks/cables/tin_cable" } }, - "gold" : { + "gold": { "textures": { - "cable": "techreborn:blocks/cables/gold_cabl" + "cable": "techreborn:blocks/cables/gold_cable" } }, - "hv" : { + "hv": { "textures": { "cable": "techreborn:blocks/cables/hv_cable" } }, - "glassfiber" : { + "glassfiber": { "textures": { "cable": "techreborn:blocks/cables/glass_fiber_cable" } }, - "insulatedcopper" : { + "insulatedcopper": { "textures": { "cable": "techreborn:blocks/cables/copper_insulated_cable" } }, - "insulatedgold" : { + "insulatedgold": { "textures": { "cable": "techreborn:blocks/cables/gold_insulated_cable" } }, - "insulatedhv" : { + "insulatedhv": { "textures": { "cable": "techreborn:blocks/cables/hv_insulated_cable" } diff --git a/src/main/resources/assets/techreborn/blockstates/cable_inv.json b/src/main/resources/assets/techreborn/blockstates/cable_inv.json new file mode 100644 index 000000000..87b569956 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/cable_inv.json @@ -0,0 +1,17 @@ +{ + "forge_marker": 1, + "defaults": { + "transform": "forge:default-block", + "model": "techreborn:item" + }, + "variants": { + "copper": [ + { + "transform": "forge:default-item", + "textures": { + "texture": "techreborn:items/cables/copper" + } + } + ] + } +} diff --git a/src/main/resources/assets/techreborn/blockstates/cable_thin.json b/src/main/resources/assets/techreborn/blockstates/cable_thin.json new file mode 100644 index 000000000..8b08da797 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/cable_thin.json @@ -0,0 +1,109 @@ +{ + "forge_marker": 1, + "defaults": { + "transform": "forge:default-block", + "model": "techreborn:cable_thin", + "textures": { + "cable": "techreborn:block/cable", + "particle": "#cable" + } + }, + "variants": { + "down": { + "true": { + "submodel": { + "pipeDown": { + "model": "techreborn:cable_connection_alt_thin", + "x": 270 + } + } + }, + "false": { + } + }, + "east": { + "true": { + "submodel": "techreborn:cable_connection_thin", + "y": 90 + }, + "false": { + } + }, + "north": { + "true": { + "submodel": "techreborn:cable_connection_thin" + }, + "false": { + } + }, + "south": { + "true": { + "submodel": "techreborn:cable_connection_alt_thin" + }, + "false": { + } + }, + "up": { + "true": { + "submodel": { + "pipeUp": { + "model": "techreborn:cable_connection_thin", + "x": 270 + } + } + }, + "false": { + } + }, + "west": { + "true": { + "submodel": "techreborn:cable_connection_alt_thin", + "y": 90 + }, + "false": { + } + }, + "type": { + "copper": { + "textures": { + "cable": "techreborn:blocks/cables/copper_cable" + } + }, + "tin": { + "textures": { + "cable": "techreborn:blocks/cables/tin_cable" + } + }, + "gold": { + "textures": { + "cable": "techreborn:blocks/cables/gold_cable" + } + }, + "hv": { + "textures": { + "cable": "techreborn:blocks/cables/hv_cable" + } + }, + "glassfiber": { + "textures": { + "cable": "techreborn:blocks/cables/glass_fiber_cable" + } + }, + "insulatedcopper": { + "textures": { + "cable": "techreborn:blocks/cables/copper_insulated_cable" + } + }, + "insulatedgold": { + "textures": { + "cable": "techreborn:blocks/cables/gold_insulated_cable" + } + }, + "insulatedhv": { + "textures": { + "cable": "techreborn:blocks/cables/hv_insulated_cable" + } + } + } + } +} diff --git a/src/main/resources/assets/techreborn/models/block/cable.json b/src/main/resources/assets/techreborn/models/block/cable.json index 09e709120..bd6a5052f 100644 --- a/src/main/resources/assets/techreborn/models/block/cable.json +++ b/src/main/resources/assets/techreborn/models/block/cable.json @@ -1,21 +1,20 @@ { - "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", - "textures": { - "0": "#cable" - }, - "elements": [ - { - "name": "Cable", - "from": [ 5.0, 5.0, 5.0 ], - "to": [ 11.0, 11.0, 11.0 ], - "faces": { - "north": { "texture": "#0", "uv": [ 0.0, 0.0, 6.0, 6.0 ] }, - "east": { "texture": "#0", "uv": [ 0.0, 0.0, 6.0, 6.0 ] }, - "south": { "texture": "#0", "uv": [ 0.0, 0.0, 6.0, 6.0 ] }, - "west": { "texture": "#0", "uv": [ 0.0, 0.0, 6.0, 6.0 ] }, - "up": { "texture": "#0", "uv": [ 0.0, 0.0, 6.0, 6.0 ] }, - "down": { "texture": "#0", "uv": [ 0.0, 0.0, 6.0, 6.0 ] } - } - } - ] + "credit": "Made with Blockbench, a free, modern block model editor by JannisX11", + "textures": {"0": "textures/#cable"}, + "elements": [ + { + "name": "Cable", + "from": [6, 6, 6], + "to": [10, 10, 10], + "shade": true, + "faces": { + "north": {"uv": [1, 1, 5, 5], "texture": "#0"}, + "east": {"uv": [1, 1, 5, 5], "texture": "#0"}, + "south": {"uv": [1, 1, 5, 5], "texture": "#0"}, + "west": {"uv": [1, 1, 5, 5], "texture": "#0"}, + "up": {"uv": [1, 1, 5, 5], "texture": "#0"}, + "down": {"uv": [1, 1, 5, 5], "texture": "#0"} + } + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/block/cable_connection_alt_thin.json b/src/main/resources/assets/techreborn/models/block/cable_connection_alt_thin.json new file mode 100644 index 000000000..85fe8563c --- /dev/null +++ b/src/main/resources/assets/techreborn/models/block/cable_connection_alt_thin.json @@ -0,0 +1,36 @@ +{ + "credit": "Made with Blockbench, a free, modern block model editor by JannisX11", + "textures": {"0": "#cable"}, + "elements": [ + { + "name": "Cube", + "from": [6, 6, 10], + "to": [10, 10, 16], + "shade": true, + "faces": { + "north": { + "uv": [1, 1, 5, 5], + "texture": "#-1", + "cullface": "north" + }, + "east": {"uv": [1, 7, 7, 11], "texture": "#0"}, + "south": { + "uv": [1, 1, 5, 5], + "texture": "#-1", + "cullface": "south" + }, + "west": {"uv": [1, 7, 7, 11], "texture": "#0"}, + "up": { + "uv": [1, 7, 7, 11], + "texture": "#0", + "rotation": 90 + }, + "down": { + "uv": [1, 7, 7, 11], + "texture": "#0", + "rotation": 90 + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/block/cable_connection_thin.json b/src/main/resources/assets/techreborn/models/block/cable_connection_thin.json new file mode 100644 index 000000000..23e938e67 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/block/cable_connection_thin.json @@ -0,0 +1,36 @@ +{ + "credit": "Made with Blockbench, a free, modern block model editor by JannisX11", + "textures": {"0": "#cable"}, + "elements": [ + { + "name": "Cube", + "from": [6, 6, 0], + "to": [10, 10, 6], + "shade": true, + "faces": { + "north": { + "uv": [1, 1, 5, 5], + "texture": "#-1", + "cullface": "north" + }, + "east": {"uv": [0, 7, 6, 11], "texture": "#0"}, + "south": { + "uv": [1, 1, 5, 5], + "texture": "#-1", + "cullface": "south" + }, + "west": {"uv": [0, 7, 6, 11], "texture": "#0"}, + "up": { + "uv": [0, 7, 6, 11], + "texture": "#0", + "rotation": 90 + }, + "down": { + "uv": [0, 7, 6, 11], + "texture": "#0", + "rotation": 90 + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/block/cable_thin.json b/src/main/resources/assets/techreborn/models/block/cable_thin.json new file mode 100644 index 000000000..7767db67c --- /dev/null +++ b/src/main/resources/assets/techreborn/models/block/cable_thin.json @@ -0,0 +1,20 @@ +{ + "credit": "Made with Blockbench, a free, modern block model editor by JannisX11", + "textures": {"0": "#cable"}, + "elements": [ + { + "name": "Cable", + "from": [6, 6, 6], + "to": [10, 10, 10], + "shade": true, + "faces": { + "north": {"uv": [1, 1, 5, 5], "texture": "#0"}, + "east": {"uv": [1, 1, 5, 5], "texture": "#0"}, + "south": {"uv": [1, 1, 5, 5], "texture": "#0"}, + "west": {"uv": [1, 1, 5, 5], "texture": "#0"}, + "up": {"uv": [1, 1, 5, 5], "texture": "#0"}, + "down": {"uv": [1, 1, 5, 5], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/models/block/item.json b/src/main/resources/assets/techreborn/models/block/item.json new file mode 100644 index 000000000..306e722d5 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/block/item.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "#texture" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/techreborn/textures/blocks/cables/copper_cable.png b/src/main/resources/assets/techreborn/textures/blocks/cables/copper_cable.png index 1e9cab62f8dbaeab5355bcf197492e6c71f6d743..dadf71da881a10a5df9d080e7f44964413351de7 100644 GIT binary patch literal 1295 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstPBjy3;{kN zu0ZjQAoI>(i>?sM?og|qFzeoMo4yF!2~qYFqa7y2I8KgrniA(cHQr@fg6ouIuNg`1 zvr;@~r+Upw^`4RDJ15P1Zo1FB4Bz>gehae$7Ucvk&J9|U7rZn-WO-p2(C|?(8Ulkk z1SWGmE@oh0WGD&p3;sW{0YmV2c2!_paTa()0>eZoAA}j@9MyIK1tm*dBT9nv(@M${ zi&7a15;OBk^zu?m6ioCC^bE~hGS`0vDk|}GaSYK2?mc^v?~npd>qDy>4Mqjd+S3g0 z|JTj-=;*xNT4#RtXFgXEL(*fRUl|U^ippzE6h6Q00+JVZye}x=Tk%Ff|J;Koz4M#e zyi7lDw)^&F(XMx#X1B!D{N`ASYjIwvFx6h)yiIwP!Jm&y@At<$KH&{^-on~)(J>d4 O$~;~DT-G@yGywpYaDW8> delta 562 zcmV-20?qx83cv)A8Gi-<001BJ|6u?C00d`2O+f$vv5yPM^osx8L zwH;-)pXN?*QPzc0>y)H}tDQJ^Z(lNNr5RLWLaB91(!uqcBoFTkJRB4l)&9evUp1LF zQ_SC`>6Z;@^zTePJ}@@%wRLX zr|4r^`V+MC+&Z&elX*MMeLKT#E6GGw?r$61?j;z@-7W<9R*my>H^EIU&bXrUCE@14 z@St_2>mPN4X(P_OmExBeO&c#be-)BPh6EU)BQ^Fb#((1Rs2ZhL3}7W!X-8y(j|mT_ znRPyk$S(N#x*4KZ3d$LvlYP!v-YYX7mTb|<`Z&pYIWpZG>W^snSI}H8ml9Uq$Gn+b zWMdbDs5B0gq=O6DVp5Gs4k^xZ{^bp7{g0*xI7qaiT(Lm=^d?J5Qa zMuw6gzu^BP8!!ZaXIBNr7-xY;WHAGSP(BDV$~mg-0t!l&xJHx&=ckpFCl;kL6eMQm zmFVTAmMEC$8R!|Bxn!>Y3RKkO>Ealo5j?f`w9p{~4p&ZM*g0yZZ*nyhLJx4M>1OR*H0jq8OJi|{j%4lnCmZfB{rC1k{>I#R X|Hy{u+F93xKq=4D)z4*}Q$iB}nKO6^ delta 439 zcmV;o0Z9Ix3dRGF8Gi-<001BJ|6u?C00d`2O+f$vv5yP(_7JzJ34x{m0LrKY#uD_51g4pi!e>Gz5lL2ppYmoyfqz$WRjG z7yN%@1BT%5?5e=n<1FxqEM{O3$_HUaIY+f!Ktah8*NBqf{Irtt#G+J&g2c?c61}|C z5(N`I13g1Cm(2BFfr@fGT^vI+f_r-}@--RoxUSZaezYX|^oRfTUrtOq%I>sC-8|D@ zzN(eE>GiB#CN1KrFD?mWrM|l)aOtmQS>_xYTZNswq6*K3qgnR#^y?wdC+m}07`=RrG7&I!$1TqE6(1sYJi+}Sx3I6sJ9e<2Y_z*Coo&b4jr8d!(2q zZQCZw&$C3vUDq`Z!(g#E_5k1ay~UjCb@1c_Ojkn*gN~B)?zr}AH%$$oV<=k?kA*XMHIoX>lAvEcos!VgzUK3p&RaJ~HF&GHX7D?Z+;`gpe% zX#OY|4S_)$0!Mq(x6u>`#&w^)PuS;kS=j z>-N!ZV~dK%?F$wLocyEHulqLSneIWa*GGTF^Z&bk@jRr_U?cUQ{X*$RPM&_-y}jY zKEvP30C{5nHGg=H&%|9=7Vpa=hh5VlHuFoYCm#9JQFu<}IleWI8XC9KcyE5^k8M<0 z4`mu*dTVln7Y2s+C2XGM@%QYeh0psg77tx~-F499Iq$usK8ea9G9+Am_Z5^wWJtmS wJCmp!B12N2MCA|}lKLbnhscoZ*MWCi=WT=xju34601E&B07*qoM6N<$g430()c^nh diff --git a/src/main/resources/assets/techreborn/textures/blocks/cables/gold_insulated_cable.png b/src/main/resources/assets/techreborn/textures/blocks/cables/gold_insulated_cable.png index c41aa325dd17ef9ead320d00d1a89d3f0291b039..37d602dab00f9a2b6f18770e6a0c4fd5a861a1a4 100644 GIT binary patch literal 1309 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstPBjy3;{kN zu0U~RWn~o=6;)MLH8nMLb#)C54NXl=LqkI&BO_yDV-ph-Q&UqjGc$8@a|;WLt2@GP z?2fvdczP=T_1XN7H_L&>j)Kt;82lliw&Q&z z0|O&NNswRg|B($Cg1@t?0%MG`z$3Dlfk7w_gc;AU9f<=9N|v}rlmzFem6RtIr7{#G zX6BXX<)xM=nCKbk8Jf9duKx;D)a2>n7@`q8wfD5pAp;IqPL;KdvqN&X?)&%OT>E8; zRi5pJo$ZVrs+*R)Z8%g~d#`<-%%jiGO^?r$k;;32T*=nbWZm>i$?Bp%D?EP0W;R*6 zc6vrI2~XG@>AG>ztkBpwYNl^;H55V*aH;8L?OZhJ*Ah!(afXg$?fNGh?l1lK_Cfx} Z+<1S_hUlwjCscq^o~Nsy%Q~loCIEM{geL$1 delta 444 zcmV;t0YmK_1lfI5Wo9aR+hzmh{EkWx-m$teR|9@~-K~NA~NT1=D@02O| zDaFNb?>%Q`&fJ>>X4b%Bu?YJ8z6}NgV=aop*ECJ5c9RP_1q_lTaZwz{E{vkc(dGgd zw2@_*2^eimu+D(VKuK8hJg@lwG>}k}NkXkH1_6Zn6z(bmdfH<`pH&?CJ`E6=CPnsd z)3JTr9oqZNfq%`XCoblTgkjhi5YW&hR;Brz9og^Gsr}p^+x&Xhd+KAtXNKo5u88%h z^Q&$9zTLC0+1MV=_g6h7RSN%U9-g`LGz5lL2>jrfwv2&+k)b5W zFZln+1`NU9*;RqD$64SJS4D<}mTr$^x1uDw-ba4#P2<|<5k*`^Sr}d$hMi5I>*o5!(7o~(YrMye}oj2?A zeUUGWUpy?&88+li{VT)#!c+3Ogu~>|^B+F6USNA|OGSHiL1I6f)OMxyVOFJiS2*?d zZQ3wFM02V(z_N7K}pWj)z4*}Q$iB}IdPRG delta 481 zcmV<70UrK}3h)Dv8Gi-<001BJ|6u?C00d`2O+f$vv5yPK_6GLXyFYGqmG^W|(kwTuO;`LXsiLa!kvDah~A>5v9aBA<2*x1?FW%KaL3F zgi>OikYp$;f@RyVZcoI?KMW!o)INIt3@=V8CDuuPk|8Q8)Xg2FZcve$XDkUpn3phb zJ}fVQ8zl(RoPVNt?f0qq*VjmzM;H#{9Ls?l9Hfk zI@oazDQ{X-UC#vrZP>i7Al(3)W@W))RzSU&Jc!LiToAZn!mCp)7m{)@a8fm}^+GeT zKW8NyH;;1+>eZxo?(6(@QmCnc&+h{yS(b%hX8rm^-CB>_RHR`Lk_>E=3;I0P6V0&R zH(>K0Ciq8m7yE;Q4|$8P_Jfh_$3 XA(&J;xZW4$00000NkvXXu0mjff5pqu diff --git a/src/main/resources/assets/techreborn/textures/blocks/cables/hv_insulated_cable.png b/src/main/resources/assets/techreborn/textures/blocks/cables/hv_insulated_cable.png index 5d4850abd9132e5c0492d92e13a2afdfe8d649c5..436aab007f925030c2ee006384ccaa37bd5b2771 100644 GIT binary patch literal 1309 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstPBjy3;{kN zu0U~RWn~o=6;)MLH8nMLb#)C54NXl=LqkI&BO_yDV-ph-Q&UqjGc$8@a|;WL!&mMd zz474G%?GD%Jv?*g$;JE6t~`2n_3_JVPhQ=6`R4Y^w~yX`1e!StMnhmogup9x^)v~o?$x@2NaYnag8Vm&QB{TPb^AhC`ioA zE78kKEm1JhGte_MbIDx)6{x7m)5S4FBY0}>MWI6m94wqFYa6{+Z@abX|NprYON?aW zV=H#1G9-2Cteh9HBmZ~ti<64`>h5{JIl1uR$6MhqPcAInt^4}MOM>CGS8i1Wq5Ssl)UAe@|E@0Kclbw ZV)b6%5WX;bn+7QHdAjK_e10`Y2 z^StB#(?CK^CJD8v7z7Z8Q@E=P=xL7$eO7Vk`!qmgniSbzu2(yrFSczC_PT#_F<&GM z!_k0%h92w(lvaQut3J zcij>9O|!SB^~SM!*?J8QLZz;%>UM>?uKNiP(`U|{Id|^d`Sa&5Uc7ka%9X2EuU@}?{l<+OH*em&b?esc+qduD zz5C$7gNF|vK7Rc8>C>mro;`c<;>F9CFJHZS_4@Vew{PD9O&bNHAuxnO;C#RGOa=x< zhLRw^;Qu2VFa&>RR|Q5LXMsm#F#`iPumIr}U|g%bw-hMIUgGKN%Km^wT9Dmvb@7a2 zKq1Kz*NBqf{Irtt#G+J&g2c?c61}|C5(N`I13g1Cm(2BFfr<(|T^vI+f_u+8@*P&- zaS1e^z@XOP>+A8pJ|Nswm8M!?h}( Y^WElRi=}5GfOa!@y85}Sb4q9e0D#P!djJ3c delta 314 zcmV-A0mc5F3flsZ87&3?001BJ|6u?C00d`2O+f$vv5yPN2bZe?^JG%heMIczh2P5=M^#z{m$ zR5(xVQp*a2Fc9ni|5LH3NPVCp74hw#WSaqRqnCv}?ICnXGnsU#0idF;Yi!#l@ZLvC z*Qq4YG!2g95QCy9BBkq8lK477+qRNmSr(LK87W<-lEiI)u$+kbM|52$@mXhCCU=_7a7pt#OI+4$ zVoi4nIL$dHcbd+mX$osCk|Y6ZPGjUe&!zFklTKX>@&AcG`-w0g3a2pB23c7|00000 MNkvXXu0mh|g2_yMyZ`_I