@@ -1,13 +1,17 @@
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.network.chat.ChatComponentText;
|
||||
import net.minecraft.network.chat.IChatBaseComponent;
|
||||
import net.minecraft.server.level.EntityPlayer;
|
||||
import net.minecraft.world.item.EnumColor;
|
||||
import net.minecraft.world.level.block.entity.TileEntitySign;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CraftSign extends CraftBlockEntityState<TileEntitySign> implements Sign {
|
||||
|
||||
@@ -87,6 +91,17 @@ public class CraftSign extends CraftBlockEntityState<TileEntitySign> implements
|
||||
}
|
||||
}
|
||||
|
||||
public static void openSign(Sign sign, Player player) {
|
||||
Preconditions.checkArgument(sign != null, "sign == null");
|
||||
Preconditions.checkArgument(sign.isPlaced(), "Sign must be placed");
|
||||
Preconditions.checkArgument(sign.getWorld() == player.getWorld(), "Sign must be in same world as Player");
|
||||
|
||||
TileEntitySign handle = ((CraftSign) sign).getTileEntity();
|
||||
handle.isEditable = true;
|
||||
|
||||
((CraftPlayer) player).getHandle().openTextEdit(handle);
|
||||
}
|
||||
|
||||
public static IChatBaseComponent[] sanitizeLines(String[] lines) {
|
||||
IChatBaseComponent[] components = new IChatBaseComponent[4];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user