From bafd1eb18f7825ce5b7b39b6d689e9a27d2d5408 Mon Sep 17 00:00:00 2001 From: ceze88 Date: Wed, 13 Nov 2024 12:46:47 +0100 Subject: [PATCH] Replace removed methods --- .../skyblock/utils/world/block/BlockUtil.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/craftaro/skyblock/utils/world/block/BlockUtil.java b/src/main/java/com/craftaro/skyblock/utils/world/block/BlockUtil.java index 94945d1f..4a986a77 100644 --- a/src/main/java/com/craftaro/skyblock/utils/world/block/BlockUtil.java +++ b/src/main/java/com/craftaro/skyblock/utils/world/block/BlockUtil.java @@ -5,7 +5,6 @@ import com.craftaro.core.compatibility.MajorServerVersion; import com.craftaro.core.compatibility.MethodMapping; import com.craftaro.core.compatibility.ServerVersion; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; -import com.craftaro.core.utils.BlockUtils; import com.craftaro.core.utils.NMSUtils; import com.craftaro.skyblock.utils.item.ItemStackUtil; import org.bukkit.Bukkit; @@ -49,7 +48,7 @@ import java.util.List; import java.util.stream.Collectors; @SuppressWarnings("deprecation") -public final class BlockUtil extends BlockUtils { +public final class BlockUtil { public static BlockData convertBlockToBlockData(Block block, int x, int y, int z) { BlockData blockData = new BlockData(block.getType().name(), block.getData(), x, y, z, block.getBiome().toString()); @@ -303,7 +302,8 @@ public final class BlockUtil extends BlockUtils { } if (MajorServerVersion.isServerVersionAtOrBelow(MajorServerVersion.V1_12)) { - setBlockFast(block.getWorld(), block.getX(), block.getY(), block.getZ(), material, blockData.getData()); + //setBlockFast(block.getWorld(), block.getX(), block.getY(), block.getZ(), material, blockData.getData()); + block.setBlockData(Bukkit.createBlockData(blockData.getBlockData()), false); } else { block.setBlockData(Bukkit.getServer().createBlockData(blockData.getBlockData())); } @@ -488,10 +488,13 @@ public final class BlockUtil extends BlockUtils { stairs.setFacingDirection(BlockFace.valueOf(blockData.getFacing())); state.setData(stairs); } else if (blockDataType == BlockDataType.FLOWERPOT) { - setBlockFast(block.getWorld(), block.getX(), block.getY() - 1, block.getZ(), XMaterial.STONE, (byte) 0); + //setBlockFast(block.getWorld(), block.getX(), block.getY() - 1, block.getZ(), XMaterial.STONE, (byte) 0); + Block bottomBlock = block.getLocation().subtract(0.0D, 1.0D, 0.0D).getBlock(); + bottomBlock.setType(XMaterial.STONE.parseMaterial(), false); if (MajorServerVersion.isServerVersionAtLeast(MajorServerVersion.V1_8) && MajorServerVersion.isServerVersionAtOrBelow(MajorServerVersion.V1_12)) { if (block.getLocation().clone().subtract(0.0D, 1.0D, 0.0D).getBlock().getType() == Material.AIR) { - setBlockFast(block.getWorld(), block.getX(), block.getY() - 1, block.getZ(), XMaterial.STONE, (byte) 0); + //setBlockFast(block.getWorld(), block.getX(), block.getY() - 1, block.getZ(), XMaterial.STONE, (byte) 0); + bottomBlock.setType(XMaterial.STONE.parseMaterial(), false); } if (blockData.getFlower() != null && !blockData.getFlower().isEmpty()) {