From 4f9afd0db08b510f47cb5a932d9a45851aa8139c Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Mon, 29 Mar 2021 13:34:05 +0200 Subject: [PATCH] Yeeting Fastreset --- .../steamwar/bausystem/world/Region_15.java | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/BauSystem_15/src/de/steamwar/bausystem/world/Region_15.java b/BauSystem_15/src/de/steamwar/bausystem/world/Region_15.java index 63f2e35..7b45d38 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/Region_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/Region_15.java @@ -77,42 +77,4 @@ class Region_15 { return e; } } - - static void fastpaste(File file, int x, int y, int z, boolean rotate) { - Clipboard clipboard; - try { - clipboard = Objects.requireNonNull(ClipboardFormats.findByFile(file)).getReader(new FileInputStream(file)).read(); - } catch (NullPointerException | IOException e) { - throw new SecurityException("Bausystem schematic not found", e); - } - - BlockVector3 dimensions = clipboard.getDimensions(); - BlockVector3 v = BlockVector3.at(x, y, z); - BlockVector3 offset = clipboard.getRegion().getMinimumPoint().subtract(clipboard.getOrigin()); - if (rotate) { - v = v.add(dimensions.getX() / 2 + dimensions.getX() % 2, 0, dimensions.getZ() / 2 + dimensions.getZ() % 2).subtract(offset.multiply(-1, 1, -1)).subtract(1, 0, 1); - } else { - v = v.subtract(dimensions.getX() / 2 - dimensions.getX() % 2, 0, dimensions.getZ() / 2 - dimensions.getZ() % 2).subtract(offset); - } - - WorldServer world = ((CraftWorld) Bukkit.getWorlds().get(0)).getHandle(); - v = v.add(offset); - - for (int X = v.getBlockX(); X < v.getBlockX() + dimensions.getBlockX(); X++) { - for (int Y = v.getBlockY(); Y < v.getBlockY() + dimensions.getBlockY(); Y++) { - for (int Z = v.getBlockZ(); Z < v.getBlockZ() + dimensions.getBlockZ(); Z++) { - BlockPosition blockPos = new BlockPosition(X, Y, Z); - BaseBlock fullBlock = clipboard.getFullBlock(BlockVector3.at(X, Y, Z).subtract(v).add(clipboard.getRegion().getMinimumPoint())); - BlockData replaceTo = BukkitAdapter.adapt(fullBlock); - world.removeTileEntity(blockPos); - if (replaceTo == null) - world.setTypeAndData(blockPos, ((CraftBlockData) Material.AIR.createBlockData()).getState(), 1042); - else - world.setTypeAndData(new BlockPosition(X, Y, Z), ((CraftBlockData) replaceTo).getState(), 1042); - - world.getChunkProvider().flagDirty(blockPos); - } - } - } - } }