From ac0c1f8fad1c4e63b7b12b684987ff88b0e74736 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 9 Dec 2017 12:53:15 +0000 Subject: [PATCH] Fix spawn protection --- .../arcade/game/games/cakewars/general/CakePlayerModule.java | 5 +++-- .../game/arcade/game/games/cakewars/ui/CakeResourcePage.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakePlayerModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakePlayerModule.java index 819e785c3..da6c7df24 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakePlayerModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakePlayerModule.java @@ -5,6 +5,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; @@ -57,7 +58,7 @@ public class CakePlayerModule extends CakeModule .setUnbreakable(true) .build(); private static final int PLATFORM_DELTA = 1; - private static final PotionEffect SPAWN_PROTECTION = new PotionEffect(PotionEffectType.REGENERATION, 80, 0); + private static final PotionEffect SPAWN_PROTECTION = new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 120, 0); private final Set _placedBlocks; // Used to store the inventory of a player when using the rune of holding @@ -247,7 +248,7 @@ public class CakePlayerModule extends CakeModule continue; } - if (itemStack.getAmount() < 1) + if (itemStack != null && itemStack.getAmount() < 1) { contents[i] = null; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java index 61a717111..9781a5cf8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/ui/CakeResourcePage.java @@ -43,7 +43,7 @@ public class CakeResourcePage extends ShopPageBase items) { - super(plugin, shop, plugin.GetClients(), plugin.GetDonation(), resource.getName() + " Shop", player, 27); + super(plugin, shop, plugin.GetClients(), plugin.GetDonation(), resource.getName() + " Shop", player, (int) ((Math.ceil(items.size() % 7)) * 9)); _game = (CakeWars) plugin.GetGame(); _resource = resource;