Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
6a6eadb937
Commit
210fd0bd9f
@ -58,10 +58,7 @@ public class SignEdit implements Listener {
|
|||||||
if (!event.getPlayer().isSneaking()) return;
|
if (!event.getPlayer().isSneaking()) return;
|
||||||
if (event.getClickedBlock() == null || !event.getClickedBlock().getType().name().contains("SIGN")) return;
|
if (event.getClickedBlock() == null || !event.getClickedBlock().getType().name().contains("SIGN")) return;
|
||||||
|
|
||||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && (event.getItem() == null || event.getItem().getType() == Material.AIR)) {
|
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && (event.getItem() == null || event.getItem().getType() == Material.AIR) || event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||||
event.setCancelled(true);
|
|
||||||
edit(event.getPlayer(), event.getClickedBlock());
|
|
||||||
} else if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
||||||
edit(event.getPlayer(), event.getClickedBlock());
|
edit(event.getPlayer(), event.getClickedBlock());
|
||||||
@ -75,11 +72,13 @@ public class SignEdit implements Listener {
|
|||||||
for (int i = 0; i < lines.length; i++) {
|
for (int i = 0; i < lines.length; i++) {
|
||||||
sign.setLine(i, lines[i].replace('§', '&'));
|
sign.setLine(i, lines[i].replace('§', '&'));
|
||||||
}
|
}
|
||||||
sign.update();
|
sign.update(true);
|
||||||
|
|
||||||
Object openSignObject = Reflection.newInstance(openSign);
|
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
||||||
blockPositionFieldAccessor.set(openSignObject, getPosition.invoke(block));
|
Object openSignObject = Reflection.newInstance(openSign);
|
||||||
TinyProtocol.instance.sendPacket(player, openSignObject);
|
blockPositionFieldAccessor.set(openSignObject, getPosition.invoke(block));
|
||||||
|
TinyProtocol.instance.sendPacket(player, openSignObject);
|
||||||
|
}, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren