Fix spawn protection

This commit is contained in:
Sam 2017-12-09 12:53:15 +00:00 committed by Alexander Meech
parent 32c4bf1c20
commit ac0c1f8fad
2 changed files with 4 additions and 3 deletions

View File

@ -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<Block> _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;
}

View File

@ -43,7 +43,7 @@ public class CakeResourcePage extends ShopPageBase<ArcadeManager, CakeResourceSh
public CakeResourcePage(ArcadeManager plugin, CakeResourceShop shop, Player player, CakeResource resource, List<CakeItem> 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;