Skip to content

Commit

Permalink
Add forge support to the text system.
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Apr 25, 2019
1 parent b1e43b7 commit 4f5f9c8
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -31,10 +31,11 @@
import com.sk89q.worldedit.session.SessionKey;
import com.sk89q.worldedit.util.HandSide;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.util.formatting.text.serializer.gson.GsonComponentSerializer;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockStateHolder;

import com.sk89q.worldedit.util.formatting.text.TextComponent;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
Expand All @@ -43,15 +44,14 @@
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;

import java.util.UUID;

import javax.annotation.Nullable;

import io.netty.buffer.Unpooled;

public class ForgePlayer extends AbstractPlayerActor {

private final EntityPlayerMP player;
Expand Down Expand Up @@ -144,7 +144,7 @@ public void printError(String msg) {

@Override
public void print(TextComponent component) {
// TODO
this.player.sendMessage(ITextComponent.Serializer.fromJson(GsonComponentSerializer.INSTANCE.serialize(component)));
}

private void sendColorized(String msg, TextFormatting formatting) {
Expand Down

0 comments on commit 4f5f9c8

Please sign in to comment.