Try and fix undead city

This commit is contained in:
Sam 2018-07-24 20:46:03 +01:00 committed by Alexander Meech
parent 293880cee9
commit f9a47c6cc2
5 changed files with 12 additions and 12 deletions

View File

@ -23,7 +23,7 @@ public class GoldLoot implements ILoot
public void dropLoot(Location location) public void dropLoot(Location location)
{ {
int count = _min + UtilMath.r(_max - _min); int count = _min + UtilMath.r(_max - _min);
_goldManager.dropGold(location.clone().add(0, 3, 0), count); _goldManager.dropGold(location.clone().add(0, 1, 0), count);
} }
@Override @Override

View File

@ -8,10 +8,9 @@ import mineplex.core.common.util.UtilMath;
public class ItemLoot implements ILoot public class ItemLoot implements ILoot
{ {
private Material _material; private final Material _material;
private byte _data; private final byte _data;
private int _min; private final int _min, _max;
private int _max;
public ItemLoot(Material material) public ItemLoot(Material material)
{ {
@ -34,9 +33,7 @@ public class ItemLoot implements ILoot
@Override @Override
public void dropLoot(Location location) public void dropLoot(Location location)
{ {
int count = UtilMath.rRange(_min, _max); location.getWorld().dropItemNaturally(location.clone().add(0, 1, 0), getItemStack());
ItemStack item = new ItemStack(_material, count, (short) 0, _data);
location.getWorld().dropItemNaturally(location.clone().add(0, 3, 0), item);
} }
@Override @Override

View File

@ -11,8 +11,8 @@ import mineplex.game.clans.items.GearManager;
public class LootManager public class LootManager
{ {
private GearManager _gearManager; private final GearManager _gearManager;
private GoldManager _goldManager; private final GoldManager _goldManager;
private WeightSet<ILoot> _commonSet; private WeightSet<ILoot> _commonSet;
private WeightSet<ILoot> _rareSet; private WeightSet<ILoot> _rareSet;

View File

@ -39,7 +39,7 @@ public class CityChest
{ {
_block.setType(Material.AIR); _block.setType(Material.AIR);
_block.getWorld().playEffect(_block.getLocation(), Effect.STEP_SOUND, Material.ENDER_CHEST.getId()); _block.getWorld().playEffect(_block.getLocation(), Effect.STEP_SOUND, Material.ENDER_CHEST.getId());
ClansManager.getInstance().getLootManager().dropUndeadCity(_block.getLocation()); ClansManager.getInstance().getLootManager().dropUndeadCity(_block.getLocation().add(0.5, 0, 0.5));
_opened = true; _opened = true;
} }

View File

@ -33,6 +33,7 @@ import mineplex.game.clans.clans.worldevent.undead.creature.UndeadWarrior;
public class UndeadCity extends WorldEvent public class UndeadCity extends WorldEvent
{ {
private final int _maxChests; private final int _maxChests;
private final int _maxMobs; private final int _maxMobs;
private final Map<BlockPosition, CityChest> _chests = new HashMap<>(); private final Map<BlockPosition, CityChest> _chests = new HashMap<>();
@ -58,7 +59,9 @@ public class UndeadCity extends WorldEvent
{ {
int addedChests = 0; int addedChests = 0;
int addedMobs = 0; int addedMobs = 0;
for (Block block : UtilBlock.getInRadius(getCenterLocation(), 55).keySet()) double size = getEventArena().getRadius();
for (Block block : UtilBlock.getInBoundingBox(getCenterLocation().clone().add(size, size, size), getCenterLocation().clone().subtract(size, size, size)))
{ {
if (block.getType() == Material.ENDER_CHEST) if (block.getType() == Material.ENDER_CHEST)
{ {