From 2d5bedc63a0fbdb4e6d42420c26c2f9df2e9a998 Mon Sep 17 00:00:00 2001 From: D4rkr34lm Date: Fri, 8 Mar 2024 22:10:41 +0100 Subject: [PATCH 1/2] Added block type to playerInteract event in script api --- .../steamwar/bausystem/features/script/event/EventListener.java | 1 + 1 file changed, 1 insertion(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java index 89f9667e..9871c27b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/event/EventListener.java @@ -125,6 +125,7 @@ public class EventListener implements Listener { table.set("blockY", event.getClickedBlock().getY()); table.set("blockZ", event.getClickedBlock().getZ()); table.set("blockFace", event.getBlockFace().name()); + table.set("blockType", event.getClickedBlock().getType().name()); } else { table.set("hasBlock", LuaValue.valueOf(false)); } -- 2.39.5 From f1db3c20476ad365fdf4dca68ee502c1931d2b9d Mon Sep 17 00:00:00 2001 From: D4rkr34lm Date: Fri, 8 Mar 2024 22:23:13 +0100 Subject: [PATCH 2/2] Updated doc --- SCRIPT.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SCRIPT.md b/SCRIPT.md index ae9cb181..dc78efe8 100644 --- a/SCRIPT.md +++ b/SCRIPT.md @@ -333,6 +333,7 @@ Wenn `hasBlock` wahr ist, gibt es folgende Variablen: | `blockY` | Die Y-Koordinate des Blocks | | `blockZ` | Die Z-Koordinate des Blocks | | `blockFace` | Die Seite des Blocks die geklickt wurde | +| `blockType` | Das Material des Blocks | ### Position -- 2.39.5