Skip to content

Commit

Permalink
Fix bed occupation state check in LivingEntityMixin#setOccupiedState (S…
Browse files Browse the repository at this point in the history
…inytra#188)

Removes the incorrect inversion and checks for originalState.contains(BedBlock.OCCUPIED) as the original Fabric API does

Signed-off-by: unilock <[email protected]>
  • Loading branch information
unilock authored Jan 29, 2025
1 parent cf68abb commit 4ca7515
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private void setOccupiedState(BlockState state, World world, BlockPos pos, Livin
// when the bed doesn't have the property.
BlockState originalState = fabric_originalState != null ? fabric_originalState : state;

if (!EntitySleepEvents.SET_BED_OCCUPATION_STATE.invoker().setBedOccupationState((LivingEntity) (Object) this, pos, originalState, occupied)) {
if (EntitySleepEvents.SET_BED_OCCUPATION_STATE.invoker().setBedOccupationState((LivingEntity) (Object) this, pos, originalState, occupied) || originalState.contains(BedBlock.OCCUPIED)) {
originalState.setBedOccupied(world, pos, entity, occupied);
}

Expand Down

0 comments on commit 4ca7515

Please sign in to comment.