From b0a466d5fd28fd6e72fca4b17e19349c815710d9 Mon Sep 17 00:00:00 2001 From: GN <35490649+Gan-N@users.noreply.github.com> Date: Wed, 14 Oct 2020 14:52:10 +0800 Subject: [PATCH 1/2] Modify part of tooltips to read zh_ us.lang --- .../craftingstation/CraftingStationBlock.java | 41 ++++ .../blocks/multitank/MultiTankBlock.java | 59 +++++ .../rftoolscontrol/blocks/node/NodeBlock.java | 120 ++++++++++ .../blocks/processor/ProcessorBlock.java | 155 +++++++++++++ .../blocks/workbench/WorkbenchBlock.java | 42 ++++ .../rftoolscontrol/items/CPUCoreItem.java | 37 +++ .../rftoolscontrol/items/CardBaseItem.java | 27 +++ .../items/GraphicsCardItem.java | 26 +++ .../rftoolscontrol/items/NetworkCardItem.java | 47 ++++ .../items/NetworkIdentifierItem.java | 91 ++++++++ .../rftoolscontrol/items/RAMChipItem.java | 28 +++ .../mcjty/rftoolscontrol/items/TokenItem.java | 54 +++++ .../consolemodule/ConsoleModuleItem.java | 117 ++++++++++ .../items/craftingcard/CraftingCardItem.java | 212 ++++++++++++++++++ .../InteractionModuleItem.java | 121 ++++++++++ .../variablemodule/VariableModuleItem.java | 122 ++++++++++ .../vectorartmodule/VectorArtModuleItem.java | 117 ++++++++++ .../craftingstation/CraftingStationBlock.java | 6 +- .../blocks/multitank/MultiTankBlock.java | 8 +- .../rftoolscontrol/blocks/node/NodeBlock.java | 7 +- .../blocks/processor/ProcessorBlock.java | 6 +- .../blocks/programmer/ProgrammerBlock.java | 6 +- .../blocks/workbench/WorkbenchBlock.java | 8 +- .../rftoolscontrol/items/CPUCoreItem.java | 6 +- .../rftoolscontrol/items/CardBaseItem.java | 7 +- .../items/GraphicsCardItem.java | 6 +- .../rftoolscontrol/items/NetworkCardItem.java | 18 +- .../items/NetworkIdentifierItem.java | 12 +- .../rftoolscontrol/items/ProgramCardItem.java | 8 +- .../rftoolscontrol/items/RAMChipItem.java | 7 +- .../mcjty/rftoolscontrol/items/TokenItem.java | 11 +- .../consolemodule/ConsoleModuleItem.java | 8 +- .../items/craftingcard/CraftingCardItem.java | 8 +- .../InteractionModuleItem.java | 9 +- .../variablemodule/VariableModuleItem.java | 9 +- .../vectorartmodule/VectorArtModuleItem.java | 8 +- src/main/main.iml | 11 + .../assets/rftoolscontrol/lang/en_us.lang | 33 ++- 38 files changed, 1563 insertions(+), 55 deletions(-) create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/craftingstation/CraftingStationBlock.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/multitank/MultiTankBlock.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/node/NodeBlock.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/processor/ProcessorBlock.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/workbench/WorkbenchBlock.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/CPUCoreItem.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/CardBaseItem.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/GraphicsCardItem.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/NetworkCardItem.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/NetworkIdentifierItem.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/RAMChipItem.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/TokenItem.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/consolemodule/ConsoleModuleItem.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/craftingcard/CraftingCardItem.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/interactionmodule/InteractionModuleItem.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/variablemodule/VariableModuleItem.java create mode 100644 src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/vectorartmodule/VectorArtModuleItem.java create mode 100644 src/main/main.iml diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/craftingstation/CraftingStationBlock.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/craftingstation/CraftingStationBlock.java new file mode 100644 index 00000000..dbeb05be --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/craftingstation/CraftingStationBlock.java @@ -0,0 +1,41 @@ +package mcjty.rftoolscontrol.blocks.craftingstation; + +import mcjty.lib.gui.GenericGuiContainer; +import mcjty.rftoolscontrol.blocks.GenericRFToolsBlock; +import mcjty.rftoolscontrol.setup.GuiProxy; +import net.minecraft.block.material.Material; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.Arrays; +import java.util.List; +import java.util.function.BiFunction; + +public class CraftingStationBlock extends GenericRFToolsBlock { + + public CraftingStationBlock() { + super(Material.IRON, CraftingStationTileEntity.class, CraftingStationContainer::new, "craftingstation", false); + } + + @SideOnly(Side.CLIENT) + @Override + public BiFunction> getGuiFactory() { + return GuiCraftingStation::new; + } + + @Override + public int getGuiID() { + return GuiProxy.GUI_CRAFTINGSTATION; + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "craftingstation").split("0x0a"))); + } +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/multitank/MultiTankBlock.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/multitank/MultiTankBlock.java new file mode 100644 index 00000000..6b072701 --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/multitank/MultiTankBlock.java @@ -0,0 +1,59 @@ +package mcjty.rftoolscontrol.blocks.multitank; + +import mcjty.lib.container.EmptyContainer; +import mcjty.lib.gui.GenericGuiContainer; +import mcjty.rftoolscontrol.blocks.GenericRFToolsBlock; +import mcjty.rftoolscontrol.setup.GuiProxy; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.Arrays; +import java.util.List; +import java.util.function.BiFunction; + +public class MultiTankBlock extends GenericRFToolsBlock { + + public MultiTankBlock() { + super(Material.IRON, MultiTankTileEntity.class, EmptyContainer::new, "tank", false); + } + + @Override + public RotationType getRotationType() { + return RotationType.NONE; + } + + @SideOnly(Side.CLIENT) + @Override + public BiFunction> getGuiFactory() { + return GuiMultiTank::new; + } + + @Override + public int getGuiID() { + return GuiProxy.GUI_TANK; + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "tank").split("0x0a"))); + } + + @Override + public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) { + return layer == BlockRenderLayer.SOLID || layer == BlockRenderLayer.TRANSLUCENT; + } + + @Override + public boolean isOpaqueCube(IBlockState state) { + return false; + } +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/node/NodeBlock.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/node/NodeBlock.java new file mode 100644 index 00000000..572e5fa0 --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/node/NodeBlock.java @@ -0,0 +1,120 @@ +package mcjty.rftoolscontrol.blocks.node; + +import mcjty.lib.container.EmptyContainer; +import mcjty.lib.gui.GenericGuiContainer; +import mcjty.rftoolscontrol.blocks.GenericRFToolsBlock; +import mcjty.rftoolscontrol.setup.GuiProxy; +import mcjty.theoneprobe.api.IProbeHitData; +import mcjty.theoneprobe.api.IProbeInfo; +import mcjty.theoneprobe.api.ProbeMode; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.Arrays; +import java.util.List; +import java.util.function.BiFunction; + +public class NodeBlock extends GenericRFToolsBlock { + + public NodeBlock() { + super(Material.IRON, NodeTileEntity.class, EmptyContainer::new, "node", false); + } + + @SideOnly(Side.CLIENT) + @Override + public BiFunction> getGuiFactory() { + return GuiNode::new; + } + + @Override + public int getGuiID() { + return GuiProxy.GUI_NODE; + } + + @Override + public boolean needsRedstoneCheck() { + return true; + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "node").split("0x0a"))); + } + + @Override + @Optional.Method(modid = "theoneprobe") + public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) { + super.addProbeInfo(mode, probeInfo, player, world, blockState, data); + TileEntity te = world.getTileEntity(data.getPos()); + if (te instanceof NodeTileEntity) { + NodeTileEntity node = (NodeTileEntity) te; + probeInfo.text(TextFormatting.GREEN + "Channel: " + node.getChannelName()); + probeInfo.text(TextFormatting.GREEN + "Name: " + node.getNodeName()); + } + } + + + private int getInputStrength(World world, BlockPos pos, EnumFacing side) { + return world.getRedstonePower(pos.offset(side), side); + } + + @Override + protected void checkRedstone(World world, BlockPos pos) { + IBlockState state = world.getBlockState(pos); + TileEntity te = world.getTileEntity(pos); + if (state.getBlock() instanceof NodeBlock && te instanceof NodeTileEntity) { + NodeTileEntity processor = (NodeTileEntity)te; + int powered = 0; + if (getInputStrength(world, pos, EnumFacing.DOWN) > 0) { + powered += 1; + } + if (getInputStrength(world, pos, EnumFacing.UP) > 0) { + powered += 2; + } + if (getInputStrength(world, pos, EnumFacing.NORTH) > 0) { + powered += 4; + } + if (getInputStrength(world, pos, EnumFacing.SOUTH) > 0) { + powered += 8; + } + if (getInputStrength(world, pos, EnumFacing.WEST) > 0) { + powered += 16; + } + if (getInputStrength(world, pos, EnumFacing.EAST) > 0) { + powered += 32; + } + processor.setPowerInput(powered); + } + } + + @Override + public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + return true; + } + + @Override + protected int getRedstoneOutput(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + TileEntity te = world.getTileEntity(pos); + if (state.getBlock() instanceof NodeBlock && te instanceof NodeTileEntity) { + NodeTileEntity processor = (NodeTileEntity) te; + return processor.getPowerOut(side.getOpposite()); + } + return 0; + } + +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/processor/ProcessorBlock.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/processor/ProcessorBlock.java new file mode 100644 index 00000000..209ef673 --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/processor/ProcessorBlock.java @@ -0,0 +1,155 @@ +package mcjty.rftoolscontrol.blocks.processor; + +import mcjty.lib.gui.GenericGuiContainer; +import mcjty.rftoolscontrol.blocks.GenericRFToolsBlock; +import mcjty.rftoolscontrol.setup.GuiProxy; +import mcjty.theoneprobe.api.IProbeHitData; +import mcjty.theoneprobe.api.IProbeInfo; +import mcjty.theoneprobe.api.ProbeMode; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.Optional; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.Arrays; +import java.util.List; +import java.util.function.BiFunction; + +public class ProcessorBlock extends GenericRFToolsBlock { + + @Override + public boolean needsRedstoneCheck() { + return true; + } + + public ProcessorBlock() { + super(Material.IRON, ProcessorTileEntity.class, ProcessorContainer::new, "processor", false); + } + + @Override + public void initModel() { + ProcessorRenderer.register(); + super.initModel(); + } + + @SideOnly(Side.CLIENT) + @Override + public BiFunction> getGuiFactory() { + return GuiProcessor::new; + } + + @Override + public int getGuiID() { + return GuiProxy.GUI_PROCESSOR; + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "processor").split("0x0a"))); + } + + @Override + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) { + super.neighborChanged(state, world, pos, blockIn, fromPos); + TileEntity te = world.getTileEntity(pos); + if (te instanceof ProcessorTileEntity) { + ((ProcessorTileEntity) te).markFluidSlotsDirty(); + } + } + + @Override + public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor) { + super.onNeighborChange(world, pos, neighbor); + TileEntity te = world.getTileEntity(pos); + if (te instanceof ProcessorTileEntity) { + ((ProcessorTileEntity) te).markFluidSlotsDirty(); + } + } + + @Override + @Optional.Method(modid = "theoneprobe") + public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) { + super.addProbeInfo(mode, probeInfo, player, world, blockState, data); + TileEntity te = world.getTileEntity(data.getPos()); + if (te instanceof ProcessorTileEntity) { + ProcessorTileEntity processor = (ProcessorTileEntity) te; + if (processor.hasNetworkCard()) { + probeInfo.text(TextFormatting.GREEN + "Channel: " + processor.getChannelName()); + probeInfo.text(TextFormatting.GREEN + "Nodes: " + processor.getNodeCount()); + } + if (mode == ProbeMode.EXTENDED) { + List lastMessages = processor.getLastMessages(6); + if (!lastMessages.isEmpty()) { + IProbeInfo v = probeInfo.vertical(probeInfo.defaultLayoutStyle().borderColor(0xffff0000)); + for (String s : lastMessages) { + v.text(" " + s); + } + } + } + } + } + + + private int getInputStrength(World world, BlockPos pos, EnumFacing side) { + return world.getRedstonePower(pos.offset(side), side); + } + + @Override + protected void checkRedstone(World world, BlockPos pos) { + IBlockState state = world.getBlockState(pos); + TileEntity te = world.getTileEntity(pos); + if (state.getBlock() instanceof ProcessorBlock && te instanceof ProcessorTileEntity) { + ProcessorTileEntity processor = (ProcessorTileEntity)te; + int powered = 0; + if (getInputStrength(world, pos, EnumFacing.DOWN) > 0) { + powered += 1; + } + if (getInputStrength(world, pos, EnumFacing.UP) > 0) { + powered += 2; + } + if (getInputStrength(world, pos, EnumFacing.NORTH) > 0) { + powered += 4; + } + if (getInputStrength(world, pos, EnumFacing.SOUTH) > 0) { + powered += 8; + } + if (getInputStrength(world, pos, EnumFacing.WEST) > 0) { + powered += 16; + } + if (getInputStrength(world, pos, EnumFacing.EAST) > 0) { + powered += 32; + } + processor.setPowerInput(powered); + } + } + + @Override + public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + return true; + } + + @Override + protected int getRedstoneOutput(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + TileEntity te = world.getTileEntity(pos); + if (state.getBlock() instanceof ProcessorBlock && te instanceof ProcessorTileEntity) { + ProcessorTileEntity processor = (ProcessorTileEntity) te; + return processor.getPowerOut(side.getOpposite()); + } + return 0; + } + +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/workbench/WorkbenchBlock.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/workbench/WorkbenchBlock.java new file mode 100644 index 00000000..152721ef --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/blocks/workbench/WorkbenchBlock.java @@ -0,0 +1,42 @@ +package mcjty.rftoolscontrol.blocks.workbench; + +import mcjty.lib.gui.GenericGuiContainer; +import mcjty.rftoolscontrol.blocks.GenericRFToolsBlock; +import mcjty.rftoolscontrol.setup.GuiProxy; +import net.minecraft.block.material.Material; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.Arrays; +import java.util.List; +import java.util.function.BiFunction; + +public class WorkbenchBlock extends GenericRFToolsBlock { + + public WorkbenchBlock() { + super(Material.IRON, WorkbenchTileEntity.class, WorkbenchContainer::new, "workbench", false); + } + + @SideOnly(Side.CLIENT) + @Override + public BiFunction> getGuiFactory() { + return GuiWorkbench::new; + } + + @Override + public int getGuiID() { + return GuiProxy.GUI_WORKBENCH; + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "workbench").split("0x0a"))); + } +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/CPUCoreItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/CPUCoreItem.java new file mode 100644 index 00000000..99f5dd1e --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/CPUCoreItem.java @@ -0,0 +1,37 @@ +package mcjty.rftoolscontrol.items; + +import mcjty.rftoolscontrol.config.ConfigSetup; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.item.ItemStack; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; + +import java.util.List; + +public class CPUCoreItem extends GenericRFToolsItem { + + private final int tier; + + public CPUCoreItem(String name, int tier) { + super(name); + setMaxStackSize(1); + this.tier = tier; + } + + public int getTier() { + return tier; + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID+"."+"cpu_core_500").split("0x0a"))); + + list.add(TextFormatting.GREEN + "" + ConfigSetup.coreSpeed[tier].get() + " operations per tick"); + list.add(TextFormatting.GREEN + "" + ConfigSetup.coreRFPerTick[tier].get() + " RF per tick"); + } +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/CardBaseItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/CardBaseItem.java new file mode 100644 index 00000000..733d6ad4 --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/CardBaseItem.java @@ -0,0 +1,27 @@ +package mcjty.rftoolscontrol.items; + +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; + +import javax.annotation.Nullable; +import java.util.List; + +public class CardBaseItem extends GenericRFToolsItem { + + public CardBaseItem() { + super("card_base"); + setMaxStackSize(64); + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, @Nullable World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID+"."+"card_base").split("0x0a"))); + + } +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/GraphicsCardItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/GraphicsCardItem.java new file mode 100644 index 00000000..63b7e8ed --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/GraphicsCardItem.java @@ -0,0 +1,26 @@ +package mcjty.rftoolscontrol.items; + +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.Arrays; +import java.util.List; + +public class GraphicsCardItem extends GenericRFToolsItem { + + public GraphicsCardItem() { + super("graphics_card"); + setMaxStackSize(1); + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "graphics_card").split("0x0a"))); + } +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/NetworkCardItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/NetworkCardItem.java new file mode 100644 index 00000000..d19121e9 --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/NetworkCardItem.java @@ -0,0 +1,47 @@ +package mcjty.rftoolscontrol.items; + +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.Arrays; +import java.util.List; + +public class NetworkCardItem extends GenericRFToolsItem { + + private final int tier; + + public static final int TIER_NORMAL = 0; + public static final int TIER_ADVANCED = 1; + + public NetworkCardItem(String name, int tier) { + super(name); + setMaxStackSize(1); + this.tier = tier; + } + + public int getTier() { + return tier; + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "network_card").split("0x0a"))); + + String[] strings = I18n.format("tooltips." + RFToolsControl.MODID + "." + "network_card.range").split("0x0a"); + + if (tier == TIER_NORMAL) { + list.add(TextFormatting.GREEN + strings[0]); + } else { + list.add(TextFormatting.GREEN + strings[1]); + list.add(TextFormatting.GREEN + strings[2]); + } + } +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/NetworkIdentifierItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/NetworkIdentifierItem.java new file mode 100644 index 00000000..8f075591 --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/NetworkIdentifierItem.java @@ -0,0 +1,91 @@ +package mcjty.rftoolscontrol.items; + +import mcjty.lib.varia.Logging; +import mcjty.rftoolscontrol.blocks.ModBlocks; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.List; + +public class NetworkIdentifierItem extends GenericRFToolsItem { + + public NetworkIdentifierItem() { + super("network_identifier"); + setMaxStackSize(1); + } + + @Override + public int getMaxItemUseDuration(ItemStack stack) { + return 1; + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack itemStack, World player, List list, ITooltipFlag whatIsThis) { + super.addInformation(itemStack, player, list, whatIsThis); + boolean hasTarget = false; + NBTTagCompound tagCompound = itemStack.getTagCompound(); + + String[] networkIdentifierI18N = I18n.format("tooltips." + RFToolsControl.MODID + "." + "network_identifier").split("0x0a"); + if (tagCompound != null) { + if (tagCompound.hasKey("monitorx")) { + int monitordim = tagCompound.getInteger("monitordim"); + int monitorx = tagCompound.getInteger("monitorx"); + int monitory = tagCompound.getInteger("monitory"); + int monitorz = tagCompound.getInteger("monitorz"); + list.add(TextFormatting.YELLOW + networkIdentifierI18N[0] + monitorx + "," + monitory + "," + monitorz); + list.add(TextFormatting.YELLOW + "(" + networkIdentifierI18N[1] + monitordim + ")"); + hasTarget = true; + } + } + if (!hasTarget) { + list.add(networkIdentifierI18N[2]); + list.add(networkIdentifierI18N[3]); + } + } + + @Override + public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + ItemStack stack = player.getHeldItem(hand); + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); + NBTTagCompound tagCompound = stack.getTagCompound(); + if (tagCompound == null) { + tagCompound = new NBTTagCompound(); + } + + if (block == ModBlocks.processorBlock) { + tagCompound.setInteger("monitordim", world.provider.getDimension()); + tagCompound.setInteger("monitorx", pos.getX()); + tagCompound.setInteger("monitory", pos.getY()); + tagCompound.setInteger("monitorz", pos.getZ()); + if (world.isRemote) { + Logging.message(player, "Network identifier is set to block"); + } + } else { + tagCompound.removeTag("monitordim"); + tagCompound.removeTag("monitorx"); + tagCompound.removeTag("monitory"); + tagCompound.removeTag("monitorz"); + if (world.isRemote) { + Logging.message(player, "Network identifier is cleared"); + } + } + stack.setTagCompound(tagCompound); + return EnumActionResult.SUCCESS; + } + +} \ No newline at end of file diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/RAMChipItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/RAMChipItem.java new file mode 100644 index 00000000..6ae054f5 --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/RAMChipItem.java @@ -0,0 +1,28 @@ +package mcjty.rftoolscontrol.items; + +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.Arrays; +import java.util.List; + +public class RAMChipItem extends GenericRFToolsItem { + + public RAMChipItem() { + super("ram_chip"); + setMaxStackSize(1); + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "ram_chip").split("0x0a"))); + } + +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/TokenItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/TokenItem.java new file mode 100644 index 00000000..fe0966d0 --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/TokenItem.java @@ -0,0 +1,54 @@ +package mcjty.rftoolscontrol.items; + +import mcjty.rftoolscontrol.api.parameters.Parameter; +import mcjty.rftoolscontrol.setup.GuiProxy; +import mcjty.rftoolscontrol.logic.ParameterTools; +import mcjty.rftoolscontrol.logic.ParameterTypeTools; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.lwjgl.input.Keyboard; + +import java.util.List; + +public class TokenItem extends GenericRFToolsItem { + + public TokenItem() { + super("token"); + setMaxStackSize(64); + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + + boolean hasContents = false; + if (stack.hasTagCompound()) { + NBTTagCompound parameter = stack.getTagCompound().getCompoundTag("parameter"); + if (!parameter.hasNoTags()) { + Parameter par = ParameterTools.readFromNBT(parameter); + hasContents = true; + list.add(TextFormatting.BLUE + "Type: " + par.getParameterType().getName()); + list.add(TextFormatting.BLUE + "Value: " + ParameterTypeTools.stringRepresentation(par.getParameterType(), par.getParameterValue())); + } + } + if (!hasContents) { + list.add(TextFormatting.BLUE + I18n.format("tooltips." + RFToolsControl.MODID+"."+"token.hascontents")); + } + + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { + String[] strings = I18n.format("tooltips." + RFToolsControl.MODID+"."+"token.keyboard").split("0x0a"); + for (String str : strings){ + list.add(TextFormatting.WHITE + str); + } + } else { + list.add(TextFormatting.WHITE + GuiProxy.SHIFT_MESSAGE); + } + } +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/consolemodule/ConsoleModuleItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/consolemodule/ConsoleModuleItem.java new file mode 100644 index 00000000..5c9b743f --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/consolemodule/ConsoleModuleItem.java @@ -0,0 +1,117 @@ +package mcjty.rftoolscontrol.items.consolemodule; + +import mcjty.lib.varia.Logging; +import mcjty.rftools.api.screens.IModuleGuiBuilder; +import mcjty.rftools.api.screens.IModuleProvider; +import mcjty.rftoolscontrol.blocks.ModBlocks; +import mcjty.rftoolscontrol.config.ConfigSetup; +import mcjty.rftoolscontrol.items.GenericRFToolsItem; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.List; + +public class ConsoleModuleItem extends GenericRFToolsItem implements IModuleProvider { + + public ConsoleModuleItem() { + super("console_module"); + setMaxStackSize(1); + } + + @Override + public int getMaxItemUseDuration(ItemStack stack) { + return 1; + } + + @Override + public Class getServerScreenModule() { + return ConsoleScreenModule.class; + } + + @Override + public Class getClientScreenModule() { + return ConsoleClientScreenModule.class; + } + + @Override + public String getName() { + return "VAR"; + } + + @Override + public void createGui(IModuleGuiBuilder guiBuilder) { + guiBuilder. + block("monitor").nl(); + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack itemStack, World player, List list, ITooltipFlag whatIsThis) { + super.addInformation(itemStack, player, list, whatIsThis); + list.add(TextFormatting.GREEN + "Uses " + ConfigSetup.CONSOLEMODULE_RFPERTICK.get() + " RF/tick"); + boolean hasTarget = false; + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound != null) { + list.add(TextFormatting.YELLOW + "Label: " + tagCompound.getString("text")); + if (tagCompound.hasKey("monitorx")) { + int monitorx = tagCompound.getInteger("monitorx"); + int monitory = tagCompound.getInteger("monitory"); + int monitorz = tagCompound.getInteger("monitorz"); + String monitorname = tagCompound.getString("monitorname"); + list.add(TextFormatting.YELLOW + "Monitoring: " + monitorname + " (at " + monitorx + "," + monitory + "," + monitorz + ")"); + hasTarget = true; + } + } + if (!hasTarget) { + String[] strings = I18n.format("tooltips." + RFToolsControl.MODID + "." + "console_module").split("0x0a"); + for(String str strings){ + list.add(TextFormatting.YELLOW + str); + } + } + } + + @Override + public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + ItemStack stack = player.getHeldItem(hand); + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); + NBTTagCompound tagCompound = stack.getTagCompound(); + if (tagCompound == null) { + tagCompound = new NBTTagCompound(); + } + + if (block == ModBlocks.processorBlock) { + tagCompound.setInteger("monitordim", world.provider.getDimension()); + tagCompound.setInteger("monitorx", pos.getX()); + tagCompound.setInteger("monitory", pos.getY()); + tagCompound.setInteger("monitorz", pos.getZ()); + if (world.isRemote) { + Logging.message(player, "Console module is set to block"); + } + } else { + tagCompound.removeTag("monitordim"); + tagCompound.removeTag("monitorx"); + tagCompound.removeTag("monitory"); + tagCompound.removeTag("monitorz"); + if (world.isRemote) { + Logging.message(player, "Console module is cleared"); + } + } + stack.setTagCompound(tagCompound); + return EnumActionResult.SUCCESS; + } + +} \ No newline at end of file diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/craftingcard/CraftingCardItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/craftingcard/CraftingCardItem.java new file mode 100644 index 00000000..ad24d834 --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/craftingcard/CraftingCardItem.java @@ -0,0 +1,212 @@ +package mcjty.rftoolscontrol.items.craftingcard; + +import mcjty.lib.varia.ItemStackList; +import mcjty.rftoolscontrol.RFToolsControl; +import mcjty.rftoolscontrol.setup.GuiProxy; +import mcjty.rftoolscontrol.items.GenericRFToolsItem; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.Constants; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import static mcjty.rftoolscontrol.items.craftingcard.CraftingCardContainer.GRID_WIDTH; +import static mcjty.rftoolscontrol.items.craftingcard.CraftingCardContainer.INPUT_SLOTS; + +public class CraftingCardItem extends GenericRFToolsItem { + + public CraftingCardItem() { + super("crafting_card"); + } + + public static void testRecipe(World world, ItemStack craftingCard) { + ItemStackList stacks = getStacksFromItem(craftingCard); + + InventoryCrafting workInventory = new InventoryCrafting(new Container() { + @Override + public boolean canInteractWith(EntityPlayer var1) { + return false; + } + }, 3, 3); + for (int y = 0 ; y < 3 ; y++) { + for (int x = 0 ; x < 3 ; x++) { + int idx = y*3+x; + int idxCard = y*GRID_WIDTH + x; + workInventory.setInventorySlotContents(idx, stacks.get(idxCard)); + } + } + IRecipe recipe = CraftingManager.findMatchingRecipe(workInventory, world); + if (recipe != null) { + ItemStack stack = recipe.getCraftingResult(workInventory); + stacks.set(INPUT_SLOTS, stack); + } else { + stacks.set(INPUT_SLOTS, ItemStack.EMPTY); + } + putStacksInItem(craftingCard, stacks); + } + + public static ItemStackList getStacksFromItem(ItemStack craftingCard) { + NBTTagCompound tagCompound = craftingCard.getTagCompound(); + if (tagCompound == null) { + tagCompound = new NBTTagCompound(); + craftingCard.setTagCompound(tagCompound); + } + ItemStackList stacks = ItemStackList.create(CraftingCardContainer.INPUT_SLOTS+1); + NBTTagList bufferTagList = tagCompound.getTagList("Items", Constants.NBT.TAG_COMPOUND); + for (int i = 0 ; i < bufferTagList.tagCount() ; i++) { + NBTTagCompound nbtTagCompound = bufferTagList.getCompoundTagAt(i); + stacks.set(i, new ItemStack(nbtTagCompound)); + } + return stacks; + } + + public static void putStacksInItem(ItemStack craftingCard, ItemStackList stacks) { + NBTTagCompound tagCompound = craftingCard.getTagCompound(); + if (tagCompound == null) { + tagCompound = new NBTTagCompound(); + craftingCard.setTagCompound(tagCompound); + } + NBTTagList bufferTagList = new NBTTagList(); + for (ItemStack stack : stacks) { + NBTTagCompound nbtTagCompound = new NBTTagCompound(); + if (!stack.isEmpty()) { + stack.writeToNBT(nbtTagCompound); + } + bufferTagList.appendTag(nbtTagCompound); + } + tagCompound.setTag("Items", bufferTagList); + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { + super.addInformation(stack, playerIn, list, advanced); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID+"."+"crafting_card").split("0x0a"))); + + boolean strictnbt = CraftingCardItem.isStrictNBT(stack); + list.add(TextFormatting.GREEN + "Strict NBT: " + TextFormatting.WHITE + (strictnbt ? "yes" : "no")); + ItemStack result = getResult(stack); + if (!result.isEmpty()) { + if (result.getCount() > 1) { + list.add(TextFormatting.BLUE + "Item: " + TextFormatting.WHITE + result.getDisplayName() + "(" + + result.getCount() + ")"); + } else { + list.add(TextFormatting.BLUE + "Item: " + TextFormatting.WHITE + result.getDisplayName()); + } + } + } + + @Override + public ActionResult onItemRightClick(World world, EntityPlayer player, EnumHand hand) { + ItemStack stack = player.getHeldItem(hand); + if (hand != EnumHand.MAIN_HAND) { + return new ActionResult<>(EnumActionResult.PASS, stack); + } + if (!world.isRemote) { + player.openGui(RFToolsControl.instance, GuiProxy.GUI_CRAFTINGCARD, player.getEntityWorld(), (int) player.posX, (int) player.posY, (int) player.posZ); + return new ActionResult<>(EnumActionResult.SUCCESS, stack); + } + return new ActionResult<>(EnumActionResult.SUCCESS, stack); + } + + public static ItemStack getResult(ItemStack card) { + NBTTagCompound tagCompound = card.getTagCompound(); + if (tagCompound == null) { + return ItemStack.EMPTY; + } + NBTTagList bufferTagList = tagCompound.getTagList("Items", Constants.NBT.TAG_COMPOUND); + NBTTagCompound nbtTagCompound = bufferTagList.getCompoundTagAt(CraftingCardContainer.SLOT_OUT); + return new ItemStack(nbtTagCompound); + } + + private static boolean isInGrid(int index) { + int x = index % 5; + int y = index / 5; + return x <= 2 && y <= 2; + } + + // Return true if this crafting card fits a 3x3 crafting grid nicely + public static boolean fitsGrid(ItemStack card) { + NBTTagCompound tagCompound = card.getTagCompound(); + if (tagCompound == null) { + return false; + } + NBTTagList bufferTagList = tagCompound.getTagList("Items", Constants.NBT.TAG_COMPOUND); + for (int i = 0 ; i < bufferTagList.tagCount() ; i++) { + if (i < CraftingCardContainer.INPUT_SLOTS) { + NBTTagCompound nbtTagCompound = bufferTagList.getCompoundTagAt(i); + ItemStack s = new ItemStack(nbtTagCompound); + if (!s.isEmpty()) { + if (!isInGrid(i)) { + return false; + } + } + } + } + return true; + } + + public static boolean isStrictNBT(ItemStack card) { + NBTTagCompound tagCompound = card.getTagCompound(); + if (tagCompound == null) { + return false; + } + return tagCompound.getBoolean("strictnbt"); + } + + public static List getIngredientsGrid(ItemStack card) { + NBTTagCompound tagCompound = card.getTagCompound(); + if (tagCompound == null) { + return Collections.emptyList(); + } + NBTTagList bufferTagList = tagCompound.getTagList("Items", Constants.NBT.TAG_COMPOUND); + List stacks = new ArrayList<>(); + for (int i = 0 ; i < bufferTagList.tagCount() ; i++) { + if (i < CraftingCardContainer.INPUT_SLOTS) { + NBTTagCompound nbtTagCompound = bufferTagList.getCompoundTagAt(i); + ItemStack s = new ItemStack(nbtTagCompound); + if (isInGrid(i)) { + stacks.add(s); + } + } + } + return stacks; + } + + public static List getIngredients(ItemStack card) { + NBTTagCompound tagCompound = card.getTagCompound(); + if (tagCompound == null) { + return Collections.emptyList(); + } + NBTTagList bufferTagList = tagCompound.getTagList("Items", Constants.NBT.TAG_COMPOUND); + List stacks = new ArrayList<>(); + for (int i = 0 ; i < bufferTagList.tagCount() ; i++) { + if (i < CraftingCardContainer.INPUT_SLOTS) { + NBTTagCompound nbtTagCompound = bufferTagList.getCompoundTagAt(i); + ItemStack s = new ItemStack(nbtTagCompound); + if (!s.isEmpty()) { + stacks.add(s); + } + } + } + return stacks; + } +} diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/interactionmodule/InteractionModuleItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/interactionmodule/InteractionModuleItem.java new file mode 100644 index 00000000..eebfbcbc --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/interactionmodule/InteractionModuleItem.java @@ -0,0 +1,121 @@ +package mcjty.rftoolscontrol.items.interactionmodule; + +import mcjty.lib.varia.Logging; +import mcjty.rftools.api.screens.IModuleGuiBuilder; +import mcjty.rftools.api.screens.IModuleProvider; +import mcjty.rftoolscontrol.blocks.ModBlocks; +import mcjty.rftoolscontrol.config.ConfigSetup; +import mcjty.rftoolscontrol.items.GenericRFToolsItem; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.List; + +public class InteractionModuleItem extends GenericRFToolsItem implements IModuleProvider { + + public InteractionModuleItem() { + super("interaction_module"); + setMaxStackSize(1); + } + + @Override + public int getMaxItemUseDuration(ItemStack stack) { + return 1; + } + + @Override + public Class getServerScreenModule() { + return InteractionScreenModule.class; + } + + @Override + public Class getClientScreenModule() { + return InteractionClientScreenModule.class; + } + + @Override + public String getName() { + return "INT"; + } + + @Override + public void createGui(IModuleGuiBuilder guiBuilder) { + guiBuilder + .label("Label:").text("text", "Label text").color("color", "Label color").nl() + .label("Button:").text("button", "Button text").color("buttonColor", "Button color").nl() + .label("Signal:").text("signal", "Signal name").nl() + .choices("align", "Label alignment", "Left", "Center", "Right").nl(); + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack itemStack, World player, List list, ITooltipFlag whatIsThis) { + super.addInformation(itemStack, player, list, whatIsThis); + list.add(TextFormatting.GREEN + "Uses " + ConfigSetup.INTERACTMODULE_RFPERTICK.get() + " RF/tick"); + boolean hasTarget = false; + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound != null) { + list.add(TextFormatting.YELLOW + "Label: " + tagCompound.getString("text")); + if (tagCompound.hasKey("monitorx")) { + int monitorx = tagCompound.getInteger("monitorx"); + int monitory = tagCompound.getInteger("monitory"); + int monitorz = tagCompound.getInteger("monitorz"); + String monitorname = tagCompound.getString("monitorname"); + list.add(TextFormatting.YELLOW + "Monitoring: " + monitorname + " (at " + monitorx + "," + monitory + "," + monitorz + ")"); + hasTarget = true; + } + } + if (!hasTarget) { + String[] interactionModuleI18n = I18n.format("tooltips." + RFToolsControl.MODID + "." + "interaction_module").split("0x0a"); + for (String str : interactionModuleI18n){ + list.add(TextFormatting.YELLOW + str); + } + + } + } + + @Override + public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + ItemStack stack = player.getHeldItem(hand); + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); + NBTTagCompound tagCompound = stack.getTagCompound(); + if (tagCompound == null) { + tagCompound = new NBTTagCompound(); + } + + if (block == ModBlocks.processorBlock) { + tagCompound.setInteger("monitordim", world.provider.getDimension()); + tagCompound.setInteger("monitorx", pos.getX()); + tagCompound.setInteger("monitory", pos.getY()); + tagCompound.setInteger("monitorz", pos.getZ()); + if (world.isRemote) { + Logging.message(player, "Interaction module is set to block"); + } + } else { + tagCompound.removeTag("monitordim"); + tagCompound.removeTag("monitorx"); + tagCompound.removeTag("monitory"); + tagCompound.removeTag("monitorz"); + if (world.isRemote) { + Logging.message(player, "Interaction module is cleared"); + } + } + stack.setTagCompound(tagCompound); + return EnumActionResult.SUCCESS; + } + +} \ No newline at end of file diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/variablemodule/VariableModuleItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/variablemodule/VariableModuleItem.java new file mode 100644 index 00000000..8ea146f9 --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/variablemodule/VariableModuleItem.java @@ -0,0 +1,122 @@ +package mcjty.rftoolscontrol.items.variablemodule; + +import mcjty.lib.varia.Logging; +import mcjty.rftools.api.screens.IModuleGuiBuilder; +import mcjty.rftools.api.screens.IModuleProvider; +import mcjty.rftoolscontrol.blocks.ModBlocks; +import mcjty.rftoolscontrol.config.ConfigSetup; +import mcjty.rftoolscontrol.items.GenericRFToolsItem; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.Arrays; +import java.util.List; + +public class VariableModuleItem extends GenericRFToolsItem implements IModuleProvider { + + public VariableModuleItem() { + super("variable_module"); + setMaxStackSize(1); + } + + @Override + public int getMaxItemUseDuration(ItemStack stack) { + return 1; + } + + @Override + public Class getServerScreenModule() { + return VariableScreenModule.class; + } + + @Override + public Class getClientScreenModule() { + return VariableClientScreenModule.class; + } + + @Override + public String getName() { + return "VAR"; + } + + @Override + public void createGui(IModuleGuiBuilder guiBuilder) { + guiBuilder + .label("Label:").text("text", "Label text").color("color", "Color for the label").nl() + .label("Stats:").color("varcolor", "Color for the variable text").nl() + .label("Var:").integer("varIdx", "Index of the variable").nl() + .choices("align", "Label alignment", "Left", "Center", "Right").nl() + .block("monitor").nl(); + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack itemStack, World player, List list, ITooltipFlag whatIsThis) { + super.addInformation(itemStack, player, list, whatIsThis); + list.add(TextFormatting.GREEN + "Uses " + ConfigSetup.VARIABLEMODULE_RFPERTICK.get() + " RF/tick"); + boolean hasTarget = false; + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound != null) { + list.add(TextFormatting.YELLOW + "Label: " + tagCompound.getString("text")); + if (tagCompound.hasKey("monitorx")) { + int monitorx = tagCompound.getInteger("monitorx"); + int monitory = tagCompound.getInteger("monitory"); + int monitorz = tagCompound.getInteger("monitorz"); + String monitorname = tagCompound.getString("monitorname"); + list.add(TextFormatting.YELLOW + "Monitoring: " + monitorname + " (at " + monitorx + "," + monitory + "," + monitorz + ")"); + hasTarget = true; + } + } + if (!hasTarget) { + String[] variableModuleI18n =I18n.format("tooltips." + RFToolsControl.MODID + "." + "variable_module").split("0x0a"); + for (String str : variableModuleI18n){ + list.add(TextFormatting.YELLOW + str); + } + } + } + + @Override + public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + ItemStack stack = player.getHeldItem(hand); + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); + NBTTagCompound tagCompound = stack.getTagCompound(); + if (tagCompound == null) { + tagCompound = new NBTTagCompound(); + } + + if (block == ModBlocks.processorBlock) { + tagCompound.setInteger("monitordim", world.provider.getDimension()); + tagCompound.setInteger("monitorx", pos.getX()); + tagCompound.setInteger("monitory", pos.getY()); + tagCompound.setInteger("monitorz", pos.getZ()); + if (world.isRemote) { + Logging.message(player, "Variable module is set to block"); + } + } else { + tagCompound.removeTag("monitordim"); + tagCompound.removeTag("monitorx"); + tagCompound.removeTag("monitory"); + tagCompound.removeTag("monitorz"); + if (world.isRemote) { + Logging.message(player, "Variable module is cleared"); + } + } + stack.setTagCompound(tagCompound); + return EnumActionResult.SUCCESS; + } + +} \ No newline at end of file diff --git a/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/vectorartmodule/VectorArtModuleItem.java b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/vectorartmodule/VectorArtModuleItem.java new file mode 100644 index 00000000..d22ceab4 --- /dev/null +++ b/src/main/_gsdata_/_saved_/java/mcjty/rftoolscontrol/items/vectorartmodule/VectorArtModuleItem.java @@ -0,0 +1,117 @@ +package mcjty.rftoolscontrol.items.vectorartmodule; + +import mcjty.lib.varia.Logging; +import mcjty.rftools.api.screens.IModuleGuiBuilder; +import mcjty.rftools.api.screens.IModuleProvider; +import mcjty.rftoolscontrol.blocks.ModBlocks; +import mcjty.rftoolscontrol.config.ConfigSetup; +import mcjty.rftoolscontrol.items.GenericRFToolsItem; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.List; + +public class VectorArtModuleItem extends GenericRFToolsItem implements IModuleProvider { + + public VectorArtModuleItem() { + super("vectorart_module"); + setMaxStackSize(1); + } + + @Override + public int getMaxItemUseDuration(ItemStack stack) { + return 1; + } + + @Override + public Class getServerScreenModule() { + return VectorArtScreenModule.class; + } + + @Override + public Class getClientScreenModule() { + return VectorArtClientScreenModule.class; + } + + @Override + public String getName() { + return "VAR"; + } + + @Override + public void createGui(IModuleGuiBuilder guiBuilder) { + guiBuilder + .block("monitor").nl(); + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack itemStack, World player, List list, ITooltipFlag whatIsThis) { + super.addInformation(itemStack, player, list, whatIsThis); + list.add(TextFormatting.GREEN + "Uses " + ConfigSetup.VECTORARTMODULE_RFPERTICK.get() + " RF/tick"); + boolean hasTarget = false; + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound != null) { + list.add(TextFormatting.YELLOW + "Label: " + tagCompound.getString("text")); + if (tagCompound.hasKey("monitorx")) { + int monitorx = tagCompound.getInteger("monitorx"); + int monitory = tagCompound.getInteger("monitory"); + int monitorz = tagCompound.getInteger("monitorz"); + String monitorname = tagCompound.getString("monitorname"); + list.add(TextFormatting.YELLOW + "Monitoring: " + monitorname + " (at " + monitorx + "," + monitory + "," + monitorz + ")"); + hasTarget = true; + } + } + if (!hasTarget) { + String[] vectorartModuleI18n = I18n.format("tooltips." + RFToolsControl.MODID + "." + "vectorart_module").split("0x0a"); + for (String str : vectorartModuleI18n){ + list.add(TextFormatting.YELLOW + str); + } + } + } + + @Override + public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + ItemStack stack = player.getHeldItem(hand); + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); + NBTTagCompound tagCompound = stack.getTagCompound(); + if (tagCompound == null) { + tagCompound = new NBTTagCompound(); + } + + if (block == ModBlocks.processorBlock) { + tagCompound.setInteger("monitordim", world.provider.getDimension()); + tagCompound.setInteger("monitorx", pos.getX()); + tagCompound.setInteger("monitory", pos.getY()); + tagCompound.setInteger("monitorz", pos.getZ()); + if (world.isRemote) { + Logging.message(player, "Vector art module is set to block"); + } + } else { + tagCompound.removeTag("monitordim"); + tagCompound.removeTag("monitorx"); + tagCompound.removeTag("monitory"); + tagCompound.removeTag("monitorz"); + if (world.isRemote) { + Logging.message(player, "Vector art module is cleared"); + } + } + stack.setTagCompound(tagCompound); + return EnumActionResult.SUCCESS; + } + +} \ No newline at end of file diff --git a/src/main/java/mcjty/rftoolscontrol/blocks/craftingstation/CraftingStationBlock.java b/src/main/java/mcjty/rftoolscontrol/blocks/craftingstation/CraftingStationBlock.java index 34268470..4aede210 100644 --- a/src/main/java/mcjty/rftoolscontrol/blocks/craftingstation/CraftingStationBlock.java +++ b/src/main/java/mcjty/rftoolscontrol/blocks/craftingstation/CraftingStationBlock.java @@ -1,15 +1,18 @@ package mcjty.rftoolscontrol.blocks.craftingstation; import mcjty.lib.gui.GenericGuiContainer; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.blocks.GenericRFToolsBlock; import mcjty.rftoolscontrol.setup.GuiProxy; import net.minecraft.block.material.Material; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.Arrays; import java.util.List; import java.util.function.BiFunction; @@ -34,7 +37,6 @@ public int getGuiID() { @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("This block assists in auto crafting"); - list.add("operations for a Processor"); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "craftingstation").split("0x0a"))); } } diff --git a/src/main/java/mcjty/rftoolscontrol/blocks/multitank/MultiTankBlock.java b/src/main/java/mcjty/rftoolscontrol/blocks/multitank/MultiTankBlock.java index 160e6349..21cb293b 100644 --- a/src/main/java/mcjty/rftoolscontrol/blocks/multitank/MultiTankBlock.java +++ b/src/main/java/mcjty/rftoolscontrol/blocks/multitank/MultiTankBlock.java @@ -2,17 +2,20 @@ import mcjty.lib.container.EmptyContainer; import mcjty.lib.gui.GenericGuiContainer; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.blocks.GenericRFToolsBlock; import mcjty.rftoolscontrol.setup.GuiProxy; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockRenderLayer; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.Arrays; import java.util.List; import java.util.function.BiFunction; @@ -42,10 +45,7 @@ public int getGuiID() { @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("This is a tank that has capacity"); - list.add("for four types of liquids"); - list.add("This block is meant for the processor"); - list.add("and cannot otherwise be used directly"); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "tank").split("0x0a"))); } @Override diff --git a/src/main/java/mcjty/rftoolscontrol/blocks/node/NodeBlock.java b/src/main/java/mcjty/rftoolscontrol/blocks/node/NodeBlock.java index 8d31cc58..fc0f21be 100644 --- a/src/main/java/mcjty/rftoolscontrol/blocks/node/NodeBlock.java +++ b/src/main/java/mcjty/rftoolscontrol/blocks/node/NodeBlock.java @@ -2,6 +2,7 @@ import mcjty.lib.container.EmptyContainer; import mcjty.lib.gui.GenericGuiContainer; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.blocks.GenericRFToolsBlock; import mcjty.rftoolscontrol.setup.GuiProxy; import mcjty.theoneprobe.api.IProbeHitData; @@ -10,6 +11,7 @@ import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -22,6 +24,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.Arrays; import java.util.List; import java.util.function.BiFunction; @@ -51,9 +54,7 @@ public boolean needsRedstoneCheck() { @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("This node can be remotely accessed"); - list.add("by the processor that has a network"); - list.add("card installed"); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "node").split("0x0a"))); } @Override diff --git a/src/main/java/mcjty/rftoolscontrol/blocks/processor/ProcessorBlock.java b/src/main/java/mcjty/rftoolscontrol/blocks/processor/ProcessorBlock.java index b2eb3146..d27a2d75 100644 --- a/src/main/java/mcjty/rftoolscontrol/blocks/processor/ProcessorBlock.java +++ b/src/main/java/mcjty/rftoolscontrol/blocks/processor/ProcessorBlock.java @@ -1,6 +1,7 @@ package mcjty.rftoolscontrol.blocks.processor; import mcjty.lib.gui.GenericGuiContainer; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.blocks.GenericRFToolsBlock; import mcjty.rftoolscontrol.setup.GuiProxy; import mcjty.theoneprobe.api.IProbeHitData; @@ -9,6 +10,7 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -22,6 +24,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.Arrays; import java.util.List; import java.util.function.BiFunction; @@ -57,8 +60,7 @@ public int getGuiID() { @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("The processor executes programs"); - list.add("for automation"); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "processor").split("0x0a"))); } @Override diff --git a/src/main/java/mcjty/rftoolscontrol/blocks/programmer/ProgrammerBlock.java b/src/main/java/mcjty/rftoolscontrol/blocks/programmer/ProgrammerBlock.java index f303351c..ba034183 100644 --- a/src/main/java/mcjty/rftoolscontrol/blocks/programmer/ProgrammerBlock.java +++ b/src/main/java/mcjty/rftoolscontrol/blocks/programmer/ProgrammerBlock.java @@ -1,15 +1,18 @@ package mcjty.rftoolscontrol.blocks.programmer; import mcjty.lib.gui.GenericGuiContainer; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.blocks.GenericRFToolsBlock; import mcjty.rftoolscontrol.setup.GuiProxy; import net.minecraft.block.material.Material; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.Arrays; import java.util.List; import java.util.function.BiFunction; @@ -35,7 +38,6 @@ public int getGuiID() { @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("Use this block to make programs"); - list.add("on a program card for the processor"); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID+"."+"programmer").split("0x0a"))); } } diff --git a/src/main/java/mcjty/rftoolscontrol/blocks/workbench/WorkbenchBlock.java b/src/main/java/mcjty/rftoolscontrol/blocks/workbench/WorkbenchBlock.java index 8a70177e..94c4d580 100644 --- a/src/main/java/mcjty/rftoolscontrol/blocks/workbench/WorkbenchBlock.java +++ b/src/main/java/mcjty/rftoolscontrol/blocks/workbench/WorkbenchBlock.java @@ -1,15 +1,18 @@ package mcjty.rftoolscontrol.blocks.workbench; import mcjty.lib.gui.GenericGuiContainer; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.blocks.GenericRFToolsBlock; import mcjty.rftoolscontrol.setup.GuiProxy; import net.minecraft.block.material.Material; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.Arrays; import java.util.List; import java.util.function.BiFunction; @@ -34,8 +37,7 @@ public int getGuiID() { @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("A general workbench that works well"); - list.add("with a processor but can also be"); - list.add("used standalone"); + + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "workbench").split("0x0a"))); } } diff --git a/src/main/java/mcjty/rftoolscontrol/items/CPUCoreItem.java b/src/main/java/mcjty/rftoolscontrol/items/CPUCoreItem.java index 3bbdae6e..dace6939 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/CPUCoreItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/CPUCoreItem.java @@ -1,5 +1,6 @@ package mcjty.rftoolscontrol.items; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.config.ConfigSetup; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; @@ -7,6 +8,7 @@ import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; import java.util.List; @@ -28,8 +30,8 @@ public int getTier() { @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("This CPU core can be used in the"); - list.add("processor to allow it to run programs"); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "cpu_core_500").split("0x0a"))); + list.add(TextFormatting.GREEN + "" + ConfigSetup.coreSpeed[tier].get() + " operations per tick"); list.add(TextFormatting.GREEN + "" + ConfigSetup.coreRFPerTick[tier].get() + " RF per tick"); } diff --git a/src/main/java/mcjty/rftoolscontrol/items/CardBaseItem.java b/src/main/java/mcjty/rftoolscontrol/items/CardBaseItem.java index 3cddaadd..3de60d40 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/CardBaseItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/CardBaseItem.java @@ -1,10 +1,12 @@ package mcjty.rftoolscontrol.items; +import mcjty.rftoolscontrol.RFToolsControl; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; import javax.annotation.Nullable; import java.util.List; @@ -20,8 +22,7 @@ public CardBaseItem() { @Override public void addInformation(ItemStack stack, @Nullable World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("This item is the base ingredient"); - list.add("for many of the items and machines"); - list.add("in RFTools Control"); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "card_base").split("0x0a"))); + } } diff --git a/src/main/java/mcjty/rftoolscontrol/items/GraphicsCardItem.java b/src/main/java/mcjty/rftoolscontrol/items/GraphicsCardItem.java index 0f83b268..5ac4993a 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/GraphicsCardItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/GraphicsCardItem.java @@ -1,11 +1,14 @@ package mcjty.rftoolscontrol.items; +import mcjty.rftoolscontrol.RFToolsControl; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.Arrays; import java.util.List; public class GraphicsCardItem extends GenericRFToolsItem { @@ -19,7 +22,6 @@ public GraphicsCardItem() { @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("The graphics card is needed to be able"); - list.add("to draw vector graphics"); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "graphics_card").split("0x0a"))); } } diff --git a/src/main/java/mcjty/rftoolscontrol/items/NetworkCardItem.java b/src/main/java/mcjty/rftoolscontrol/items/NetworkCardItem.java index 23bea036..4ec02a53 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/NetworkCardItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/NetworkCardItem.java @@ -1,12 +1,15 @@ package mcjty.rftoolscontrol.items; +import mcjty.rftoolscontrol.RFToolsControl; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.Arrays; import java.util.List; public class NetworkCardItem extends GenericRFToolsItem { @@ -30,15 +33,16 @@ public int getTier() { @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("Insert this in the processor to"); - list.add("allow access to nearby nodes"); - list.add("Use 'net setup ' in Processor"); - list.add("console to setup the network"); + + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "network_card").split("0x0a"))); + + String[] networkCardRangeI18n = I18n.format("tooltips." + RFToolsControl.MODID + "." + "network_card.range").split("0x0a"); + if (tier == TIER_NORMAL) { - list.add(TextFormatting.GREEN + "Range: 17x17x17 area"); + list.add(TextFormatting.GREEN + networkCardRangeI18n[0]); } else { - list.add(TextFormatting.GREEN + "Range: 33x33x33 area"); - list.add(TextFormatting.GREEN + "Inter-process communication"); + list.add(TextFormatting.GREEN + networkCardRangeI18n[1]); + list.add(TextFormatting.GREEN + networkCardRangeI18n[2]); } } } diff --git a/src/main/java/mcjty/rftoolscontrol/items/NetworkIdentifierItem.java b/src/main/java/mcjty/rftoolscontrol/items/NetworkIdentifierItem.java index 8f1c604a..7579c3f9 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/NetworkIdentifierItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/NetworkIdentifierItem.java @@ -1,10 +1,12 @@ package mcjty.rftoolscontrol.items; import mcjty.lib.varia.Logging; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.blocks.ModBlocks; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -37,20 +39,22 @@ public void addInformation(ItemStack itemStack, World player, List list, super.addInformation(itemStack, player, list, whatIsThis); boolean hasTarget = false; NBTTagCompound tagCompound = itemStack.getTagCompound(); + + String[] networkIdentifierI18N = I18n.format("tooltips." + RFToolsControl.MODID + "." + "network_identifier").split("0x0a"); if (tagCompound != null) { if (tagCompound.hasKey("monitorx")) { int monitordim = tagCompound.getInteger("monitordim"); int monitorx = tagCompound.getInteger("monitorx"); int monitory = tagCompound.getInteger("monitory"); int monitorz = tagCompound.getInteger("monitorz"); - list.add(TextFormatting.YELLOW + "Linked to processor at " + monitorx + "," + monitory + "," + monitorz); - list.add(TextFormatting.YELLOW + "(dimension " + monitordim + ")"); + list.add(TextFormatting.YELLOW + networkIdentifierI18N[0] + monitorx + "," + monitory + "," + monitorz); + list.add(TextFormatting.YELLOW + "(" + networkIdentifierI18N[1] + monitordim + ")"); hasTarget = true; } } if (!hasTarget) { - list.add("Sneak right-click on a processor to set"); - list.add("the target for this identifier"); + list.add(networkIdentifierI18N[2]); + list.add(networkIdentifierI18N[3]); } } diff --git a/src/main/java/mcjty/rftoolscontrol/items/ProgramCardItem.java b/src/main/java/mcjty/rftoolscontrol/items/ProgramCardItem.java index 08491f64..221394ef 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/ProgramCardItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/ProgramCardItem.java @@ -1,6 +1,8 @@ package mcjty.rftoolscontrol.items; +import mcjty.rftoolscontrol.RFToolsControl; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.text.TextFormatting; @@ -8,6 +10,8 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.Arrays; import java.util.List; public class ProgramCardItem extends GenericRFToolsItem { @@ -21,9 +25,7 @@ public ProgramCardItem() { @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("Use this item in the programmer"); - list.add("to write your program and then"); - list.add("insert it in the processor to run"); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "."+"program_card").split("0x0a"))); NBTTagCompound tagCompound = stack.getTagCompound(); if (tagCompound != null) { list.add(TextFormatting.GREEN + "Name: " + tagCompound.getString("name")); diff --git a/src/main/java/mcjty/rftoolscontrol/items/RAMChipItem.java b/src/main/java/mcjty/rftoolscontrol/items/RAMChipItem.java index 95d4c3f7..7a0bc19a 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/RAMChipItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/RAMChipItem.java @@ -1,11 +1,14 @@ package mcjty.rftoolscontrol.items; +import mcjty.rftoolscontrol.RFToolsControl; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.Arrays; import java.util.List; public class RAMChipItem extends GenericRFToolsItem { @@ -19,8 +22,8 @@ public RAMChipItem() { @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("Insert this item in the processor"); - list.add("to get eight extra variables (max 32)"); + + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "ram_chip").split("0x0a"))); } } diff --git a/src/main/java/mcjty/rftoolscontrol/items/TokenItem.java b/src/main/java/mcjty/rftoolscontrol/items/TokenItem.java index 9f3bc4ba..47a692a0 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/TokenItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/TokenItem.java @@ -1,10 +1,12 @@ package mcjty.rftoolscontrol.items; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.api.parameters.Parameter; import mcjty.rftoolscontrol.setup.GuiProxy; import mcjty.rftoolscontrol.logic.ParameterTools; import mcjty.rftoolscontrol.logic.ParameterTypeTools; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.text.TextFormatting; @@ -38,13 +40,14 @@ public void addInformation(ItemStack stack, World playerIn, List list, I } } if (!hasContents) { - list.add(TextFormatting.BLUE + "This token is empty"); + list.add(TextFormatting.BLUE + I18n.format("tooltips." + RFToolsControl.MODID+"."+"token.hascontents")); } if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { - list.add(TextFormatting.WHITE + "This item is a simple token. It does"); - list.add(TextFormatting.WHITE + "not do anything but it can store"); - list.add(TextFormatting.WHITE + "information"); + String[] tokenI18n = I18n.format("tooltips." + RFToolsControl.MODID + "." + "token.keyboard").split("0x0a"); + for (String str : tokenI18n){ + list.add(TextFormatting.WHITE + str); + } } else { list.add(TextFormatting.WHITE + GuiProxy.SHIFT_MESSAGE); } diff --git a/src/main/java/mcjty/rftoolscontrol/items/consolemodule/ConsoleModuleItem.java b/src/main/java/mcjty/rftoolscontrol/items/consolemodule/ConsoleModuleItem.java index e8ed4062..e1ab04bd 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/consolemodule/ConsoleModuleItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/consolemodule/ConsoleModuleItem.java @@ -3,11 +3,13 @@ import mcjty.lib.varia.Logging; import mcjty.rftools.api.screens.IModuleGuiBuilder; import mcjty.rftools.api.screens.IModuleProvider; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.blocks.ModBlocks; import mcjty.rftoolscontrol.config.ConfigSetup; import mcjty.rftoolscontrol.items.GenericRFToolsItem; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -75,8 +77,10 @@ public void addInformation(ItemStack itemStack, World player, List list, } } if (!hasTarget) { - list.add(TextFormatting.YELLOW + "Sneak right-click on a processor to set the"); - list.add(TextFormatting.YELLOW + "target for this module"); + String[] consoleModuleI18n = I18n.format("tooltips." + RFToolsControl.MODID + "." + "console_module").split("0x0a"); + for(String str : consoleModuleI18n){ + list.add(TextFormatting.YELLOW + str); + } } } diff --git a/src/main/java/mcjty/rftoolscontrol/items/craftingcard/CraftingCardItem.java b/src/main/java/mcjty/rftoolscontrol/items/craftingcard/CraftingCardItem.java index da239f5e..daab5e7d 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/craftingcard/CraftingCardItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/craftingcard/CraftingCardItem.java @@ -5,6 +5,7 @@ import mcjty.rftoolscontrol.setup.GuiProxy; import mcjty.rftoolscontrol.items.GenericRFToolsItem; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.InventoryCrafting; @@ -22,7 +23,9 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -97,9 +100,8 @@ public static void putStacksInItem(ItemStack craftingCard, ItemStackList stacks) @Override public void addInformation(ItemStack stack, World playerIn, List list, ITooltipFlag advanced) { super.addInformation(stack, playerIn, list, advanced); - list.add("This item can be used for auto"); - list.add("crafting. It stores ingredients"); - list.add("and end result for a recipe"); + list.addAll(Arrays.asList(I18n.format("tooltips." + RFToolsControl.MODID + "." + "crafting_card").split("0x0a"))); + boolean strictnbt = CraftingCardItem.isStrictNBT(stack); list.add(TextFormatting.GREEN + "Strict NBT: " + TextFormatting.WHITE + (strictnbt ? "yes" : "no")); ItemStack result = getResult(stack); diff --git a/src/main/java/mcjty/rftoolscontrol/items/interactionmodule/InteractionModuleItem.java b/src/main/java/mcjty/rftoolscontrol/items/interactionmodule/InteractionModuleItem.java index 54bbf919..1361518b 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/interactionmodule/InteractionModuleItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/interactionmodule/InteractionModuleItem.java @@ -3,12 +3,14 @@ import mcjty.lib.varia.Logging; import mcjty.rftools.api.screens.IModuleGuiBuilder; import mcjty.rftools.api.screens.IModuleProvider; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.blocks.ModBlocks; import mcjty.rftoolscontrol.config.ConfigSetup; import mcjty.rftoolscontrol.items.GenericRFToolsItem; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -78,8 +80,11 @@ public void addInformation(ItemStack itemStack, World player, List list, } } if (!hasTarget) { - list.add(TextFormatting.YELLOW + "Sneak right-click on a processor to set the"); - list.add(TextFormatting.YELLOW + "target for this module"); + String[] interactionModuleI18n = I18n.format("tooltips." + RFToolsControl.MODID + "." + "interaction_module").split("0x0a"); + for (String str : interactionModuleI18n){ + list.add(TextFormatting.YELLOW + str); + } + } } diff --git a/src/main/java/mcjty/rftoolscontrol/items/variablemodule/VariableModuleItem.java b/src/main/java/mcjty/rftoolscontrol/items/variablemodule/VariableModuleItem.java index eeeeef33..848e15b7 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/variablemodule/VariableModuleItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/variablemodule/VariableModuleItem.java @@ -3,12 +3,14 @@ import mcjty.lib.varia.Logging; import mcjty.rftools.api.screens.IModuleGuiBuilder; import mcjty.rftools.api.screens.IModuleProvider; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.blocks.ModBlocks; import mcjty.rftoolscontrol.config.ConfigSetup; import mcjty.rftoolscontrol.items.GenericRFToolsItem; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -21,6 +23,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.Arrays; import java.util.List; public class VariableModuleItem extends GenericRFToolsItem implements IModuleProvider { @@ -79,8 +82,10 @@ public void addInformation(ItemStack itemStack, World player, List list, } } if (!hasTarget) { - list.add(TextFormatting.YELLOW + "Sneak right-click on a processor to set the"); - list.add(TextFormatting.YELLOW + "target for this module"); + String[] variableModuleI18n =I18n.format("tooltips." + RFToolsControl.MODID + "." + "variable_module").split("0x0a"); + for (String str : variableModuleI18n){ + list.add(TextFormatting.YELLOW + str); + } } } diff --git a/src/main/java/mcjty/rftoolscontrol/items/vectorartmodule/VectorArtModuleItem.java b/src/main/java/mcjty/rftoolscontrol/items/vectorartmodule/VectorArtModuleItem.java index 8e6aee00..cdd392b9 100644 --- a/src/main/java/mcjty/rftoolscontrol/items/vectorartmodule/VectorArtModuleItem.java +++ b/src/main/java/mcjty/rftoolscontrol/items/vectorartmodule/VectorArtModuleItem.java @@ -3,12 +3,14 @@ import mcjty.lib.varia.Logging; import mcjty.rftools.api.screens.IModuleGuiBuilder; import mcjty.rftools.api.screens.IModuleProvider; +import mcjty.rftoolscontrol.RFToolsControl; import mcjty.rftoolscontrol.blocks.ModBlocks; import mcjty.rftoolscontrol.config.ConfigSetup; import mcjty.rftoolscontrol.items.GenericRFToolsItem; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -75,8 +77,10 @@ public void addInformation(ItemStack itemStack, World player, List list, } } if (!hasTarget) { - list.add(TextFormatting.YELLOW + "Sneak right-click on a processor to set the"); - list.add(TextFormatting.YELLOW + "target for this module"); + String[] vectorartModuleI18n = I18n.format("tooltips." + RFToolsControl.MODID + "." + "vectorart_module").split("0x0a"); + for (String str : vectorartModuleI18n){ + list.add(TextFormatting.YELLOW + str); + } } } diff --git a/src/main/main.iml b/src/main/main.iml new file mode 100644 index 00000000..908ad4f5 --- /dev/null +++ b/src/main/main.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/assets/rftoolscontrol/lang/en_us.lang b/src/main/resources/assets/rftoolscontrol/lang/en_us.lang index 733d8bf2..9cad998c 100644 --- a/src/main/resources/assets/rftoolscontrol/lang/en_us.lang +++ b/src/main/resources/assets/rftoolscontrol/lang/en_us.lang @@ -28,4 +28,35 @@ tile.rftoolscontrol.workbench.name=Workbench tile.rftoolscontrol.tank.name=Multi Tank # Creative Tabs -itemGroup.RFToolsControl=RFTools Control \ No newline at end of file +itemGroup.RFToolsControl=RFTools Control + + +# Tooltips +# 0x0a Indicates line break +tooltips.rftoolscontrol.programmer="Use this block to make programs 0x0aon a program card for the processor" +tooltips.rftoolscontrol.program_card="Use this item in the programmer 0x0ato write your program and then 0x0ainsert it in the processor to run +tooltips.rftoolscontrol.card_base=This item is the base ingredient 0x0afor many of the items and machines 0x0ain RFTools Control +tooltips.rftoolscontrol.cpu_core_500=This CPU core can be used in the 0x0a processor to allow it to run programs +tooltips.rftoolscontrol.crafting_card=This item can be used for auto 0x0acrafting. It stores ingredients 0x0aand end result for a recipe +tooltips.rftoolscontrol.console_module=Sneak right-click on a processor to set the 0x0atarget for this module +tooltips.rftoolscontrol.processor=The processor executes programs 0x0afor automation +tooltips.rftoolscontrol.token.hascontents=This token is empty +tooltips.rftoolscontrol.token.keyboard=This item is a simple token. It does 0x0anot do anything but it can store 0x0ainformation +tooltips.rftoolscontrol.craftingstation=This block assists in auto crafting 0x0aoperations for a Processor +tooltips.rftoolscontrol.tank=This is a tank that has capacity 0x0afor four types of liquids 0x0aThis block is meant for the processor 0x0aand cannot otherwise be used directly +tooltips.rftoolscontrol.network_card=Insert this in the processor to 0x0aallow access to nearby nodes 0x0aUse 'net setup ' in Processor 0x0aconsole to setup the network + +# Must be separated into three segments by two 0x0a, otherwise NullPointerException will occur +tooltips.rftoolscontrol.network_card.range=Range: 17x17x17 area 0x0aRange: 33x33x33 area 0x0aInter-process communication + +tooltips.rftoolscontrol.node=This node can be remotely accessed 0x0aby the processor that has a network 0x0acard installed +tooltips.rftoolscontrol.workbench=A general workbench that works well 0x0awith a processor but can also be 0x0aused standalone +tooltips.rftoolscontrol.graphics_card=The graphics card is needed to be able 0x0ato draw vector graphics + +# Must be separated into four paragraphs with three 0x0a, otherwise a NullPointerException will occur +tooltips.rftoolscontrol.network_identifier=Linked to processor at 0x0adimension 0x0aSneak right-click on a processor to set 0x0athe target for this identifier + +tooltips.rftoolscontrol.ram_chip=Insert this item in the processor 0x0ato get eight extra variables (max 32) +tooltips.rftoolscontrol.interaction_module=Sneak right-click on a processor to set the 0x0atarget for this module +tooltips.rftoolscontrol.variable_module=Sneak right-click on a processor to set the 0x0atarget for this module +tooltips.rftoolscontrol.vectorart_module=Sneak right-click on a processor to set the 0x0atarget for this module \ No newline at end of file From 8a0c2eb216d2f30a6c29324a4a5a9ba872dfd14a Mon Sep 17 00:00:00 2001 From: GN <35490649+Gan-N@users.noreply.github.com> Date: Wed, 14 Oct 2020 21:38:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20en=5Fus.lang?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove extra punctuation --- src/main/resources/assets/rftoolscontrol/lang/en_us.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/rftoolscontrol/lang/en_us.lang b/src/main/resources/assets/rftoolscontrol/lang/en_us.lang index 9cad998c..f4c9d924 100644 --- a/src/main/resources/assets/rftoolscontrol/lang/en_us.lang +++ b/src/main/resources/assets/rftoolscontrol/lang/en_us.lang @@ -33,8 +33,8 @@ itemGroup.RFToolsControl=RFTools Control # Tooltips # 0x0a Indicates line break -tooltips.rftoolscontrol.programmer="Use this block to make programs 0x0aon a program card for the processor" -tooltips.rftoolscontrol.program_card="Use this item in the programmer 0x0ato write your program and then 0x0ainsert it in the processor to run +tooltips.rftoolscontrol.programmer=Use this block to make programs 0x0aon a program card for the processor +tooltips.rftoolscontrol.program_card=Use this item in the programmer 0x0ato write your program and then 0x0ainsert it in the processor to run tooltips.rftoolscontrol.card_base=This item is the base ingredient 0x0afor many of the items and machines 0x0ain RFTools Control tooltips.rftoolscontrol.cpu_core_500=This CPU core can be used in the 0x0a processor to allow it to run programs tooltips.rftoolscontrol.crafting_card=This item can be used for auto 0x0acrafting. It stores ingredients 0x0aand end result for a recipe