Skip to content

Commit 4ca7515

Browse files
authored
Fix bed occupation state check in LivingEntityMixin#setOccupiedState (#188)
Removes the incorrect inversion and checks for originalState.contains(BedBlock.OCCUPIED) as the original Fabric API does Signed-off-by: unilock <unilock@fennet.rentals>
1 parent cf68abb commit 4ca7515

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/mixin/entity/event/LivingEntityMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private void setOccupiedState(BlockState state, World world, BlockPos pos, Livin
128128
// when the bed doesn't have the property.
129129
BlockState originalState = fabric_originalState != null ? fabric_originalState : state;
130130

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

0 commit comments

Comments
 (0)