From 1dd8ce906c576d2872d9caac9b84f7c149afded6 Mon Sep 17 00:00:00 2001 From: zhangyuheng Date: Thu, 21 Mar 2024 01:09:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BB=8E=E6=9F=93=E8=89=B2=E7=9B=92=E5=AD=90=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=9D=90=E6=96=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../deercloud/liteworldedit/Jobs/Place.java | 38 ++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6ec6608..77073f6 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ site.deercloud LiteWorldEdit - 2.4.0.2 + 2.4.1.0 jar LiteWorldEdit diff --git a/src/main/java/site/deercloud/liteworldedit/Jobs/Place.java b/src/main/java/site/deercloud/liteworldedit/Jobs/Place.java index 1994a1c..a5a1b95 100644 --- a/src/main/java/site/deercloud/liteworldedit/Jobs/Place.java +++ b/src/main/java/site/deercloud/liteworldedit/Jobs/Place.java @@ -84,7 +84,43 @@ public class Place extends Job { private boolean moveBlockFromShulkerBoxToInv() { Inventory _inventory = this.get_inventory(); - HashMap shulkerBoxes = _inventory.all(Material.SHULKER_BOX); + HashMap shulkerBoxes = new HashMap<>(); + HashMap plainShulkerBoxes = _inventory.all(Material.SHULKER_BOX); + HashMap whiteShulkerBoxes = _inventory.all(Material.WHITE_SHULKER_BOX); + HashMap orangeShulkerBoxes = _inventory.all(Material.ORANGE_SHULKER_BOX); + HashMap magentaShulkerBoxes = _inventory.all(Material.MAGENTA_SHULKER_BOX); + HashMap lightBlueShulkerBoxes = _inventory.all(Material.LIGHT_BLUE_SHULKER_BOX); + HashMap yellowShulkerBoxes = _inventory.all(Material.YELLOW_SHULKER_BOX); + HashMap limeShulkerBoxes = _inventory.all(Material.LIME_SHULKER_BOX); + HashMap pinkShulkerBoxes = _inventory.all(Material.PINK_SHULKER_BOX); + HashMap grayShulkerBoxes = _inventory.all(Material.GRAY_SHULKER_BOX); + HashMap lightGrayShulkerBoxes = _inventory.all(Material.LIGHT_GRAY_SHULKER_BOX); + HashMap cyanShulkerBoxes = _inventory.all(Material.CYAN_SHULKER_BOX); + HashMap purpleShulkerBoxes = _inventory.all(Material.PURPLE_SHULKER_BOX); + HashMap blueShulkerBoxes = _inventory.all(Material.BLUE_SHULKER_BOX); + HashMap brownShulkerBoxes = _inventory.all(Material.BROWN_SHULKER_BOX); + HashMap greenShulkerBoxes = _inventory.all(Material.GREEN_SHULKER_BOX); + HashMap redShulkerBoxes = _inventory.all(Material.RED_SHULKER_BOX); + HashMap blackShulkerBoxes = _inventory.all(Material.BLACK_SHULKER_BOX); + + shulkerBoxes.putAll(plainShulkerBoxes); + shulkerBoxes.putAll(whiteShulkerBoxes); + shulkerBoxes.putAll(orangeShulkerBoxes); + shulkerBoxes.putAll(magentaShulkerBoxes); + shulkerBoxes.putAll(lightBlueShulkerBoxes); + shulkerBoxes.putAll(yellowShulkerBoxes); + shulkerBoxes.putAll(limeShulkerBoxes); + shulkerBoxes.putAll(pinkShulkerBoxes); + shulkerBoxes.putAll(grayShulkerBoxes); + shulkerBoxes.putAll(lightGrayShulkerBoxes); + shulkerBoxes.putAll(cyanShulkerBoxes); + shulkerBoxes.putAll(purpleShulkerBoxes); + shulkerBoxes.putAll(blueShulkerBoxes); + shulkerBoxes.putAll(brownShulkerBoxes); + shulkerBoxes.putAll(greenShulkerBoxes); + shulkerBoxes.putAll(redShulkerBoxes); + shulkerBoxes.putAll(blackShulkerBoxes); + for (Integer index : shulkerBoxes.keySet()) { LoggerX.debug("找到潜影盒:" + index); ItemStack itemStack = _inventory.getItem(index);