diff --git a/src/main/java/gregtech/api/capability/IDataStickIntractable.java b/src/main/java/gregtech/api/capability/IDataStickIntractable.java index 4b9d36ee6ff..dfd25f2c896 100644 --- a/src/main/java/gregtech/api/capability/IDataStickIntractable.java +++ b/src/main/java/gregtech/api/capability/IDataStickIntractable.java @@ -5,7 +5,7 @@ public interface IDataStickIntractable { - void onDataStickLeftClick(EntityPlayer player, ItemStack dataStick); + boolean onDataStickShiftRightClick(EntityPlayer player, ItemStack dataStick); boolean onDataStickRightClick(EntityPlayer player, ItemStack dataStick); } diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index d2a3f5b4597..435281e015a 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -493,10 +493,13 @@ public final void onCoverLeftClick(EntityPlayer playerIn, CuboidRayTraceResult r public boolean onRightClick(EntityPlayer playerIn, EnumHand hand, EnumFacing facing, CuboidRayTraceResult hitResult) { ItemStack heldStack = playerIn.getHeldItem(hand); - if (this instanceof IDataStickIntractable dsi) { - if (MetaItems.TOOL_DATA_STICK.isItemEqual(heldStack) && dsi.onDataStickRightClick(playerIn, heldStack)) { - return true; - } + + if (this instanceof IDataStickIntractable dataStickIntractable && + MetaItems.TOOL_DATA_STICK.isItemEqual(heldStack)) { + + return playerIn.isSneaking() ? + dataStickIntractable.onDataStickShiftRightClick(playerIn, heldStack) : + dataStickIntractable.onDataStickRightClick(playerIn, heldStack); } if (!playerIn.isSneaking() && openGUIOnRightClick()) { @@ -654,14 +657,7 @@ public boolean onHardHammerClick(EntityPlayer playerIn, EnumHand hand, EnumFacin return true; } - public void onLeftClick(EntityPlayer player, EnumFacing facing, CuboidRayTraceResult hitResult) { - if (this instanceof IDataStickIntractable dsi) { - ItemStack stack = player.getHeldItemMainhand(); - if (MetaItems.TOOL_DATA_STICK.isItemEqual(stack)) { - dsi.onDataStickLeftClick(player, stack); - } - } - } + public void onLeftClick(EntityPlayer player, EnumFacing facing, CuboidRayTraceResult hitResult) {} /** * @return true if the player must sneak to rotate this metatileentity, otherwise false diff --git a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEInputBus.java b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEInputBus.java index 3d4fea9abc0..4c65d935e7f 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEInputBus.java +++ b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEInputBus.java @@ -319,7 +319,7 @@ public void addInformation(ItemStack stack, @Nullable World player, @NotNull Lis tooltip.add(I18n.format("gregtech.machine.item_bus.import.tooltip")); tooltip.add(I18n.format("gregtech.machine.me.item_import.tooltip")); tooltip.add(I18n.format("gregtech.machine.me_import_item_hatch.configs.tooltip")); - tooltip.add(I18n.format("gregtech.machine.me.copy_paste.tooltip")); + tooltip.add(I18n.format("gregtech.machine.copy_paste.tooltip")); tooltip.add(I18n.format("gregtech.universal.enabled")); } @@ -350,12 +350,14 @@ public void setGhostCircuitConfig(int config) { } @Override - public final void onDataStickLeftClick(EntityPlayer player, ItemStack dataStick) { + public final boolean onDataStickShiftRightClick(EntityPlayer player, ItemStack dataStick) { NBTTagCompound tag = new NBTTagCompound(); tag.setTag("MEInputBus", writeConfigToTag()); dataStick.setTagCompound(tag); - dataStick.setTranslatableName("gregtech.machine.me.item_import.data_stick.name"); - player.sendStatusMessage(new TextComponentTranslation("gregtech.machine.me.import_copy_settings"), true); + dataStick.setStackDisplayName( + I18n.format("gregtech.machine.import.data_stick.name", I18n.format(getMetaFullName()))); + player.sendStatusMessage(new TextComponentTranslation("gregtech.machine.import_copy_settings"), true); + return true; } protected NBTTagCompound writeConfigToTag() { @@ -384,7 +386,7 @@ public final boolean onDataStickRightClick(EntityPlayer player, ItemStack dataSt } readConfigFromTag(tag.getCompoundTag("MEInputBus")); syncME(); - player.sendStatusMessage(new TextComponentTranslation("gregtech.machine.me.import_paste_settings"), true); + player.sendStatusMessage(new TextComponentTranslation("gregtech.machine.import_paste_settings"), true); return true; } diff --git a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEInputHatch.java b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEInputHatch.java index 4e510077787..ebbeb73c5ae 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEInputHatch.java +++ b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEInputHatch.java @@ -259,7 +259,7 @@ public void addInformation(ItemStack stack, @Nullable World player, @NotNull Lis tooltip.add(I18n.format("gregtech.machine.fluid_hatch.import.tooltip")); tooltip.add(I18n.format("gregtech.machine.me.fluid_import.tooltip")); tooltip.add(I18n.format("gregtech.machine.me_import_fluid_hatch.configs.tooltip")); - tooltip.add(I18n.format("gregtech.machine.me.copy_paste.tooltip")); + tooltip.add(I18n.format("gregtech.machine.copy_paste.tooltip")); tooltip.add(I18n.format("gregtech.universal.enabled")); } @@ -274,12 +274,14 @@ public void registerAbilities(List list) { } @Override - public final void onDataStickLeftClick(EntityPlayer player, ItemStack dataStick) { + public final boolean onDataStickShiftRightClick(EntityPlayer player, ItemStack dataStick) { NBTTagCompound tag = new NBTTagCompound(); tag.setTag("MEInputHatch", writeConfigToTag()); dataStick.setTagCompound(tag); - dataStick.setTranslatableName("gregtech.machine.me.fluid_import.data_stick.name"); - player.sendStatusMessage(new TextComponentTranslation("gregtech.machine.me.import_copy_settings"), true); + dataStick.setStackDisplayName( + I18n.format("gregtech.machine.import.data_stick.name", I18n.format(getMetaFullName()))); + player.sendStatusMessage(new TextComponentTranslation("gregtech.machine.import_copy_settings"), true); + return true; } protected NBTTagCompound writeConfigToTag() { @@ -307,7 +309,7 @@ public final boolean onDataStickRightClick(EntityPlayer player, ItemStack dataSt } readConfigFromTag(tag.getCompoundTag("MEInputHatch")); syncME(); - player.sendStatusMessage(new TextComponentTranslation("gregtech.machine.me.import_paste_settings"), true); + player.sendStatusMessage(new TextComponentTranslation("gregtech.machine.import_paste_settings"), true); return true; } diff --git a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEStockingBus.java b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEStockingBus.java index f8bd7a5850a..fdc0d15eb25 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEStockingBus.java +++ b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEStockingBus.java @@ -358,7 +358,7 @@ public void addInformation(ItemStack stack, @Nullable World player, @NotNull Lis tooltip.add(I18n.format("gregtech.machine.item_bus.import.tooltip")); tooltip.add(I18n.format("gregtech.machine.me.stocking_item.tooltip")); tooltip.add(I18n.format("gregtech.machine.me_import_item_hatch.configs.tooltip")); - tooltip.add(I18n.format("gregtech.machine.me.copy_paste.tooltip")); + tooltip.add(I18n.format("gregtech.machine.copy_paste.tooltip")); tooltip.add(I18n.format("gregtech.machine.me.stocking_item.tooltip.2")); tooltip.add(I18n.format("gregtech.universal.enabled")); } diff --git a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEStockingHatch.java b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEStockingHatch.java index fcc9e1e7d12..bdafdd1690f 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEStockingHatch.java +++ b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/MetaTileEntityMEStockingHatch.java @@ -263,7 +263,7 @@ public void addInformation(ItemStack stack, @Nullable World player, @NotNull Lis tooltip.add(I18n.format("gregtech.machine.fluid_hatch.import.tooltip")); tooltip.add(I18n.format("gregtech.machine.me.stocking_fluid.tooltip")); tooltip.add(I18n.format("gregtech.machine.me_import_fluid_hatch.configs.tooltip")); - tooltip.add(I18n.format("gregtech.machine.me.copy_paste.tooltip")); + tooltip.add(I18n.format("gregtech.machine.copy_paste.tooltip")); tooltip.add(I18n.format("gregtech.machine.me.stocking_fluid.tooltip.2")); tooltip.add(I18n.format("gregtech.universal.enabled")); } diff --git a/src/main/resources/assets/gregtech/lang/en_us.lang b/src/main/resources/assets/gregtech/lang/en_us.lang index ad4571025da..89f3cedfda1 100644 --- a/src/main/resources/assets/gregtech/lang/en_us.lang +++ b/src/main/resources/assets/gregtech/lang/en_us.lang @@ -4512,6 +4512,11 @@ gregtech.machine.muffle.off=Sound Muffling: Disabled gregtech.machine.perfect_oc=Does not lose energy efficiency when overclocked. gregtech.machine.parallel_limit=Can run up to §b%d§r§7 Recipes at once. +gregtech.machine.copy_paste.tooltip=Shift right-click with Data Stick to copy settings, right-click to apply +gregtech.machine.import_copy_settings=Saved settings to Data Stick +gregtech.machine.import_paste_settings=Applied settings from Data Stick +gregtech.machine.import.data_stick.name=§oMachine Configuration Data (%s) + gregtech.machine.ld_item_endpoint.name=Long Distance Item Pipeline Endpoint gregtech.machine.ld_fluid_endpoint.name=Long Distance Fluid Pipeline Endpoint gregtech.machine.endpoint.tooltip.min_length=§bMinimum Endpoint Distance: §f%d Blocks @@ -5325,11 +5330,6 @@ gregtech.machine.me.fluid_export.tooltip=Stores fluids directly into the ME netw gregtech.machine.me.fluid_export.tooltip.2=Can cache an infinite amount of fluid gregtech.machine.me.stocking_auto_pull_enabled=Auto-Pull Enabled gregtech.machine.me.stocking_auto_pull_disabled=Auto-Pull Disabled -gregtech.machine.me.copy_paste.tooltip=Left-click with Data Stick to copy settings, right-click to apply -gregtech.machine.me.import_copy_settings=Saved settings to Data Stick -gregtech.machine.me.import_paste_settings=Applied settings from Data Stick -gregtech.machine.me.item_import.data_stick.name=§oME Input Bus Configuration Data -gregtech.machine.me.fluid_import.data_stick.name=§oME Input Hatch Configuration Data # Universal tooltips gregtech.universal.tooltip.voltage_in=§aVoltage IN: §f%,d EU/t (%s§f) diff --git a/src/main/resources/assets/gregtech/lang/ru_ru.lang b/src/main/resources/assets/gregtech/lang/ru_ru.lang index f8bfe1a7604..e9614e0fadc 100644 --- a/src/main/resources/assets/gregtech/lang/ru_ru.lang +++ b/src/main/resources/assets/gregtech/lang/ru_ru.lang @@ -4127,6 +4127,11 @@ gregtech.machine.endpoint.tooltip.1=Соединяется с блоком §fТ gregtech.machine.endpoint.tooltip.2=Трубопровод обязан иметь §f1 Входную§7 и §f1 Выходную§7 конечную точку. gregtech.machine.endpoint.tooltip.3=Только Конечная точка трубопровода может находится в §fЗагруженном чанке§7. +gregtech.machine.copy_paste.tooltip=ЛКС с Флешкой для копирования, ПКМ для применения +gregtech.machine.import_copy_settings=Настройки сохранены в Флешку +gregtech.machine.import_paste_settings=Настройки из Флешки применены +#gregtech.machine.import.data_stick.name + # Advancements gregtech.advancement.root_steam.name=Эра пара gregtech.advancement.root_steam.desc=Добро пожаловать в GregTech! Все начинается с вашего первого медного слитка. @@ -5934,9 +5939,6 @@ gregtech.machine.me.stocking_item.tooltip=Извлекает предметы н gregtech.machine.me_import_item_hatch.configs.tooltip=Держит 16 предметов в наличии tile.gt_explosive.breaking_tooltip=При обычной добыче взрывается, добудьте с SHIFT, чтобы забрать обратно gregtech.machine.me.stocking_fluid.tooltip=Извлекает жидкости непосредственно из сети ME -gregtech.machine.me.copy_paste.tooltip=ЛКС с Флешкой для копирования, ПКМ для применения -gregtech.machine.me.import_copy_settings=Настройки сохранены в Флешку -gregtech.machine.me.import_paste_settings=Настройки из Флешки применены gregtech.machine.me.fluid_import.data_stick.name=§oНастройки ME Накопительного жидкостного люка gregtech.recipe.dimensions_blocked=Заблокированные измерения: %s gregtech.gui.item_auto_input.tooltip.enabled=Авто. ввод предметов включен diff --git a/src/main/resources/assets/gregtech/lang/zh_cn.lang b/src/main/resources/assets/gregtech/lang/zh_cn.lang index fb68f3d3bf2..591a998e8d2 100644 --- a/src/main/resources/assets/gregtech/lang/zh_cn.lang +++ b/src/main/resources/assets/gregtech/lang/zh_cn.lang @@ -4499,6 +4499,12 @@ gregtech.machine.muffle.off=静音:已禁用 gregtech.machine.perfect_oc=超频不会损失能效。 gregtech.machine.parallel_limit=可同时处理至多§b%d§7个配方。 +gregtech.machine.copy_paste.tooltip=左键点击闪存以复制设置,右键点击以应用 +gregtech.machine.import_copy_settings=已将设置保存到闪存 +gregtech.machine.import_paste_settings=已从闪存应用设置 +#gregtech.machine.import.data_stick.name + + gregtech.machine.ld_item_endpoint.name=长距离物品管道接口 gregtech.machine.ld_fluid_endpoint.name=长距离流体管道接口 gregtech.machine.endpoint.tooltip.min_length=§b最低接口间距:§f%d格方块 @@ -5312,9 +5318,6 @@ gregtech.machine.me.fluid_export.tooltip=将流体直接存储到ME网络中 gregtech.machine.me.fluid_export.tooltip.2=可以缓存无限数量的流体 gregtech.machine.me.stocking_auto_pull_enabled=ME自动拉取已启用 gregtech.machine.me.stocking_auto_pull_disabled=ME自动拉取已禁用 -gregtech.machine.me.copy_paste.tooltip=左键点击闪存以复制设置,右键点击以应用 -gregtech.machine.me.import_copy_settings=已将设置保存到闪存 -gregtech.machine.me.import_paste_settings=已从闪存应用设置 gregtech.machine.me.item_import.data_stick.name=§oME输入总线配置数据 gregtech.machine.me.fluid_import.data_stick.name=§oME输入仓配置数据