forked from virt-mirrors/Sit
allow sitting on the dried ghast because why not
This commit is contained in:
parent
26df4015fe
commit
35e6435417
1 changed files with 6 additions and 1 deletions
|
@ -44,6 +44,7 @@ import java.util.List;
|
||||||
public class Utl {
|
public class Utl {
|
||||||
|
|
||||||
private static double BED_HEIGHT = 0.5625;
|
private static double BED_HEIGHT = 0.5625;
|
||||||
|
private static double DRIED_GHAST_HEIGHT = 0.625;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if a block is obstructed (no collision)
|
* check if a block is obstructed (no collision)
|
||||||
|
@ -173,6 +174,10 @@ public class Utl {
|
||||||
return BED_HEIGHT;
|
return BED_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// why not sit on the dried ghast?
|
||||||
|
if (Registries.BLOCK.getEntry(block).getIdAsString().equals("minecraft:dried_ghast"))
|
||||||
|
return DRIED_GHAST_HEIGHT;
|
||||||
|
|
||||||
// make sure that the block that is being sit on has no interaction when hand sitting
|
// make sure that the block that is being sit on has no interaction when hand sitting
|
||||||
if (hit != null && blockIsInList(config.getInteractionBlocks(), blockState)) {
|
if (hit != null && blockIsInList(config.getInteractionBlocks(), blockState)) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -228,7 +233,7 @@ public class Utl {
|
||||||
// get the blockstate
|
// get the blockstate
|
||||||
BlockState blockState = player.getWorld().getBlockState(blockPos);
|
BlockState blockState = player.getWorld().getBlockState(blockPos);
|
||||||
// check if the block is still there & the block is a valid sit block (by checking if there is a sit height for the block)
|
// check if the block is still there & the block is a valid sit block (by checking if there is a sit height for the block)
|
||||||
return !blockState.isAir() && (getSittingHeight(player,blockPos,null) != null || blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), Identifier.tryParse("minecraft:beds"))));
|
return !blockState.isAir() && getSittingHeight(player,blockPos,null) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue