mirror of
https://github.com/songoda/EpicBosses.git
synced 2025-01-22 06:41:20 +01:00
3.0.0-SNAPSHOT-U35
+ Finished most of the DropTable system + Added Commands to the drop table system, like the previous system + Added a new message to the Debug enum + Added the DropTableManager to the main class to be loaded in with the plugin
This commit is contained in:
parent
001563e18d
commit
6039cf58c4
@ -11,6 +11,7 @@
|
||||
"SKMainHand": 30.0,
|
||||
"SKOffHand": 30.0
|
||||
},
|
||||
"randomSprayDrops": true,
|
||||
"sprayMaxDistance": 10,
|
||||
"sprayMaxDrops": 5
|
||||
}
|
||||
@ -27,6 +28,7 @@
|
||||
"SKMainHand": 30.0,
|
||||
"SKOffHand": 30.0
|
||||
},
|
||||
"randomDrops": true,
|
||||
"dropMaxDrops": 4
|
||||
}
|
||||
},
|
||||
@ -44,8 +46,15 @@
|
||||
"SKMainHand": 10.0,
|
||||
"SKOffHand": 10.0
|
||||
},
|
||||
"maxDrops": -1,
|
||||
"randomDrops": false,
|
||||
"commands": {
|
||||
"SKEco500": 30.0,
|
||||
"SKEco2500": 50.0,
|
||||
"SKEco5000": 10.0
|
||||
},
|
||||
"maxDrops": 3,
|
||||
"maxCommands": 1,
|
||||
"randomDrops": true,
|
||||
"randomCommands": true,
|
||||
"requiredPercentage": 80.0
|
||||
},
|
||||
"2": {
|
||||
|
@ -37,11 +37,5 @@
|
||||
"&7This stone will bring you",
|
||||
"&7great luck in battle."
|
||||
]
|
||||
},
|
||||
"SKCustomDrop2": {
|
||||
"type": "COMMAND",
|
||||
"command": [
|
||||
"SKEco500"
|
||||
]
|
||||
}
|
||||
}
|
@ -34,6 +34,7 @@ public class CustomBosses extends JavaPlugin implements IReloadable {
|
||||
@Getter private BossesFileManager bossesFileManager;
|
||||
@Getter private ItemsFileManager itemStackManager;
|
||||
|
||||
@Getter private BossDropTableManager bossDropTableManager;
|
||||
@Getter private BossEntityContainer bossEntityContainer;
|
||||
@Getter private BossMechanicManager bossMechanicManager;
|
||||
@Getter private BossLocationManager bossLocationManager;
|
||||
@ -65,6 +66,7 @@ public class CustomBosses extends JavaPlugin implements IReloadable {
|
||||
this.bossMechanicManager = new BossMechanicManager(this);
|
||||
this.bossHookManager = new BossHookManager(this);
|
||||
this.bossLocationManager = new BossLocationManager(this);
|
||||
this.bossDropTableManager = new BossDropTableManager(this);
|
||||
|
||||
loadFileManagersAndHandlers();
|
||||
|
||||
|
@ -15,6 +15,7 @@ import java.util.Map;
|
||||
public class DropTableElement extends RewardsTableElement {
|
||||
|
||||
@Expose @Getter @Setter private Map<String, Double> dropRewards;
|
||||
@Expose @Getter @Setter private Boolean randomDrops;
|
||||
@Expose @Getter @Setter private Integer dropMaxDrops;
|
||||
|
||||
}
|
||||
|
@ -13,9 +13,9 @@ import java.util.Map;
|
||||
*/
|
||||
public class GiveTableSubElement {
|
||||
|
||||
@Expose @Getter @Setter private Map<String, Double> items;
|
||||
@Expose @Getter @Setter private Integer maxDrops;
|
||||
@Expose @Getter @Setter private Boolean randomDrops;
|
||||
@Expose @Getter @Setter private Map<String, Double> items, commands;
|
||||
@Expose @Getter @Setter private Integer maxDrops, maxCommands;
|
||||
@Expose @Getter @Setter private Boolean randomDrops, randomCommands;
|
||||
@Expose @Getter @Setter private Double requiredPercentage;
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import java.util.Map;
|
||||
public class SprayTableElement extends RewardsTableElement {
|
||||
|
||||
@Expose @Getter @Setter private Map<String, Double> sprayRewards;
|
||||
@Expose @Getter @Setter private Boolean randomSprayDrops;
|
||||
@Expose @Getter @Setter private Integer sprayMaxDistance, sprayMaxDrops;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
package com.songoda.epicbosses.handlers;
|
||||
|
||||
/**
|
||||
* @author Charles Cullen
|
||||
* @version 1.0.0
|
||||
* @since 27-Oct-18
|
||||
*/
|
||||
public interface IGetDropTableListItem<T> {
|
||||
|
||||
T getListItem(String id);
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.songoda.epicbosses.handlers.droptable;
|
||||
|
||||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.handlers.IGetDropTableListItem;
|
||||
import com.songoda.epicbosses.utils.Debug;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Charles Cullen
|
||||
* @version 1.0.0
|
||||
* @since 27-Oct-18
|
||||
*/
|
||||
public class GetDropTableCommand implements IGetDropTableListItem<List<String>> {
|
||||
|
||||
@Override
|
||||
public List<String> getListItem(String id) {
|
||||
List<String> commands = BossAPI.getStoredCommands(id);
|
||||
|
||||
if(commands == null) {
|
||||
Debug.FAILED_TO_LOAD_COMMANDS.debug(id);
|
||||
}
|
||||
|
||||
return commands;
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.songoda.epicbosses.handlers.droptable;
|
||||
|
||||
import com.songoda.epicbosses.CustomBosses;
|
||||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.handlers.IGetDropTableListItem;
|
||||
import com.songoda.epicbosses.managers.files.ItemsFileManager;
|
||||
import com.songoda.epicbosses.utils.Debug;
|
||||
import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
/**
|
||||
* @author Charles Cullen
|
||||
* @version 1.0.0
|
||||
* @since 27-Oct-18
|
||||
*/
|
||||
public class GetDropTableItemStack implements IGetDropTableListItem<ItemStack> {
|
||||
|
||||
private ItemsFileManager itemsFileManager;
|
||||
|
||||
public GetDropTableItemStack(CustomBosses plugin) {
|
||||
this.itemsFileManager = plugin.getItemStackManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getListItem(String id) {
|
||||
ItemStackHolder itemStackHolder = BossAPI.getStoredItemStack(id);
|
||||
|
||||
if(itemStackHolder == null) {
|
||||
Debug.FAILED_TO_LOAD_CUSTOM_ITEM.debug(id);
|
||||
return null;
|
||||
}
|
||||
|
||||
ItemStack itemStack = this.itemsFileManager.getItemStackConverter().from(itemStackHolder);
|
||||
|
||||
if(itemStack == null) {
|
||||
Debug.FAILED_TO_LOAD_CUSTOM_ITEM.debug(id);
|
||||
return null;
|
||||
}
|
||||
|
||||
return itemStack;
|
||||
}
|
||||
}
|
@ -66,6 +66,7 @@ public class BossDeathListener implements Listener {
|
||||
Location location = event.getLocation();
|
||||
|
||||
Map<UUID, Double> mapOfDamage = this.bossEntityManager.getSortedMapOfDamage(activeBossHolder);
|
||||
Map<UUID, Double> mapOfPercent = this.bossEntityManager.getPercentageMap(mapOfDamage);
|
||||
List<String> commands = this.bossEntityManager.getOnDeathCommands(bossEntity);
|
||||
List<String> messages = this.bossEntityManager.getOnDeathMessage(bossEntity);
|
||||
int messageRadius = this.bossEntityManager.getOnDeathMessageRadius(bossEntity);
|
||||
@ -87,14 +88,18 @@ public class BossDeathListener implements Listener {
|
||||
if(current > onlyShow) break;
|
||||
|
||||
List<String> clonedPositionsMessage = new ArrayList<>(positionsMessage);
|
||||
double percentage = this.bossEntityManager.getPercentage(activeBossHolder, entry.getKey());
|
||||
Double percentage = mapOfPercent.getOrDefault(entry.getKey(), null);
|
||||
int position = current;
|
||||
|
||||
if(percentage == null) percentage = -1.0D;
|
||||
|
||||
double finalPercentage = percentage;
|
||||
|
||||
clonedPositionsMessage.replaceAll(s -> s
|
||||
.replace("{pos}", "" + position)
|
||||
.replace("{name}", Bukkit.getOfflinePlayer(entry.getKey()).getName())
|
||||
.replace("{dmg}", NumberUtils.get().formatDouble(entry.getValue()))
|
||||
.replace("{percent}", NumberUtils.get().formatDouble(percentage))
|
||||
.replace("{percent}", NumberUtils.get().formatDouble(finalPercentage))
|
||||
.replace('&', '§'));
|
||||
|
||||
finalPositionsMessage.addAll(clonedPositionsMessage);
|
||||
@ -132,7 +137,7 @@ public class BossDeathListener implements Listener {
|
||||
}
|
||||
});
|
||||
|
||||
DeadBossHolder deadBossHolder = new DeadBossHolder(bossEntity, location, mapOfDamage);
|
||||
DeadBossHolder deadBossHolder = new DeadBossHolder(bossEntity, location, mapOfDamage, mapOfPercent);
|
||||
BossDeathEvent bossDeathEvent = new BossDeathEvent(activeBossHolder);
|
||||
DropTable dropTable = this.bossEntityManager.getDropTable(bossEntity);
|
||||
|
||||
|
@ -2,22 +2,25 @@ package com.songoda.epicbosses.managers;
|
||||
|
||||
import com.songoda.epicbosses.CustomBosses;
|
||||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.droptable.elements.DropTableElement;
|
||||
import com.songoda.epicbosses.droptable.elements.GiveTableElement;
|
||||
import com.songoda.epicbosses.droptable.elements.GiveTableSubElement;
|
||||
import com.songoda.epicbosses.droptable.elements.SprayTableElement;
|
||||
import com.songoda.epicbosses.handlers.IGetDropTableListItem;
|
||||
import com.songoda.epicbosses.handlers.droptable.GetDropTableCommand;
|
||||
import com.songoda.epicbosses.handlers.droptable.GetDropTableItemStack;
|
||||
import com.songoda.epicbosses.holder.DeadBossHolder;
|
||||
import com.songoda.epicbosses.managers.files.ItemsFileManager;
|
||||
import com.songoda.epicbosses.utils.Debug;
|
||||
import com.songoda.epicbosses.utils.NumberUtils;
|
||||
import com.songoda.epicbosses.utils.RandomUtils;
|
||||
import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Charles Cullen
|
||||
@ -26,57 +29,40 @@ import java.util.UUID;
|
||||
*/
|
||||
public class BossDropTableManager {
|
||||
|
||||
private ItemsFileManager itemsFileManager;
|
||||
private BossEntityManager bossEntityManager;
|
||||
private final IGetDropTableListItem<ItemStack> getDropTableItemStack;
|
||||
private final IGetDropTableListItem<List<String>> getDropTableCommand;
|
||||
|
||||
public BossDropTableManager(CustomBosses plugin) {
|
||||
this.itemsFileManager = plugin.getItemStackManager();
|
||||
this.bossEntityManager = plugin.getBossEntityManager();
|
||||
this.getDropTableItemStack = new GetDropTableItemStack(plugin);
|
||||
this.getDropTableCommand = new GetDropTableCommand();
|
||||
}
|
||||
|
||||
public List<ItemStack> getSprayItems(SprayTableElement sprayTableElement) {
|
||||
Map<String, Double> rewards = sprayTableElement.getSprayRewards();
|
||||
List<ItemStack> customDrops = new ArrayList<>();
|
||||
Integer maxDropsElement = sprayTableElement.getSprayMaxDrops();
|
||||
Integer maxDrops = sprayTableElement.getSprayMaxDrops();
|
||||
Boolean randomDrops = sprayTableElement.getRandomSprayDrops();
|
||||
|
||||
if(maxDropsElement == null) maxDropsElement = -1;
|
||||
if(maxDrops == null) maxDrops = -1;
|
||||
if(randomDrops == null) randomDrops = false;
|
||||
|
||||
final int maxDrops = maxDropsElement;
|
||||
|
||||
for(Map.Entry<String, Double> entry : rewards.entrySet()) {
|
||||
if(maxDrops > 0) {
|
||||
if(customDrops.size() >= maxDrops) return customDrops;
|
||||
return getCustomRewards(randomDrops, maxDrops, rewards);
|
||||
}
|
||||
|
||||
double chance = entry.getValue();
|
||||
String itemName = entry.getKey();
|
||||
double randomNumber = RandomUtils.get().getRandomDecimalNumber();
|
||||
public List<ItemStack> getDropItems(DropTableElement dropTableElement) {
|
||||
Map<String, Double> rewards = dropTableElement.getDropRewards();
|
||||
Integer maxDrops = dropTableElement.getDropMaxDrops();
|
||||
Boolean randomDrops = dropTableElement.getRandomDrops();
|
||||
|
||||
if(randomNumber > chance) continue;
|
||||
if(maxDrops == null) maxDrops = -1;
|
||||
if(randomDrops == null) randomDrops = false;
|
||||
|
||||
ItemStackHolder itemStackHolder = BossAPI.getStoredItemStack(itemName);
|
||||
|
||||
if(itemStackHolder == null) {
|
||||
Debug.FAILED_TO_LOAD_CUSTOM_ITEM.debug(itemName);
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemStack itemStack = this.itemsFileManager.getItemStackConverter().from(itemStackHolder);
|
||||
|
||||
if(itemStack == null) {
|
||||
Debug.FAILED_TO_LOAD_CUSTOM_ITEM.debug(itemName);
|
||||
continue;
|
||||
}
|
||||
|
||||
customDrops.add(itemStack);
|
||||
}
|
||||
|
||||
return customDrops;
|
||||
return getCustomRewards(randomDrops, maxDrops, rewards);
|
||||
}
|
||||
|
||||
public void handleGiveTable(GiveTableElement giveTableElement, DeadBossHolder deadBossHolder) {
|
||||
Map<String, Map<String, GiveTableSubElement>> rewards = giveTableElement.getGiveRewards();
|
||||
Map<UUID, Double> mapOfDamage = deadBossHolder.getSortedDamageMap();
|
||||
Map<UUID, Double> percentMap = deadBossHolder.getPercentageMap();
|
||||
List<UUID> positions = new ArrayList<>(mapOfDamage.keySet());
|
||||
|
||||
rewards.forEach((positionString, lootMap) -> {
|
||||
@ -90,18 +76,100 @@ public class BossDropTableManager {
|
||||
if(positions.size() < position) return;
|
||||
|
||||
UUID uuid = positions.get(position);
|
||||
double percentage = this.bossEntityManager.getPercentage(activeBossHolder, entry.getKey());
|
||||
Player player = Bukkit.getPlayer(uuid);
|
||||
double percentage = percentMap.getOrDefault(uuid, -1.0);
|
||||
List<ItemStack> totalRewards = new ArrayList<>();
|
||||
List<String> totalCommands = new ArrayList<>();
|
||||
|
||||
if(player == null) return;
|
||||
|
||||
lootMap.forEach((key, subElement) -> {
|
||||
Double requiredPercentage = subElement.getRequiredPercentage();
|
||||
Boolean randomDrops = subElement.getRandomDrops();
|
||||
Integer maxDrops = subElement.getMaxDrops(), maxCommands = subElement.getMaxCommands();
|
||||
Boolean randomDrops = subElement.getRandomDrops(), randomCommands = subElement.getRandomCommands();
|
||||
|
||||
if(requiredPercentage == null) requiredPercentage = 0.0D;
|
||||
if(maxDrops == null) maxDrops = -1;
|
||||
if(maxCommands == null) maxCommands = -1;
|
||||
if(randomDrops == null) randomDrops = false;
|
||||
if(randomCommands == null) randomCommands = false;
|
||||
|
||||
if(requiredPercentage > percentage) return;
|
||||
|
||||
totalRewards.addAll(getCustomRewards(randomDrops, maxDrops, subElement.getItems()));
|
||||
totalCommands.addAll(getCommands(randomCommands, maxCommands, subElement.getCommands()));
|
||||
});
|
||||
|
||||
totalCommands.replaceAll(s -> s.replace("%player%", player.getName()));
|
||||
|
||||
totalCommands.forEach(s -> Bukkit.dispatchCommand(Bukkit.getConsoleSender(), s));
|
||||
totalRewards.forEach(itemStack -> {
|
||||
if(player.getInventory().firstEmpty() == -1) {
|
||||
player.getWorld().dropItemNaturally(player.getLocation(), itemStack);
|
||||
} else {
|
||||
player.getInventory().addItem(itemStack);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private List<ItemStack> getCustomRewards(boolean random, int max, Map<String, Double> chanceMap) {
|
||||
List<ItemStack> newListToMerge = new ArrayList<>();
|
||||
|
||||
if(chanceMap == null) return newListToMerge;
|
||||
|
||||
List<String> keyList = new ArrayList<>(chanceMap.keySet());
|
||||
|
||||
if(random) Collections.shuffle(keyList);
|
||||
|
||||
for(String itemName : keyList) {
|
||||
Double chance = chanceMap.get(itemName);
|
||||
double randomNumber = RandomUtils.get().getRandomDecimalNumber();
|
||||
|
||||
if(randomNumber > chance) continue;
|
||||
if((max > 0) && (newListToMerge.size() >= max)) break;
|
||||
|
||||
ItemStack itemStack = this.getDropTableItemStack.getListItem(itemName);
|
||||
|
||||
if(itemStack == null) {
|
||||
Debug.DROP_TABLE_FAILED_TO_GET_ITEM.debug();
|
||||
continue;
|
||||
}
|
||||
|
||||
newListToMerge.add(itemStack);
|
||||
}
|
||||
|
||||
return newListToMerge;
|
||||
}
|
||||
|
||||
private List<String> getCommands(boolean random, int max, Map<String, Double> chanceMap) {
|
||||
List<String> newListToMerge = new ArrayList<>();
|
||||
|
||||
if(chanceMap == null) return newListToMerge;
|
||||
|
||||
List<String> keyList = new ArrayList<>(chanceMap.keySet());
|
||||
|
||||
if(random) Collections.shuffle(keyList);
|
||||
|
||||
for(String itemName : keyList) {
|
||||
Double chance = chanceMap.get(itemName);
|
||||
double randomNumber = RandomUtils.get().getRandomDecimalNumber();
|
||||
|
||||
if(randomNumber > chance) continue;
|
||||
if((max > 0) && (newListToMerge.size() >= max)) break;
|
||||
|
||||
List<String> commands = this.getDropTableCommand.getListItem(itemName);
|
||||
|
||||
if(commands == null) {
|
||||
Debug.DROP_TABLE_FAILED_TO_GET_ITEM.debug();
|
||||
continue;
|
||||
}
|
||||
|
||||
newListToMerge.addAll(commands);
|
||||
}
|
||||
|
||||
return newListToMerge;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,9 @@ package com.songoda.epicbosses.managers;
|
||||
import com.songoda.epicbosses.CustomBosses;
|
||||
import com.songoda.epicbosses.api.BossAPI;
|
||||
import com.songoda.epicbosses.droptable.DropTable;
|
||||
import com.songoda.epicbosses.droptable.elements.DropTableElement;
|
||||
import com.songoda.epicbosses.droptable.elements.GiveTableElement;
|
||||
import com.songoda.epicbosses.droptable.elements.SprayTableElement;
|
||||
import com.songoda.epicbosses.entity.BossEntity;
|
||||
import com.songoda.epicbosses.holder.ActiveBossHolder;
|
||||
import com.songoda.epicbosses.holder.DeadBossHolder;
|
||||
@ -28,12 +31,14 @@ public class BossEntityManager {
|
||||
private static final List<ActiveBossHolder> ACTIVE_BOSS_HOLDERS = new ArrayList<>();
|
||||
|
||||
private DropTableFileManager dropTableFileManager;
|
||||
private BossDropTableManager bossDropTableManager;
|
||||
private BossMechanicManager bossMechanicManager;
|
||||
private ItemsFileManager bossItemFileManager;
|
||||
private BossesFileManager bossesFileManager;
|
||||
|
||||
public BossEntityManager(CustomBosses customBosses) {
|
||||
this.dropTableFileManager = customBosses.getDropTableFileManager();
|
||||
this.bossDropTableManager = customBosses.getBossDropTableManager();
|
||||
this.bossMechanicManager = customBosses.getBossMechanicManager();
|
||||
this.bossItemFileManager = customBosses.getItemStackManager();
|
||||
this.bossesFileManager = customBosses.getBossesFileManager();
|
||||
@ -200,32 +205,25 @@ public class BossEntityManager {
|
||||
return sortedMap;
|
||||
}
|
||||
|
||||
public double getPercentage(ActiveBossHolder activeBossHolder, UUID uuid) {
|
||||
Map<UUID, Double> damagingUsers = activeBossHolder.getMapOfDamagingUsers();
|
||||
public Map<UUID, Double> getPercentageMap(Map<UUID, Double> damagingUsers) {
|
||||
Map<UUID, Double> percentageMap = new HashMap<>();
|
||||
double totalDamage = 0.0;
|
||||
|
||||
for(Double damage : damagingUsers.values()) {
|
||||
if(damage != null) totalDamage += damage;
|
||||
}
|
||||
|
||||
double playerDamage = damagingUsers.get(uuid);
|
||||
double onePercent = totalDamage / 100;
|
||||
|
||||
return playerDamage / onePercent;
|
||||
}
|
||||
damagingUsers.forEach((uuid, damage) -> {
|
||||
if(uuid == null || damage == null) return;
|
||||
|
||||
public double getPercentage(DeadBossHolder deadBossHolder, UUID uuid) {
|
||||
Map<UUID, Double> damagingUsers = deadBossHolder.getSortedDamageMap();
|
||||
double totalDamage = 0.0;
|
||||
double playerPercent = damage / onePercent;
|
||||
|
||||
for(Double damage : damagingUsers.values()) {
|
||||
if(damage != null) totalDamage += damage;
|
||||
}
|
||||
percentageMap.put(uuid, playerPercent);
|
||||
});
|
||||
|
||||
double playerDamage = damagingUsers.get(uuid);
|
||||
double onePercent = totalDamage / 100;
|
||||
|
||||
return playerDamage / onePercent;
|
||||
return percentageMap;
|
||||
}
|
||||
|
||||
public DropTable getDropTable(BossEntity bossEntity) {
|
||||
@ -243,14 +241,21 @@ public class BossEntityManager {
|
||||
}
|
||||
|
||||
if(dropType.equalsIgnoreCase("SPRAY")) {
|
||||
SprayTableElement sprayTableElement = (SprayTableElement) dropTable.getRewards();
|
||||
List<ItemStack> itemStacks = this.bossDropTableManager.getSprayItems(sprayTableElement);
|
||||
|
||||
//TODO: Spray itemstacks
|
||||
} else if(dropType.equalsIgnoreCase("GIVE")) {
|
||||
GiveTableElement giveTableElement = (GiveTableElement) dropTable.getRewards();
|
||||
|
||||
this.bossDropTableManager.handleGiveTable(giveTableElement, deadBossHolder);
|
||||
} else if(dropType.equalsIgnoreCase("DROP")) {
|
||||
DropTableElement dropTableElement = (DropTableElement) dropTable.getRewards();
|
||||
List<ItemStack> itemStacks = this.bossDropTableManager.getDropItems(dropTableElement);
|
||||
|
||||
itemStacks.forEach(itemStack -> deadBossHolder.getLocation().getWorld().dropItemNaturally(deadBossHolder.getLocation(), itemStack));
|
||||
} else {
|
||||
Debug.FAILED_TO_FIND_DROP_TABLE_TYPE.debug(tableName);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@ public enum Debug {
|
||||
FAILED_TO_CREATE_ACTIVE_BOSS_HOLDER("Something went wrong while trying to create an active boss holder for someone who is trying to spawn a boss."),
|
||||
|
||||
DROP_TABLE_FAILED_INVALID_NUMBER("The specified position ({0}) on the drop table is not a valid number."),
|
||||
DROP_TABLE_FAILED_TO_GET_ITEM("The drop table failed to get the specific item for the list."),
|
||||
|
||||
MECHANIC_TYPE_NOT_STORED("This mechanic type is not stored, therefore will not be applied. Valid mechanic types are IOptionalMechanic and IPrimaryMechanic.");
|
||||
|
||||
|
2
pom.xml
2
pom.xml
@ -19,7 +19,7 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<plugin.version>1.0.0-SNAPSHOT-U34</plugin.version>
|
||||
<plugin.version>1.0.0-SNAPSHOT-U35</plugin.version>
|
||||
<plugin.name>EpicBosses</plugin.name>
|
||||
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
|
||||
<plugin.author>AMinecraftDev</plugin.author>
|
||||
|
Loading…
Reference in New Issue
Block a user