update naar UltimateKingdom 1.10
This commit is contained in:
parent
c27aeb1c48
commit
3f1cc262d9
|
@ -21,7 +21,7 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
compileOnly "org.spigotmc:spigot:1.8-R0.1-SNAPSHOT"
|
||||
compileOnly 'me.map:ultimatekingdom:ALPHA-1.7.37'
|
||||
compileOnly 'me.map:ultimatekingdom:1.10.0-BETA'
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -8,8 +8,7 @@ import me.map.ultimatekingdom.API.UltimateKingdom;
|
|||
|
||||
import me.map.ultimatekingdom.API.objects.Kingdom;
|
||||
import me.map.ultimatekingdom.API.objects.KingdomPlayer;
|
||||
import me.map.ultimatekingdom.API.settings.BooleanSetting;
|
||||
import me.map.ultimatekingdom.API.settings.SettingsType;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
@ -20,11 +19,7 @@ import java.util.UUID;
|
|||
|
||||
public class Example extends JavaPlugin {
|
||||
|
||||
//String unique name, String displayname, Settingstype settingstype, Boolean protected, Boolean owncommand, Boolean HidefromInfo
|
||||
public static BooleanSetting newsetting = new BooleanSetting("UniqueName","displayname", SettingsType.KINGDOM,true,false,false);
|
||||
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
HandlerList.unregisterAll(this);
|
||||
}
|
||||
|
@ -46,25 +41,15 @@ public class Example extends JavaPlugin {
|
|||
new TestCommand(); // of als er geen register() in commando is -> new TestCommand().register();
|
||||
|
||||
//vertaling toevoegen
|
||||
UltimateKingdom.getKingdomServer().Message().addTranslations("test_command" ,"^&adit is kingdom: &f{0} &aen player ^&f{1}");
|
||||
UltimateKingdom.getKingdomServer().Messages().addTranslations("test_command" ,"^&adit is kingdom: &f{0} &aen player ^&f{1}");
|
||||
|
||||
//vertaling ophalen/gebruiken
|
||||
String string = UltimateKingdom.translate("test_command",kingdom.getDisplayName(),kingdomPlayer.getDisplayName());
|
||||
String string = UltimateKingdom.translate("test_command",kingdom.getDisplayName(),kingdomPlayer.getName());
|
||||
|
||||
//register placeholder zodat deze door de hele plugin gebruikt kan worden.
|
||||
UltimateKingdom.getKingdomServer().PlaceHolders().PlayerPlaceHolders().register(new OwnPlaceHolder());
|
||||
|
||||
//registeren van een true/false setting voor kingdom
|
||||
try {
|
||||
kingdom.setSetting(Example.newsetting.setValue(true));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//ophalen setting
|
||||
if (kingdom.hasSetting(Example.newsetting)) {
|
||||
Boolean true_false = ((BooleanSetting) kingdom.getSetting(Example.newsetting)).getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package me.map.example.listener;
|
||||
|
||||
|
||||
import me.map.ultimatekingdom.gameplay.KingdomAction;
|
||||
|
||||
import me.map.ultimatekingdom.gameplay.events.actions.KingdomBuildEvent;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
@ -14,5 +14,4 @@ public class Luisteraar implements Listener {
|
|||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package me.map.example;
|
||||
import me.map.ultimatekingdom.API.objects.Kingdom;
|
||||
import me.map.ultimatekingdom.Shared.metadata.*;
|
||||
import me.map.ultimatekingdom.API.objects.metadata.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -81,7 +81,7 @@ public class metadata {
|
|||
//remove all values
|
||||
kingdom.removeMetaData(myMetaData,(result) ->{
|
||||
if (result.isOk()) {
|
||||
|
||||
//do somehting
|
||||
} else {
|
||||
System.err.println(result.toString());
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package me.map.example.placeholder;
|
||||
|
||||
import me.map.ultimatekingdom.API.expansion.PlayerPlaceHolderExpansion;
|
||||
|
||||
|
||||
import me.map.ultimatekingdom.API.objects.KingdomPlayer;
|
||||
import me.map.ultimatekingdom.API.placeholders.PlayerPlaceHolderExpansion;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class OwnPlaceHolder extends PlayerPlaceHolderExpansion {
|
||||
|
|
Loading…
Reference in New Issue
Block a user