Superconductor update, adds cables, and new upgrades.

This commit is contained in:
modmuss50 2019-03-23 18:03:41 +00:00
parent 0ca18ade97
commit 1d78c60e51
21 changed files with 197 additions and 12 deletions

View file

@ -65,6 +65,11 @@ public class FusionReactorRecipe {
*/ */
int tickTime; int tickTime;
/**
* This is the minium reactor size that this recipe can work with
*/
int minSize;
/** /**
* @param topInput This is the top slot stack * @param topInput This is the top slot stack
* @param bottomInput This is the bottom slot stack * @param bottomInput This is the bottom slot stack
@ -75,14 +80,31 @@ public class FusionReactorRecipe {
*/ */
public FusionReactorRecipe(ItemStack topInput, ItemStack bottomInput, ItemStack output, double startEU, public FusionReactorRecipe(ItemStack topInput, ItemStack bottomInput, ItemStack output, double startEU,
double euTick, int tickTime) { double euTick, int tickTime) {
this(topInput, bottomInput, output, startEU, euTick, tickTime, 0);
}
/**
* @param topInput This is the top slot stack
* @param bottomInput This is the bottom slot stack
* @param output This is the output stack
* @param startEU This is the inital EU amount
* @param euTick This is the eu that is transfured every tick
* @param tickTime This is the time the recipe takes to process
* @param minSize This is the min size of reactor required for this recipe
*/
public FusionReactorRecipe(ItemStack topInput, ItemStack bottomInput, ItemStack output, double startEU,
double euTick, int tickTime, int minSize) {
this.topInput = topInput; this.topInput = topInput;
this.bottomInput = bottomInput; this.bottomInput = bottomInput;
this.output = output; this.output = output;
this.startEU = startEU; this.startEU = startEU;
this.euTick = euTick; this.euTick = euTick;
this.tickTime = tickTime; this.tickTime = tickTime;
this.minSize = minSize;
} }
public ItemStack getTopInput() { public ItemStack getTopInput() {
return topInput; return topInput;
} }
@ -106,4 +128,8 @@ public class FusionReactorRecipe {
public int getTickTime() { public int getTickTime() {
return tickTime; return tickTime;
} }
public int getMinSize() {
return minSize;
}
} }

View file

@ -41,7 +41,8 @@ public enum EnumCableType implements IStringSerializable {
GLASSFIBER("glassfiber", "techreborn:blocks/cables/glass_fiber_cable", 8192, 12.0, false, EnumPowerTier.INSANE), GLASSFIBER("glassfiber", "techreborn:blocks/cables/glass_fiber_cable", 8192, 12.0, false, EnumPowerTier.INSANE),
ICOPPER("insulatedcopper", "techreborn:blocks/cables/copper_insulated_cable", 128, 10.0, false, EnumPowerTier.MEDIUM), ICOPPER("insulatedcopper", "techreborn:blocks/cables/copper_insulated_cable", 128, 10.0, false, EnumPowerTier.MEDIUM),
IGOLD("insulatedgold", "techreborn:blocks/cables/gold_insulated_cable", 512, 10.0, false, EnumPowerTier.HIGH), IGOLD("insulatedgold", "techreborn:blocks/cables/gold_insulated_cable", 512, 10.0, false, EnumPowerTier.HIGH),
IHV("insulatedhv", "techreborn:blocks/cables/hv_insulated_cable", 2048, 10.0, false, EnumPowerTier.EXTREME); IHV("insulatedhv", "techreborn:blocks/cables/hv_insulated_cable", 2048, 10.0, false, EnumPowerTier.EXTREME),
SUPERCONDUCTOR("superconductor", "techreborn:blocks/cables/superconductor_cable", Integer.MAX_VALUE / 4, 10.0, false, EnumPowerTier.INFINITE);
public String textureName = "minecraft:blocks/iron_block"; public String textureName = "minecraft:blocks/iron_block";
public int transferRate = 128; public int transferRate = 128;
@ -73,6 +74,10 @@ public enum EnumCableType implements IStringSerializable {
return new ItemStack(ModBlocks.CABLE, 1, this.ordinal()); return new ItemStack(ModBlocks.CABLE, 1, this.ordinal());
} }
public ItemStack getStack(int amount) {
return new ItemStack(ModBlocks.CABLE, amount, this.ordinal());
}
@SubscribeEvent @SubscribeEvent
public static void handleConfig(ConfigRegistryFactory.RebornRegistryEvent event){ public static void handleConfig(ConfigRegistryFactory.RebornRegistryEvent event){
Configuration config = event.getConfiguration(ModInfo.MOD_ID, "misc"); Configuration config = event.getConfiguration(ModInfo.MOD_ID, "misc");

View file

@ -85,7 +85,8 @@ public class GuiAESU extends GuiBase {
super.actionPerformed(button); super.actionPerformed(button);
if (button.id >= 300 && button.id <= 303) { if (button.id >= 300 && button.id <= 303) {
boolean shift = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT); boolean shift = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT);
NetworkManager.sendToServer(new PacketAesu(button.id, tile, shift)); boolean ctrl = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL);
NetworkManager.sendToServer(new PacketAesu(button.id, tile, shift, ctrl));
} }
} }
} }

View file

@ -42,7 +42,7 @@ import java.awt.*;
import java.util.List; import java.util.List;
public class RecipeUtil { public class RecipeUtil {
private static final int color = Color.darkGray.getRGB(); public static final int color = Color.darkGray.getRGB();
private RecipeUtil() { private RecipeUtil() {
} }

View file

@ -59,5 +59,9 @@ public class FusionReactorRecipeWrapper implements IRecipeWrapper {
@Override @Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
RecipeUtil.drawInfo(minecraft, 0, 34, baseRecipe.getStartEU(), baseRecipe.getEuTick(), baseRecipe.getTickTime()); RecipeUtil.drawInfo(minecraft, 0, 34, baseRecipe.getStartEU(), baseRecipe.getEuTick(), baseRecipe.getTickTime());
if(baseRecipe.getMinSize() != 0){
minecraft.fontRenderer.drawString("Reactor Size: " + baseRecipe.getMinSize(), 0, 74, RecipeUtil.color);
}
} }
} }

View file

@ -38,6 +38,7 @@ import reborncore.common.util.StringUtils;
import techreborn.Core; import techreborn.Core;
import techreborn.blocks.BlockStorage; import techreborn.blocks.BlockStorage;
import techreborn.blocks.BlockStorage2; import techreborn.blocks.BlockStorage2;
import techreborn.blocks.cable.EnumCableType;
import techreborn.compat.CompatManager; import techreborn.compat.CompatManager;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.IC2Duplicates; import techreborn.init.IC2Duplicates;
@ -191,6 +192,13 @@ public class CraftingTableRecipes extends RecipeMethods {
} }
registerShaped(EnumCableType.SUPERCONDUCTOR.getStack(), "MFM", "SSS", "MFM", 'M', getMaterial("advanced_machine", Type.MACHINE_FRAME), 'S', "craftingSuperconductor", 'F', getMaterial("energy_flow_circuit", 1, Type.PART));
registerShaped(EnumCableType.SUPERCONDUCTOR.getStack(8), "MFM", "SSS", "MFM", 'M', getMaterial("advanced_machine", Type.MACHINE_FRAME), 'S', getMaterial("enhanced_super_conductor", Type.PART), 'F', getMaterial("energy_flow_circuit", 1, Type.PART));
registerShaped(ItemUpgrades.getUpgradeByName("superconductor"), "SOS", "CMC", "SOS", 'C', EnumCableType.SUPERCONDUCTOR.getStack(), 'M', getMaterial("highly_advanced_machine", Type.MACHINE_FRAME) , 'O', getMaterial("data_orb", Type.PART), 'S', getMaterial("enhanced_super_conductor", Type.PART));
if (!CompatManager.isQuantumStorageLoaded) { if (!CompatManager.isQuantumStorageLoaded) {
registerShaped(getStack(ModBlocks.QUANTUM_CHEST), "DCD", "ATA", "DQD", 'D', getMaterial("dataOrb", Type.PART), 'C', getMaterial("computerMonitor", Type.PART), 'A', "machineBlockElite", 'Q', getStack(ModBlocks.DIGITAL_CHEST), 'T', getStack(IC2Duplicates.COMPRESSOR)); registerShaped(getStack(ModBlocks.QUANTUM_CHEST), "DCD", "ATA", "DQD", 'D', getMaterial("dataOrb", Type.PART), 'C', getMaterial("computerMonitor", Type.PART), 'A', "machineBlockElite", 'Q', getStack(ModBlocks.DIGITAL_CHEST), 'T', getStack(IC2Duplicates.COMPRESSOR));
registerShaped(getStack(ModBlocks.QUANTUM_TANK), "EPE", "PCP", "EPE", 'P', "platePlatinum", 'E', "circuitAdvanced", 'C', getStack(ModBlocks.QUANTUM_CHEST)); registerShaped(getStack(ModBlocks.QUANTUM_TANK), "EPE", "PCP", "EPE", 'P', "platePlatinum", 'E', "circuitAdvanced", 'C', getStack(ModBlocks.QUANTUM_CHEST));

View file

@ -24,11 +24,18 @@
package techreborn.init.recipes; package techreborn.init.recipes;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentData;
import net.minecraft.init.Items;
import net.minecraft.item.ItemEnchantedBook;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import techreborn.api.reactor.FusionReactorRecipe; import techreborn.api.reactor.FusionReactorRecipe;
import techreborn.api.reactor.FusionReactorRecipeHelper; import techreborn.api.reactor.FusionReactorRecipeHelper;
import techreborn.blocks.BlockOre; import techreborn.blocks.BlockOre;
import techreborn.items.ItemCells; import techreborn.items.ItemCells;
import techreborn.items.ingredients.ItemDusts; import techreborn.items.ingredients.ItemDusts;
import techreborn.items.ingredients.ItemParts;
/** /**
* @author drcrazy * @author drcrazy
@ -48,5 +55,12 @@ public class FusionReactorRecipes extends RecipeMethods {
FusionReactorRecipeHelper.registerRecipe( FusionReactorRecipeHelper.registerRecipe(
new FusionReactorRecipe(ItemCells.getCellByName("wolframium"), ItemCells.getCellByName("lithium"), new FusionReactorRecipe(ItemCells.getCellByName("wolframium"), ItemCells.getCellByName("lithium"),
BlockOre.getOreByName("iridium"), 90000000, -2048, 1024)); BlockOre.getOreByName("iridium"), 90000000, -2048, 1024));
ItemStack book = new ItemStack(Items.ENCHANTED_BOOK);
ItemEnchantedBook.addEnchantment(book, new EnchantmentData(Enchantment.REGISTRY.getObject(new ResourceLocation("efficiency")), 5));
FusionReactorRecipeHelper.registerRecipe(
new FusionReactorRecipe(ItemParts.getPartByName("super_conductor", 4), book,
ItemParts.getPartByName("enhanced_super_conductor", 4), 100000000, -8192, 2048, 50));
} }
} }

View file

@ -24,14 +24,18 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.tile.IUpgrade; import reborncore.api.tile.IUpgrade;
import reborncore.api.tile.IUpgradeable;
import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.powerSystem.TilePowerAcceptor;
import reborncore.common.recipes.IUpgradeHandler; import reborncore.common.recipes.IUpgradeHandler;
import reborncore.common.registration.RebornRegistry; import reborncore.common.registration.RebornRegistry;
@ -39,10 +43,12 @@ import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.tile.TileLegacyMachineBase; import reborncore.common.tile.TileLegacyMachineBase;
import techreborn.init.ModItems; import techreborn.init.ModItems;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
import techreborn.tiles.storage.TileAdjustableSU;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.security.InvalidParameterException; import java.security.InvalidParameterException;
import java.util.List;
@RebornRegistry(modID = ModInfo.MOD_ID) @RebornRegistry(modID = ModInfo.MOD_ID)
public class ItemUpgrades extends ItemTR implements IUpgrade { public class ItemUpgrades extends ItemTR implements IUpgrade {
@ -56,7 +62,7 @@ public class ItemUpgrades extends ItemTR implements IUpgrade {
@ConfigRegistry(config = "items", category = "upgrades", key = "energy_storage", comment = "Energy storage upgrade extra power") @ConfigRegistry(config = "items", category = "upgrades", key = "energy_storage", comment = "Energy storage upgrade extra power")
public static double energyStoragePower = 40_000; public static double energyStoragePower = 40_000;
public static final String[] types = new String[] { "overclock", "transformer", "energy_storage"}; public static final String[] types = new String[] { "overclock", "transformer", "energy_storage", "superconductor"};
public ItemUpgrades() { public ItemUpgrades() {
setUnlocalizedName("techreborn.upgrade"); setUnlocalizedName("techreborn.upgrade");
@ -127,6 +133,9 @@ public class ItemUpgrades extends ItemTR implements IUpgrade {
acceptor.extraTeir += 1; acceptor.extraTeir += 1;
} }
} }
if(machineBase instanceof TileAdjustableSU){
}
} }
@Override @Override
@ -134,4 +143,22 @@ public class ItemUpgrades extends ItemTR implements IUpgrade {
public void handleRightClick(TileEntity tile, ItemStack stack, Container container, int slotID) { public void handleRightClick(TileEntity tile, ItemStack stack, Container container, int slotID) {
} }
@Override
public void addInformation(ItemStack stack,
@Nullable
World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
if(stack.getItemDamage() == 3){
tooltip.add(TextFormatting.LIGHT_PURPLE + "Increases the max output of the AESU");
tooltip.add(TextFormatting.GOLD + "Blame obstinate_3 for this");
}
}
@Override
public boolean isValidForInventory(IUpgradeable upgradeable, ItemStack stack) {
if(stack.getItemDamage() == 3){
return upgradeable instanceof TileAdjustableSU;
}
return true;
}
} }

View file

@ -27,9 +27,12 @@ package techreborn.items.ingredients;
import com.google.common.base.CaseFormat; import com.google.common.base.CaseFormat;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.utils.TechRebornCreativeTab; import techreborn.utils.TechRebornCreativeTab;
@ -46,7 +49,7 @@ public class ItemParts extends ItemTR {
"thorium_cell", "double_thorium_cell", "quad_thorium_cell", "plutonium_cell", "double_plutonium_cell", "thorium_cell", "double_thorium_cell", "quad_thorium_cell", "plutonium_cell", "double_plutonium_cell",
"quad_plutonium_cell", "computer_monitor", "machine_parts", "neutron_reflector", "iridium_neutron_reflector", "quad_plutonium_cell", "computer_monitor", "machine_parts", "neutron_reflector", "iridium_neutron_reflector",
"thick_neutron_reflector", "electronic_circuit", "advanced_circuit", "sap", "rubber", "scrap", "thick_neutron_reflector", "electronic_circuit", "advanced_circuit", "sap", "rubber", "scrap",
"carbon_mesh", "carbon_fiber", "coolant_simple", "coolant_triple", "coolant_six"}; "carbon_mesh", "carbon_fiber", "coolant_simple", "coolant_triple", "coolant_six", "enhanced_super_conductor"};
public ItemParts() { public ItemParts() {
this.setCreativeTab(TechRebornCreativeTab.instance); this.setCreativeTab(TechRebornCreativeTab.instance);
@ -116,4 +119,21 @@ public class ItemParts extends ItemTR {
} }
return itemStack; return itemStack;
} }
@SideOnly(Side.CLIENT)
@Override
public boolean hasEffect(ItemStack stack) {
if(stack.getItemDamage() == getPartByName("enhanced_super_conductor").getItemDamage()){
return true;
}
return false;
}
@Override
public EnumRarity getRarity(ItemStack stack) {
if(stack.getItemDamage() == getPartByName("enhanced_super_conductor").getItemDamage()){
return EnumRarity.EPIC;
}
return super.getRarity(stack);
}
} }

View file

@ -38,14 +38,16 @@ public class PacketAesu implements INetworkPacket<PacketAesu> {
int buttonID; int buttonID;
BlockPos pos; BlockPos pos;
boolean shift; boolean shift;
boolean ctrl;
public PacketAesu() { public PacketAesu() {
} }
public PacketAesu(int buttonID, TileAdjustableSU tile, boolean shift) { public PacketAesu(int buttonID, TileAdjustableSU tile, boolean shift, boolean ctrl) {
this.buttonID = buttonID; this.buttonID = buttonID;
this.pos = tile.getPos(); this.pos = tile.getPos();
this.shift = shift; this.shift = shift;
this.ctrl = ctrl;
} }
@Override @Override
@ -53,6 +55,7 @@ public class PacketAesu implements INetworkPacket<PacketAesu> {
out.writeBlockPos(pos); out.writeBlockPos(pos);
out.writeInt(buttonID); out.writeInt(buttonID);
out.writeBoolean(shift); out.writeBoolean(shift);
out.writeBoolean(ctrl);
} }
@Override @Override
@ -60,13 +63,14 @@ public class PacketAesu implements INetworkPacket<PacketAesu> {
this.pos = in.readBlockPos(); this.pos = in.readBlockPos();
this.buttonID = in.readInt(); this.buttonID = in.readInt();
this.shift = in.readBoolean(); this.shift = in.readBoolean();
this.ctrl = in.readBoolean();
} }
@Override @Override
public void processData(PacketAesu message, MessageContext context) { public void processData(PacketAesu message, MessageContext context) {
TileEntity tile = context.getServerHandler().player.world.getTileEntity(message.pos); TileEntity tile = context.getServerHandler().player.world.getTileEntity(message.pos);
if (tile instanceof TileAdjustableSU){ if (tile instanceof TileAdjustableSU){
((TileAdjustableSU) tile).handleGuiInputFromClient(message.buttonID, shift); ((TileAdjustableSU) tile).handleGuiInputFromClient(message.buttonID, shift, ctrl);
} }
} }
} }

View file

@ -74,6 +74,7 @@ public class TileFusionControlComputer extends TilePowerAcceptor
int outputStackSlot = 2; int outputStackSlot = 2;
FusionReactorRecipe currentRecipe = null; FusionReactorRecipe currentRecipe = null;
boolean hasStartedCrafting = false; boolean hasStartedCrafting = false;
long lastTick = -1;
public TileFusionControlComputer() { public TileFusionControlComputer() {
super(); super();
@ -180,7 +181,8 @@ public class TileFusionControlComputer extends TilePowerAcceptor
* @return boolean True if reactor can execute recipe provided * @return boolean True if reactor can execute recipe provided
*/ */
private boolean validateReactorRecipe(FusionReactorRecipe recipe) { private boolean validateReactorRecipe(FusionReactorRecipe recipe) {
return validateReactorRecipeInputs(recipe, getStackInSlot(topStackSlot), getStackInSlot(bottomStackSlot)) || validateReactorRecipeInputs(recipe, getStackInSlot(bottomStackSlot), getStackInSlot(topStackSlot)); boolean validRecipe = validateReactorRecipeInputs(recipe, getStackInSlot(topStackSlot), getStackInSlot(bottomStackSlot)) || validateReactorRecipeInputs(recipe, getStackInSlot(bottomStackSlot), getStackInSlot(topStackSlot));
return validRecipe && getSize() >= recipe.getMinSize();
} }
private boolean validateReactorRecipeInputs(FusionReactorRecipe recipe, ItemStack slot1, ItemStack slot2) { private boolean validateReactorRecipeInputs(FusionReactorRecipe recipe, ItemStack slot1, ItemStack slot2) {
@ -206,6 +208,12 @@ public class TileFusionControlComputer extends TilePowerAcceptor
return; return;
} }
if(lastTick == world.getTotalWorldTime()){
//Prevent tick accerators, blame obstinate for this.
return;
}
lastTick = world.getTotalWorldTime();
// Force check every second // Force check every second
if (world.getTotalWorldTime() % 20 == 0) { if (world.getTotalWorldTime() % 20 == 0) {
checkCoils(); checkCoils();

View file

@ -28,6 +28,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import reborncore.api.power.EnumPowerTier; import reborncore.api.power.EnumPowerTier;
import reborncore.api.tile.IUpgrade;
import reborncore.common.registration.RebornRegistry; import reborncore.common.registration.RebornRegistry;
import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.util.Inventory; import reborncore.common.util.Inventory;
@ -35,6 +36,7 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder; import reborncore.client.containerBuilder.builder.ContainerBuilder;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
import techreborn.items.ItemUpgrades;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
@RebornRegistry(modID = ModInfo.MOD_ID) @RebornRegistry(modID = ModInfo.MOD_ID)
@ -54,9 +56,39 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro
super("ADJUSTABLE_SU", 4, ModBlocks.ADJUSTABLE_SU, EnumPowerTier.INSANE, maxInput, maxOutput, maxEnergy); super("ADJUSTABLE_SU", 4, ModBlocks.ADJUSTABLE_SU, EnumPowerTier.INSANE, maxInput, maxOutput, maxEnergy);
} }
public void handleGuiInputFromClient(int id, boolean shift) { int superconductors = 0;
@Override
public void update() {
super.update();
superconductors = 0;
for (int i = 0; i < getUpgradeSlotCount(); i++) {
ItemStack stack = getUpgradeInvetory().getStackInSlot(i);
if(stack.getItem() instanceof ItemUpgrades && stack.getItemDamage() == 3){
superconductors++;
}
}
if (OUTPUT > getMaxConfigOutput()) {
OUTPUT = getMaxConfigOutput();
}
}
public int getMaxConfigOutput(){
int extra = 0;
if(superconductors > 0){
extra = (int) Math.pow(2, (superconductors + 2)) * maxOutput;
}
return maxOutput + extra;
}
public void handleGuiInputFromClient(int id, boolean shift, boolean ctrl) {
if (id == 300) { if (id == 300) {
OUTPUT += shift ? 4096 : 256; OUTPUT += shift ? 4096 : 256;
if(ctrl){
//Set to max, limited to the max later
OUTPUT = Integer.MAX_VALUE;
}
} }
if (id == 301) { if (id == 301) {
OUTPUT += shift ? 512 : 64; OUTPUT += shift ? 512 : 64;
@ -66,9 +98,12 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro
} }
if (id == 303) { if (id == 303) {
OUTPUT -= shift ? 4096 : 256; OUTPUT -= shift ? 4096 : 256;
if(ctrl){
OUTPUT = 1;
}
} }
if (OUTPUT > maxOutput) { if (OUTPUT > getMaxConfigOutput()) {
OUTPUT = maxOutput; OUTPUT = getMaxConfigOutput();
} }
if (OUTPUT <= -1) { if (OUTPUT <= -1) {
OUTPUT = 0; OUTPUT = 0;
@ -126,4 +161,14 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro
.complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45) .complete(8, 18).addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45)
.syncEnergyValue().syncIntegerValue(this::getCurrentOutput, this::setCurentOutput).addInventory().create(this); .syncEnergyValue().syncIntegerValue(this::getCurrentOutput, this::setCurentOutput).addInventory().create(this);
} }
@Override
public boolean canBeUpgraded() {
return true;
}
@Override
public boolean isUpgradeValid(IUpgrade upgrade, ItemStack stack) {
return upgrade instanceof ItemUpgrades && stack.getItemDamage() == 3;
}
} }

View file

@ -45,6 +45,11 @@
"textures": { "textures": {
"layer0": "techreborn:items/cables/insulatedhv" "layer0": "techreborn:items/cables/insulatedhv"
} }
},
"superconductor": {
"textures": {
"layer0": "techreborn:items/cables/superconductor"
}
} }
} }
} }

View file

@ -77,6 +77,11 @@
"textures": { "textures": {
"cable": "techreborn:blocks/cables/hv_insulated_cable" "cable": "techreborn:blocks/cables/hv_insulated_cable"
} }
},
"superconductor": {
"textures": {
"cable": "techreborn:blocks/cables/superconductor_cable"
}
} }
} }
} }

View file

@ -195,6 +195,11 @@
"textures": { "textures": {
"layer0": "techreborn:items/part/coolant_six" "layer0": "techreborn:items/part/coolant_six"
} }
},
"enhanced_super_conductor": {
"textures": {
"layer0": "techreborn:items/part/super_conductor"
}
} }
} }
} }

View file

@ -35,6 +35,11 @@
"textures": { "textures": {
"layer0": "techreborn:items/upgrade/injection_upgrade" "layer0": "techreborn:items/upgrade/injection_upgrade"
} }
},
"superconductor": {
"textures": {
"layer0": "techreborn:items/upgrade/superconductor"
}
} }
} }
} }

View file

@ -146,6 +146,7 @@ tile.techreborn.cable.glassfiber.name=Glass Fiber Cable
tile.techreborn.cable.insulatedcopper.name=Insulated Copper Cable tile.techreborn.cable.insulatedcopper.name=Insulated Copper Cable
tile.techreborn.cable.insulatedgold.name=Insulated Gold Cable tile.techreborn.cable.insulatedgold.name=Insulated Gold Cable
tile.techreborn.cable.insulatedhv.name=Insulated HV Cable tile.techreborn.cable.insulatedhv.name=Insulated HV Cable
tile.techreborn.cable.superconductor.name=Superconductor Cable
#Fluid blocks #Fluid blocks
tile.techreborn.berylium.name=Beryllium tile.techreborn.berylium.name=Beryllium
@ -487,6 +488,7 @@ item.techreborn.part.coolant_six.name=60k Coolant Cell
item.techreborn.part.carbon_mesh.name=Carbon Mesh item.techreborn.part.carbon_mesh.name=Carbon Mesh
item.techreborn.part.carbon_fiber.name=Carbon Fiber item.techreborn.part.carbon_fiber.name=Carbon Fiber
item.techreborn.part.uuMatter.name=UU-Matter item.techreborn.part.uuMatter.name=UU-Matter
item.techreborn.part.enhanced_super_conductor.name=Enhanced Superconductor
#Items-Armor #Items-Armor
item.techreborn.cloakingdevice.name=Cloaking Device item.techreborn.cloakingdevice.name=Cloaking Device
@ -528,6 +530,7 @@ item.techreborn.scrapbox.name=Scrap Box
item.techreborn.upgrade.overclock.name=Overclocker Upgrade item.techreborn.upgrade.overclock.name=Overclocker Upgrade
item.techreborn.upgrade.transformer.name=Transformer Upgrade item.techreborn.upgrade.transformer.name=Transformer Upgrade
item.techreborn.upgrade.energy_storage.name=Energy Storage Upgrade item.techreborn.upgrade.energy_storage.name=Energy Storage Upgrade
item.techreborn.upgrade.superconductor.name=Superconductor Upgrade
item.bronzeSword.name=Bronze Sword item.bronzeSword.name=Bronze Sword

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB