mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 02:55:45 +01:00
Avoid players seeing item frames to optimise maps in item frames
This commit is contained in:
parent
bf3bf6f776
commit
fe15df7c8b
@ -11,6 +11,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.v1_18_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_18_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
@ -548,6 +549,14 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
|||||||
npc.getOrAddTrait(Inventory.class);
|
npc.getOrAddTrait(Inventory.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canSee(org.bukkit.entity.Entity entity) {
|
||||||
|
if (entity.getType() == EntityType.ITEM_FRAME) {
|
||||||
|
return false; // optimise for large maps in item frames
|
||||||
|
}
|
||||||
|
return super.canSee(entity);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Player getBukkitEntity() {
|
public Player getBukkitEntity() {
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
Reference in New Issue
Block a user