Skip to content

Commit

Permalink
feat(SkinHandler_Legacy): Added SkinHandler_Legacy
Browse files Browse the repository at this point in the history
Added SkinHandler_Legacy for Minecraft versions below 1.17
Gson is now shaded to the plugin jar in order to prevent compatibility issues.

BREAKING CHANGE: Added new methods and change of the old ones.
  • Loading branch information
GeorgeV220 committed Jan 11, 2023
1 parent 6fc4532 commit 31a49c0
Show file tree
Hide file tree
Showing 3 changed files with 322 additions and 8 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ allprojects {
compileOnly 'co.aikar:acf-paper:0.5.1-SNAPSHOT'
compileOnly 'co.aikar:acf-bungee:0.5.1-SNAPSHOT'
compileOnly 'co.aikar:acf-velocity:0.5.1-SNAPSHOT'
compileOnly 'com.georgev22:martexlibrary:8.6.0'
compileOnly 'com.georgev22:martexlibrary:8.10.1'
compileOnly 'com.georgev22.api:libraryloader:1.3.0'
compileOnly 'org.jetbrains:annotations:23.1.0'
compileOnly 'commons-codec:commons-codec:1.15'
Expand Down Expand Up @@ -105,8 +105,9 @@ dependencies {
implementation 'co.aikar:acf-paper:0.5.1-SNAPSHOT'
implementation 'co.aikar:acf-bungee:0.5.1-SNAPSHOT'
implementation 'co.aikar:acf-velocity:0.5.1-SNAPSHOT'
implementation 'com.georgev22:martexlibrary:8.6.0'
implementation 'com.georgev22:martexlibrary:8.10.1'
implementation 'com.georgev22.api:libraryloader:1.3.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation project(path: ':core')
implementation project(path: ':bukkit')
implementation project(path: ':bungee')
Expand All @@ -120,6 +121,7 @@ dependencies {

shadowJar {
archiveClassifier.set('')
relocate 'com.google.gson', "${packageName}.gson"
relocate 'co.aikar.commands', "${packageName}.commands.acf"
relocate 'co.aikar.locales', "${packageName}.commands.acf.locales"
relocate 'org.bstats', "${packageName}.bstats"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.georgev22.api.libraryloader.exceptions.UnknownDependencyException;
import com.georgev22.library.minecraft.BukkitMinecraftUtils;
import com.georgev22.library.scheduler.SchedulerManager;
import com.georgev22.skinoverlay.handler.SkinHandler.SkinHandler_;
import com.georgev22.skinoverlay.handler.handlers.*;
import com.georgev22.skinoverlay.listeners.bukkit.DeveloperInformListener;
import com.georgev22.skinoverlay.listeners.bukkit.PlayerListeners;
Expand Down Expand Up @@ -37,12 +36,12 @@ public class SkinOverlayBukkit extends JavaPlugin implements SkinOverlayImpl {

@Override
public void onLoad() {
if (getCurrentVersion().isBelow(V1_16_R3)) {
try {
try {
if (getCurrentVersion().isBelow(V1_16_R3)) {
new LibraryLoader(this.getClass(), this.getDataFolder()).loadAll();
} catch (InvalidDependencyException | UnknownDependencyException e) {
throw new RuntimeException(e);
}
} catch (InvalidDependencyException | UnknownDependencyException e) {
throw new RuntimeException(e);
}
SkinOverlay.getInstance().onLoad(this);
}
Expand All @@ -59,7 +58,7 @@ public void onEnable() {
case V1_18_R2 -> SkinOverlay.getInstance().setSkinHandler(new SkinHandler_1_18_R2());
case V1_19_R1 -> SkinOverlay.getInstance().setSkinHandler(new SkinHandler_1_19());
case V1_19_R2 -> SkinOverlay.getInstance().setSkinHandler(new SkinHandler_1_19_R2());
default -> SkinOverlay.getInstance().setSkinHandler(new SkinHandler_());
default -> SkinOverlay.getInstance().setSkinHandler(new SkinHandler_Legacy());
}

SkinOverlay.getInstance().onEnable();
Expand Down

0 comments on commit 31a49c0

Please sign in to comment.