use of com.denizenscript.denizen.events.player.PlayerChangesSignScriptEvent in project Denizen-For-Bukkit by DenizenScript.
the class DenizenPacketListenerImpl method a.
@Override
public void a(PacketPlayInUpdateSign packet) {
if (fakeSignExpected != null && packet.b().equals(fakeSignExpected)) {
fakeSignExpected = null;
PlayerChangesSignScriptEvent evt = (PlayerChangesSignScriptEvent) PlayerChangesSignScriptEvent.instance.clone();
evt.cancelled = false;
evt.material = new MaterialTag(org.bukkit.Material.OAK_WALL_SIGN);
evt.location = new LocationTag(getPlayer().getLocation());
LocationTag loc = evt.location.clone();
loc.setY(0);
evt.event = new SignChangeEvent(loc.getBlock(), getPlayer(), packet.c());
evt.fire(evt.event);
}
super.a(packet);
}
use of com.denizenscript.denizen.events.player.PlayerChangesSignScriptEvent in project Denizen-For-Bukkit by DenizenScript.
the class DenizenPacketListenerImpl method handleSignUpdate.
@Override
public void handleSignUpdate(ServerboundSignUpdatePacket packet) {
if (fakeSignExpected != null && packet.getPos().equals(fakeSignExpected)) {
fakeSignExpected = null;
PlayerChangesSignScriptEvent evt = (PlayerChangesSignScriptEvent) PlayerChangesSignScriptEvent.instance.clone();
evt.cancelled = false;
evt.material = new MaterialTag(org.bukkit.Material.OAK_WALL_SIGN);
evt.location = new LocationTag(player.getBukkitEntity().getLocation());
LocationTag loc = evt.location.clone();
loc.setY(0);
evt.event = new SignChangeEvent(loc.getBlock(), player.getBukkitEntity(), packet.getLines());
evt.fire(evt.event);
}
super.handleSignUpdate(packet);
}
use of com.denizenscript.denizen.events.player.PlayerChangesSignScriptEvent in project Denizen-For-Bukkit by DenizenScript.
the class DenizenPacketListenerImpl method handleSignUpdate.
@Override
public void handleSignUpdate(ServerboundSignUpdatePacket packet) {
if (fakeSignExpected != null && packet.getPos().equals(fakeSignExpected)) {
fakeSignExpected = null;
PlayerChangesSignScriptEvent evt = (PlayerChangesSignScriptEvent) PlayerChangesSignScriptEvent.instance.clone();
evt.cancelled = false;
evt.material = new MaterialTag(org.bukkit.Material.OAK_WALL_SIGN);
evt.location = new LocationTag(player.getBukkitEntity().getLocation());
LocationTag loc = evt.location.clone();
loc.setY(0);
evt.event = new SignChangeEvent(loc.getBlock(), player.getBukkitEntity(), packet.getLines());
evt.fire(evt.event);
}
super.handleSignUpdate(packet);
}
Aggregations