Skip to content

Commit

Permalink
Added support for 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverSchlueter committed Jun 13, 2023
1 parent defbebe commit cd657e1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It is lightweight and fast (using [packets](https://wiki.vg/Protocol)).

PlaceholderAPI and MiniPlaceholders is supported.

**Only for minecraft server version 1.20**<br>
**Only for minecraft server version 1.20 & 1.20.1**<br>
_Using [paper](https://papermc.io/downloads) is highly recommended_


Expand Down
25 changes: 17 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ plugins {
}

group = "de.oliver"
version = "1.1.0"
description = "Simple, lightweight and fast hologram plugin using display entities"
version = "1.1.0"
val mcVersion = "1.20.1"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
Expand All @@ -22,16 +23,20 @@ repositories {
}

dependencies {
paperweight.paperDevBundle("1.20-R0.1-SNAPSHOT")
paperweight.paperDevBundle("$mcVersion-R0.1-SNAPSHOT")

implementation("de.oliver:FancyLib:1.0.2")
compileOnly("de.oliver:FancyNpcs:1.2.0")
compileOnly("de.oliver:FancyNpcs:1.2.1")

compileOnly("me.clip:placeholderapi:2.11.3")
compileOnly("io.github.miniplaceholders:miniplaceholders-api:2.1.0")
compileOnly("io.github.miniplaceholders:miniplaceholders-api:2.2.0")
}

tasks {
runServer{
minecraftVersion(mcVersion)
}

publishing {
repositories {
maven {
Expand Down Expand Up @@ -64,10 +69,6 @@ tasks {
}
}

runServer{
minecraftVersion("1.20")
}

// Configure reobfJar to run when invoking the build task
assemble {
dependsOn(reobfJar)
Expand All @@ -85,5 +86,13 @@ tasks {
}
processResources {
filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
val props = mapOf(
"version" to project.version,
"description" to project.description,
)
inputs.properties(props)
filesMatching("plugin.yml") {
expand(props)
}
}
}
16 changes: 12 additions & 4 deletions src/main/java/de/oliver/fancyholograms/FancyHolograms.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class FancyHolograms extends JavaPlugin {

public static final String SUPPORTED_VERSION = "1.20";
public static final String[] SUPPORTED_VERSIONS = new String[]{"1.20", "1.20.1"};
private static FancyHolograms instance;

private final FancyScheduler scheduler;
Expand Down Expand Up @@ -67,12 +67,20 @@ public void onEnable() {
});

DedicatedServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer();

String serverVersion = nmsServer.getServerVersion();
if (!serverVersion.equals(SUPPORTED_VERSION)){

boolean isSupportedVersion = false;
for (String supportedVersion : SUPPORTED_VERSIONS) {
if(serverVersion.equals(supportedVersion)){
isSupportedVersion = true;
break;
}
}

if (!isSupportedVersion) {
getLogger().warning("--------------------------------------------------");
getLogger().warning("Unsupported minecraft server version.");
getLogger().warning("Please update the server to " + SUPPORTED_VERSION + ".");
getLogger().warning("Please update the server to " + String.join(" / ", SUPPORTED_VERSIONS) + ".");
getLogger().warning("Disabling the FancyHolograms plugin.");
getLogger().warning("--------------------------------------------------");
pluginManager.disablePlugin(this);
Expand Down
7 changes: 4 additions & 3 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: FancyHolograms
main: de.oliver.fancyholograms.FancyHolograms
description: $description
author: OliverHD
version: 1.1.0
api-version: 1.19
version: $version
folia-supported: true
main: de.oliver.fancyholograms.FancyHolograms
api-version: 1.19
load: POSTWORLD
softdepend:
- FancyNpcs
Expand Down

0 comments on commit cd657e1

Please sign in to comment.