Commits
Miles Holder authored and md_5 committed 46c7fc3b1b4
104 104 | |
105 105 | super.applyTo(sign); |
106 106 | } |
107 107 | |
108 108 | public static void openSign(Sign sign, Player player, Side side) { |
109 109 | Preconditions.checkArgument(sign != null, "sign == null"); |
110 110 | Preconditions.checkArgument(side != null, "side == null"); |
111 111 | Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed"); |
112 112 | Preconditions.checkArgument(sign.getWorld() == player.getWorld(), "Sign must be in same world as Player"); |
113 113 | |
114 - | TileEntitySign handle = ((CraftSign<?>) sign).getTileEntity(); |
115 - | |
116 114 | if (!CraftEventFactory.callPlayerSignOpenEvent(player, sign, side, PlayerSignOpenEvent.Cause.PLUGIN)) { |
117 115 | return; |
118 116 | } |
119 117 | |
118 + | TileEntitySign handle = ((CraftSign<?>) sign).getTileEntity(); |
119 + | handle.setAllowedPlayerEditor(player.getUniqueId()); |
120 + | |
120 121 | ((CraftPlayer) player).getHandle().openTextEdit(handle, Side.FRONT == side); |
121 122 | } |
122 123 | |
123 124 | public static IChatBaseComponent[] sanitizeLines(String[] lines) { |
124 125 | IChatBaseComponent[] components = new IChatBaseComponent[4]; |
125 126 | |
126 127 | for (int i = 0; i < 4; i++) { |
127 128 | if (i < lines.length && lines[i] != null) { |
128 129 | components[i] = CraftChatMessage.fromString(lines[i])[0]; |
129 130 | } else { |