Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
20 changes: 8 additions & 12 deletions src/main/java/gregtech/api/metatileentity/MetaTileEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand All @@ -275,12 +275,14 @@ public void registerAbilities(List<IFluidTank> 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() {
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
11 changes: 6 additions & 5 deletions src/main/resources/assets/gregtech/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/assets/gregtech/lang/ru_ru.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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! Все начинается с вашего первого медного слитка.
Expand Down Expand Up @@ -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 Накопительного жидкостного люка
Expand Down
9 changes: 6 additions & 3 deletions src/main/resources/assets/gregtech/lang/zh_cn.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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格方块
Expand Down Expand Up @@ -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输入仓配置数据

Expand Down
Loading