Remove redundant BlockPosition creation from sleep API

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2019-01-02 22:58:07 +11:00
parent 5aff480181
commit ec15f56573

View file

@ -162,7 +162,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
Preconditions.checkArgument(location != null, "Location == null");
Preconditions.checkArgument(location.getWorld().equals(getWorld()), "Cannot sleep across worlds");
BlockPosition blockposition = new BlockPosition(new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
BlockPosition blockposition = new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ());
IBlockData iblockdata = getHandle().world.getType(blockposition);
if (!(iblockdata.getBlock() instanceof BlockBed)) {
return false;