forked from CristianDossow/DamageIndicator
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed adventure compatibility on paper 1.16.5
- Loading branch information
Showing
7 changed files
with
97 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/cl/mastercode/DamageIndicator/dependency/Dependency.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cl.mastercode.DamageIndicator.dependency; | ||
|
||
public enum Dependency { | ||
KYORI_API("net{}kyori", "adventure-api", DependencyManager.KYORI_VERSION), | ||
KYORI_KEY("net{}kyori", "adventure-key", DependencyManager.KYORI_VERSION), | ||
KYORI_EXAMINATION_API("net{}kyori", "examination-api", DependencyManager.KYORI_EXAMINATION_VERSION), | ||
KYORI_EXAMINATION_STRING("net{}kyori", "examination-string", DependencyManager.KYORI_EXAMINATION_VERSION), | ||
KYORI_NBT("net{}kyori", "adventure-nbt", DependencyManager.KYORI_VERSION), | ||
KYORI_GSON("net{}kyori", "adventure-text-serializer-gson", DependencyManager.KYORI_VERSION), | ||
KYORI_GSON_LEGACY("net{}kyori", "adventure-text-serializer-gson-legacy-impl", DependencyManager.KYORI_VERSION), | ||
KYORI_LEGACY_SERIALIZER("net{}kyori", "adventure-text-serializer-legacy", DependencyManager.KYORI_VERSION), | ||
KYORI_MINI_MESSAGE("net{}kyori", "adventure-text-minimessage", DependencyManager.KYORI_VERSION), | ||
KYORI_PLATFORM_API("net{}kyori", "adventure-platform-api", DependencyManager.KYORI_PLATFORM_VERSION), | ||
KYORI_PLATFORM_BUKKIT("net{}kyori", "adventure-platform-bukkit", DependencyManager.KYORI_PLATFORM_VERSION), | ||
KYORI_PLATFORM_BUNGEECORD("net{}kyori", "adventure-text-serializer-bungeecord", DependencyManager.KYORI_PLATFORM_VERSION), | ||
KYORI_PLATFORM_FACET("net{}kyori", "adventure-platform-facet", DependencyManager.KYORI_PLATFORM_VERSION), | ||
KYORI_PLATFORM_VIAVERSION("net{}kyori", "adventure-platform-viaversion", DependencyManager.KYORI_PLATFORM_VERSION); | ||
|
||
private final String groupId; | ||
private final String artifactId; | ||
private final String version; | ||
|
||
Dependency(String groupId, String artifactId, String version) { | ||
this.groupId = groupId; | ||
this.artifactId = artifactId; | ||
this.version = version; | ||
} | ||
|
||
public String getGroupId() { | ||
return groupId; | ||
} | ||
|
||
public String getArtifactId() { | ||
return artifactId; | ||
} | ||
|
||
public String getVersion() { | ||
return version; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/cl/mastercode/DamageIndicator/dependency/DependencyManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package cl.mastercode.DamageIndicator.dependency; | ||
|
||
import cl.mastercode.DamageIndicator.DIMain; | ||
import net.byteflux.libby.BukkitLibraryManager; | ||
import net.byteflux.libby.Library; | ||
import net.byteflux.libby.relocation.Relocation; | ||
|
||
public class DependencyManager { | ||
public static final String KYORI_VERSION = "4.13.1"; | ||
public static final String KYORI_EXAMINATION_VERSION = "1.3.0"; | ||
public static final String KYORI_PLATFORM_VERSION = "4.3.4"; | ||
|
||
private final BukkitLibraryManager libraryManager; | ||
|
||
public DependencyManager(DIMain plugin) { | ||
libraryManager = new BukkitLibraryManager(plugin); | ||
} | ||
|
||
public void loadDependencies() { | ||
Relocation relocation = Relocation.builder().pattern("net{}kyori").relocatedPattern("cl{}mastercode{}DamageIndicator{}libs{}kyori").build(); | ||
libraryManager.addMavenCentral(); | ||
for (Dependency dependency : Dependency.values()) { | ||
Library library = Library.builder().groupId(dependency.getGroupId()).artifactId(dependency.getArtifactId()).version(dependency.getVersion()).relocate(relocation).build(); | ||
libraryManager.loadLibrary(library); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters