Skip to content

Commit

Permalink
Refactoring after lib update
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Emelyanov committed Mar 31, 2024
1 parent 3b84a71 commit 15f941d
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 234 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void createGui(IEditorGui gui) {
colorsGui(gui);
redstoneGui(gui);
gui.nl();
((ConnectorEditorPanel) gui).translatableChoices(TAG_MODE, energyMode, InsExtMode.values());// TODO: 09.03.2024 remove ConnectorEditorPanel cast after rftoolbase update
gui.translatableChoices(TAG_MODE, energyMode, InsExtMode.values());
gui.nl()
.label(PRIORITY_LABEL.i18n()).integer(TAG_PRIORITY, PRIORITY_TOOLTIP.i18n(), priority, 30).nl()

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mcjty/xnet/apiimpl/enums/InsExtMode.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mcjty.xnet.apiimpl.enums;

import mcjty.lib.varia.ComponentFactory;
import mcjty.lib.gui.ITranslatableEnum;
import mcjty.xnet.utils.I18nUtils;
import mcjty.xnet.utils.ITranslatableEnum;

public enum InsExtMode implements ITranslatableEnum<InsExtMode> {
INS("xnet.enum.insextmode.ins"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mcjty.xnet.apiimpl.items.enums;

import mcjty.lib.varia.ComponentFactory;
import mcjty.lib.gui.ITranslatableEnum;
import mcjty.xnet.utils.I18nUtils;
import mcjty.xnet.utils.ITranslatableEnum;

public enum ExtractMode implements ITranslatableEnum<ExtractMode> {
FIRST("xnet.enum.items.extractmode.first"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mcjty.xnet.apiimpl.items.enums;

import mcjty.lib.varia.ComponentFactory;
import mcjty.lib.gui.ITranslatableEnum;
import mcjty.xnet.utils.I18nUtils;
import mcjty.xnet.utils.ITranslatableEnum;

public enum StackMode implements ITranslatableEnum<StackMode> {
SINGLE("xnet.enum.items.stackmode.single"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,13 @@ public void createGui(IEditorGui gui) {
sideGui(gui);
colorsGui(gui);
redstoneGui(gui);
gui.nl();
((ConnectorEditorPanel)gui).translatableChoices(TAG_MODE, logicMode, LogicMode.values());// TODO: 09.03.2024 remove ConnectorEditorPanel cast after rftoolbase update
gui.nl();
gui.nl().translatableChoices(TAG_MODE, logicMode, LogicMode.values()).nl();
if (logicMode == LogicMode.SENSOR) {
for (RSSensor sensor : sensors) {
sensor.createGui(gui);
}
} else {
output.createGui((ConnectorEditorPanel) gui); // TODO: 06.03.2024 remove ConnectorEditorPanel cast after rftoolbase update
output.createGui(gui);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mcjty/xnet/apiimpl/logic/RSOutput.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mcjty.xnet.apiimpl.logic;

import mcjty.rftoolsbase.api.xnet.channels.Color;
import mcjty.rftoolsbase.api.xnet.gui.IEditorGui;
import mcjty.xnet.apiimpl.logic.enums.LogicFilter;
import mcjty.xnet.modules.controller.client.ConnectorEditorPanel;
import mcjty.xnet.utils.CastTools;
import net.minecraft.nbt.CompoundTag;

Expand Down Expand Up @@ -135,7 +135,7 @@ public void setRedstoneOut(int redstoneOut) {
this.redstoneOut = redstoneOut;
}

public void createGui(ConnectorEditorPanel gui) {// TODO: 09.03.2024 remove ConnectorEditorPanel cast after rftoolbase update
public void createGui(IEditorGui gui) {
if (gui.isAdvanced()) {
gui.translatableChoices(TAG_RS_FILTER, logicFilter, LogicFilter.values());
switch (logicFilter) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mcjty/xnet/apiimpl/logic/RSSensor.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public boolean isEnabled(String tag) {
}

public void createGui(IEditorGui gui) {
((AbstractEditorPanel)gui).translatableChoices(TAG_MODE + index, sensorMode, SensorMode.values());
gui.translatableChoices(TAG_MODE + index, sensorMode, SensorMode.values());
gui
.choices(TAG_OP + index, LOGIC_SENSOR_OPERATOR_TOOLTIP.i18n(), operator, Operator.values())
.integer(TAG_AMOUNT + index, LOGIC_SENSOR_AMOUNT_TOOLTIP.i18n(), amount, 46)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mcjty.xnet.apiimpl.logic.enums;

import mcjty.lib.gui.ITranslatableEnum;
import mcjty.xnet.utils.I18nUtils;
import mcjty.xnet.utils.ITranslatableEnum;
import org.apache.commons.lang3.StringUtils;

public enum LogicFilter implements ITranslatableEnum<LogicFilter> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


import mcjty.lib.varia.ComponentFactory;
import mcjty.lib.gui.ITranslatableEnum;
import mcjty.xnet.utils.I18nUtils;
import mcjty.xnet.utils.ITranslatableEnum;


public enum LogicMode implements ITranslatableEnum<LogicMode> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mcjty.xnet.apiimpl.logic.enums;

import mcjty.lib.varia.ComponentFactory;
import mcjty.lib.gui.ITranslatableEnum;
import mcjty.xnet.utils.I18nUtils;
import mcjty.xnet.utils.ITranslatableEnum;

public enum SensorMode implements ITranslatableEnum<SensorMode> {
OFF("xnet.enum.logic.sensormode.off"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private static void userSetMimicBlock(@Nonnull ItemStack item, BlockState mimicB
setMimicBlock(item, mimicBlock);
if (world.isClientSide) {
player.displayClientMessage(ComponentFactory.literal(
String.format(FACADE_CURRENT_MIMIC_FORMATTED.i18n(), mimicBlock.getBlock().getDescriptionId())),
FACADE_CURRENT_MIMIC_FORMATTED.i18n(mimicBlock.getBlock().getDescriptionId())),
false
);
}
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/mcjty/xnet/utils/ChoiceEvent.java

This file was deleted.

203 changes: 0 additions & 203 deletions src/main/java/mcjty/xnet/utils/EnumChoiceLabel.java

This file was deleted.

11 changes: 0 additions & 11 deletions src/main/java/mcjty/xnet/utils/ITranslatableEnum.java

This file was deleted.

0 comments on commit 15f941d

Please sign in to comment.