+ Fixed issue with potion effects lagging the server
+ Fixed issue with potion effect types not being compatible in 1.8.8 or other versions
+ Fixed issue with PotionEffectConverter throwing NPE if input is null
+ General Project clean up
+ Fixed /boss new autospawn command not working
This commit is contained in:
Charles 2019-02-01 01:56:04 +08:00
parent ab697c73cd
commit 8a71c487f7
18 changed files with 111 additions and 40 deletions

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.massivecraft:FactionsOne:1.2.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/FactionsOne/1.2.1/FactionsOne-1.2.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/FactionsOne/1.2.1/FactionsOne-1.2.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/FactionsOne/1.2.1/FactionsOne-1.2.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.massivecraft.factions:FactionsUUID:1.6.9.5-U0.1.21">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/factions/FactionsUUID/1.6.9.5-U0.1.21/FactionsUUID-1.6.9.5-U0.1.21.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/factions/FactionsUUID/1.6.9.5-U0.1.21/FactionsUUID-1.6.9.5-U0.1.21-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/factions/FactionsUUID/1.6.9.5-U0.1.21/FactionsUUID-1.6.9.5-U0.1.21-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.massivecraft.factions:Factions:2.13.3-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/factions/Factions/2.13.3-SNAPSHOT/Factions-2.13.3-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/factions/Factions/2.13.3-SNAPSHOT/Factions-2.13.3-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/factions/Factions/2.13.3-SNAPSHOT/Factions-2.13.3-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.massivecraft.massivecore:MassiveCore:2.13.3.1-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/massivecore/MassiveCore/2.13.3.1-SNAPSHOT/MassiveCore-2.13.3.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/massivecore/MassiveCore/2.13.3.1-SNAPSHOT/MassiveCore-2.13.3.1-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/massivecore/MassiveCore/2.13.3.1-SNAPSHOT/MassiveCore-2.13.3.1-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +1,13 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: org.spigotmc:spigot:1.12.2"> <library name="Maven: com.spigotmc:spigot:1.12.2">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot/1.12.2/spigot-1.12.2.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/spigotmc/spigot/1.12.2/spigot-1.12.2.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot/1.12.2/spigot-1.12.2-javadoc.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/spigotmc/spigot/1.12.2/spigot-1.12.2-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot/1.12.2/spigot-1.12.2-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/spigotmc/spigot/1.12.2/spigot-1.12.2-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: net.milkbowl.vault:Vault:1.6.6">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/milkbowl/vault/Vault/1.6.6/Vault-1.6.6.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/net/milkbowl/vault/Vault/1.6.6/Vault-1.6.6-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/net/milkbowl/vault/Vault/1.6.6/Vault-1.6.6-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: net.redstoneore.legacyfactions:LegacyFactions:1.4.7">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/redstoneore/legacyfactions/LegacyFactions/1.4.7/LegacyFactions-1.4.7.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/net/redstoneore/legacyfactions/LegacyFactions/1.4.7/LegacyFactions-1.4.7-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/net/redstoneore/legacyfactions/LegacyFactions/1.4.7/LegacyFactions-1.4.7-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -21,15 +21,15 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.massivecraft</groupId> <groupId>com.massivecraft.factions</groupId>
<artifactId>Factions</artifactId> <artifactId>Factions</artifactId>
<version>LATEST</version> <version>2.13.3-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.massivecraft</groupId> <groupId>com.massivecraft.massivecore</groupId>
<artifactId>MassiveCore</artifactId> <artifactId>MassiveCore</artifactId>
<version>LATEST</version> <version>2.13.3.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -21,9 +21,9 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.massivecraft</groupId> <groupId>com.massivecraft.factions</groupId>
<artifactId>FactionsUUID</artifactId> <artifactId>FactionsUUID</artifactId>
<version>LATEST</version> <version>1.6.9.5-U0.1.21</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -21,9 +21,9 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.massivecraft</groupId> <groupId>net.redstoneore.legacyfactions</groupId>
<artifactId>LegacyFactions</artifactId> <artifactId>LegacyFactions</artifactId>
<version>LATEST</version> <version>1.4.7</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -27,7 +27,7 @@ import java.util.List;
* boss new skill [name] [type] [mode] * boss new skill [name] [type] [mode]
* boss new command [name] [commands] * boss new command [name] [commands]
* boss new message [name] [message] * boss new message [name] [message]
* boss new autospawn [name] [type] * boss new autospawn [name]
*/ */
public class BossNewCmd extends SubCommand { public class BossNewCmd extends SubCommand {
@ -61,7 +61,7 @@ public class BossNewCmd extends SubCommand {
//-------------------- //--------------------
// A U T O S P A W N // A U T O S P A W N
//-------------------- //--------------------
if(args.length == 4 && args[1].equalsIgnoreCase("autospawn")) { if(args.length == 3 && args[1].equalsIgnoreCase("autospawn")) {
String nameInput = args[2]; String nameInput = args[2];
if(this.autoSpawnFileManager.getAutoSpawn(nameInput) != null) { if(this.autoSpawnFileManager.getAutoSpawn(nameInput) != null) {

View File

@ -2,7 +2,6 @@ package com.songoda.epicbosses.listeners.pre;
import com.songoda.epicbosses.CustomBosses; import com.songoda.epicbosses.CustomBosses;
import com.songoda.epicbosses.api.BossAPI; import com.songoda.epicbosses.api.BossAPI;
import com.songoda.epicbosses.container.BossEntityContainer;
import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.BossEntity;
import com.songoda.epicbosses.events.BossSpawnEvent; import com.songoda.epicbosses.events.BossSpawnEvent;
import com.songoda.epicbosses.events.PreBossSpawnEvent; import com.songoda.epicbosses.events.PreBossSpawnEvent;
@ -15,7 +14,6 @@ import com.songoda.epicbosses.managers.BossTauntManager;
import com.songoda.epicbosses.utils.*; import com.songoda.epicbosses.utils.*;
import com.songoda.epicbosses.utils.itemstack.ItemStackUtils; import com.songoda.epicbosses.utils.itemstack.ItemStackUtils;
import com.songoda.epicbosses.utils.version.VersionHandler; import com.songoda.epicbosses.utils.version.VersionHandler;
import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -38,7 +36,6 @@ import java.util.Map;
public class BossSpawnListener implements Listener { public class BossSpawnListener implements Listener {
private BossLocationManager bossLocationManager; private BossLocationManager bossLocationManager;
private BossTargetManager bossTargetManager;
private BossEntityManager bossEntityManager; private BossEntityManager bossEntityManager;
private BossTauntManager bossTauntManager; private BossTauntManager bossTauntManager;
private VersionHandler versionHandler; private VersionHandler versionHandler;
@ -47,7 +44,6 @@ public class BossSpawnListener implements Listener {
this.versionHandler = customBosses.getVersionHandler(); this.versionHandler = customBosses.getVersionHandler();
this.bossTauntManager = customBosses.getBossTauntManager(); this.bossTauntManager = customBosses.getBossTauntManager();
this.bossEntityManager = customBosses.getBossEntityManager(); this.bossEntityManager = customBosses.getBossEntityManager();
this.bossTargetManager = customBosses.getBossTargetManager();
this.bossLocationManager = customBosses.getBossLocationManager(); this.bossLocationManager = customBosses.getBossLocationManager();
} }

View File

@ -1,6 +1,7 @@
package com.songoda.epicbosses.utils; package com.songoda.epicbosses.utils;
import lombok.Getter; import lombok.Getter;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
import java.util.ArrayList; import java.util.ArrayList;
@ -20,7 +21,7 @@ public enum PotionEffectFinder {
Resistance("Resistance", PotionEffectType.DAMAGE_RESISTANCE, "damage_resistance", "res", "damageresistance"), Resistance("Resistance", PotionEffectType.DAMAGE_RESISTANCE, "damage_resistance", "res", "damageresistance"),
Haste("Haste", PotionEffectType.FAST_DIGGING, "fast_digging", "haste"), Haste("Haste", PotionEffectType.FAST_DIGGING, "fast_digging", "haste"),
Fire_Resistance("FireResistance", PotionEffectType.FIRE_RESISTANCE, "fire_resistance", "fire_resist", "fire_res", "fireresist", "fireres"), Fire_Resistance("FireResistance", PotionEffectType.FIRE_RESISTANCE, "fire_resistance", "fire_resist", "fire_res", "fireresist", "fireres"),
Glowing("Glowing", PotionEffectType.GLOWING), Glowing("Glowing", PotionEffectType.getByName("GLOWING")),
Harm("Harm", PotionEffectType.HARM, "damage"), Harm("Harm", PotionEffectType.HARM, "damage"),
Heal("Heal", PotionEffectType.HEAL), Heal("Heal", PotionEffectType.HEAL),
HealthBoost("HealthBoost", PotionEffectType.HEALTH_BOOST, "healthboost", "health_boost"), HealthBoost("HealthBoost", PotionEffectType.HEALTH_BOOST, "healthboost", "health_boost"),
@ -28,8 +29,8 @@ public enum PotionEffectFinder {
Strength("Strength", PotionEffectType.INCREASE_DAMAGE, "increase_damage", "increasedamage"), Strength("Strength", PotionEffectType.INCREASE_DAMAGE, "increase_damage", "increasedamage"),
Invisibility("Invisibility", PotionEffectType.INVISIBILITY), Invisibility("Invisibility", PotionEffectType.INVISIBILITY),
Jump("Jump", PotionEffectType.JUMP), Jump("Jump", PotionEffectType.JUMP),
Levitation("Levitation", PotionEffectType.LEVITATION), Levitation("Levitation", PotionEffectType.getByName("LEVITATION")),
Luck("Luck", PotionEffectType.LUCK), Luck("Luck", PotionEffectType.getByName("LUCK")),
NightVision("NightVision", PotionEffectType.NIGHT_VISION, "seeinthedarkness", "nv", "night_vision"), NightVision("NightVision", PotionEffectType.NIGHT_VISION, "seeinthedarkness", "nv", "night_vision"),
Posion("Posion", PotionEffectType.POISON, "witched"), Posion("Posion", PotionEffectType.POISON, "witched"),
Regen("regen", PotionEffectType.REGENERATION, "regeneration"), Regen("regen", PotionEffectType.REGENERATION, "regeneration"),
@ -37,7 +38,7 @@ public enum PotionEffectFinder {
Slow("Slow", PotionEffectType.SLOW, "tank"), Slow("Slow", PotionEffectType.SLOW, "tank"),
MiningFatigue("MiningFatigue", PotionEffectType.SLOW_DIGGING, "slow_digging"), MiningFatigue("MiningFatigue", PotionEffectType.SLOW_DIGGING, "slow_digging"),
Speed("Speed", PotionEffectType.SPEED, "fast", "fastboots"), Speed("Speed", PotionEffectType.SPEED, "fast", "fastboots"),
Unluck("Unlucky", PotionEffectType.UNLUCK, "unluck", "notlucky"), Unluck("Unlucky", PotionEffectType.getByName("UNLUCK"), "unluck", "notlucky"),
WaterBreathing("WaterBreathing", PotionEffectType.WATER_BREATHING, "breathunderwater", "water_breathing", "fish"), WaterBreathing("WaterBreathing", PotionEffectType.WATER_BREATHING, "breathunderwater", "water_breathing", "fish"),
Weakness("Weakness", PotionEffectType.WEAKNESS), Weakness("Weakness", PotionEffectType.WEAKNESS),
Wither("Wither", PotionEffectType.WITHER, "blackhearts"); Wither("Wither", PotionEffectType.WITHER, "blackhearts");
@ -68,7 +69,10 @@ public enum PotionEffectFinder {
public static PotionEffectFinder getByEffect(PotionEffectType potionEffectType) { public static PotionEffectFinder getByEffect(PotionEffectType potionEffectType) {
for(PotionEffectFinder potionEffectFinder : values()) { for(PotionEffectFinder potionEffectFinder : values()) {
if(potionEffectType.equals(potionEffectFinder.getPotionEffectType())) return potionEffectFinder; PotionEffectType effectType = potionEffectFinder.getPotionEffectType();
if(effectType == null) continue;
if(potionEffectType.equals(effectType)) return potionEffectFinder;
} }
return null; return null;

View File

@ -24,7 +24,7 @@ public class HolographicDisplayHelper implements IHelper {
CustomBosses plugin = CustomBosses.get(); CustomBosses plugin = CustomBosses.get();
Hologram hologram = HologramsAPI.createHologram(plugin, livingEntity.getEyeLocation()); Hologram hologram = HologramsAPI.createHologram(plugin, livingEntity.getEyeLocation());
hologram.insertTextLine(1, line); hologram.appendTextLine(line);
new BukkitRunnable() { new BukkitRunnable() {
@Override @Override

View File

@ -41,7 +41,7 @@ public class PotionEffectConverter implements IConverter<PotionEffectHolder, Pot
if(duration < 1) duration = (Integer.MAX_VALUE / 20); if(duration < 1) duration = (Integer.MAX_VALUE / 20);
if(potionEffectTypeConverted == null) return null; if(potionEffectTypeConverted == null) return null;
if(potionEffectType != null) return new PotionEffect(potionEffectTypeConverted, level-1, (duration*20)); if(potionEffectType != null) return new PotionEffect(potionEffectTypeConverted, duration*20, level-1);
return null; return null;
} }

View File

@ -22,6 +22,8 @@ public class PotionEffectTypeConverter implements IConverter<String, PotionEffec
@Override @Override
public PotionEffectType from(String s) { public PotionEffectType from(String s) {
if(s == null) return null;
PotionEffectFinder potionEffectFinder = PotionEffectFinder.getByName(s); PotionEffectFinder potionEffectFinder = PotionEffectFinder.getByName(s);
if(potionEffectFinder == null) return null; if(potionEffectFinder == null) return null;

View File

@ -4,14 +4,9 @@ package com.songoda.epicbosses.utils.time;
* @author AMinecraftDev * @author AMinecraftDev
* @version 1.0.0 * @version 1.0.0
* @since 23-May-17 * @since 23-May-17
*/ *
/**
* Makes it easy to convert * Makes it easy to convert
* time * time
*
* @author Debugged
* @version 1.0.0
* @since 3-1-2017
*/ */
public enum TimeUnit { public enum TimeUnit {

14
pom.xml
View File

@ -19,7 +19,7 @@
</modules> </modules>
<properties> <properties>
<plugin.version>1.0.4</plugin.version> <plugin.version>1.0.5</plugin.version>
<plugin.name>EpicBosses</plugin.name> <plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main> <plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
<plugin.author>AMinecraftDev</plugin.author> <plugin.author>AMinecraftDev</plugin.author>
@ -27,15 +27,15 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>com.spigotmc</groupId>
<artifactId>spigot</artifactId> <artifactId>spigot</artifactId>
<version>1.12.2</version> <version>1.12.2</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.milkbowl</groupId> <groupId>net.milkbowl.vault</groupId>
<artifactId>vault</artifactId> <artifactId>Vault</artifactId>
<version>LATEST</version> <version>1.6.6</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -81,10 +81,6 @@
<id>filoghost-repo</id> <id>filoghost-repo</id>
<url>https://ci.filoghost.me/plugin/repository/everything/</url> <url>https://ci.filoghost.me/plugin/repository/everything/</url>
</repository> </repository>
<repository>
<id>private</id>
<url>http://repo.songoda.com/repository/private/</url>
</repository>
<repository> <repository>
<id>vault-repo</id> <id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url> <url>http://nexus.hc.to/content/repositories/pub_releases</url>