Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: 1.16.0-1.19.2-1.21.3 #509

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 25 additions & 64 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
}

version '1.15.2-1.19.2-1.21.1'
version '1.15.3-1.19.2-1.21.3'
def apiVersion = '1.19'
def name = getRootProject().getName() // Defined in settings.gradle
def main = 'com.volmit.adapt.Adapt'
def manifoldVersion = '2024.1.30'
def manifoldVersion = '2024.1.37'

// ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED
// ======================== WINDOWS =============================
Expand All @@ -44,15 +44,16 @@ registerCustomOutputTaskUnix('the456gamer', '/home/the456gamer/projects/minecraf
// ==============================================================

def VERSIONS = Map.of(
"v1_21_2", "1.21.2-R0.1-SNAPSHOT",
"v1_21", "1.21-R0.1-SNAPSHOT",
"v1_20_5", "1.20.5-R0.1-SNAPSHOT",
"v1_20_4", "1.20.4-R0.1-SNAPSHOT",
"v1_19_2", "1.19.2-R0.1-SNAPSHOT"
)

VERSIONS.each {
def key = it.key;
def value = it.value;
def key = it.key
def value = it.value
project(":version:${key}") {
apply plugin: 'java'
apply plugin: 'java-library'
Expand Down Expand Up @@ -93,19 +94,19 @@ allprojects {
content {
includeGroup("org.bukkit")
includeGroup("org.spigotmc")
includeGroup("com.frengor")
}
}
mavenCentral()
maven { url "https://repo.papermc.io/repository/maven-public/"}
maven { url "https://repo.codemc.org/repository/maven-public" }
maven { url "https://mvn.lumine.io/repository/maven-public/" }
maven { url "https://nexus.frengor.com/repository/public/"}
maven { url "https://jitpack.io"}
maven { url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
maven { url 'https://jitpack.io' }
maven { url 'https://ci.ender.zone/plugin/repository/everything/' }
maven { url "https://arcanearts.jfrog.io/artifactory/archives" }
maven { url 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
maven { url "https://repo.glaremasters.me/repository/bloodshot/" }
maven { url "https://maven.enginehub.org/repo/" }
maven { url "https://repo.oraxen.com/releases" }
maven { url 'https://jitpack.io' }
mavenLocal()

}
Expand All @@ -123,26 +124,31 @@ allprojects {
annotationProcessor 'org.projectlombok:lombok:1.18.24'

// Cancer
implementation 'art.arcane:Amulet:22.7.18'
implementation 'art.arcane:Fukkit:22.7.5'
implementation 'art.arcane:Curse:23.5.2'
implementation 'com.github.VolmitDev:Fukkit:23.6.1'
implementation 'com.github.VolmitDev:Amulet:23.5.1'
implementation 'com.github.VolmitDev:Chrono:22.9.10'
implementation 'com.github.VolmitDev:Curse:23.4.3'
implementation 'com.github.VolmitDev:MultiBurst:22.9.2'
implementation 'com.github.VolmitDev:Spatial:22.11.1'

implementation "io.papermc:paperlib:1.0.7"
implementation 'com.github.ben-manes.caffeine:caffeine:3.0.6'
annotationProcessor 'systems.manifold:manifold-ext:' + manifoldVersion
testAnnotationProcessor 'systems.manifold:manifold-ext:' + manifoldVersion
implementation 'systems.manifold:manifold-rt:' + manifoldVersion

//Random Api's
implementation 'com.github.DeadSilenceIV:AdvancedChestsAPI:2.9-BETA'
implementation 'com.sk89q.worldguard:worldguard-bukkit:7.0.8'
implementation "com.github.FrancoBM12:API-MagicCosmetics:2.2.2"
implementation "com.github.FrancoBM12:API-MagicCosmetics:2.2.8"
implementation 'me.clip:placeholderapi:2.11.2'
implementation 'com.github.LoneDev6:api-itemsadder:3.2.5'
implementation 'io.th0rgal:oraxen:1.94.0'
implementation 'io.th0rgal:oraxen:1.182.0'
implementation 'com.massivecraft:Factions:1.6.9.5-U0.6.21'
implementation "com.github.angeschossen:ChestProtectAPI:3.9.1"
implementation "com.github.TechFortress:GriefPrevention:16.18.1"
implementation 'xyz.xenondevs:particle:1.8.1'
implementation "com.frengor:ultimateadvancementapi-shadeable:2.4.1"
implementation "com.frengor:ultimateadvancementapi-shadeable:2.4.2"
compileOnly 'com.griefdefender:api:2.1.0-SNAPSHOT'
compileOnly 'io.netty:netty-all:4.1.68.Final'

Expand All @@ -155,6 +161,7 @@ allprojects {
compileOnly 'net.kyori:adventure-platform-bukkit:4.3.0'
compileOnly 'net.kyori:adventure-api:4.13.1'
compileOnly 'it.unimi.dsi:fastutil:8.5.13'
compileOnly "fr.skytasul:glowingentities:1.4"
implementation 'com.google.guava:guava:30.1-jre'
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
}
Expand All @@ -179,64 +186,18 @@ shadowJar {
dependencies {
include(dependency('systems.manifold:'))
include(dependency('xyz.xenondevs:'))
include(dependency('art.arcane:'))
include(dependency('com.github.VolmitDev:'))
include(dependency('com.frengor:ultimateadvancementapi-shadeable:'))
}
}

configurations.all {
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 60, 'minutes'
resolutionStrategy.cacheDynamicVersionsFor 60, 'minutes'
}

dependencies {
// Provided or Classpath
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
implementation 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'

// Vomit
implementation 'art.arcane:Curse:23.5.2'
implementation 'art.arcane:MultiBurst:22.9.2'
implementation 'art.arcane:Chrono:22.9.10'
implementation 'art.arcane:Spatial:22.11.1'
implementation 'com.github.ben-manes.caffeine:caffeine:3.0.6'

// Cancer
implementation 'art.arcane:Amulet:22.7.18'
implementation 'art.arcane:Fukkit:22.7.5'
implementation 'art.arcane:Curse:23.5.2'
implementation "io.papermc:paperlib:1.0.7"
annotationProcessor 'systems.manifold:manifold-ext:' + manifoldVersion
testAnnotationProcessor 'systems.manifold:manifold-ext:' + manifoldVersion
implementation 'systems.manifold:manifold-rt:' + manifoldVersion

//Random Api's
implementation 'com.github.DeadSilenceIV:AdvancedChestsAPI:2.9-BETA'
implementation 'com.sk89q.worldguard:worldguard-bukkit:7.0.8'
implementation "com.github.FrancoBM12:API-MagicCosmetics:2.2.2"
implementation 'me.clip:placeholderapi:2.11.2'
implementation 'com.github.LoneDev6:api-itemsadder:3.2.5'
implementation 'io.th0rgal:oraxen:1.94.0'
implementation 'com.massivecraft:Factions:1.6.9.5-U0.6.21'
implementation "com.github.angeschossen:ChestProtectAPI:3.9.1"
implementation "com.github.TechFortress:GriefPrevention:16.18.1"
implementation 'xyz.xenondevs:particle:1.8.1'
implementation "com.frengor:ultimateadvancementapi-shadeable:2.4.1"
compileOnly 'com.griefdefender:api:2.1.0-SNAPSHOT'
compileOnly 'io.netty:netty-all:4.1.68.Final'

// Dynamically Loaded
compileOnly 'com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2'
compileOnly 'org.apache.commons:commons-lang3:3.12.0'
compileOnly 'com.google.code.gson:gson:2.10'
compileOnly 'com.elmakers.mine.bukkit:EffectLib:9.4'
compileOnly 'net.kyori:adventure-text-minimessage:4.13.1'
compileOnly 'net.kyori:adventure-platform-bukkit:4.3.0'
compileOnly 'net.kyori:adventure-api:4.13.1'
compileOnly 'it.unimi.dsi:fastutil:8.5.13'
implementation 'com.google.guava:guava:30.1-jre'
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
}

if (JavaVersion.current().toString() != "17") {
Expand All @@ -257,7 +218,7 @@ if (JavaVersion.current().toString() != "17") {
System.exit(69)
}

def buildDir = layout.buildDirectory.asFile.get();
def buildDir = layout.buildDirectory.asFile.get()
def outputJar = new File(buildDir, "libs/Adapt-" + version + "-all.jar")

java {
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
rootProject.name = 'Adapt'

include(
':version:v1_21_2',
':version:v1_21',
':version:v1_20_5',
':version:v1_20_4',
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/volmit/adapt/Adapt.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import com.volmit.adapt.api.world.AdaptServer;
import com.volmit.adapt.content.gui.SkillsGui;
import com.volmit.adapt.content.protector.*;
import com.volmit.adapt.nms.GlowingEntities;
import fr.skytasul.glowingentities.GlowingEntities;
import com.volmit.adapt.util.*;
import com.volmit.adapt.util.collection.KList;
import com.volmit.adapt.util.collection.KMap;
Expand Down Expand Up @@ -169,6 +169,7 @@ public void stopSim() {
manager.disable();
MaterialValue.save();
WorldData.stop();
CustomModel.clear();
}


Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/volmit/adapt/AdaptConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ public class AdaptConfig {
private boolean hardcoreResetOnPlayerDeath = false;
private boolean hardcoreNoRefunds = false;
private boolean loginBonus = true;
private boolean welcomeMessage = true;
private boolean advancements = true;
private boolean useSql = false;
private int sqlSecondsCheckverify = 30;
private boolean useEnchantmentTableParticleForActiveEffects = true;
private boolean escClosesAllGuis = false;
private boolean guiBackButton = false;
private boolean customModels = true;
private int learnUnlearnButtonDelayTicks = 14;
private int maxRecipeListPrecaution = 25;
private boolean actionbarNotifyXp = true;
Expand Down
27 changes: 22 additions & 5 deletions src/main/java/com/volmit/adapt/api/adaptation/Adaptation.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,19 @@ default BlockFace getBlockFace(Player player, int maxrange) {
return targetBlock.getFace(adjacentBlock);
}

default CustomModel getModel() {
return CustomModel.get(getIcon(), "adaptation", getName(), "icon");
}

default CustomModel getModel(int level) {
var model = CustomModel.get(getIcon(), "adaptation", getName(), "level-" + level);
if (model.material() == getIcon() && model.model() == 0)
model = CustomModel.get(Material.PAPER, "snippets", "gui", "level", String.valueOf(level));
if (model.material() == Material.PAPER && model.model() == 0)
model = getModel();
return model;
}

default boolean openGui(Player player, boolean checkPermissions) {
if (hasBlacklistPermission(player, this)) {
return false;
Expand All @@ -395,7 +408,10 @@ default void openGui(Player player) {
spw.play(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 0.855f);
Window w = new UIWindow(player);
w.setTag("skill/" + getSkill().getName() + "/" + getName());
w.setDecorator((window, position, row) -> new UIElement("bg").setName(" ").setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE)));
w.setDecorator((window, position, row) -> new UIElement("bg")
.setName(" ")
.setMaterial(new MaterialBlock(Material.BLACK_STAINED_GLASS_PANE))
.setModel(CustomModel.get(Material.BLACK_STAINED_GLASS_PANE, "snippets", "gui", "background")));
w.setResolution(WindowResolution.W9_H6);
int o = 0;

Expand Down Expand Up @@ -427,6 +443,7 @@ default void openGui(Player player) {
int lvl = i;
Element de = new UIElement("lp-" + i + "g")
.setMaterial(new MaterialBlock(getIcon()))
.setModel(getModel(i))
.setName(getDisplayName(i))
.setEnchanted(mylevel >= lvl)
.setProgress(1D)
Expand Down Expand Up @@ -486,11 +503,9 @@ default void openGui(Player player) {
int backRow = w.getViewportHeight() - 1;
w.setElement(backPos, backRow, new UIElement("back")
.setMaterial(new MaterialBlock(Material.RED_BED))
.setModel(CustomModel.get(Material.RED_BED, "snippets", "gui", "back"))
.setName("" + C.RESET + C.GRAY + Localizer.dLocalize("snippets", "gui", "back"))
.onLeftClick((e) -> {
w.close();
onGuiClose(player, true);
}));
.onLeftClick((e) -> onGuiClose(player, true)));
}

AdaptPlayer a = Adapt.instance.getAdaptServer().getPlayer(player);
Expand All @@ -507,6 +522,8 @@ private void onGuiClose(Player player, boolean openPrevGui) {
spw.play(player.getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.3f, 0.855f);
if (openPrevGui) {
getSkill().openGui(player);
} else {
Adapt.instance.getGuiLeftovers().remove(player.getUniqueId().toString());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@


import com.fren_gor.ultimateAdvancementAPI.AdvancementTab;
import com.fren_gor.ultimateAdvancementAPI.UltimateAdvancementAPI;
import com.fren_gor.ultimateAdvancementAPI.advancement.Advancement;
import com.fren_gor.ultimateAdvancementAPI.advancement.BaseAdvancement;
import com.fren_gor.ultimateAdvancementAPI.advancement.RootAdvancement;
import com.fren_gor.ultimateAdvancementAPI.advancement.display.AdvancementDisplay;
import com.fren_gor.ultimateAdvancementAPI.advancement.display.AdvancementFrameType;
import com.fren_gor.ultimateAdvancementAPI.database.TeamProgression;
import com.volmit.adapt.Adapt;
import com.volmit.adapt.util.CustomModel;
import lombok.*;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;

import java.util.*;
Expand All @@ -42,6 +43,8 @@ public class AdaptAdvancement {
@Builder.Default
private Material icon = Material.EMERALD;
@Builder.Default
private CustomModel model = null;
@Builder.Default
private String title = "MISSING TITLE";
@Builder.Default
private String description = "MISSING DESCRIPTION";
Expand All @@ -63,7 +66,10 @@ private Advancement toAdvancement(Advancement parent, int index, int depth) {
children = new ArrayList<>();
}

AdvancementDisplay d = new AdvancementDisplay.Builder(getIcon(), getTitle())
var icon = getModel() != null ?
getModel().toItemStack() :
new ItemStack(getIcon());
AdvancementDisplay d = new AdvancementDisplay.Builder(icon, getTitle())
.description(getDescription())
.frame(getFrame())
.showToast(toast)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.volmit.adapt.util.AdvancementUtils;
import com.volmit.adapt.api.world.AdaptPlayer;

import com.volmit.adapt.util.CustomModel;
import lombok.Builder;
import lombok.Data;
import org.bukkit.Material;
Expand All @@ -33,6 +34,8 @@ public class AdvancementNotification implements Notification {
@Builder.Default
private final Material icon = Material.DIAMOND;
@Builder.Default
private final CustomModel model = null;
@Builder.Default
private final String title = " ";
@Builder.Default
private final String description = " ";
Expand All @@ -54,7 +57,8 @@ public String getGroup() {
@Override
public void play(AdaptPlayer p) {
if (p.getPlayer() != null) {
AdvancementUtils.displayToast(p.getPlayer(), new ItemStack(icon), title, description, frameType);
var icon = getModel() != null ? getModel().toItemStack() : new ItemStack(getIcon());
AdvancementUtils.displayToast(p.getPlayer(), icon, title, description, frameType);
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/volmit/adapt/api/skill/SimpleSkill.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected boolean shouldReturnForPlayer(Player p) {
return true;
}
Adapt.verbose("Checking " + p.getName() + " for " + getName());
return !this.isEnabled() || hasBlacklistPermission(p, this) || isWorldBlacklisted(p) || isInCreativeOrSpectator(p);
return !this.isEnabled() || hasBlacklistPermission(p, this) || isWorldBlacklisted(p) || isInCreativeOrSpectator(p) || getPlayer(p) == null;
} catch (Exception ignored) {
return true;
}
Expand Down Expand Up @@ -197,7 +197,7 @@ protected void shouldReturnForPlayer(Player p, Cancellable c, Runnable r) {
}
}

protected boolean shouldReturnForWorld(World world, Skill skill) {
protected boolean shouldReturnForWorld(World world, Skill<?> skill) {
try {
return !skill.isEnabled() || AdaptConfig.get().blacklistedWorlds.contains(world.getName());
} catch (Exception ignored) {
Expand Down Expand Up @@ -237,6 +237,7 @@ public AdaptAdvancement buildAdvancements() {
.title(displayName)
.description(getDescription())
.icon(getIcon())
.model(getModel())
.children(a)
.visibility(AdvancementVisibility.HIDDEN)
.build();
Expand Down
Loading