Skip to content

Commit

Permalink
Use API-powered version check
Browse files Browse the repository at this point in the history
  • Loading branch information
xism4 committed Jun 19, 2024
1 parent b082f85 commit 577dc1d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ public enum ScoreboardAction {
CHANGE, REMOVE
}

enum VersionType {
public enum VersionType {
V1_7, V1_8, V1_13, V1_17;

public boolean isHigherOrEqual() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.xism4.sternalboard.managers.tab;

import com.xism4.sternalboard.SternalBoardHandler;
import com.xism4.sternalboard.SternalBoardPlugin;
import com.xism4.sternalboard.managers.tab.list.LegacyTabExecutor;
import com.xism4.sternalboard.managers.tab.list.ModernTabExecutor;
import com.xism4.sternalboard.utils.GameVersion;
import org.bukkit.entity.Player;

public abstract class TabExecutor {
Expand All @@ -12,7 +12,7 @@ public abstract class TabExecutor {

private static TabExecutor getInstance(SternalBoardPlugin plugin) {
if (instance == null) {
if (GameVersion.isGreaterEqualThan(GameVersion.v1_13_R1)) {
if (SternalBoardHandler.VersionType.V1_13.isHigherOrEqual()) {
instance = new ModernTabExecutor(
plugin
);
Expand Down
85 changes: 0 additions & 85 deletions plugin/src/main/java/com/xism4/sternalboard/utils/GameVersion.java

This file was deleted.

0 comments on commit 577dc1d

Please sign in to comment.