Skip to content

Commit

Permalink
Fix version parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerS1066 committed Jun 20, 2024
1 parent 52ec695 commit 19557e6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public abstract class WorldHandler {
public abstract void setAccessLocation(@NotNull InventoryView inventoryView, @NotNull Location location);

public static @NotNull String getPackageName(@NotNull String minecraftVersion) {
return "v1_" + minecraftVersion.substring(minecraftVersion.indexOf('.') + 1, minecraftVersion.lastIndexOf('.'));
String[] parts = minecraftVersion.split("\\.");
if (parts.length < 2)
throw new IllegalArgumentException();
return "v1_" + parts[1];
}
}

0 comments on commit 19557e6

Please sign in to comment.