diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java b/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java index a7641e7..08d1bc9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java @@ -28,9 +28,12 @@ import com.comphenix.protocol.wrappers.BlockPosition; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; import de.steamwar.core.Core; +import de.steamwar.core.VersionedCallable; +import net.minecraft.server.v1_15_R1.PacketPlayOutOpenSignEditor; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import com.comphenix.protocol.ProtocolLibrary; +import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Sign; import org.bukkit.entity.Player; @@ -117,9 +120,10 @@ public class RegionListener implements Listener { @EventHandler public void editSign(PlayerInteractEvent event) { if(event.getAction() != Action.RIGHT_CLICK_BLOCK || - !event.getClickedBlock().getType().name().contains("_SIGN") || + !event.getClickedBlock().getType().name().contains("SIGN") || !event.getPlayer().isSneaking()) return; + Player player = event.getPlayer(); Sign sign = (Sign) event.getClickedBlock().getState(); String[] lines = sign.getLines(); @@ -127,6 +131,7 @@ public class RegionListener implements Listener { sign.setLine(i, lines[i].replace('ยง', '&')); } sign.update(); + PacketContainer signOpen = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.OPEN_SIGN_EDITOR); signOpen.getBlockPositionModifier().write(0, new BlockPosition(event.getClickedBlock().getLocation().toVector())); try { @@ -147,7 +152,7 @@ public class RegionListener implements Listener { String[] lines = packetContainer.getStringArrays().read(0); Block signLoc = position.toLocation(player.getWorld()).getBlock(); - if(!signLoc.getType().name().contains("_SIGN")) + if(!signLoc.getType().name().contains("SIGN")) return; Sign sign = ((Sign) signLoc.getState());