Skip to content

Commit

Permalink
Make environment regex case-insensitive
Browse files Browse the repository at this point in the history
Fixes detection for 1.18 pre-release versions
  • Loading branch information
jpenilla authored and electronicboy committed Nov 25, 2021
1 parent 669714f commit d7fc6d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/papermc/lib/environments/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public abstract class Environment {

private final int minecraftVersion;
private final int minecraftPatchVersion;
private int minecraftPreReleaseVersion;
private final int minecraftPreReleaseVersion;

protected AsyncChunks asyncChunksHandler = new AsyncChunksSync();
protected AsyncTeleport asyncTeleportHandler = new AsyncTeleportSync();
Expand All @@ -42,7 +42,7 @@ public abstract class Environment {
protected BedSpawnLocation bedSpawnLocationHandler = new BedSpawnLocationSync();

public Environment() {
Pattern versionPattern = Pattern.compile("\\(MC: (\\d)\\.(\\d+)\\.?(\\d+?)?(?: Pre-Release )?(\\d)?\\)");
Pattern versionPattern = Pattern.compile("(?i)\\(MC: (\\d)\\.(\\d+)\\.?(\\d+?)?(?: Pre-Release )?(\\d)?\\)");
Matcher matcher = versionPattern.matcher(Bukkit.getVersion());
int version = 0;
int patchVersion = 0;
Expand Down

0 comments on commit d7fc6d4

Please sign in to comment.