Skip to content

Commit

Permalink
add a few more npc sit block type offset fixers
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 2, 2021
1 parent 88a68b9 commit 8ac96fb
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -18,6 +18,7 @@
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.type.Bed;
import org.bukkit.block.data.type.Campfire;
import org.bukkit.block.data.type.Slab;
import org.bukkit.block.data.type.Stairs;
import org.bukkit.command.CommandSender;
Expand Down Expand Up @@ -362,6 +363,12 @@ else if (args.hasValueFlag("anchor")) {
if (data instanceof Stairs || data instanceof Bed || (data instanceof Slab && ((Slab) data).getType() == Slab.Type.BOTTOM)) {
targetLocation.setY(targetLocation.getBlockY() + 0.3);
}
else if (data instanceof Campfire) {
targetLocation.setY(targetLocation.getBlockY() + 0.2);
}
else if (block.getType().name().endsWith("CARPET")) {
targetLocation.setY(targetLocation.getBlockY());
}
else if (block.getType().isSolid()) {
targetLocation.setY(targetLocation.getBlockY() + 0.8);
}
Expand Down

0 comments on commit 8ac96fb

Please sign in to comment.