Block, Command and Item spawners added to boosting system.

This commit is contained in:
Brianna O'Keefe 2019-02-06 22:13:24 -05:00
parent f49ee5131e
commit ddcd524b49
3 changed files with 6 additions and 3 deletions

View File

@ -33,7 +33,8 @@ public class SpawnOptionBlock implements SpawnOption {
Location location = spawner.getLocation();
if (location == null || location.getWorld() == null) return;
for (int i = 0; i < spawner.getSpawnerDataCount(); i++) {
int spawnerBoost = spawner.getBoost();
for (int i = 0; i < spawner.getSpawnerDataCount() + spawnerBoost; i++) {
for (Material material : blocks) {
int searchIndex = 0;
while (searchIndex++ <= MAX_SEARCH_COUNT) {

View File

@ -37,7 +37,8 @@ public class SpawnOptionCommand implements SpawnOption {
Location location = spawner.getLocation();
if (location == null || location.getWorld() == null) return;
for (int i = 0; i < spawner.getSpawnerDataCount(); i++) {
int spawnerBoost = spawner.getBoost();
for (int i = 0; i < spawner.getSpawnerDataCount() + spawnerBoost; i++) {
for (String command : commands) {
String finalCommand = command;
String lowercaseCommand = finalCommand.toLowerCase();

View File

@ -37,7 +37,8 @@ public class SpawnOptionItem implements SpawnOption {
Location spawnLocation = location.clone().add(0.5, 0.9, 0.5);
location.getWorld().playSound(location, Sound.ENTITY_ITEM_PICKUP, 0.1F, 1F);
for (int i = 0; i < spawner.getSpawnerDataCount(); i++) {
int spawnerBoost = spawner.getBoost();
for (int i = 0; i < spawner.getSpawnerDataCount() + spawnerBoost; i++) {
for (ItemStack item : items) {
Item droppedItem = world.dropItem(spawnLocation, item);
spawner.setSpawnCount(spawner.getSpawnCount() + 1);