Change ItemFrame to actually provide a defensive copy. Fixes BUKKIT-2784
If a defensive copy is not used in the API, changes to the item are reflected in memory, but never updated to the client. It also goes against the general contract provided in Bukkit, where setItem should be the only way to change the underlying item frame. By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
@@ -27,7 +27,7 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame {
|
||||
|
||||
public org.bukkit.inventory.ItemStack getItem() {
|
||||
ItemStack i = getHandle().i();
|
||||
return i == null ? new org.bukkit.inventory.ItemStack(Material.AIR) : new CraftItemStack(i);
|
||||
return i == null ? new org.bukkit.inventory.ItemStack(Material.AIR) : CraftItemStack.asBukkitStack(i);
|
||||
}
|
||||
|
||||
public Rotation getRotation() {
|
||||
|
||||
Reference in New Issue
Block a user