mirror of
https://github.com/songoda/EpicBosses.git
synced 2024-09-27 13:03:01 +02:00
Merge branch 'development'
This commit is contained in:
commit
d54fc8cf85
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>EpicBosses</artifactId>
|
<artifactId>EpicBosses</artifactId>
|
||||||
<groupId>com.songoda.epicbosses</groupId>
|
<groupId>com.songoda.epicbosses</groupId>
|
||||||
<version>1.2.9</version>
|
<version>1.2.10</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>EpicBosses</artifactId>
|
<artifactId>EpicBosses</artifactId>
|
||||||
<groupId>com.songoda.epicbosses</groupId>
|
<groupId>com.songoda.epicbosses</groupId>
|
||||||
<version>1.2.9</version>
|
<version>1.2.10</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>EpicBosses</artifactId>
|
<artifactId>EpicBosses</artifactId>
|
||||||
<groupId>com.songoda.epicbosses</groupId>
|
<groupId>com.songoda.epicbosses</groupId>
|
||||||
<version>1.2.9</version>
|
<version>1.2.10</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>EpicBosses</artifactId>
|
<artifactId>EpicBosses</artifactId>
|
||||||
<groupId>com.songoda.epicbosses</groupId>
|
<groupId>com.songoda.epicbosses</groupId>
|
||||||
<version>1.2.9</version>
|
<version>1.2.10</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>EpicBosses</artifactId>
|
<artifactId>EpicBosses</artifactId>
|
||||||
<groupId>com.songoda.epicbosses</groupId>
|
<groupId>com.songoda.epicbosses</groupId>
|
||||||
<version>1.2.9</version>
|
<version>1.2.10</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -6,7 +6,6 @@ import com.songoda.epicbosses.container.BossEntityContainer;
|
|||||||
import com.songoda.epicbosses.entity.BossEntity;
|
import com.songoda.epicbosses.entity.BossEntity;
|
||||||
import com.songoda.epicbosses.utils.EntityFinder;
|
import com.songoda.epicbosses.utils.EntityFinder;
|
||||||
import com.songoda.epicbosses.utils.Message;
|
import com.songoda.epicbosses.utils.Message;
|
||||||
import com.songoda.epicbosses.utils.Permission;
|
|
||||||
import com.songoda.epicbosses.utils.StringUtils;
|
import com.songoda.epicbosses.utils.StringUtils;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
@ -88,7 +87,7 @@ public class CommandCreate extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "create <[>name> <entity>";
|
return "create <name> <entity>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3,7 +3,6 @@ package com.songoda.epicbosses.commands;
|
|||||||
import com.songoda.core.commands.AbstractCommand;
|
import com.songoda.core.commands.AbstractCommand;
|
||||||
import com.songoda.epicbosses.managers.DebugManager;
|
import com.songoda.epicbosses.managers.DebugManager;
|
||||||
import com.songoda.epicbosses.utils.Message;
|
import com.songoda.epicbosses.utils.Message;
|
||||||
import com.songoda.epicbosses.utils.Permission;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -47,16 +46,16 @@ public class CommandDebug extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPermissionNode() {
|
public String getPermissionNode() {
|
||||||
return "boss.reload";
|
return "boss.debug";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "reload";
|
return "debug";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return "Reloads EpicBosses and its configurations.";
|
return "Toggles on and off the debug mode.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ public class CommandGiveEgg extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "giveegg <name> <player> [amount]";
|
return "give/giveegg <name> <player> [amount]";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -39,7 +39,7 @@ public class CommandList extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "list";
|
return "list/show";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,12 +34,12 @@ public class CommandMenu extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPermissionNode() {
|
public String getPermissionNode() {
|
||||||
return "menu";
|
return "boss.menu";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return null;
|
return "menu";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -46,7 +46,7 @@ public class CommandShop extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "shop";
|
return "shop/buy/store";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -39,7 +39,7 @@ public class CommandSkills extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "skills";
|
return "skills/skill";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -111,12 +111,12 @@ public class ActiveBossHolder implements IActiveHolder {
|
|||||||
.filter(e -> e.getValue() != null && e.getValue().getWorld().isChunkLoaded(
|
.filter(e -> e.getValue() != null && e.getValue().getWorld().isChunkLoaded(
|
||||||
e.getValue().getLocation().getBlockX() >> 4,
|
e.getValue().getLocation().getBlockX() >> 4,
|
||||||
e.getValue().getLocation().getBlockZ() >> 4))
|
e.getValue().getLocation().getBlockZ() >> 4))
|
||||||
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||||
|
|
||||||
// remove everything we can
|
// remove everything we can
|
||||||
toRemove.entrySet().stream().forEach(e -> {
|
toRemove.forEach((key, value) -> {
|
||||||
e.getValue().remove();
|
value.remove();
|
||||||
livingEntityMap.remove(e.getKey());
|
livingEntityMap.remove(key);
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -160,6 +160,7 @@ public class BossDeathListener implements Listener {
|
|||||||
DeadBossHolder deadBossHolder = new DeadBossHolder(bossEntity, location, mapOfDamage, mapOfPercent);
|
DeadBossHolder deadBossHolder = new DeadBossHolder(bossEntity, location, mapOfDamage, mapOfPercent);
|
||||||
BossDeathEvent bossDeathEvent = new BossDeathEvent(activeBossHolder, autoSpawn);
|
BossDeathEvent bossDeathEvent = new BossDeathEvent(activeBossHolder, autoSpawn);
|
||||||
DropTable dropTable = this.bossEntityManager.getDropTable(bossEntity);
|
DropTable dropTable = this.bossEntityManager.getDropTable(bossEntity);
|
||||||
|
this.bossEntityManager.removeActiveBossHolder(activeBossHolder);
|
||||||
|
|
||||||
if (dropTable == null) {
|
if (dropTable == null) {
|
||||||
Debug.FAILED_TO_FIND_DROP_TABLE.debug(activeBossHolder.getName(), bossEntity.getDrops().getDropTable());
|
Debug.FAILED_TO_FIND_DROP_TABLE.debug(activeBossHolder.getName(), bossEntity.getDrops().getDropTable());
|
||||||
|
@ -13,9 +13,7 @@ import org.bukkit.entity.*;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.EntityCombustEvent;
|
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
|
||||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,13 +43,15 @@ public class BossDamageListener implements Listener {
|
|||||||
double damage = event.getDamage();
|
double damage = event.getDamage();
|
||||||
Player player = null;
|
Player player = null;
|
||||||
|
|
||||||
if (activeBossHolder == null) {
|
if (activeBossHolder == null && livingEntity.getCustomName() != null) {
|
||||||
// Check to see if this was a boss and respawn it if so.
|
// Check to see if this was a boss and respawn it if so.
|
||||||
String convert = TextUtils.convertFromInvisibleString(livingEntity.getCustomName());
|
String convert = livingEntity.getCustomName();
|
||||||
if (convert.startsWith("BOSS:")) {
|
|
||||||
|
if (convert.toUpperCase().startsWith(TextUtils.convertToInvisibleString("BOSS:"))) {
|
||||||
String name = convert.split(":")[1];
|
String name = convert.split(":")[1];
|
||||||
|
|
||||||
BossEntity bossEntity = bossesFileManager.getBossEntity(name);
|
BossEntity bossEntity = bossesFileManager.getBossEntity(name);
|
||||||
|
if (bossEntity != null) {
|
||||||
bossEntityManager.createActiveBossHolder(bossEntity, livingEntity.getLocation(), name, null);
|
bossEntityManager.createActiveBossHolder(bossEntity, livingEntity.getLocation(), name, null);
|
||||||
|
|
||||||
if (livingEntity.isInsideVehicle() && livingEntity.getVehicle() != null)
|
if (livingEntity.isInsideVehicle() && livingEntity.getVehicle() != null)
|
||||||
@ -62,6 +62,7 @@ public class BossDamageListener implements Listener {
|
|||||||
|
|
||||||
livingEntity.remove();
|
livingEntity.remove();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,10 +3,13 @@ package com.songoda.epicbosses.managers.files;
|
|||||||
import com.songoda.epicbosses.EpicBosses;
|
import com.songoda.epicbosses.EpicBosses;
|
||||||
import com.songoda.epicbosses.container.BossEntityContainer;
|
import com.songoda.epicbosses.container.BossEntityContainer;
|
||||||
import com.songoda.epicbosses.entity.BossEntity;
|
import com.songoda.epicbosses.entity.BossEntity;
|
||||||
|
import com.songoda.epicbosses.entity.elements.EntityStatsElement;
|
||||||
|
import com.songoda.epicbosses.entity.elements.MainStatsElement;
|
||||||
import com.songoda.epicbosses.file.BossesFileHandler;
|
import com.songoda.epicbosses.file.BossesFileHandler;
|
||||||
import com.songoda.epicbosses.utils.ILoadable;
|
import com.songoda.epicbosses.utils.ILoadable;
|
||||||
import com.songoda.epicbosses.utils.IReloadable;
|
import com.songoda.epicbosses.utils.IReloadable;
|
||||||
import com.songoda.epicbosses.utils.ISavable;
|
import com.songoda.epicbosses.utils.ISavable;
|
||||||
|
import com.songoda.epicbosses.utils.StringUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -54,6 +57,15 @@ public class BossesFileManager implements ILoadable, ISavable, IReloadable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BossEntity getBossEntity(String name) {
|
public BossEntity getBossEntity(String name) {
|
||||||
|
for (Map.Entry<String, BossEntity> entry : this.bossEntityContainer.getData().entrySet()) {
|
||||||
|
for (EntityStatsElement entityStatsElement : entry.getValue().getEntityStats()) {
|
||||||
|
MainStatsElement mainStatsElement = entityStatsElement.getMainStats();
|
||||||
|
String customName = mainStatsElement.getDisplayName();
|
||||||
|
System.out.println(name + " : " + StringUtils.get().translateColor(customName));
|
||||||
|
if (StringUtils.get().translateColor(customName).equals(name))
|
||||||
|
return entry.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
return this.bossEntityContainer.getData().getOrDefault(name, null);
|
return this.bossEntityContainer.getData().getOrDefault(name, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,8 @@ import com.songoda.epicbosses.mechanics.IBossMechanic;
|
|||||||
import com.songoda.epicbosses.utils.StringUtils;
|
import com.songoda.epicbosses.utils.StringUtils;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Charles Cullen
|
* @author Charles Cullen
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
@ -29,7 +31,7 @@ public class NameMechanic implements IBossMechanic {
|
|||||||
if (livingEntity == null || customName == null) continue;
|
if (livingEntity == null || customName == null) continue;
|
||||||
String formattedName = StringUtils.get().translateColor(customName);
|
String formattedName = StringUtils.get().translateColor(customName);
|
||||||
|
|
||||||
livingEntity.setCustomName(TextUtils.convertToInvisibleString("BOSS:" + activeBossHolder.getName() + ":") + formattedName);
|
livingEntity.setCustomName(TextUtils.convertToInvisibleString("BOSS:") + formattedName);
|
||||||
livingEntity.setCustomNameVisible(true);
|
livingEntity.setCustomNameVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
package com.songoda.epicbosses.utils;
|
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Charles Cullen
|
|
||||||
* @version 1.0.0
|
|
||||||
* @since 04-Oct-18
|
|
||||||
*/
|
|
||||||
public enum Permission {
|
|
||||||
|
|
||||||
admin("boss.admin"),
|
|
||||||
create("boss.create"),
|
|
||||||
debug("boss.debug"),
|
|
||||||
edit("boss.edit"),
|
|
||||||
give("boss.give"),
|
|
||||||
help("boss.help"),
|
|
||||||
nearby("boss.nearby"),
|
|
||||||
reload("boss.reload"),
|
|
||||||
shop("boss.shop"),
|
|
||||||
time("boss.time");
|
|
||||||
|
|
||||||
private String permission;
|
|
||||||
|
|
||||||
Permission(String permission) {
|
|
||||||
this.permission = permission;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasPermission(CommandSender commandSender) {
|
|
||||||
return commandSender.hasPermission(getPermission());
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPermission() {
|
|
||||||
return this.permission;
|
|
||||||
}
|
|
||||||
}
|
|
@ -35,6 +35,16 @@ public class StringUtils {
|
|||||||
return messages;
|
return messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toNum(String s) {
|
||||||
|
StringBuilder t = new StringBuilder();
|
||||||
|
for (int i = 0; i < s.length(); ++i) {
|
||||||
|
char ch = s.charAt(i);
|
||||||
|
int n = (int)ch - (int)'a' + 1;
|
||||||
|
t.append(n);
|
||||||
|
}
|
||||||
|
return t.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public String stripColor(String string) {
|
public String stripColor(String string) {
|
||||||
return ChatColor.stripColor(string);
|
return ChatColor.stripColor(string);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>EpicBosses</artifactId>
|
<artifactId>EpicBosses</artifactId>
|
||||||
<groupId>com.songoda.epicbosses</groupId>
|
<groupId>com.songoda.epicbosses</groupId>
|
||||||
<version>1.2.9</version>
|
<version>1.2.10</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
8
pom.xml
8
pom.xml
@ -4,7 +4,7 @@
|
|||||||
<groupId>com.songoda.epicbosses</groupId>
|
<groupId>com.songoda.epicbosses</groupId>
|
||||||
<artifactId>EpicBosses</artifactId>
|
<artifactId>EpicBosses</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.2.9</version>
|
<version>1.2.10</version>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>api-modules/FactionsM</module>
|
<module>api-modules/FactionsM</module>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<plugin.version>1.2.9</plugin.version>
|
<plugin.version>1.2.10</plugin.version>
|
||||||
<plugin.name>EpicBosses</plugin.name>
|
<plugin.name>EpicBosses</plugin.name>
|
||||||
<plugin.main>com.songoda.epicbosses.EpicBosses</plugin.main>
|
<plugin.main>com.songoda.epicbosses.EpicBosses</plugin.main>
|
||||||
<plugin.author>Songoda</plugin.author>
|
<plugin.author>Songoda</plugin.author>
|
||||||
@ -48,6 +48,10 @@
|
|||||||
<id>private</id>
|
<id>private</id>
|
||||||
<url>http://repo.songoda.com/artifactory/private/</url>
|
<url>http://repo.songoda.com/artifactory/private/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>public</id>
|
||||||
|
<url>http://repo.songoda.com/artifactory/public/</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
Loading…
Reference in New Issue
Block a user