Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
plusls committed Jan 16, 2022
1 parent 7a90e2d commit d7bf8bb
Showing 1 changed file with 52 additions and 53 deletions.
105 changes: 52 additions & 53 deletions src/main/java/com/plusls/ommc/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,59 +148,6 @@ public static class Generic {
SORT_INVENTORY
);
public static final ConfigOptionList SORT_INVENTORY_SHULKER_BOX_LAST = new TranslatableConfigOptionList(PREFIX, "sortInventoryShulkerBoxLast", SortInventoryShulkerBoxLastType.AUTO);

public enum SortInventoryShulkerBoxLastType implements IConfigOptionListEntry {
FALSE("false", "ommc.gui.label.sort_inventory_shulker_box_last_type.false"),
TRUE("true", "ommc.gui.label.sort_inventory_shulker_box_last_type.true"),
AUTO("auto", "ommc.gui.label.sort_inventory_shulker_box_last_type.auto");
private final String configString;
private final String translationKey;

SortInventoryShulkerBoxLastType(String configString, String translationKey) {
this.configString = configString;
this.translationKey = translationKey;
}

@Override
public String getStringValue() {
return this.configString;
}

@Override
public String getDisplayName() {
return I18n.translate(this.translationKey);
}

@Override
public IConfigOptionListEntry cycle(boolean forward) {
int id = this.ordinal();
if (forward) {
++id;
if (id >= values().length) {
id = 0;
}
} else {
--id;
if (id < 0) {
id = values().length - 1;
}
}

return values()[id % values().length];
}

@Override
public IConfigOptionListEntry fromString(String name) {
SortInventoryShulkerBoxLastType[] values = values();
for (SortInventoryShulkerBoxLastType mode : values) {
if (mode.configString.equalsIgnoreCase(name)) {
return mode;
}
}
return AUTO;
}
}

public static final ConfigBoolean SORT_INVENTORY_SUPPORT_EMPTY_SHULKER_BOX_STACK = new TranslatableConfigBoolean(PREFIX, "sortInventorySupportEmptyShulkerBoxStack", false);
public static final ImmutableList<IConfigBase> OPTIONS = ImmutableList.of(
OPEN_CONFIG_GUI,
Expand Down Expand Up @@ -257,6 +204,58 @@ public IConfigOptionListEntry fromString(String name) {
}
});
}

public enum SortInventoryShulkerBoxLastType implements IConfigOptionListEntry {
FALSE("false", "ommc.gui.label.sort_inventory_shulker_box_last_type.false"),
TRUE("true", "ommc.gui.label.sort_inventory_shulker_box_last_type.true"),
AUTO("auto", "ommc.gui.label.sort_inventory_shulker_box_last_type.auto");
private final String configString;
private final String translationKey;

SortInventoryShulkerBoxLastType(String configString, String translationKey) {
this.configString = configString;
this.translationKey = translationKey;
}

@Override
public String getStringValue() {
return this.configString;
}

@Override
public String getDisplayName() {
return I18n.translate(this.translationKey);
}

@Override
public IConfigOptionListEntry cycle(boolean forward) {
int id = this.ordinal();
if (forward) {
++id;
if (id >= values().length) {
id = 0;
}
} else {
--id;
if (id < 0) {
id = values().length - 1;
}
}

return values()[id % values().length];
}

@Override
public IConfigOptionListEntry fromString(String name) {
SortInventoryShulkerBoxLastType[] values = values();
for (SortInventoryShulkerBoxLastType mode : values) {
if (mode.configString.equalsIgnoreCase(name)) {
return mode;
}
}
return AUTO;
}
}
}

public static class FeatureToggle {
Expand Down

0 comments on commit d7bf8bb

Please sign in to comment.