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 611cb125922..c2f54e16422 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -511,10 +511,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()) { @@ -689,14 +692,7 @@ public boolean onWireCutterClick(EntityPlayer playerIn, EnumHand hand, EnumFacin return false; } - 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 b1e53f22f4a..9c089332d5c 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.machine.me.extra_connections.tooltip")); tooltip.add(I18n.format("gregtech.universal.enabled")); } @@ -351,12 +351,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() { @@ -385,7 +387,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 2bcdc10f542..c84fb2f58bd 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.machine.me.extra_connections.tooltip")); tooltip.add(I18n.format("gregtech.universal.enabled")); } @@ -275,12 +275,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() { @@ -308,7 +310,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 70fb8de03c3..5bc9848c8ad 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 @@ -371,7 +371,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.machine.me.extra_connections.tooltip")); 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 f751a05a7a3..5f92ca70bce 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 @@ -276,7 +276,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.machine.me.extra_connections.tooltip")); 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 eef80763ada..cbb86f128e6 100644 --- a/src/main/resources/assets/gregtech/lang/en_us.lang +++ b/src/main/resources/assets/gregtech/lang/en_us.lang @@ -4567,6 +4567,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 @@ -5383,15 +5388,11 @@ 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 gregtech.machine.me.extra_connections.enabled=Allow connections from all sides gregtech.machine.me.extra_connections.disabled=Allow connection only on front face gregtech.machine.me.extra_connections.tooltip=Right-click with wire cutters to allow connecting to AE2 on all sides + # Universal tooltips gregtech.universal.tooltip.voltage_in=§aVoltage IN: §f%,d EU/t (%s§f) gregtech.universal.tooltip.max_voltage_in=§aMax Voltage IN: §f%,d (%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 a4e1c852d1f..1645d98a9af 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,7 +5939,7 @@ 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.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 Накопительного жидкостного люка diff --git a/src/main/resources/assets/gregtech/lang/zh_cn.lang b/src/main/resources/assets/gregtech/lang/zh_cn.lang index 55dd3e25595..3236fb9fd19 100644 --- a/src/main/resources/assets/gregtech/lang/zh_cn.lang +++ b/src/main/resources/assets/gregtech/lang/zh_cn.lang @@ -4512,6 +4512,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格方块 @@ -5325,9 +5331,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输入仓配置数据