Skip to content

Commit

Permalink
fix 1.21 support
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei1058 committed Aug 31, 2024
1 parent 1fdc3f4 commit 8ac4ae8
Show file tree
Hide file tree
Showing 22 changed files with 60 additions and 35 deletions.
2 changes: 1 addition & 1 deletion bedwars-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bedwars-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
public abstract class VersionSupport {

private static String name2;
public static String PLUGIN_TAG_GENERIC_KEY = "BedWars1058";
public static String PLUGIN_TAG_TIER_KEY = "tierIdentifier";
public static String PLUGIN_TAG_GENERIC_KEY = "bed_wars_1058";
public static String PLUGIN_TAG_TIER_KEY = "tier_identifier";

private Effect eggBridge;

Expand Down
2 changes: 1 addition & 1 deletion bedwars-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bedwars-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>BedWars1058</artifactId>
<packaging>pom</packaging>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
2 changes: 1 addition & 1 deletion resetadapter_aswm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>resetadapter-aswm</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion resetadapter_slime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>resetadapter-slime</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion resetadapter_slimepaper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>resetadapter-slimepaper</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion versionsupport_1_12_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion versionsupport_1_8_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>versionsupport_1_8_R3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion versionsupport_common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion versionsupport_nms_cmn1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>BedWars1058</artifactId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>versionsupport_nms_cmn1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,20 @@ public org.bukkit.inventory.ItemStack addCustomData(org.bukkit.inventory.ItemSta
if (null == tag) {
return i;
}
tag.set(
Objects.requireNonNull(NamespacedKey.fromString(key, getPlugin())),
PersistentDataType.STRING,
data
);
try {
tag.set(
Objects.requireNonNull(NamespacedKey.fromString(key.toLowerCase(), getPlugin())),
PersistentDataType.STRING,
data
);
} catch (IllegalArgumentException e) {
if (!e.getMessage().contains("Invalid Key. Must be")) {
getPlugin().getLogger().severe("Cannot append item custom tag with key -> " + key);
getPlugin().getLogger().severe("Reason:" + e.getMessage());
}
e.printStackTrace();

}
return i;
}

Expand All @@ -348,12 +357,20 @@ public org.bukkit.inventory.ItemStack setTag(org.bukkit.inventory.ItemStack item
if (null == tag) {
return itemStack;
}
key = key.replaceFirst("minecraft:", "");
tag.set(
Objects.requireNonNull(NamespacedKey.minecraft(key)),
PersistentDataType.STRING,
value
);
try {
key = key.replaceFirst("minecraft:", "");
tag.set(
Objects.requireNonNull(NamespacedKey.minecraft(key.toLowerCase())),
PersistentDataType.STRING,
value
);
} catch (IllegalArgumentException e) {
if (e.getMessage().contains("Invalid Key. Must be")) {
getPlugin().getLogger().severe("Cannot append item custom tag with key -> " + key);
getPlugin().getLogger().severe("Reason:" + e.getMessage());
}
e.printStackTrace();
}
return itemStack;
}

Expand Down Expand Up @@ -480,7 +497,8 @@ public org.bukkit.Material woolMaterial() {
}


@Override @Nullable
@Override
@Nullable
public String getShopUpgradeIdentifier(org.bukkit.inventory.ItemStack itemStack) {
return getTag(itemStack, VersionSupport.PLUGIN_TAG_TIER_KEY);
}
Expand Down
2 changes: 1 addition & 1 deletion versionsupport_v1_16_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion versionsupport_v1_17_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion versionsupport_v1_18_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BedWars1058</artifactId>
<groupId>com.andrei1058.bedwars</groupId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion versionsupport_v1_19_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>BedWars1058</artifactId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>versionsupport_v1_19_R2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion versionsupport_v1_19_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>BedWars1058</artifactId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>versionsupport_v1_19_R3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion versionsupport_v1_20_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>BedWars1058</artifactId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>versionsupport_v1_20_R1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion versionsupport_v1_20_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>BedWars1058</artifactId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>versionsupport_v1_20_R2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion versionsupport_v1_20_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>BedWars1058</artifactId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>versionsupport_v1_20_R3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion versionsupport_v1_20_R4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>BedWars1058</artifactId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>versionsupport_v1_20_R4</artifactId>
Expand Down
11 changes: 9 additions & 2 deletions versionsupport_v1_21_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.andrei1058.bedwars</groupId>
<artifactId>BedWars1058</artifactId>
<version>23.12.1-SNAPSHOT</version>
<version>24.8-SNAPSHOT</version>
</parent>

<artifactId>versionsupport_v1_21_R1</artifactId>
Expand All @@ -15,6 +15,13 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>
<repository>
<id>andrei1058-repo</id>
<url>https://repo.andrei1058.dev/releases</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.andrei1058.bedwars</groupId>
Expand Down Expand Up @@ -52,7 +59,7 @@
<dependency>
<groupId>com.andrei1058.spigot.sidebar</groupId>
<artifactId>sidebar-v1_21_R1</artifactId>
<version>24.8-SNAPSHOT</version>
<version>24.8</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down

0 comments on commit 8ac4ae8

Please sign in to comment.