From 6ec5afc6c02fbcdb4d78f670104bec78b666c3f9 Mon Sep 17 00:00:00 2001 From: Liyan Zhao Date: Thu, 11 Jul 2024 01:59:28 +0800 Subject: [PATCH] fix --- gradle.properties | 4 ++-- .../com/github/zly2006/enclosure/mixin/MixinBlockItem.java | 1 + .../com/github/zly2006/enclosure/mixin/MixinPlayerEntity.java | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 1772196..5242da3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,8 +2,8 @@ org.gradle.jvmargs=-Xmx5G org.gradle.parallel=true # Mod Properties -mod_version=0.4.2 -archices_preview_version=alpha +mod_version=0.4.3 +archices_preview_version= maven_group=com.github.zly2006 archives_base_name=enclosure-fabric diff --git a/src/main/java/com/github/zly2006/enclosure/mixin/MixinBlockItem.java b/src/main/java/com/github/zly2006/enclosure/mixin/MixinBlockItem.java index f85c2ac..ff398d2 100644 --- a/src/main/java/com/github/zly2006/enclosure/mixin/MixinBlockItem.java +++ b/src/main/java/com/github/zly2006/enclosure/mixin/MixinBlockItem.java @@ -20,6 +20,7 @@ private void canPlace(ItemPlacementContext context, BlockState state, CallbackIn if (context.getPlayer() instanceof ServerPlayerEntity serverPlayer) { if (!ServerMain.INSTANCE.checkPermission(serverPlayer, Permission.PLACE_BLOCK, context.getBlockPos())) { serverPlayer.sendMessage(PLACE_BLOCK.getNoPermissionMsg(serverPlayer)); + serverPlayer.currentScreenHandler.syncState(); cir.setReturnValue(false); } } diff --git a/src/main/java/com/github/zly2006/enclosure/mixin/MixinPlayerEntity.java b/src/main/java/com/github/zly2006/enclosure/mixin/MixinPlayerEntity.java index 55f7df8..4ef7cf3 100644 --- a/src/main/java/com/github/zly2006/enclosure/mixin/MixinPlayerEntity.java +++ b/src/main/java/com/github/zly2006/enclosure/mixin/MixinPlayerEntity.java @@ -47,6 +47,7 @@ private void protectPlacing(BlockPos pos, Direction facing, ItemStack stack, Cal if (((LivingEntity) this) instanceof ServerPlayerEntity serverPlayer) { if (!ServerMain.INSTANCE.checkPermission(serverPlayer, PLACE_BLOCK, pos)) { serverPlayer.sendMessage(PLACE_BLOCK.getNoPermissionMsg(serverPlayer)); + serverPlayer.currentScreenHandler.syncState(); cir.setReturnValue(false); } }