Skip to content

Commit c716bbb

Browse files
committed
fix(gen): Don't use use jdk internal classes + only check for SBR
- Pork lib is dropped as a dependency because that's not really maintained. May cause issues?
1 parent 526f79c commit c716bbb

6 files changed

Lines changed: 27 additions & 30 deletions

File tree

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ dependencies {
1616
exclude(group = "com.github.cryptomorin", module = "XSeries")
1717
}
1818
implementation(libs.com.alpsbte.canvas)
19-
implementation(libs.net.daporkchop.lib.binary)
2019
implementation(libs.com.github.cryptomorin.xseries)
2120
implementation(libs.net.wesjd.anvilgui)
2221
implementation(libs.micycle.clipper2)

gradle/libs.versions.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ com-squareup-okhttp3-okhttp-jvm = "5.3.2" # https://central.sonatype.com/artifac
1010
javaapiforkml = "3.0.10" # https://github.com/urbancamo/javaapiforkml
1111
io-papermc-paper-paper-api = "1.21.11-R0.1-SNAPSHOT" # https://artifactory.papermc.io/ui/native/universe/io/papermc/paper/paper-api/
1212
micycle-clipper2 = "1.3.3" # https://github.com/micycle1/Clipper2-java/releases
13-
net-daporkchop-lib-binary = "0.5.9-SNAPSHOT" # https://maven.daporkchop.net/net/daporkchop/lib/binary/
1413
net-wesjd-anvilgui = "1.10.11-SNAPSHOT" # https://github.com/WesJD/AnvilGUI https://mvn.wesjd.net/
1514
org-json-json = "20251224" # https://mvnrepository.com/artifact/org.json/json
1615
io-freefair-lombok = "9.2.0" # https://plugins.gradle.org/plugin/io.freefair.lombok
1716
com-googlecode-json-simple = "1.1.1" # https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple
1817
com-palantir-git-version = "4.2.0" # https://github.com/palantir/gradle-git-version/releases
1918
com-gradleup-shadow = "9.3.1" # https://github.com/GradleUp/shadow/releases
2019
alpslib-io = "1.2.0" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-io/
21-
alpslib-utils = "1.4.1" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-utils/
20+
alpslib-utils = "1.4.2" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-utils/
2221
fawe-bom = "1.55" # Ref: https://github.com/IntellectualSites/bom
2322
bstats = "3.1.0" # https://central.sonatype.com/artifact/org.bstats/bstats-bukkit
2423
bluemap-api = "2.7.7" # Ref: https://github.com/BlueMap-Minecraft/BlueMapAPI
@@ -32,7 +31,6 @@ com-squareup-okhttp3-okhttp-jvm = { module = "com.squareup.okhttp3:okhttp-jvm",
3231
javaapiforkml = { module = "uk.m0nom:javaapiforkml", version.ref = "javaapiforkml" }
3332
io-papermc-paper-paper-api = { module = "io.papermc.paper:paper-api", version.ref = "io-papermc-paper-paper-api" }
3433
micycle-clipper2 = { module = "com.github.micycle1:Clipper2-java", version.ref = "micycle-clipper2" }
35-
net-daporkchop-lib-binary = { module = "net.daporkchop.lib:binary", version.ref = "net-daporkchop-lib-binary" }
3634
net-wesjd-anvilgui = { module = "net.wesjd:anvilgui", version.ref = "net-wesjd-anvilgui" }
3735
org-json-json = { module = "org.json:json", version.ref = "org-json-json" }
3836
com-googlecode-json-simple = { module = "com.googlecode.json-simple:json-simple", version.ref = "com-googlecode-json-simple" }

src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeHeightMenu.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeSettings;
88
import net.buildtheearth.buildteamtools.modules.generator.model.Settings;
99
import net.buildtheearth.buildteamtools.utils.menus.NameListMenu;
10-
import net.daporkchop.lib.common.misc.Tuple;
1110
import org.apache.commons.lang3.StringUtils;
11+
import org.apache.commons.lang3.tuple.MutablePair;
1212
import org.bukkit.Sound;
1313
import org.bukkit.entity.Player;
1414
import org.bukkit.inventory.ItemStack;
@@ -28,13 +28,13 @@ public TreeHeightMenu(Player player, boolean autoLoad) {
2828
/**
2929
* Get a list of all tree widths
3030
*/
31-
private static @NonNull List<Tuple<ItemStack, String>> getTreeHeights() {
32-
List<Tuple<ItemStack, String>> treeHeights = new ArrayList<>();
31+
private static @NonNull List<MutablePair<ItemStack, String>> getTreeHeights() {
32+
List<MutablePair<ItemStack, String>> treeHeights = new ArrayList<>();
3333

34-
treeHeights.add(new Tuple<>(new Item(XMaterial.LIME_CONCRETE.parseItem()).setDisplayName("Any").build(), "Any"));
34+
treeHeights.add(MutablePair.of(new Item(XMaterial.LIME_CONCRETE.parseItem()).setDisplayName("Any").build(), "Any"));
3535

3636
GeneratorModule.getInstance().getTree().getHeights().forEach(h ->
37-
treeHeights.add(new Tuple<>(Item.create(XMaterial.PAPER.get(), StringUtils.capitalize(h)), h)));
37+
treeHeights.add(MutablePair.of(Item.create(XMaterial.PAPER.get(), StringUtils.capitalize(h)), h)));
3838

3939
return treeHeights;
4040
}

src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeTypeMenu.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import net.buildtheearth.buildteamtools.modules.generator.menu.GeneratorMenu;
1010
import net.buildtheearth.buildteamtools.modules.generator.model.Settings;
1111
import net.buildtheearth.buildteamtools.utils.menus.NameListMenu;
12-
import net.daporkchop.lib.common.misc.Tuple;
1312
import org.apache.commons.lang3.StringUtils;
13+
import org.apache.commons.lang3.tuple.MutablePair;
1414
import org.bukkit.Sound;
1515
import org.bukkit.entity.Player;
1616
import org.bukkit.inventory.ItemStack;
@@ -28,13 +28,13 @@ public TreeTypeMenu(Player player, boolean autoLoad) {
2828
}
2929

3030
/** Get a list of all tree types */
31-
private static @NonNull List<Tuple<ItemStack, String>> getTreeTypes() {
32-
List<Tuple<ItemStack, String>> treeTypes = new ArrayList<>();
31+
private static @NonNull List<MutablePair<ItemStack, String>> getTreeTypes() {
32+
List<MutablePair<ItemStack, String>> treeTypes = new ArrayList<>();
3333

34-
treeTypes.add(new Tuple<>(new Item(XMaterial.LIME_CONCRETE.parseItem()).setDisplayName("Any").build(), "Any"));
34+
treeTypes.add(new MutablePair<>(new Item(XMaterial.LIME_CONCRETE.parseItem()).setDisplayName("Any").build(), "Any"));
3535

3636
for(TreeType treeType : TreeType.values())
37-
treeTypes.add(new Tuple<>(Item.create(XMaterial.OAK_SAPLING.get(), StringUtils.capitalize(treeType.getName())), treeType.getName()));
37+
treeTypes.add(new MutablePair<>(Item.create(XMaterial.OAK_SAPLING.get(), StringUtils.capitalize(treeType.getName())), treeType.getName()));
3838

3939
return treeTypes;
4040
}

src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeWidthMenu.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeWidth;
99
import net.buildtheearth.buildteamtools.modules.generator.model.Settings;
1010
import net.buildtheearth.buildteamtools.utils.menus.NameListMenu;
11-
import net.daporkchop.lib.common.misc.Tuple;
1211
import org.apache.commons.lang3.StringUtils;
12+
import org.apache.commons.lang3.tuple.MutablePair;
1313
import org.bukkit.Sound;
1414
import org.bukkit.entity.Player;
1515
import org.bukkit.inventory.ItemStack;
@@ -29,13 +29,13 @@ public TreeWidthMenu(Player player, boolean autoLoad) {
2929
/**
3030
* Get a list of all tree widths
3131
*/
32-
private static @NonNull List<Tuple<ItemStack, String>> getTreeWidths() {
33-
List<Tuple<ItemStack, String>> treeWidths = new ArrayList<>();
32+
private static @NonNull List<MutablePair<ItemStack, String>> getTreeWidths() {
33+
List<MutablePair<ItemStack, String>> treeWidths = new ArrayList<>();
3434

35-
treeWidths.add(new Tuple<>(new Item(XMaterial.LIME_CONCRETE.parseItem()).setDisplayName("Any").build(), "Any"));
35+
treeWidths.add(new MutablePair<>(new Item(XMaterial.LIME_CONCRETE.parseItem()).setDisplayName("Any").build(), "Any"));
3636

3737
for (TreeWidth treeWidth : TreeWidth.values())
38-
treeWidths.add(new Tuple<>(Item.create(XMaterial.JUNGLE_SAPLING.get(), StringUtils.capitalize(treeWidth.getName())), treeWidth.getName()));
38+
treeWidths.add(new MutablePair<>(Item.create(XMaterial.JUNGLE_SAPLING.get(), StringUtils.capitalize(treeWidth.getName())), treeWidth.getName()));
3939

4040
return treeWidths;
4141
}

src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.alpsbte.alpslib.utils.item.Item;
44
import net.buildtheearth.buildteamtools.utils.CustomHeads;
55
import net.buildtheearth.buildteamtools.utils.MenuItems;
6-
import net.daporkchop.lib.common.misc.Tuple;
6+
import org.apache.commons.lang3.tuple.MutablePair;
77
import org.bukkit.enchantments.Enchantment;
88
import org.bukkit.entity.Player;
99
import org.bukkit.inventory.ItemStack;
@@ -26,12 +26,12 @@ public class NameListMenu extends AbstractPaginatedMenu {
2626
public static final int BACK_ITEM_SLOT = 27;
2727

2828
protected final List<String> selectedNames;
29-
private final List<Tuple<ItemStack, String>> items;
29+
private final List<MutablePair<ItemStack, String>> items;
3030

3131
private final AbstractMenu backMenu;
3232

3333

34-
public NameListMenu(Player player, String invName, List<Tuple<ItemStack, String>> items, AbstractMenu backMenu, boolean autoLoad) {
34+
public NameListMenu(Player player, String invName, List<MutablePair<ItemStack, String>> items, AbstractMenu backMenu, boolean autoLoad) {
3535
super(4, 3, invName, player, autoLoad);
3636

3737
this.items = items;
@@ -85,13 +85,13 @@ protected List<?> getSource() {
8585
@Override
8686
protected void setPaginatedPreviewItems(List<?> source) {
8787
// Set pagignated items
88-
List<Tuple<ItemStack, String>> pagItems = source.stream().map(l -> (Tuple<ItemStack, String>) l).toList();
88+
List<MutablePair<ItemStack, String>> pagItems = source.stream().map(l -> (MutablePair<ItemStack, String>) l).toList();
8989
int slot = 0;
90-
for (Tuple<ItemStack, String> item : pagItems) {
91-
if (selectedNames.contains(item.getB()))
92-
item.setA(new Item(item.getA()).setAmount(1).addEnchantment(Enchantment.LUCK_OF_THE_SEA, 1).hideEnchantments(true).build());
90+
for (MutablePair<ItemStack, String> item : pagItems) {
91+
if (selectedNames.contains(item.getRight()))
92+
item.setLeft(new Item(item.getLeft()).setAmount(1).addEnchantment(Enchantment.LUCK_OF_THE_SEA, 1).hideEnchantments(true).build());
9393

94-
getMenu().getSlot(slot).setItem(item.getA());
94+
getMenu().getSlot(slot).setItem(item.getLeft());
9595
slot++;
9696
}
9797
}
@@ -103,12 +103,12 @@ protected void setPaginatedMenuItemsAsync(List<?> source) {
103103

104104
@Override
105105
protected void setPaginatedItemClickEventsAsync(@NonNull List<?> source) {
106-
List<Tuple<ItemStack, String>> pagItems = source.stream().map(l -> (Tuple<ItemStack, String>) l).toList();
106+
List<MutablePair<ItemStack, String>> pagItems = source.stream().map(l -> (MutablePair<ItemStack, String>) l).toList();
107107
int slot = 0;
108-
for (Tuple<ItemStack, String> item : pagItems) {
108+
for (MutablePair<ItemStack, String> item : pagItems) {
109109
final int _slot = slot;
110110
getMenu().getSlot(_slot).setClickHandler((clickPlayer, clickInformation) -> {
111-
String type = (item.getB().toLowerCase());
111+
String type = (item.getRight().toLowerCase());
112112

113113
if (selectedNames.contains(type))
114114
selectedNames.remove(type);

0 commit comments

Comments
 (0)