From fcb1ce4e4b4d7a4d448311daf487a4e33b019b95 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 7 Oct 2023 21:05:01 +0200 Subject: [PATCH] Hotfix PlaceItemUtils and Blackstone placing Walls in 1.19 Signed-off-by: yoyosource --- .../src/de/steamwar/bausystem/utils/PlaceItemWrapper15.java | 2 +- .../src/de/steamwar/bausystem/utils/PlaceItemUtils.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BauSystem_15/src/de/steamwar/bausystem/utils/PlaceItemWrapper15.java b/BauSystem_15/src/de/steamwar/bausystem/utils/PlaceItemWrapper15.java index c945351a..cbb65fd3 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/utils/PlaceItemWrapper15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/utils/PlaceItemWrapper15.java @@ -31,7 +31,7 @@ public class PlaceItemWrapper15 implements PlaceItemWrapper { String nonWall = material.name().replace("_WALL_", "").replace("WALL_", "").replace("_WALL", ""); try { Material nonWallMaterial = Material.valueOf(nonWall); - if (nonWallMaterial != material) { + if (nonWallMaterial != material && nonWallMaterial.isItem() && !nonWallMaterial.isBlock()) { BLOCK_MATERIAL_TO_WALL_BLOCK_MATERIAL.put(nonWallMaterial, material); } } catch (Exception e) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/utils/PlaceItemUtils.java b/BauSystem_Main/src/de/steamwar/bausystem/utils/PlaceItemUtils.java index b4af6262..e9189282 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/utils/PlaceItemUtils.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/utils/PlaceItemUtils.java @@ -162,8 +162,9 @@ public class PlaceItemUtils { if (blockData == null) return PlaceItemResult.NO_BLOCK_ITEM_HELD; // Placing a Block inside of Water should set it to Waterlogged - if (blockData instanceof Waterlogged) { - ((Waterlogged) blockData).setWaterlogged(block.getType() == Material.WATER); + if (blockData instanceof Waterlogged && block.getType() == Material.WATER) { + Levelled levelled = (Levelled) block.getBlockData(); + ((Waterlogged) blockData).setWaterlogged(levelled.getLevel() == levelled.getMaximumLevel()); } if (blockData instanceof Slab) {