diff --git a/src/main/java/pers/xanadu/enderdragon/command/MainCommand.java b/src/main/java/pers/xanadu/enderdragon/command/MainCommand.java index 9846a7f..ad42a45 100644 --- a/src/main/java/pers/xanadu/enderdragon/command/MainCommand.java +++ b/src/main/java/pers/xanadu/enderdragon/command/MainCommand.java @@ -30,20 +30,20 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command return false; } switch(args[0].toLowerCase()){ - case "parse" : { - if(!sender.isOp()) return false; - if(args.length == 2) GroovyManager.invoke("test.groovy", args[1]); - else if(args.length == 3) GroovyManager.invoke("test.groovy",args[1],Bukkit.getPlayer(args[2])); -// List entities = p.getNearbyEntities(50,50,50); -// entities.forEach(entity -> { -// if(entity instanceof org.bukkit.entity.EnderDragon){ -// org.bukkit.entity.EnderDragon dragon = (org.bukkit.entity.EnderDragon) entity; -// //dragon.setPhase(CHARGE_PLAYER); -// //SkillManager.launchDragonFireball(dragon,p.getLocation()); -// SkillManager.callEnderManReinforce(p,3); -// } -// -// +// case "parse" : { +// if(!sender.isOp()) return false; +// if(args.length == 2) GroovyManager.invoke("test.groovy", args[1]); +// else if(args.length == 3) GroovyManager.invoke("test.groovy",args[1],Bukkit.getPlayer(args[2])); +//// List entities = p.getNearbyEntities(50,50,50); +//// entities.forEach(entity -> { +//// if(entity instanceof org.bukkit.entity.EnderDragon){ +//// org.bukkit.entity.EnderDragon dragon = (org.bukkit.entity.EnderDragon) entity; +//// //dragon.setPhase(CHARGE_PLAYER); +//// //SkillManager.launchDragonFireball(dragon,p.getLocation()); +//// SkillManager.callEnderManReinforce(p,3); +//// } +//// +//// //// if(entity instanceof org.bukkit.entity.EnderDragon){ //// Bukkit.broadcastMessage(entity.getName());//1 Special Ender Dragon //// } @@ -53,10 +53,10 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command //// if(entity instanceof ComplexLivingEntity){ //// Bukkit.broadcastMessage(entity.getName());//8 EnderDragon //// } -// }); - - return true; - } +//// }); +// +// return true; +// } case "action" : { if(!sender.isOp()){ Lang.sendFeedback(sender,Lang.command_no_permission); diff --git a/src/main/java/pers/xanadu/enderdragon/config/FileUpdater.java b/src/main/java/pers/xanadu/enderdragon/config/FileUpdater.java index 09dc1e7..3bca5d5 100644 --- a/src/main/java/pers/xanadu/enderdragon/config/FileUpdater.java +++ b/src/main/java/pers/xanadu/enderdragon/config/FileUpdater.java @@ -2,7 +2,6 @@ import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; -import pers.xanadu.enderdragon.EnderDragon; import java.io.*; @@ -10,9 +9,9 @@ public class FileUpdater { public static void update() throws IOException { - String respawn_world_name = null; + FileConfiguration config_old = plugin.getConfig(); - if("2.1.0".equals(config_old.getString("version"))){ + if("2.2.0".equals(config_old.getString("version"))){ Config.saveResource("config.yml","new/config.yml",true); File config_new_F = new File(plugin.getDataFolder(),"new/config.yml"); FileConfiguration config_new = YamlConfiguration.loadConfiguration(config_new_F); @@ -24,111 +23,26 @@ public static void update() throws IOException { config_new.set("special_dragon_jude_mode",judge_mode); config_new.set("dragon_setting_file",config_old.getStringList("dragon_setting_file")); // auto_respawn - config_new.set("auto_respawn.task1.enable",config_old.getBoolean("auto_respawn.enable")); - respawn_world_name = config_old.getString("auto_respawn.world_the_end_name"); - config_new.set("auto_respawn.task1.world_name",respawn_world_name); - config_new.set("auto_respawn.task1.respawn_time",config_old.getString("auto_respawn.respawn_time")); - config_new.set("crystal_invulnerable",config_old.getBoolean("auto_respawn.invulnerable")); + config_new.set("auto_respawn",config_old.getConfigurationSection("auto_respawn")); config_new.set("respawn_cd.enable",config_old.getBoolean("respawn_cd.enable")); + config_new.set("crystal_invulnerable",config_old.getBoolean("crystal_invulnerable")); config_new.set("resist_player_respawn",config_old.getBoolean("resist_player_respawn")); config_new.set("resist_dragon_breath_gather",config_old.getBoolean("resist_dragon_breath_gather")); config_new.set("main_gui",config_old.getString("main_gui")); config_new.set("blacklist_worlds",config_old.getStringList("blacklist_worlds")); - //item_format.data -> item_format.reward - config_new.set("item_format.reward",config_old.getString("item_format.data")); - + config_new.set("item_format.reward",config_old.getString("item_format.reward")); config_new.set("hook_plugins.MythicLib",config_old.getBoolean("hook_plugins.MythicLib")); + config_new.set("expansion.groovy",config_old.getBoolean("expansion.groovy")); config_new.set("debug",config_old.getBoolean("debug")); config_new.set("advanced_setting.world_env_fix",config_old.getBoolean("advanced_setting.world_env_fix")); config_new.set("advanced_setting.save_respawn_status",config_old.getBoolean("advanced_setting.save_respawn_status")); + config_new.set("save_bossbar",config_old.getBoolean("save_bossbar")); + config_new.set("backslash_split.reward",config_old.getBoolean("backslash_split.reward")); config_new.save(config_new_F); } else Lang.error("The version of config.yml is not supported!"); - File folder = new File(plugin.getDataFolder(),"setting"); - if(folder.exists()){ - File[] files = folder.listFiles(); - if(files != null){ - for(File file : files){ - FileConfiguration config = YamlConfiguration.loadConfiguration(file); - String ver = config.getString("version"); - if(!"2.1.0".equals(ver)) { - Lang.error("The version of setting/"+file.getName()+" is not supported!"); - continue; - } - String name = file.getName(); - Config.copyFile("setting/"+name,"new/setting/"+name,true); - } - File new_folder = new File(plugin.getDataFolder(),"new/setting/"); - files = new_folder.listFiles(); - if(files != null){ - for(File file : files){ - FileOutputStream out = new FileOutputStream(file,true); - out.write(("\n\n" + - "# the least interval time between injuries (unit:tick, 1tick=0.05s)\n" + - "# only supports integer value\n" + - "no_damage_tick: 10\n" + - "\n" + - "attack:\n" + - " #the damage modify when this dragon attacks player with body or limb (allow double and negative value)\n" + - " damage_modify: 0\n" + - "\n" + - " #the effect give to player when this ender dragon attacks player with body or limb\n" + - " #the format is the same as effect_cloud.potion\n" + - " potion_effect:\n" + - " - ''\n" + - " - ''\n" + - " - ''\n" + - "\n" + - " # the effect give to player when this ender dragon attacks player with body or limb\n" + - " # format: (: seconds)\n" + - " extra_effect:\n" + - " fire: 0\n" + - " # \"freeze\" can only be used in server greater than or equal to version 1.17\n" + - " freeze: 0\n" + - "\n" - ).getBytes()); - out.close(); - FileConfiguration fc = YamlConfiguration.loadConfiguration(file); - fc.set("version","2.2.0"); - fc.set("attack.damage_modify",fc.getDouble("attack_damage_modify")); - fc.set("attack_damage_modify",null); - fc.get("attack.potion_effect",fc.getStringList("attack_potion_effect")); - fc.set("attack_potion_effect",null); - fc.save(file); - } - } - } - } - String lang_name = config_old.getString("lang","English") + ".yml"; - FileConfiguration lang_old = lang; - if("2.1.0".equals(lang_old.getString("version"))){ - Config.saveResource("lang/"+lang_name,"new/lang/"+lang_name,true); - File lang_new_F = new File(plugin.getDataFolder(),"new/lang/"+lang_name); - FileConfiguration lang_new = YamlConfiguration.loadConfiguration(lang_new_F); - lang_old.getKeys(true).forEach(key->{ - Object obj = lang_old.get(key); - lang_new.set(key,obj); - }); - lang_new.set("version","2.2.0"); - lang_new.save(lang_new_F); - } - else Lang.error("The version of "+lang_name+" is not supported!"); - FileConfiguration data_old = EnderDragon.data; - if("2.1.0".equals(data_old.getString("version"))){ - Config.copyFile("data.yml","new/data.yml",true); - File new_data_file = new File(plugin.getDataFolder(),"new/data.yml"); - FileConfiguration new_data = YamlConfiguration.loadConfiguration(new_data_file); - String next_time = new_data.getString("auto_respawn.next_respawn_time"); - new_data.set("version","2.2.0"); - if(next_time!=null && respawn_world_name!=null){ - new_data.set("auto_respawn.task1.world_name",respawn_world_name); - new_data.set("auto_respawn.task1.next_respawn_time",next_time); - } - new_data.save(new_data_file); - } - else Lang.error("The version of data.yml is not supported!"); Lang.info("New config files are generated in plugins/EnderDragon/new."); Lang.warn("Attention: Please confirm the accuracy before using new config!"); } diff --git a/src/main/java/pers/xanadu/enderdragon/event/DragonDamageByPlayerEvent.java b/src/main/java/pers/xanadu/enderdragon/event/DragonDamageByPlayerEvent.java index 9d53ec3..b3e60df 100644 --- a/src/main/java/pers/xanadu/enderdragon/event/DragonDamageByPlayerEvent.java +++ b/src/main/java/pers/xanadu/enderdragon/event/DragonDamageByPlayerEvent.java @@ -4,20 +4,20 @@ import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.entity.EntityDamageByEntityEvent; - +/** + * Called when a dragon is damaged by a player, including block_explosion. + */ public final class DragonDamageByPlayerEvent extends EntityDamageByEntityEvent { private static final HandlerList handlers = new HandlerList(); private boolean cancel = false; private final Player damager; private final EnderDragon dragon; - private final DamageCause cause; private final double finalDamage; public DragonDamageByPlayerEvent(final Player damager, final EnderDragon dragon, final DamageCause cause, final double finalDamage) { super(damager, dragon, cause, finalDamage); this.damager = damager; this.dragon = dragon; - this.cause = cause; this.finalDamage = finalDamage; } @@ -29,15 +29,15 @@ public static HandlerList getHandlerList() { public HandlerList getHandlers() { return handlers; } - + @Override public void setCancelled(final boolean cancel) { this.cancel = cancel; } - + @Override public boolean isCancelled() { return cancel; } - + @Override public Player getDamager() { return damager; } @@ -46,9 +46,6 @@ public EnderDragon getDragon() { return dragon; } - public DamageCause getDamagerCause() { - return cause; - } @Override public double getDamage() { return finalDamage; diff --git a/src/main/java/pers/xanadu/enderdragon/event/DragonRespawnEvent.java b/src/main/java/pers/xanadu/enderdragon/event/DragonRespawnPostEvent.java similarity index 81% rename from src/main/java/pers/xanadu/enderdragon/event/DragonRespawnEvent.java rename to src/main/java/pers/xanadu/enderdragon/event/DragonRespawnPostEvent.java index 022bd63..bae8264 100644 --- a/src/main/java/pers/xanadu/enderdragon/event/DragonRespawnEvent.java +++ b/src/main/java/pers/xanadu/enderdragon/event/DragonRespawnPostEvent.java @@ -7,13 +7,17 @@ import org.bukkit.event.entity.CreatureSpawnEvent; import pers.xanadu.enderdragon.manager.DragonManager; import pers.xanadu.enderdragon.util.MyDragon; - -public final class DragonRespawnEvent extends CreatureSpawnEvent { +/** + * Called when a dragon is spawned, filtered through blacklist. + *

+ * Cancelling this event make no changes. + */ +public final class DragonRespawnPostEvent extends CreatureSpawnEvent { private static final HandlerList handlers = new HandlerList(); private boolean cancel = false; private final World world; private final MyDragon myDragon; - public DragonRespawnEvent(final EnderDragon dragon,final SpawnReason reason,final MyDragon myDragon) { + public DragonRespawnPostEvent(final EnderDragon dragon, final SpawnReason reason, final MyDragon myDragon) { super(dragon,reason); world = dragon.getWorld(); this.myDragon = myDragon; diff --git a/src/main/java/pers/xanadu/enderdragon/listener/DragonBaseHurtListener.java b/src/main/java/pers/xanadu/enderdragon/listener/DragonBaseHurtListener.java index 50e7289..3fbd345 100644 --- a/src/main/java/pers/xanadu/enderdragon/listener/DragonBaseHurtListener.java +++ b/src/main/java/pers/xanadu/enderdragon/listener/DragonBaseHurtListener.java @@ -20,13 +20,17 @@ public void BaseAttackToDragon(EntityDamageByEntityEvent e){ EnderDragon dragon = (EnderDragon) victim; if(entity instanceof Player){ Player player = (Player) entity; - pm.callEvent(new DragonDamageByPlayerEvent(player,dragon,e.getCause(),e.getFinalDamage())); + DragonDamageByPlayerEvent event = new DragonDamageByPlayerEvent(player,dragon,e.getCause(),e.getFinalDamage()); + pm.callEvent(event); + if(event.isCancelled()) e.setCancelled(true); } else if(entity instanceof Projectile){ Projectile projectile = (Projectile) entity; if(!(projectile.getShooter() instanceof Player)) return; Player damager = (Player) projectile.getShooter(); - pm.callEvent(new DragonDamageByPlayerEvent(damager,dragon,e.getCause(),e.getFinalDamage())); + DragonDamageByPlayerEvent event = new DragonDamageByPlayerEvent(damager,dragon,e.getCause(),e.getFinalDamage()); + pm.callEvent(event); + if(event.isCancelled()) e.setCancelled(true); } } } diff --git a/src/main/java/pers/xanadu/enderdragon/listener/DragonDamageByPlayerListener.java b/src/main/java/pers/xanadu/enderdragon/listener/DragonDamageByPlayerListener.java index c84fe1b..e293383 100644 --- a/src/main/java/pers/xanadu/enderdragon/listener/DragonDamageByPlayerListener.java +++ b/src/main/java/pers/xanadu/enderdragon/listener/DragonDamageByPlayerListener.java @@ -19,6 +19,7 @@ public class DragonDamageByPlayerListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST) public void OnDragonDamageByPlayer(final DragonDamageByPlayerEvent e){ + if(e.isCancelled()) return; Player p = e.getDamager(); EnderDragon dragon = e.getDragon(); double health = dragon.getHealth(); diff --git a/src/main/java/pers/xanadu/enderdragon/listener/DragonExplosionHurtListener.java b/src/main/java/pers/xanadu/enderdragon/listener/DragonExplosionHurtListener.java index b68d63b..ef74694 100644 --- a/src/main/java/pers/xanadu/enderdragon/listener/DragonExplosionHurtListener.java +++ b/src/main/java/pers/xanadu/enderdragon/listener/DragonExplosionHurtListener.java @@ -39,7 +39,9 @@ public void OnDragonDamageByTNT(final EntityDamageByEntityEvent e){ TNTPrimed tnt = (TNTPrimed) entity; if(!(tnt.getSource() instanceof Player)) return; Player damager = (Player) tnt.getSource(); - pers.xanadu.enderdragon.EnderDragon.pm.callEvent(new DragonDamageByPlayerEvent(damager,dragon,e.getCause(),e.getFinalDamage())); + DragonDamageByPlayerEvent event = new DragonDamageByPlayerEvent(damager,dragon,e.getCause(),e.getFinalDamage()); + pm.callEvent(event); + if(event.isCancelled()) e.setCancelled(true); } } } @@ -54,16 +56,15 @@ public void OnDragonDamageByExplode(final EntityDamageByBlockEvent e){ if(e.getCause() != EntityDamageEvent.DamageCause.BLOCK_EXPLOSION) return; Entity entity = e.getEntity(); if(entity instanceof EnderDragon){ - //Bukkit.broadcastMessage(e.getFinalDamage()+"awa"); EnderDragon dragon = (EnderDragon) entity; for(UUID uuid : mp.keySet()){ PlayerExplodeDragonEvent ped = mp.get(uuid); if(ped == null) continue; if(ped.getTime() != time) continue; if(ped.getEnderDragon().getUniqueId() != dragon.getUniqueId()) continue; - //mp.remove(uuid); - pm.callEvent(new DragonDamageByPlayerEvent(ped.getPlayer(),dragon,cause,e.getFinalDamage())); - //Bukkit.broadcastMessage("final: "+e.getFinalDamage()); + DragonDamageByPlayerEvent event = new DragonDamageByPlayerEvent(ped.getPlayer(),dragon,cause,e.getFinalDamage()); + pm.callEvent(event); + if(event.isCancelled()) e.setCancelled(true); break; } } @@ -82,7 +83,6 @@ public void OnPlayerClickBed(final PlayerBedEnterEvent e){ } } - public static void clearUID(final UUID uuid){ mp.remove(uuid); } diff --git a/src/main/java/pers/xanadu/enderdragon/listener/DragonSpawnListener.java b/src/main/java/pers/xanadu/enderdragon/listener/DragonSpawnListener.java index ca7630e..2ca58af 100644 --- a/src/main/java/pers/xanadu/enderdragon/listener/DragonSpawnListener.java +++ b/src/main/java/pers/xanadu/enderdragon/listener/DragonSpawnListener.java @@ -12,11 +12,12 @@ import org.bukkit.event.entity.CreatureSpawnEvent; import pers.xanadu.enderdragon.config.Config; import pers.xanadu.enderdragon.config.Lang; -import pers.xanadu.enderdragon.event.DragonRespawnEvent; +import pers.xanadu.enderdragon.event.DragonRespawnPostEvent; import pers.xanadu.enderdragon.manager.DamageManager; import pers.xanadu.enderdragon.util.MyDragon; import pers.xanadu.enderdragon.util.Version; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; import static pers.xanadu.enderdragon.EnderDragon.*; @@ -72,7 +73,10 @@ public void OnDragonSpawn(final CreatureSpawnEvent e){ else if(Version.mcMainVersion >= 12){ getInstance().getBossBarManager().setBossBar(dragon.getWorld(),myDragon.display_name,bossBar_color,bossBar_style); } - Bukkit.getPluginManager().callEvent(new DragonRespawnEvent(dragon,e.getSpawnReason(),myDragon)); + Bukkit.getPluginManager().callEvent(new DragonRespawnPostEvent(dragon,e.getSpawnReason(),myDragon)); + if(Config.advanced_setting_save_bossbar){ + getInstance().getBossBarManager().saveBossBarData(Collections.singletonList(dragon.getWorld())); + } } } diff --git a/src/main/java/pers/xanadu/enderdragon/listener/mythiclib/PlayerAttackListener.java b/src/main/java/pers/xanadu/enderdragon/listener/mythiclib/PlayerAttackListener.java index f532c66..efc2175 100644 --- a/src/main/java/pers/xanadu/enderdragon/listener/mythiclib/PlayerAttackListener.java +++ b/src/main/java/pers/xanadu/enderdragon/listener/mythiclib/PlayerAttackListener.java @@ -21,6 +21,7 @@ public void onPlayerAttack(final PlayerAttackEvent e){ if(final_damage > 0.0d){ DragonDamageByPlayerEvent event = new DragonDamageByPlayerEvent(e.getAttacker().getPlayer(),dragon, e.toBukkit().getCause(), final_damage); pm.callEvent(event); + if(event.isCancelled()) e.setCancelled(true); } } diff --git a/src/main/java/pers/xanadu/enderdragon/script/Events.java b/src/main/java/pers/xanadu/enderdragon/script/Events.java index 4b47847..7df60f2 100644 --- a/src/main/java/pers/xanadu/enderdragon/script/Events.java +++ b/src/main/java/pers/xanadu/enderdragon/script/Events.java @@ -70,9 +70,6 @@ public static Events register(Class clazz, EventPriority GroovyManager.event_set.add(tmp); return tmp; } -// private static void register(Class clazz, Events event, EventPriority priority, boolean ignoreCancelled) { -// Bukkit.getPluginManager().registerEvent(clazz,event,priority,event,plugin,ignoreCancelled); -// } @Override public void execute(@NotNull Listener listener, @NotNull Event event) { diff --git a/src/main/java/pers/xanadu/enderdragon/util/ColorUtil.java b/src/main/java/pers/xanadu/enderdragon/util/ColorUtil.java index 1cbb5b7..768d70f 100644 --- a/src/main/java/pers/xanadu/enderdragon/util/ColorUtil.java +++ b/src/main/java/pers/xanadu/enderdragon/util/ColorUtil.java @@ -49,8 +49,8 @@ private static String transGradient(String str) { } private static int[] gradient(String start,String end,int length){ int[] color = new int[length]; - int[] rgb1 = MathUtil.hexToInt(start); - int[] rgb2 = MathUtil.hexToInt(end); + int[] rgb1 = MathUtil.hex2Int(start); + int[] rgb2 = MathUtil.hex2Int(end); if(length==0){return color;} if(length==1){ for(int j=0;j<3;j++){ diff --git a/src/main/java/pers/xanadu/enderdragon/util/MathUtil.java b/src/main/java/pers/xanadu/enderdragon/util/MathUtil.java index ccb4dd5..311d34c 100644 --- a/src/main/java/pers/xanadu/enderdragon/util/MathUtil.java +++ b/src/main/java/pers/xanadu/enderdragon/util/MathUtil.java @@ -28,7 +28,7 @@ public static double div(double d1,double d2,int len){ BigDecimal b2 = new BigDecimal(d2); return b1.divide(b2,len, RoundingMode.HALF_UP).doubleValue(); } - public static int[] hexToInt(final String hex){ + public static int[] hex2Int(final String hex){ int[] result = new int[3]; String s1 = hex.substring(0,2); String s2 = hex.substring(2,4); @@ -38,11 +38,11 @@ public static int[] hexToInt(final String hex){ result[2] = Integer.parseInt(s3,16); return result; } - public static String locationToString(final Location loc){ + public static String location2String(final Location loc){ if (loc.getWorld() == null) return ""; return loc.getWorld().getName()+";"+loc.getX()+";"+loc.getY()+";"+loc.getZ(); } - public static Location stringToLocation(final String str){ + public static Location string2Location(final String str){ final String[] parts = str.split(";"); if(parts.length != 4) return null; final World world = Bukkit.getWorld(parts[0]); diff --git a/src/main/java/pers/xanadu/enderdragon/util/UpdateChecker.java b/src/main/java/pers/xanadu/enderdragon/util/UpdateChecker.java index 75c45ed..26afbf0 100644 --- a/src/main/java/pers/xanadu/enderdragon/util/UpdateChecker.java +++ b/src/main/java/pers/xanadu/enderdragon/util/UpdateChecker.java @@ -12,7 +12,7 @@ import java.net.URL; import java.net.URLConnection; -public class UpdateChecker { +public final class UpdateChecker { public static void checkUpdate(){ Lang.info(Lang.plugin_checking_update); new BukkitRunnable(){ diff --git a/src/main/resources/config-zhcn.yml b/src/main/resources/config-zhcn.yml index 84bb378..8f741ff 100644 --- a/src/main/resources/config-zhcn.yml +++ b/src/main/resources/config-zhcn.yml @@ -67,8 +67,11 @@ blacklist_worlds: - 'world' - 'world_nether' -#生成原因包含在这里的末影龙不被插件监听 -#举例: COMMAND,CUSTOM,DEFAULT +#由以下原因生成的末影龙不被插件监听 +#常用选项:COMMAND(原版summon指令生成),CUSTOM(别的插件生成的),DEFAULT(自然生成,包括玩家放置水晶复活的) +#你可以在这里找到所有生成原因: +#https://bukkit.windit.net/javadoc/org/bukkit/event/entity/CreatureSpawnEvent.SpawnReason.html +#写法示例: [COMMAND,CUSTOM] blacklist_spawn_reason: [] #可选: [default/nbt/advanced] diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 5fb56b3..0ad3a95 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -66,8 +66,11 @@ blacklist_worlds: - 'world' - 'world_nether' -#ender_dragon with these spawn reason will be ignored by this plugin. -#example: COMMAND,CUSTOM,DEFAULT +# Ender_dragon spawns with these reasons will be ignored by this plugin. +# common options: COMMAND(spawn with /summon), CUSTOM(generate by other plugins), DEFAULT(by nature, including end_crystal) +# You can find all spawn reasons here: +# https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/CreatureSpawnEvent.SpawnReason.html +# example: [COMMAND,CUSTOM] blacklist_spawn_reason: [] #optional: [default/nbt/advanced] diff --git a/src/main/resources/expansion/groovy/test.groovy b/src/main/resources/expansion/groovy/test.groovy index a351bf1..8102bfe 100644 --- a/src/main/resources/expansion/groovy/test.groovy +++ b/src/main/resources/expansion/groovy/test.groovy @@ -1,16 +1,19 @@ package expansion.groovy +import groovy.transform.Field import org.bukkit.Bukkit -import pers.xanadu.enderdragon.config.Lang + +import static pers.xanadu.enderdragon.EnderDragon.plugin + +@Field static def x=5 static void enable(){ -// Lang.info("I am a test script written in groovy.") + //Bukkit.getLogger().info("static variable test: x="+x) + } -static void test(){ - Bukkit.broadcastMessage("you runs test()") -} +