More configs & start fixing cable models
17
src/main/java/techreborn/compat/CompatConfigs.java
Normal file
|
@ -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;
|
||||
|
||||
}
|
|
@ -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");
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<String, ItemStack> 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));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ public class TileCreativePanel extends TilePowerAcceptor implements IWrenchable
|
|||
|
||||
@Override
|
||||
public EnumPowerTier getBaseTier() {
|
||||
return EnumPowerTier.LOW;
|
||||
return EnumPowerTier.INFINITE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
109
src/main/resources/assets/techreborn/blockstates/cable_thin.json
Normal file
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "#texture"
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 454 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 459 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 496 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 1.3 KiB |