forked from virt-mirrors/Sit
include all custom blocks for non sitable with hand if the block has an interaction
This commit is contained in:
parent
f4ac860799
commit
8201047f78
1 changed files with 4 additions and 3 deletions
|
@ -161,6 +161,9 @@ public class Utl {
|
||||||
ServerConfig config = FileData.getServerConfig();
|
ServerConfig config = FileData.getServerConfig();
|
||||||
Block block = blockState.getBlock();
|
Block block = blockState.getBlock();
|
||||||
|
|
||||||
|
// make sure that the block that is being sit on has no interaction when hand sitting
|
||||||
|
if (hit != null && blockState.onUse(player.getWorld(), player, hit).isAccepted()) return null;
|
||||||
|
|
||||||
// only if custom is enabled
|
// only if custom is enabled
|
||||||
if (config.isCustomEnabled()) {
|
if (config.isCustomEnabled()) {
|
||||||
// if the block is on the blacklist, false
|
// if the block is on the blacklist, false
|
||||||
|
@ -183,9 +186,7 @@ public class Utl {
|
||||||
&& block instanceof CarpetBlock) return CARPET;
|
&& block instanceof CarpetBlock) return CARPET;
|
||||||
if (config.getPresetBlocks().isFullBlocks()
|
if (config.getPresetBlocks().isFullBlocks()
|
||||||
// make sure the block is a full cube
|
// make sure the block is a full cube
|
||||||
&& blockState.isFullCube(player.getWorld(),blockPos)
|
&& blockState.isFullCube(player.getWorld(),blockPos)) return 1.0;
|
||||||
// make sure there isn't an action for the block IF the hit isn't null (manual command / no right click check)
|
|
||||||
&& (hit == null || !blockState.onUse(player.getWorld(), player, hit).isAccepted())) return 1.0;
|
|
||||||
|
|
||||||
// at the end, return false
|
// at the end, return false
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue