Stop using deprecated getItemInHand()
This commit is contained in:
parent
f9cc07608d
commit
3402efe5c7
|
|
@ -19,6 +19,7 @@
|
||||||
package me.ryanhamshire.GriefPrevention;
|
package me.ryanhamshire.GriefPrevention;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
|
|
||||||
//tells a player about how many claim blocks he has, etc
|
//tells a player about how many claim blocks he has, etc
|
||||||
//implemented as a task so that it can be delayed
|
//implemented as a task so that it can be delayed
|
||||||
|
|
@ -37,7 +38,7 @@ class EquipShovelProcessingTask implements Runnable
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
//if he's not holding the golden shovel anymore, do nothing
|
//if he's not holding the golden shovel anymore, do nothing
|
||||||
if(player.getItemInHand().getType() != GriefPrevention.instance.config_claims_modificationTool) return;
|
if(GriefPrevention.instance.getItemInHand(player, EquipmentSlot.HAND).getType() != GriefPrevention.instance.config_claims_modificationTool) return;
|
||||||
|
|
||||||
PlayerData playerData = GriefPrevention.instance.dataStore.getPlayerData(player.getUniqueId());
|
PlayerData playerData = GriefPrevention.instance.dataStore.getPlayerData(player.getUniqueId());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
import org.bukkit.event.player.*;
|
import org.bukkit.event.player.*;
|
||||||
import org.bukkit.event.player.PlayerLoginEvent.Result;
|
import org.bukkit.event.player.PlayerLoginEvent.Result;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||||
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
|
|
@ -1405,7 +1406,7 @@ class PlayerEventHandler implements Listener
|
||||||
if(!GriefPrevention.instance.pvpRulesApply(player.getWorld())) return;
|
if(!GriefPrevention.instance.pvpRulesApply(player.getWorld())) return;
|
||||||
|
|
||||||
//if we're preventing spawn camping and the player was previously empty handed...
|
//if we're preventing spawn camping and the player was previously empty handed...
|
||||||
if(GriefPrevention.instance.config_pvp_protectFreshSpawns && (player.getItemInHand().getType() == Material.AIR))
|
if(GriefPrevention.instance.config_pvp_protectFreshSpawns && (GriefPrevention.instance.getItemInHand(player, EquipmentSlot.HAND).getType() == Material.AIR))
|
||||||
{
|
{
|
||||||
//if that player is currently immune to pvp
|
//if that player is currently immune to pvp
|
||||||
PlayerData playerData = this.dataStore.getPlayerData(event.getPlayer().getUniqueId());
|
PlayerData playerData = this.dataStore.getPlayerData(event.getPlayer().getUniqueId());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user