Skip to content

Commit 7062f09

Browse files
committed
Update to 1.21.11-rc1
1 parent 129e03c commit 7062f09

2 files changed

Lines changed: 15 additions & 16 deletions

File tree

gradle.properties

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Project Specifics
2-
projectVersion=0.9.8.1
2+
projectVersion=0.9.9
33
modrinthId=G9eJHDO2
44

55
# Minecraft
6-
minecraftVersion=1.21.9
7-
minecraftRequired=>=1.21.9- <1.21.11
8-
minecraftCompatible=1.21.9,1.21.10
9-
yarnMappings=1.21.9+build.1
10-
loaderVersion=0.17.3
11-
fabricApiVersion=0.134.0+1.21.9
12-
polymerVersion=0.14.3+1.21.10
6+
minecraftVersion=1.21.11-rc1
7+
minecraftRequired=>=1.21.11-
8+
minecraftCompatible=1.21.11-rc1
9+
yarnMappings=1.21.11-rc1+build.1
10+
loaderVersion=0.18.+
11+
fabricApiVersion=0.139.4+1.21.11
12+
polymerVersion=0.15.0-beta.3+1.21.11-pre5
1313

1414
# Plugins
1515
systemProp.loomVersion=1.13.+

src/main/java/gay/ampflower/polysit/Main.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import net.minecraft.world.BlockView;
4444
import net.minecraft.world.World;
4545
import net.minecraft.world.WorldProperties;
46+
import net.minecraft.world.attribute.EnvironmentAttributes;
4647
import org.jetbrains.annotations.NotNull;
4748
import org.slf4j.Logger;
4849

@@ -232,14 +233,10 @@ private static boolean isAir(BlockState state, BlockPos pos, Entity entity) {
232233

233234
private static boolean maySleep(final Entity entity, final BlockPos pos) {
234235
if (entity instanceof ServerPlayerEntity player) {
235-
final var result = EntitySleepEvents.ALLOW_SLEEP_TIME.invoker().allowSleepTime(player, pos, false);
236-
if (result.isAccepted()) {
237-
return true;
236+
final var result = EntitySleepEvents.ALLOW_SLEEPING.invoker().allowSleep(player, pos);
237+
if (result != null) {
238+
return false;
238239
}
239-
if (result == ActionResult.PASS) {
240-
return !player.getEntityWorld().isDay();
241-
}
242-
return false;
243240
}
244241

245242
return !entity.getEntityWorld().isDay();
@@ -274,7 +271,9 @@ public static ActionResult sit(@NotNull final World world, @NotNull final BlockS
274271
if (state.getBlock() instanceof BedBlock && !maySleep(entity, pos)) {
275272
if (!command && entity instanceof ServerPlayerEntity player) {
276273
// Let the bed explode as it should normally.
277-
if (!BedBlock.isBedWorking(world)) {
274+
final var rule = world.getEnvironmentAttributes()
275+
.getAttributeValue(EnvironmentAttributes.BED_RULE_GAMEPLAY, pos);
276+
if (rule.explodes()) {
278277
return ActionResult.PASS;
279278
}
280279

0 commit comments

Comments
 (0)