From 187c2a68d036fc18138fc8ede7d054f432b1696f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 23 Dec 2022 23:22:10 +0100 Subject: [PATCH] Fix panzern and laufbau undon --- .../bausystem/features/slaves/laufbau/LaufbauCommand.java | 1 + .../features/slaves/laufbau/states/CreatingLaufState.java | 4 ++-- .../bausystem/features/slaves/panzern/Panzern.java | 8 ++++---- .../bausystem/features/slaves/panzern/PanzernCommand.java | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java index d188e799..b7f2de60 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java @@ -54,6 +54,7 @@ public class LaufbauCommand extends SWCommand { while (true) { if (!laufbau.hasNext()) { BauSystem.MESSAGE.send("LAUFBAU_DONE", player); + laufbau.getEditSession().close(); WorldEditUtils.addToPlayer(player, laufbau.getEditSession()); cancel(); return; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/CreatingLaufState.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/CreatingLaufState.java index be76c5a7..68a7d9d0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/CreatingLaufState.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/CreatingLaufState.java @@ -146,7 +146,7 @@ public class CreatingLaufState implements LaufbauState { } try { editSession.setBlock(BukkitAdapter.asBlockVector(location), BukkitAdapter.adapt(highest.blockData)); - location.getBlock().setBlockData(highest.blockData, false); + // location.getBlock().setBlockData(highest.blockData, false); if (highest.blockConsumer != null) highest.blockConsumer.accept(location.getBlock()); } catch (MaxChangedBlocksException e) { e.printStackTrace(); @@ -190,7 +190,7 @@ public class CreatingLaufState implements LaufbauState { } try { editSession.setBlock(BukkitAdapter.asBlockVector(location), SHELL); - location.getBlock().setType(Material.END_STONE, false); + // location.getBlock().setType(Material.END_STONE, false); } catch (MaxChangedBlocksException e) { e.printStackTrace(); // ingored diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/Panzern.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/Panzern.java index f8ade838..1fdfd82a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/Panzern.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/Panzern.java @@ -120,20 +120,20 @@ public class Panzern { emptyBlocks.add(currentBlock.getLocation().toVector()); return; case SLAB: - currentBlock.setType(slabMaterial); + // currentBlock.setType(slabMaterial); editSession.setBlock(BukkitAdapter.asBlockVector(currentBlock.getLocation()), slabType); break; case BLOCK: case DEFAULT: - currentBlock.setType(blockMaterial); + // currentBlock.setType(blockMaterial); editSession.setBlock(BukkitAdapter.asBlockVector(currentBlock.getLocation()), blockType); break; case UNMOVABLE: - currentBlock.setType(Material.JUKEBOX); + // currentBlock.setType(Material.JUKEBOX); editSession.setBlock(BukkitAdapter.asBlockVector(currentBlock.getLocation()), jukeboxType); break; case UNMOVABLE_SLAB: - currentBlock.setType(Material.COBWEB); + // currentBlock.setType(Material.COBWEB); editSession.setBlock(BukkitAdapter.asBlockVector(currentBlock.getLocation()), cobwebType); break; default: diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java index 9f26830c..e05ca76a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java @@ -69,6 +69,7 @@ public class PanzernCommand extends SWCommand { while (true) { if (!panzern.hasNext()) { BauSystem.MESSAGE.send("PANZERN_DONE", player); + panzern.getEditSession().close(); WorldEditUtils.addToPlayer(player, panzern.getEditSession()); cancel(); return;