mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-18 15:17:36 +01:00
Changed usage of CraftItemStack to ItemStack.
This commit is contained in:
parent
edd2f460a0
commit
8edb6976fb
@ -20,7 +20,6 @@
|
||||
package com.sk89q.worldguard.bukkit;
|
||||
|
||||
import com.sk89q.worldguard.blacklist.events.ItemAcquireBlacklistEvent;
|
||||
import org.bukkit.craftbukkit.entity.CraftItem;
|
||||
import org.bukkit.entity.Item;
|
||||
import com.sk89q.worldguard.blacklist.events.ItemDropBlacklistEvent;
|
||||
import org.bukkit.*;
|
||||
@ -182,10 +181,12 @@ public void onPlayerDropItem(PlayerDropItemEvent event) {
|
||||
}
|
||||
|
||||
if (plugin.blacklist != null) {
|
||||
CraftItem ci = (CraftItem)event.getItemDrop();
|
||||
Item ci = event.getItemDrop();
|
||||
|
||||
if (!plugin.blacklist.check(new ItemDropBlacklistEvent(plugin.wrapPlayer(event.getPlayer()), toVector(ci.getLocation()),
|
||||
ci.getItemStack().getTypeId()), false, false)) {
|
||||
if (!plugin.blacklist.check(
|
||||
new ItemDropBlacklistEvent(plugin.wrapPlayer(event
|
||||
.getPlayer()), toVector(ci.getLocation()), ci
|
||||
.getItemStack().getTypeId()), false, false)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
@ -194,8 +195,9 @@ public void onPlayerDropItem(PlayerDropItemEvent event) {
|
||||
|
||||
/**
|
||||
* Called when a player attempts to pickup an item
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*
|
||||
* @param event
|
||||
* Relevant event details
|
||||
*/
|
||||
@Override
|
||||
public void onPlayerPickupItem(PlayerPickupItemEvent event) {
|
||||
@ -205,10 +207,12 @@ public void onPlayerPickupItem(PlayerPickupItemEvent event) {
|
||||
}
|
||||
|
||||
if (plugin.blacklist != null) {
|
||||
CraftItem ci = (CraftItem)event.getItem();
|
||||
Item ci = event.getItem();
|
||||
|
||||
if (!plugin.blacklist.check(new ItemAcquireBlacklistEvent(plugin.wrapPlayer(event.getPlayer()), toVector(ci.getLocation()),
|
||||
ci.getItemStack().getTypeId()), false, false)) {
|
||||
if (!plugin.blacklist.check(
|
||||
new ItemAcquireBlacklistEvent(plugin.wrapPlayer(event
|
||||
.getPlayer()), toVector(ci.getLocation()), ci
|
||||
.getItemStack().getTypeId()), false, false)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user