Skip to content

Commit

Permalink
v1.17.0-ALPHA
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoMorin committed Jul 14, 2024
1 parent ba67389 commit 6f8501b
Show file tree
Hide file tree
Showing 508 changed files with 9,655 additions and 3,526 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
*
**/build
ChangeLog.md
CONTRIBUTING.md
TODO.md
buildSrc/src/main/java/org/kingdoms/gradle/publisher/impl/SpigotPublisher.kt

buildSrc/
local/secrets.yml
local/spigotmc.har
local/logs

core/src/main/resources/evaluator.dll
core/src/main/resources/cachASCII-16.yml
Expand Down Expand Up @@ -44,3 +41,5 @@ core/src/test/java/PrivateVault.java

!shared/
!shared/**

**/build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# KingdomsX

[![Spigot Version](https://img.shields.io/badge/Spigot-1.19-dark_green.svg)](https://shields.io/)
[![Spigot Version](https://img.shields.io/badge/Spigot-1.21-dark_green.svg)](https://shields.io/)
[![Crowdin](https://badges.crowdin.net/kingdomsx/localized.svg)](https://crowdin.com/project/kingdomsx)
[![CodeFactor](https://www.codefactor.io/repository/github/cryptomorin/kingdomsx/badge/master)](https://www.codefactor.io/repository/github/cryptomorin/kingdomsx/overview/master)
[![Discord](https://discordapp.com/api/guilds/429132410748141579/widget.png?style=shield)](https://discord.gg/cKsSwtt)
Expand Down
Binary file not shown.
Binary file removed addons/Kingdoms-Addon-Outposts-3.0.1.6.2.jar
Binary file not shown.
Binary file added addons/Kingdoms-Addon-Outposts-3.0.1.6.3.jar
Binary file not shown.
Binary file removed addons/Kingdoms-Addon-Peace-Treaties-1.2.6.0.2.jar
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions addons/addon-meta-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ peace-treaties:
version: '<peace-treaties-version>'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Peace-Treaties-<peace-treaties-version>.jar?raw=true'
supported-core-version: 1.16.20.1

enginehub:
version: '<enginehub-version>'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-EngineHub-<enginehub-version>.jar?raw=true'
supported-core-version: 1.17.0-ALHPA

20 changes: 11 additions & 9 deletions addons/addon-meta.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
outposts:
version: '3.0.1.6.2'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Outposts-3.0.1.6.2.jar?raw=true'
version: '3.0.1.6.3'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Outposts-3.0.1.6.3.jar?raw=true'
supported-core-version: 1.16.20.1

map-viewers:
version: '2.1.0.1'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Map-Viewers-2.1.0.1.jar?raw=true'
version: '2.1.0.2'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Map-Viewers-2.1.0.2.jar?raw=true'
supported-core-version: 1.16.20.1

peace-treaties:
version: '1.2.6.0.2'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Peace-Treaties-1.2.6.0.2.jar?raw=true'
supported-core-version: 1.16.20.1
version: '1.2.6.0.3'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-Peace-Treaties-1.2.6.0.3.jar?raw=true'
supported-core-version: 1.16.20.1
enginehub:
version: '1.0.0'
url: 'https://github.com/CryptoMorin/KingdomsX/blob/master/addons/Kingdoms-Addon-EngineHub-1.0.0.jar?raw=true'
supported-core-version: 1.17.0-ALHPA
2 changes: 1 addition & 1 deletion core/service/authentication/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ repositories {

dependencies {
compileOnly(project(":core:service"))
compileOnly("fr.xephi:authme:5.6.0-SNAPSHOT") { isTransitive = false } // https://github.com/AuthMe/AuthMeReloaded
compileOnly("fr.xephi:authme:5.7.0-SNAPSHOT") { isTransitive = false } // https://github.com/AuthMe/AuthMeReloaded
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public Entity spawnMythicMob(Location location, String mob, int level) {
}

@Override
public boolean isAvailable() {
public Throwable checkAvailability() {
try {
MythicMobs.inst().getAPIHelper();
return true;
return null;
} catch (Throwable ex) {
return false;
return ex;
}
}
}
2 changes: 1 addition & 1 deletion core/service/mythicmobs/v5/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ dependencies {
compileOnly(project(":core:service"))
compileOnly(project(":core:service:mythicmobs"))
compileOnly(
localDependency("MythicMobs-5.1.0.jar")
localDependency("MythicMobs-5.6.2.jar")
) // They didn't upload v5.0.0 to the repo
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public Entity spawnMythicMob(Location location, String mob, int level) {
}

@Override
public boolean isAvailable() {
public Throwable checkAvailability() {
try {
MythicProvider.get().getMobManager();
return true;
return null;
} catch (Throwable ex) {
return false;
return ex;
}
}

Expand Down
22 changes: 22 additions & 0 deletions core/service/nova/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
plugins {
commons
spigot
}

group = "org.kingdoms.services"
version = "unspecified"

repositories {
maven("https://repo.xenondevs.xyz/releases")
}

dependencies {
compileOnly(project(":core:service"))
compileOnly(project(":platform:bukkit"))
compileOnly(project(":shared"))

// https://xenondevs.xyz/docs/nova/api/
// https://repo.xenondevs.xyz/#/releases/xyz/xenondevs/nova/nova-api/
// What's "Nova-Api"?
compileOnly("xyz.xenondevs.nova:nova-api:0.16.1")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package org.kingdoms.services;

import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Entity;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.kingdoms.api.KingdomsAPI;
import org.kingdoms.api.KingdomsActionProcessor;
import org.kingdoms.platform.bukkit.adapters.BukkitAdapter;
import xyz.xenondevs.nova.api.Nova;
import xyz.xenondevs.nova.api.protection.ProtectionIntegration;

/**
* https://github.com/xenondevs/Nova
* https://github.com/xenondevs/Nova/tree/main/nova-hooks
*/
public final class ServiceNova implements Service, ProtectionIntegration {
private static final KingdomsActionProcessor API = KingdomsAPI.getApi().getActionProcessor();

@Override
public void enable() {
Nova.getNova().registerProtectionIntegration(this);
}

@Override
public boolean canBreak(@NotNull OfflinePlayer offlinePlayer, @Nullable ItemStack itemStack, @NotNull Location location) {
return API.canBreak(offlinePlayer, itemStack, BukkitAdapter.adapt(location));
}

@Override
public boolean canPlace(@NotNull OfflinePlayer offlinePlayer, @NotNull ItemStack itemStack, @NotNull Location location) {
return API.canPlace(offlinePlayer, itemStack, BukkitAdapter.adapt(location));
}

@Override
public boolean canUseBlock(@NotNull OfflinePlayer offlinePlayer, @Nullable ItemStack itemStack, @NotNull Location location) {
return API.canUseBlock(offlinePlayer, itemStack, BukkitAdapter.adapt(location));
}

@Override
public boolean canUseItem(@NotNull OfflinePlayer offlinePlayer, @NotNull ItemStack itemStack, @NotNull Location location) {
return API.canUseItem(offlinePlayer, itemStack, BukkitAdapter.adapt(location));
}

@Override
public boolean canInteractWithEntity(@NotNull OfflinePlayer offlinePlayer, @NotNull Entity entity, @Nullable ItemStack itemStack) {
return API.canInteractWithEntity(offlinePlayer, entity, itemStack);
}

@Override
public boolean canHurtEntity(@NotNull OfflinePlayer offlinePlayer, @NotNull Entity entity, @Nullable ItemStack itemStack) {
return true;
}
}
18 changes: 12 additions & 6 deletions core/service/pets/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ repositories {

dependencies {
compileOnly(project(":core:service"))
compileOnly(
localDependency("MCPets-3.0.2.jar")
) // They don't have an official API.
compileOnly(
localDependency("MyPet-3.12-SNAPSHOT-B1727.jar")
) // Local https://wiki.mypet-plugin.de/hooks/hook-types

// They don't have an official API.
compileOnly(localDependency("MCPets-3.0.2.jar"))

// Local https://wiki.mypet-plugin.de/hooks/hook-types
compileOnly(localDependency("MyPet-3.12-SNAPSHOT-B1727.jar"))

// https://discord.com/channels/903053383475277844/1203319394499829770/1206931275060084767
// Not using NexEngine will result in compile errors: error: cannot access AbstractManager
// https://github.com/nulli0n/NexEngine-spigot/releases
compileOnly(localDependency("CombatPets-1.0.30.jar"))
compileOnly(localDependency("NexEngine-2.2.12-R2-Final.jar"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.kingdoms.services.pets;

import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import su.nightexpress.combatpets.api.pet.IPetHolder;
import su.nightexpress.combatpets.pet.PetManager;

public final class ServiceCombatPets implements ServicePet {
@Override
public PetInfo getPetInfo(Entity entity) {
if (!(entity instanceof LivingEntity)) return null;
IPetHolder pet = PetManager.getPet((LivingEntity) entity);
if (pet == null) return null;
return new PetInfo(pet.getOwner().getUniqueId(), true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import fr.nocsy.mcpets.data.Pet;
import org.bukkit.entity.Entity;

import java.util.UUID;

public final class ServiceMCPets implements ServicePet {
@Override
public UUID getOwner(Entity entity) {
public PetInfo getPetInfo(Entity entity) {
Pet pet = Pet.getFromEntity(entity);
return pet == null ? null : pet.getOwner();
if (pet == null) return null;
return new PetInfo(pet.getOwner(), !pet.isInvulnerable());
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.kingdoms.services.pets;

import de.Keyle.MyPet.api.entity.MyPet;
import de.Keyle.MyPet.api.entity.MyPetBukkitEntity;
import org.bukkit.entity.Entity;

import java.util.UUID;

public final class ServiceMyPet implements ServicePet {
@Override
public UUID getOwner(Entity entity) {
public PetInfo getPetInfo(Entity entity) {
if (entity instanceof MyPetBukkitEntity) {
return ((MyPetBukkitEntity) entity).getMyPet().getOwner().getPlayerUUID();
MyPet pet = ((MyPetBukkitEntity) entity).getMyPet();
return new PetInfo(pet.getOwner().getPlayerUUID(), true);
} else {
return null;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.kingdoms.services.pets

import org.bukkit.entity.Entity
import org.kingdoms.services.Service
import java.util.*

interface ServicePet : Service {
fun getPetInfo(entity: Entity): PetInfo?
}

class PetInfo(val owner: UUID?, @get:JvmName("canBeAttacked") val canBeAttacked: Boolean)
2 changes: 1 addition & 1 deletion core/service/skins-restorer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ repositories {

dependencies {
compileOnly(project(":core:service"))
compileOnly("net.skinsrestorer:skinsrestorer-api:14.2.8")
compileOnly("net.skinsrestorer:skinsrestorer-api:15.1.0")
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
package org.kingdoms.services;

import net.skinsrestorer.api.PlayerWrapper;
import net.skinsrestorer.api.SkinVariant;
import net.skinsrestorer.api.SkinsRestorerAPI;
import net.skinsrestorer.api.exception.SkinRequestException;
import net.skinsrestorer.api.property.IProperty;
import net.skinsrestorer.api.SkinsRestorer;
import net.skinsrestorer.api.SkinsRestorerProvider;
import net.skinsrestorer.api.exception.DataRequestException;
import net.skinsrestorer.api.exception.MineSkinException;
import net.skinsrestorer.api.property.SkinProperty;
import net.skinsrestorer.api.property.SkinVariant;
import net.skinsrestorer.api.storage.PlayerStorage;
import net.skinsrestorer.api.storage.SkinStorage;
import org.bukkit.entity.Player;

import java.util.Optional;

public final class ServiceSkins implements Service {
private static final SkinsRestorerAPI API = SkinsRestorerAPI.getApi();
private static final SkinsRestorer API = SkinsRestorerProvider.get();

public void changeSkin(Player player, SkinValueType type, String value) {
IProperty prop;
// Example plugin: https://github.com/SkinsRestorer/SkinsRestorerAPIExample/blob/main/src/main/java/net/skinsrestorer/apiexample/SkinsRestorerAPIExample.java
SkinProperty prop;
try {
if (type == SkinValueType.URL) prop = API.genSkinUrl(value, SkinVariant.CLASSIC);
else prop = API.getSkinData(value);
} catch (SkinRequestException e) {
throw new RuntimeException(e);
PlayerStorage playerStorage = API.getPlayerStorage();
Optional<SkinProperty> property = playerStorage.getSkinForPlayer(player.getUniqueId(), player.getName());

SkinStorage skinStorage = API.getSkinStorage();
if (type == SkinValueType.URL) {
prop = skinStorage.findOrCreateSkinData(value, SkinVariant.CLASSIC).get().getProperty();
} else prop = property.get();
} catch (DataRequestException | MineSkinException e) {
throw new RuntimeException("Error while attemptin gto change " + player + "'s skin to '" + value + "' value of " + type, e);
}
API.applySkin(new PlayerWrapper(player), prop);
API.getSkinApplier(Player.class).applySkin(player, prop);
}

public enum SkinValueType {
Expand Down
6 changes: 4 additions & 2 deletions core/service/src/main/java/org/kingdoms/services/Service.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package org.kingdoms.services;

public interface Service {
default boolean isAvailable() {
return true;
default Throwable checkAvailability() {
return null;
}

default String getServiceName() {return this.getClass().getSimpleName();}

default void enable() {}

default void disable() {}
Expand Down
9 changes: 5 additions & 4 deletions core/service/vanish/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ group = "org.kingdoms.services.vanish"
version = "2.0.0"

repositories {
maven("https://repo.essentialsx.net/snapshots/")
//maven("https://repo.essentialsx.net/snapshots/")
maven("https://repo.essentialsx.net/releases/")
}

dependencies {
compileOnly(project(":core:service"))

// https://repo.essentialsx.net/snapshots/net/essentialsx/EssentialsX
// https://repo.essentialsx.net/releases/net/essentialsx/EssentialsX
// https://repo.essentialsx.net/#/snapshots/net/essentialsx/EssentialsX
// https://repo.essentialsx.net/#/releases/net/essentialsx/EssentialsX
// https://jd-v2.essentialsx.net/
// https://github.com/EssentialsX/Essentials/
compileOnly("net.essentialsx:EssentialsX:2.20.0-SNAPSHOT") { isTransitive = false }
compileOnly("net.essentialsx:EssentialsX:2.20.1") { isTransitive = false }

// https://github.com/Zrips/CMI-API/releases
// https://www.zrips.net/cmi/api/
Expand Down
2 changes: 1 addition & 1 deletion core/service/vault/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ version = "1.0.0"

dependencies {
compileOnly(project(":core:service"))
compileOnly("com.github.MilkBowl:VaultAPI:1.7") { isTransitive = false }// https://github.com/MilkBowl/VaultAPI
compileOnly("com.github.MilkBowl:VaultAPI:1.7") { isTransitive = false } // https://github.com/MilkBowl/VaultAPI
}
Loading

0 comments on commit 6f8501b

Please sign in to comment.