// Path: ChatUILib/src/main/java/com/simon816/chatui/lib/PlayerContext.java
// public class PlayerContext {
// 
//     public final int height;
//     public final int width;
//     public final boolean forceUnicode;
// 
//     private final UUID playerUUID;
//     private final TextUtils utils;
// 
//     public PlayerContext(Player player, int width, int height, boolean forceUnicode, FontData fontData) {
//         this(player.getUniqueId(), width, height, forceUnicode, new TextUtils(fontData, forceUnicode, player.getUniqueId()));
//         checkArgument(height >= 1, "Height must be at least one");
//         checkArgument(width >= 1, "Width must be at least one");
//     }
// 
//     private PlayerContext(UUID playerUuid, int width, int height, boolean forceUnicode, TextUtils utils) {
//         this.playerUUID = playerUuid;
//         this.width = width;
//         this.height = height;
//         this.forceUnicode = forceUnicode;
//         this.utils = utils;
//     }
// 
//     public Player getPlayer() {
//         return Sponge.getServer().getPlayer(this.playerUUID).get();
//     }
// 
//     public TextUtils utils() {
//         return this.utils;
//     }
// 
//     public PlayerContext withHeight(int height) {
//         checkArgument(height >= 1, "Height must be at least one");
//         if (height == this.height) {
//             return this;
//         }
//         return new PlayerContext(this.playerUUID, this.width, height, this.forceUnicode, this.utils);
//     }
// 
//     public PlayerContext withWidth(int width) {
//         checkArgument(width >= 1, "Width must be at least one");
//         if (width == this.width) {
//             return this;
//         }
//         return new PlayerContext(this.playerUUID, width, this.height, this.forceUnicode, this.utils);
//     }
// 
//     public PlayerContext withUnicode(boolean forceUnicode) {
//         if (forceUnicode == this.forceUnicode) {
//             return this;
//         }
//         return new PlayerContext(this.playerUUID, this.width, this.height, forceUnicode,
//                 new TextUtils(this.utils.getFontData(), forceUnicode, this.playerUUID));
//     }
// 
//     @Override
//     public String toString() {
//         return MoreObjects.toStringHelper(this)
//                 .add("player", this.getPlayer())
//                 .add("width", this.width)
//                 .add("height", this.height)
//                 .add("forceUnicode", this.forceUnicode)
//                 .toString();
//     }
// 
// }
// 
// Path: ChatUILib/src/main/java/com/simon816/chatui/ui/canvas/CanvasUI.java
// public enum Context {
//     BLOCKS,
//     BRAILLE
// }
// 
// Path: ChatUILib/src/main/java/com/simon816/chatui/ui/canvas/CanvasUI.java
// public static abstract class RenderingContext {
// 
//     final List<Layer> layers = Lists.newArrayList();
// 
//     public abstract Context getType();
// 
//     protected abstract LineDrawingContext createDrawContext(PlayerContext ctx);
// 
//     public void addLayer(Layer layer) {
//         this.layers.add(layer);
//     }
// 
//     public void clear() {
//         this.layers.clear();
//     }
// 
// }
// 
// Path: ChatUILib/src/main/java/com/simon816/chatui/ui/canvas/LineDrawingContext.java
// public static class PixelMetadata {
// 
//     public final TextColor color;
//     public final ClickAction<?> clickHandler;
//     public final boolean locked;
// 
//     public PixelMetadata(TextColor color) {
//         this(color, null, false);
//     }
// 
//     public PixelMetadata(TextColor color, Consumer<PlayerChatView> callback, boolean locked) {
//         this.color = color;
//         this.clickHandler = callback == null ? null : Utils.execClick(callback);
//         this.locked = locked;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (obj == this) {
//             return true;
//         }
//         if (obj == null || obj.getClass() != this.getClass()) {
//             return false;
//         }
//         PixelMetadata other = (PixelMetadata) obj;
//         // Don't care about locked here
//         return other.color == this.color && other.clickHandler == this.clickHandler;
//     }
// 
//     public Text toText(String string) {
//         Text.Builder b = Text.builder(string).color(this.color);
//         if (this.clickHandler != null) {
//             b.onClick(this.clickHandler);
//         }
//         return b.build();
//     }
// 
// }
// 
// Path: ChatUILib/src/main/java/com/simon816/chatui/ui/canvas/ShapeFunction.java
// public static interface DrawHandler {
// 
//     default void setup(LineDrawingContext ctx, Object... args) {
//     }
// 
//     default void finish(LineDrawingContext ctx) {
//     }
// 
//     void write(LineDrawingContext ctx, int x, int y, Object... args);
// }


import com.simon816.chatui.lib.PlayerContext;
import com.simon816.chatui.ui.canvas.CanvasUI.Context;
import com.simon816.chatui.ui.canvas.CanvasUI.RenderingContext;
import com.simon816.chatui.ui.canvas.LineDrawingContext.PixelMetadata;
import com.simon816.chatui.ui.canvas.ShapeFunction.DrawHandler;
import org.spongepowered.api.text.format.TextColor;
import org.spongepowered.api.text.format.TextColors;

package com.simon816.chatui.ui.canvas;


public class BlockRenderContext extends RenderingContext {

    private static final PixelMetadata EMPTY_DATA = new PixelMetadata(TextColors.BLACK);

    @Override
    public Context getType() {
        return Context.BLOCKS;
    }

    @Override

// Path: ChatUILib/src/main/java/com/simon816/chatui/lib/PlayerContext.java
// public class PlayerContext {
// 
//     public final int height;
//     public final int width;
//     public final boolean forceUnicode;
// 
//     private final UUID playerUUID;
//     private final TextUtils utils;
// 
//     public PlayerContext(Player player, int width, int height, boolean forceUnicode, FontData fontData) {
//         this(player.getUniqueId(), width, height, forceUnicode, new TextUtils(fontData, forceUnicode, player.getUniqueId()));
//         checkArgument(height >= 1, "Height must be at least one");
//         checkArgument(width >= 1, "Width must be at least one");
//     }
// 
//     private PlayerContext(UUID playerUuid, int width, int height, boolean forceUnicode, TextUtils utils) {
//         this.playerUUID = playerUuid;
//         this.width = width;
//         this.height = height;
//         this.forceUnicode = forceUnicode;
//         this.utils = utils;
//     }
// 
//     public Player getPlayer() {
//         return Sponge.getServer().getPlayer(this.playerUUID).get();
//     }
// 
//     public TextUtils utils() {
//         return this.utils;
//     }
// 
//     public PlayerContext withHeight(int height) {
//         checkArgument(height >= 1, "Height must be at least one");
//         if (height == this.height) {
//             return this;
//         }
//         return new PlayerContext(this.playerUUID, this.width, height, this.forceUnicode, this.utils);
//     }
// 
//     public PlayerContext withWidth(int width) {
//         checkArgument(width >= 1, "Width must be at least one");
//         if (width == this.width) {
//             return this;
//         }
//         return new PlayerContext(this.playerUUID, width, this.height, this.forceUnicode, this.utils);
//     }
// 
//     public PlayerContext withUnicode(boolean forceUnicode) {
//         if (forceUnicode == this.forceUnicode) {
//             return this;
//         }
//         return new PlayerContext(this.playerUUID, this.width, this.height, forceUnicode,
//                 new TextUtils(this.utils.getFontData(), forceUnicode, this.playerUUID));
//     }
// 
//     @Override
//     public String toString() {
//         return MoreObjects.toStringHelper(this)
//                 .add("player", this.getPlayer())
//                 .add("width", this.width)
//                 .add("height", this.height)
//                 .add("forceUnicode", this.forceUnicode)
//                 .toString();
//     }
// 
// }
// 
// Path: ChatUILib/src/main/java/com/simon816/chatui/ui/canvas/CanvasUI.java
// public enum Context {
//     BLOCKS,
//     BRAILLE
// }
// 
// Path: ChatUILib/src/main/java/com/simon816/chatui/ui/canvas/CanvasUI.java
// public static abstract class RenderingContext {
// 
//     final List<Layer> layers = Lists.newArrayList();
// 
//     public abstract Context getType();
// 
//     protected abstract LineDrawingContext createDrawContext(PlayerContext ctx);
// 
//     public void addLayer(Layer layer) {
//         this.layers.add(layer);
//     }
// 
//     public void clear() {
//         this.layers.clear();
//     }
// 
// }
// 
// Path: ChatUILib/src/main/java/com/simon816/chatui/ui/canvas/LineDrawingContext.java
// public static class PixelMetadata {
// 
//     public final TextColor color;
//     public final ClickAction<?> clickHandler;
//     public final boolean locked;
// 
//     public PixelMetadata(TextColor color) {
//         this(color, null, false);
//     }
// 
//     public PixelMetadata(TextColor color, Consumer<PlayerChatView> callback, boolean locked) {
//         this.color = color;
//         this.clickHandler = callback == null ? null : Utils.execClick(callback);
//         this.locked = locked;
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (obj == this) {
//             return true;
//         }
//         if (obj == null || obj.getClass() != this.getClass()) {
//             return false;
//         }
//         PixelMetadata other = (PixelMetadata) obj;
//         // Don't care about locked here
//         return other.color == this.color && other.clickHandler == this.clickHandler;
//     }
// 
//     public Text toText(String string) {
//         Text.Builder b = Text.builder(string).color(this.color);
//         if (this.clickHandler != null) {
//             b.onClick(this.clickHandler);
//         }
//         return b.build();
//     }
// 
// }
// 
// Path: ChatUILib/src/main/java/com/simon816/chatui/ui/canvas/ShapeFunction.java
// public static interface DrawHandler {
// 
//     default void setup(LineDrawingContext ctx, Object... args) {
//     }
// 
//     default void finish(LineDrawingContext ctx) {
//     }
// 
//     void write(LineDrawingContext ctx, int x, int y, Object... args);
// }


// Path: ChatUILib/src/main/java/com/simon816/chatui/ui/canvas/BlockRenderContext.java
import com.simon816.chatui.lib.PlayerContext;
import com.simon816.chatui.ui.canvas.CanvasUI.Context;
import com.simon816.chatui.ui.canvas.CanvasUI.RenderingContext;
import com.simon816.chatui.ui.canvas.LineDrawingContext.PixelMetadata;
import com.simon816.chatui.ui.canvas.ShapeFunction.DrawHandler;
import org.spongepowered.api.text.format.TextColor;
import org.spongepowered.api.text.format.TextColors;

package com.simon816.chatui.ui.canvas;


public class BlockRenderContext extends RenderingContext {

    private static final PixelMetadata EMPTY_DATA = new PixelMetadata(TextColors.BLACK);

    @Override
    public Context getType() {
        return Context.BLOCKS;
    }

    @Override

    protected LineDrawingContext createDrawContext(PlayerContext ctx) {
