Skip to content

Commit

Permalink
Move version to main class
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisTestUser committed Sep 24, 2024
1 parent 7a3e75c commit aab61c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ This plugin will work for both Spigot and Paper, but the latter is recommended b

## Updating to Later Versions

In build.gradle.kts, change the variable mcVersion to the new version. Then run 'gradlew build'. If there are still errors, the source code will need to be manually updated to be compatible with the new Minecraft version.
In build.gradle.kts, change the variable mcVersion to the new version. Go to LargeRaids.java and change the version also. Then run 'gradlew build'. If there are still errors, the source code will need to be manually updated to be compatible with the new Minecraft version.

In addition to fixing errors, you should look at the Mojang mapping for the ```groupsSpawned``` variable. If it is not ```J```, then you should change it at ```RaidWrapper.setGroupsSpawned()```.

## Statistics

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/solarrabbit/largeraids/LargeRaids.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ public final class LargeRaids extends JavaPlugin {
private TriggerManager triggerManager;
private VillageManager villageManager;

private static final String VERSION = "1.20.6";

@Override
public void onEnable() {
logger = new PluginLogger();

if (!VersionUtil.VERSION.equals(Bukkit.getServer().getMinecraftVersion())) {
if (!VERSION.equals(Bukkit.getServer().getMinecraftVersion())) {
boolean skipCheck = LargeRaids.class.getResource("/BYPASS_VERSION_CHECK.txt") != null;
log(String.format("Server version is not supported! Supported Version: %s, Your Version: %s",
VersionUtil.VERSION, Bukkit.getServer().getMinecraftVersion()), Level.FAIL, false);
VERSION, Bukkit.getServer().getMinecraftVersion()), Level.FAIL, false);
if (!skipCheck) {
log("You can allow the plugin to run anyways (not recommended) "
+ "by placing BYPASS_VERSION_CHECK.txt inside the plugin JAR", Level.FAIL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import org.bukkit.entity.Vex;

public class VersionUtil {
public static final String VERSION = "1.20.6";

public static AbstractBlockPositionWrapper getBlockPositionWrapper(Location location) {
return getBlockPositionWrapper(location.getX(), location.getY(), location.getZ());
}
Expand Down

0 comments on commit aab61c1

Please sign in to comment.