Fix issues found in testing

This commit is contained in:
Sam 2018-01-10 00:51:46 +00:00 committed by Alexander Meech
parent 5252d79c5f
commit 35c932048f
3 changed files with 11 additions and 8 deletions

View File

@ -70,7 +70,6 @@ public abstract class Skywars extends Game
private static final long CRUMBLE_TIME = TimeUnit.SECONDS.toMillis(100);
private MapCrumbleModule _mapCrumbleModule;
private GeneratorModule _generatorModule;
private final OreHider _oreHider;
@ -150,7 +149,7 @@ public abstract class Skywars extends Game
@Override
public void ParseData()
{
_mapCrumbleModule = new MapCrumbleModule()
new MapCrumbleModule()
.setEnableAfter(CRUMBLE_TIME, () ->
{
Announce(C.cGreenB + "The world begins to crumble...", false);
@ -159,8 +158,8 @@ public abstract class Skywars extends Game
{
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1, 1);
}
});
_mapCrumbleModule.register(this);
})
.register(this);
new ZombieGuardianModule()
.addSpawns(WorldData.GetDataLocs("RED"))
@ -295,7 +294,7 @@ public abstract class Skywars extends Game
.addItem(new ItemStack(Material.LAVA_BUCKET), 80)
.addItem(new ItemStack(Material.WATER_BUCKET))
.addItem(new ItemStack(Material.ENDER_PEARL), 1, 2)
.setProbability(0.8),
,
new ChestLootPool()
.addItem(createEnchantedBook(Enchantment.DAMAGE_ALL))
@ -351,6 +350,7 @@ public abstract class Skywars extends Game
new ChestLootPool()
.addItem(new ItemStack(Material.COOKED_BEEF), 1, 3)
.addItem(new ItemStack(Material.COOKED_CHICKEN), 1, 3)
.addItem(new ItemStack(Material.COOKED_FISH), 1, 3)
.setAmountsPerChest(1, 2)
.setProbability(0.8)
,
@ -371,7 +371,7 @@ public abstract class Skywars extends Game
.addItem(new ItemStack(Material.ENDER_PEARL), 1, 2)
.addItem(new ItemStack(Material.MUSHROOM_SOUP))
.setAmountsPerChest(1, 2)
.setProbability(0.8),
,
new ChestLootPool()
.addItem(createEnchantedBook(Enchantment.DAMAGE_ALL))

View File

@ -1,5 +1,6 @@
package nautilus.game.arcade.game.games.skywars.kits.perks;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@ -11,6 +12,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
@ -41,8 +43,9 @@ public abstract class SkywarsPerk extends Perk
Player player = event.getPlayer();
ItemStack itemStack = player.getItemInHand();
Block block = event.getClickedBlock();
if (!hasPerk(player) || itemStack == null || !itemStack.isSimilar(_itemStack))
if (!hasPerk(player) || itemStack == null || !itemStack.isSimilar(_itemStack) || UtilBlock.usable(block))
{
return;
}

View File

@ -33,7 +33,7 @@ public class ChestLootPool
public ChestLootPool addItem(ItemStack itemStack)
{
return addItem(itemStack, itemStack.getAmount(), itemStack.getAmount(), 1);
return addItem(itemStack, itemStack.getAmount(), itemStack.getAmount(), DEFAULT_RARITY);
}
public ChestLootPool addItem(ItemStack itemStack, int rarity)