From 26140fd05411abfbbef1014e4db888fd7dc8c710 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 29 Mar 2022 12:37:32 +0200 Subject: [PATCH] Fix build --- .../src/de/steamwar/bausystem/utils/NMSWrapper15.java | 6 ++++++ .../src/de/steamwar/bausystem/utils/NMSWrapper18.java | 10 ++++++---- .../features/slaves/laufbau/BlockBoundingBox.java | 3 ++- .../de/steamwar/bausystem/features/world/SignEdit.java | 2 +- .../src/de/steamwar/bausystem/utils/NMSWrapper.java | 2 ++ 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java b/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java index a5d430b5..48c0d3a0 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java @@ -32,6 +32,7 @@ import de.steamwar.bausystem.entities.WarpEntity15; import net.minecraft.server.v1_15_R1.*; import org.bukkit.Bukkit; import org.bukkit.GameMode; +import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.World; import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity; @@ -103,6 +104,11 @@ public class NMSWrapper15 implements NMSWrapper.INMSWrapper { return Particle.BARRIER; } + @Override + public Material pathMaterial() { + return Material.GRASS_PATH; + } + private static final int threshold = 2048; @Override public boolean checkItemStack(ItemStack item) { diff --git a/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java b/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java index 10b01d26..9cbcf429 100644 --- a/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java +++ b/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java @@ -42,10 +42,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutGameStateChange; import net.minecraft.server.level.PlayerInteractManager; import net.minecraft.world.level.EnumGamemode; import net.minecraft.world.phys.Vec3D; -import org.bukkit.Bukkit; -import org.bukkit.GameMode; -import org.bukkit.Particle; -import org.bukkit.World; +import org.bukkit.*; import org.bukkit.craftbukkit.v1_18_R1.entity.CraftEntity; import org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemStack; @@ -115,6 +112,11 @@ public class NMSWrapper18 implements NMSWrapper.INMSWrapper { return Particle.BLOCK_MARKER; } + @Override + public Material pathMaterial() { + return Material.DIRT_PATH; + } + private static final int threshold = 2048; @Override public boolean checkItemStack(ItemStack item) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/BlockBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/BlockBoundingBox.java index 6c1257ad..b8b51edf 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/BlockBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/BlockBoundingBox.java @@ -19,6 +19,7 @@ package de.steamwar.bausystem.features.slaves.laufbau; +import de.steamwar.bausystem.utils.NMSWrapper; import de.steamwar.inventory.SWItem; import lombok.Getter; import lombok.ToString; @@ -86,7 +87,7 @@ public class BlockBoundingBox { addPixel(Material.AIR.createBlockData(), 0, 0, 0, 0, 0, 0, null); addPixel(Material.END_STONE.createBlockData(), 0, 0, 0, 16, 16, 16, null); - addPixel(SWItem.getMaterial("GRASS_PATH").createBlockData(), 0, 0, 0, 16, 15, 16, createItem("LAUFBAU_BLOCK_GRASS_PATH", SWItem.getMaterial("GRASS_PATH"))); + addPixel(NMSWrapper.impl.pathMaterial().createBlockData(), 0, 0, 0, 16, 15, 16, createItem("LAUFBAU_BLOCK_GRASS_PATH", NMSWrapper.impl.pathMaterial())); addPixel(Material.SOUL_SAND.createBlockData(), 0, 0, 0, 16, 14, 16, createItem("LAUFBAU_BLOCK_SOUL_SAND", Material.SOUL_SAND)); Cocoa cocoaNorth = (Cocoa) Material.COCOA.createBlockData(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEdit.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEdit.java index e59c870e..ea97e452 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEdit.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEdit.java @@ -45,7 +45,7 @@ public class SignEdit implements Listener { private static final Class generatorAccess = Reflection.getClass("{nms.world.level}.GeneratorAccess"); private static final Reflection.MethodInvoker getPosition = Reflection.getTypedMethod(craftBlock, "getPosition", blockPosition); private static final Reflection.MethodInvoker getWorldHandle = Reflection.getTypedMethod(craftWorld, "getHandle", null); - private static final Reflection.MethodInvoker at = Reflection.getTypedMethod(craftBlock, "at", generatorAccess, blockPosition); + private static final Reflection.MethodInvoker at = Reflection.getTypedMethod(craftBlock, "at", craftBlock, generatorAccess, blockPosition); private static final Class openSign = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutOpenSignEditor"); private static final Reflection.FieldAccessor blockPositionFieldAccessor = Reflection.getField(openSign, blockPosition, 0); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/utils/NMSWrapper.java b/BauSystem_Main/src/de/steamwar/bausystem/utils/NMSWrapper.java index 00dd5294..3d7d2c05 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/utils/NMSWrapper.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/utils/NMSWrapper.java @@ -26,6 +26,7 @@ import de.steamwar.bausystem.features.tracer.AbstractTraceEntity; import de.steamwar.bausystem.features.warp.AbstractWarpEntity; import de.steamwar.core.VersionDependent; import org.bukkit.GameMode; +import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.World; import org.bukkit.entity.Player; @@ -50,6 +51,7 @@ public class NMSWrapper { void setPlayerBuildAbilities(Player player); Particle tntPositionParticle(); + Material pathMaterial(); boolean checkItemStack(ItemStack item);