Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions codex-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>studio.magemonkey</groupId>
<artifactId>codex-parent</artifactId>
<version>1.1.1-R2.1-SNAPSHOT</version>
<version>1.1.1-R0.17-SNAPSHOT</version>
</parent>

<artifactId>codex-api</artifactId>
Expand Down Expand Up @@ -44,7 +44,7 @@
<dependency>
<groupId>com.nexomc</groupId>
<artifactId>nexo</artifactId>
<version>1.23</version>
<version>1.21.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand Down
2 changes: 1 addition & 1 deletion codex-bungee/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>studio.magemonkey</groupId>
<artifactId>codex-parent</artifactId>
<version>1.1.1-R2.1-SNAPSHOT</version>
<version>1.1.1-R0.17-SNAPSHOT</version>
</parent>

<artifactId>codex-bungee</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,15 @@ public Objective registerNewObjective(Scoreboard scoreboard, Objective objective
@SuppressWarnings("deprecation")
public HoverEvent getHoverEvent(@NotNull ItemStack itemStack) {
String components = itemStack.getItemMeta() != null ? itemStack.getItemMeta().getAsString() : "{}";

// Naprawa booleanów
components = components.replaceAll(": ?0b", ": false")
.replaceAll(": ?1b", ": true")
.replaceAll(": ?(\\d+\\.\\d+)d", ": $1");
.replaceAll(": ?1b", ": true");

// Naprawa liczb z przyrostkami f / d (np. "1.0f", "-2.5d")
// Usuwa cudzysłowy i przyrostek, zostawia czystą liczbę (JSON)
components = components.replaceAll("\"((-?\\d+(?:\\.\\d+)?)[fd])\"", "$2");

return new HoverEvent(HoverEvent.Action.SHOW_ITEM,
new ComponentsShowItem(
itemStack.getType().getKey().toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public class NMSImpl implements NMS {
public String getVersion() {
return "1.21.11";
}

@NotNull
@Override
public Object getConnection(Player player) {
Expand Down Expand Up @@ -272,10 +271,15 @@ public Objective registerNewObjective(Scoreboard scoreboard, Objective objective
@SuppressWarnings("deprecation")
public HoverEvent getHoverEvent(@NotNull ItemStack itemStack) {
String components = itemStack.getItemMeta() != null ? itemStack.getItemMeta().getAsString() : "{}";

// Naprawa booleanów
components = components.replaceAll(": ?0b", ": false")
.replaceAll(": ?1b", ": true")
.replaceAll(": ?(\\d+\\.\\d+)d", ": $1")
.replaceAll("\\b(\\d+\\.\\d+)f\\b", "$1");
.replaceAll(": ?1b", ": true");

// Naprawa liczb z przyrostkami f / d (np. "1.0f", "-2.5d")
// Usuwa cudzysłowy i przyrostek, zostawia czystą liczbę (JSON)
components = components.replaceAll("\"((-?\\d+(?:\\.\\d+)?)[fd])\"", "$2");

return new HoverEvent(HoverEvent.Action.SHOW_ITEM,
new ComponentsShowItem(
itemStack.getType().getKey().toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,19 @@ public Objective registerNewObjective(Scoreboard scoreboard, Objective objective
}

@Override
@SuppressWarnings("deprecation")
public HoverEvent getHoverEvent(@NotNull ItemStack itemStack) {
System.out.println("[DEBUG] getHoverEvent FIXED for 1.21.7");
String components = itemStack.getItemMeta() != null ? itemStack.getItemMeta().getAsString() : "{}";

// Naprawa booleanów
components = components.replaceAll(": ?0b", ": false")
.replaceAll(": ?1b", ": true")
.replaceAll(": ?(\\d+\\.\\d+)d", ": $1");
.replaceAll(": ?1b", ": true");

// Naprawa liczb z przyrostkami f / d (w cudzysłowie lub bez)
components = components.replaceAll("(-?\\d+(?:\\.\\d+)?)[fd]", "$1");

System.out.println("[DEBUG] After fix: " + components);

return new HoverEvent(HoverEvent.Action.SHOW_ITEM,
new ComponentsShowItem(
itemStack.getType().getKey().toString(),
Expand Down
3 changes: 2 additions & 1 deletion codex-nms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<description>A collection of NMS libraries for Codex</description>

<modules>
<module>codex-nms-v1_16_5</module>

<module>codex-nms-v1_17_1</module>
<module>codex-nms-v1_18_2</module>
<module>codex-nms-v1_19_4</module>
Expand All @@ -43,6 +43,7 @@
<module>codex-nms-v1_21_7</module>
<module>codex-nms-v1_21_10</module>
<module>codex-nms-v1_21_11</module>

</modules>

<dependencies>
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>studio.magemonkey</groupId>
<artifactId>magemonkey-parent</artifactId>
<version>1.21.11-R2</version>
<version>1.21.11-R1</version>
</parent>

<artifactId>codex-parent</artifactId>
<version>1.1.1-R2.1-SNAPSHOT</version>
<version>1.1.1-R2.1-SNAPSHOT</version> <!-- zmieniona wersja -->
<packaging>pom</packaging>
<name>CodexParent</name>
<description>The core plugin for VoidEdge plugins</description>
Expand Down Expand Up @@ -89,12 +89,12 @@
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.4.2</version>
<version>7.4.1</version>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-core</artifactId>
<version>7.4.2</version>
<version>7.4.1</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
Expand Down Expand Up @@ -303,4 +303,4 @@
<url>${deploy.url}/releases</url>
</repository>
</distributionManagement>
</project>
</project>