use of net.minecraft.network.play.server.SPacketSignEditorOpen in project Almura by AlmuraDev.
the class SignEditFeature method interact.
@Listener
public void interact(final InteractBlockEvent.Secondary.MainHand event, @Root final Player player) {
if (!(player instanceof EntityPlayerMP) || !player.require(Keys.IS_SNEAKING)) {
return;
}
final BlockSnapshot snapshot = event.getTargetBlock();
final BlockType type = snapshot.getState().getType();
if (type == BlockTypes.STANDING_SIGN || type == BlockTypes.WALL_SIGN) {
snapshot.getLocation().flatMap(Location::getTileEntity).ifPresent((be) -> {
if (be instanceof TileEntitySign) {
((EntityPlayerMP) player).connection.sendPacket(new SPacketSignEditorOpen(VecHelper.toBlockPos(snapshot.getPosition())));
}
});
}
}
Aggregations