From 5608fb71917c12f065c1dd5ce319d08ec6850382 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sat, 27 Mar 2021 02:11:17 +0900 Subject: fix bannables --- .../impl/boss/terminal/FeatureSimonSaysSolver.java | 4 +--- .../impl/boss/terminal/FeatureTerminalSolvers.java | 4 ---- .../features/impl/dungeon/FeatureBoxBats.java | 2 ++ .../features/impl/dungeon/FeatureBoxSkelemaster.java | 1 + .../features/impl/dungeon/FeatureBoxStarMobs.java | 3 ++- .../bombdefuse/chambers/arrow/ArrowRightProcessor.java | 13 ------------- .../chambers/creeper/CreeperRightProcessor.java | 16 ---------------- .../bombdefuse/chambers/number/NumberRightProcessor.java | 12 ------------ .../kr/syeyoung/dungeonsguide/stomp/StompPayload.java | 11 ++++------- 9 files changed, 10 insertions(+), 56 deletions(-) diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureSimonSaysSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureSimonSaysSolver.java index 6840788f..6e7ef176 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureSimonSaysSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureSimonSaysSolver.java @@ -79,9 +79,7 @@ public class FeatureSimonSaysSolver extends SimpleFeature implements WorldRender BlockPos pos = event.pos.add(1,0,0); if (120 <= pos.getY() && pos.getY() <= 123 && pos.getX() == 310 && 291 <= pos.getZ() && pos.getZ() <= 294) { if (w.getBlockState(event.pos).getBlock() != Blocks.stone_button) return; - if (!pos.equals(orderclick.peek())) { - if (isEnabled()) event.setCanceled(true); - } else { + if (pos.equals(orderclick.peek())) { orderclick.poll(); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureTerminalSolvers.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureTerminalSolvers.java index d792a07c..d069c84d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureTerminalSolvers.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/terminal/FeatureTerminalSolvers.java @@ -119,15 +119,11 @@ public class FeatureTerminalSolvers extends SimpleFeature implements GuiOpenList if (solutionProvider == null) return; if (solution == null) return; if (solution.getCurrSlots() == null) { - mouseInputEvent.setCanceled(true); return; } - mouseInputEvent.setCanceled(true); Slot s = ((GuiChest) Minecraft.getMinecraft().currentScreen).getSlotUnderMouse(); if (solution.getCurrSlots().contains(s)) { clicked.add(s); - Minecraft.getMinecraft().playerController.windowClick(((GuiChest)Minecraft.getMinecraft().currentScreen).inventorySlots.windowId, s.getSlotIndex(), - 2, 0, Minecraft.getMinecraft().thePlayer); return; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxBats.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxBats.java index a36a6f03..92df3989 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxBats.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxBats.java @@ -39,11 +39,13 @@ public class FeatureBoxBats extends SimpleFeature implements WorldRenderListener List skeletonList = Minecraft.getMinecraft().theWorld.getEntities(EntityBat.class, new Predicate() { @Override public boolean apply(@Nullable EntityBat input) { + if (input != null && input.isInvisible()) return false; return input != null && input.getDistanceSq(player) < sq; } }); AColor c = this.getParameter("color").getValue(); for (EntityBat entitySkeleton : skeletonList) { + if (!entitySkeleton.isInvisible()) RenderUtils.highlightBox(entitySkeleton, c, partialTicks, true); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxSkelemaster.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxSkelemaster.java index 1786e7cf..545a5449 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxSkelemaster.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxSkelemaster.java @@ -40,6 +40,7 @@ public class FeatureBoxSkelemaster extends SimpleFeature implements WorldRenderL @Override public boolean apply(@Nullable EntityArmorStand input) { if (player.distanceSq(input.getPosition()) > sq) return false; + if (input.isInvisible() || !input.getAlwaysRenderNameTag()) return false; return input.getName().contains("Skeleton Master"); } }); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java index 670ad077..e647e0de 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureBoxStarMobs.java @@ -39,12 +39,13 @@ public class FeatureBoxStarMobs extends SimpleFeature implements WorldRenderList @Override public boolean apply(@Nullable EntityArmorStand input) { if (player.distanceSq(input.getPosition()) > sq) return false; + if (input.isInvisible() || !input.getAlwaysRenderNameTag()) return false; return input.getName().contains("✯"); } }); AColor c = this.getParameter("color").getValue(); for (EntityArmorStand entitySkeleton : skeletonList) { - RenderUtils.highlightBox(entitySkeleton, c, partialTicks, true); + RenderUtils.highlightBox(entitySkeleton, c, partialTicks, true); } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java index f3def5a7..1203e7b4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java @@ -75,19 +75,6 @@ public class ArrowRightProcessor extends GeneralDefuseChamberProcessor { } } - @Override - public void onInteract(PlayerInteractEntityEvent event) { - if (answer == -1) return; - if (event.getEntity() instanceof EntityArmorStand) { -// BlockPos pos = event.getEntity().getPosition(); -// for (int i = 0; i < 9; i++) { -// if (currentAnswers[i] == correctAnswers[i] && pos.equals(grid[i].add(0, -1, 0))) event.setCanceled(true); -// } -// -// System.out.println(" block ? "+event.isCanceled()); - } - } - private int match(EntityArmorStand armorStand) { if (armorStand == null) return -1; ItemStack item = armorStand.getInventory()[4]; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java index 1abac165..42726479 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java @@ -49,22 +49,6 @@ public class CreeperRightProcessor extends GeneralDefuseChamberProcessor { } } } - - @Override - public void onInteractBlock(PlayerInteractEvent event) { - BlockPos pos = event.pos; - World w = event.world; - - if (answer == -1) return; - - if (w.getBlockState(pos).getBlock() == Blocks.wooden_button) { - for (int i = 0; i < 9; i++) { - if (poses[answer] == pos && ((answer >> i) & 0x01) == 0) { - event.setCanceled(true); - } - } - } - } @Override public void onDataRecieve(NBTTagCompound compound) { if (2 == compound.getByte("a")) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java index fd0f40ec..a764b1d8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java @@ -57,18 +57,6 @@ public class NumberRightProcessor extends GeneralDefuseChamberProcessor { RenderUtils.drawTextAtWorld(d4+"", d4p.getX()+ 0.5f, d4p.getY()+ 0.2f, d4p.getZ()+ 0.5f, 0xFFFFFF00, 0.03F, false, false, partialTicks); } - @Override - public void onInteract(PlayerInteractEntityEvent event) { - if (answer == -1) return; - if (event.getEntity() instanceof EntityArmorStand) { - BlockPos pos = event.getEntity().getPosition(); - if (a1 == d1 && pos.equals(d1p)) event.setCanceled(true); - if (a2 == d2 && pos.equals(d2p)) event.setCanceled(true); - if (a3 == d3 && pos.equals(d3p)) event.setCanceled(true); - if (a4 == d4 && pos.equals(d4p)) event.setCanceled(true); - } - } - @Override public void onDataRecieve(NBTTagCompound compound) { if (1 == compound.getByte("a")) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompPayload.java b/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompPayload.java index c3e00de7..19dd4ac1 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompPayload.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/stomp/StompPayload.java @@ -5,9 +5,7 @@ import lombok.Data; import lombok.Singular; import lombok.experimental.Accessors; -import java.util.HashMap; -import java.util.Map; -import java.util.Scanner; +import java.util.*; @Data @Accessors(chain = true, fluent = true) @@ -59,12 +57,11 @@ public class StompPayload { stompPayload.headers.put(name, value); } - StringBuilder payloadBuilder = new StringBuilder(); + List lines = new ArrayList(); while (scanner.hasNextLine() && !(line = scanner.nextLine()).equals("\0")) { - payloadBuilder.append(line); - payloadBuilder.append("\n"); + lines.add(line); } - stompPayload.payload = payloadBuilder.toString(); + stompPayload.payload = String.join("\n", lines); return stompPayload; } } -- cgit