geforkt von Mirrors/FastAsyncWorldEdit
[Fabric] Update fabric/yarn versions to 1.14.3.
Dieser Commit ist enthalten in:
Ursprung
aa8d34c913
Commit
efc4d7cba1
@ -22,9 +22,9 @@ buildscript {
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'fabric-loom'
|
||||
|
||||
def minecraftVersion = "1.14.2"
|
||||
def fabricVersion = "0.3.0+build.185"
|
||||
def yarnMappings = "1.14.2+build.7"
|
||||
def minecraftVersion = "1.14.3"
|
||||
def fabricVersion = "0.3.0+build.187"
|
||||
def yarnMappings = "1.14.3+build.1"
|
||||
def loaderVersion = "0.4.8+build.155"
|
||||
|
||||
configurations.all { Configuration it ->
|
||||
|
@ -51,7 +51,7 @@ class FabricBiomeRegistry implements BiomeRegistry {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return biome.getTextComponent().getString();
|
||||
return biome.getName().asFormattedString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class FabricBlockRegistry extends BundledBlockRegistry {
|
||||
public String getName(BlockType blockType) {
|
||||
Block block = FabricAdapter.adapt(blockType);
|
||||
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) {
|
||||
return block.getTextComponent().getFormattedText();
|
||||
return block.getName().asFormattedString();
|
||||
} else {
|
||||
return super.getName(blockType);
|
||||
}
|
||||
|
@ -43,8 +43,8 @@ import net.minecraft.nbt.FloatTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.StringTag;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.DyeColor;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.JsonHelper;
|
||||
@ -1839,12 +1839,12 @@ class FabricDataFixer extends DataFixerBuilder implements com.sk89q.worldedit.wo
|
||||
|
||||
if (!"null".equals(s) && !Strings.isNullOrEmpty(s)) {
|
||||
if ((s.charAt(0) != 34 || s.charAt(s.length() - 1) != 34) && (s.charAt(0) != 123 || s.charAt(s.length() - 1) != 125)) {
|
||||
object = new TextComponent(s);
|
||||
object = new LiteralText(s);
|
||||
} else {
|
||||
try {
|
||||
object = JsonHelper.deserialize(DataConverterSignText.a, s, Component.class, true);
|
||||
object = JsonHelper.deserialize(DataConverterSignText.a, s, Text.class, true);
|
||||
if (object == null) {
|
||||
object = new TextComponent("");
|
||||
object = new LiteralText("");
|
||||
}
|
||||
} catch (JsonParseException jsonparseexception) {
|
||||
;
|
||||
@ -1852,7 +1852,7 @@ class FabricDataFixer extends DataFixerBuilder implements com.sk89q.worldedit.wo
|
||||
|
||||
if (object == null) {
|
||||
try {
|
||||
object = Component.Serializer.fromJsonString(s);
|
||||
object = Text.Serializer.fromJson(s);
|
||||
} catch (JsonParseException jsonparseexception1) {
|
||||
;
|
||||
}
|
||||
@ -1860,21 +1860,21 @@ class FabricDataFixer extends DataFixerBuilder implements com.sk89q.worldedit.wo
|
||||
|
||||
if (object == null) {
|
||||
try {
|
||||
object = Component.Serializer.fromLenientJsonString(s);
|
||||
object = Text.Serializer.fromLenientJson(s);
|
||||
} catch (JsonParseException jsonparseexception2) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
if (object == null) {
|
||||
object = new TextComponent(s);
|
||||
object = new LiteralText(s);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
object = new TextComponent("");
|
||||
object = new LiteralText("");
|
||||
}
|
||||
|
||||
nbttaglist.set(i, new StringTag(Component.Serializer.toJsonString((Component) object)));
|
||||
nbttaglist.set(i, new StringTag(Text.Serializer.toJson((Text) object)));
|
||||
}
|
||||
|
||||
nbttagcompound1.put("pages", nbttaglist);
|
||||
@ -2432,18 +2432,18 @@ class FabricDataFixer extends DataFixerBuilder implements com.sk89q.worldedit.wo
|
||||
|
||||
private static class DataConverterSignText implements DataConverter {
|
||||
|
||||
public static final Gson a = new GsonBuilder().registerTypeAdapter(Component.class, new JsonDeserializer() {
|
||||
Component a(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
|
||||
public static final Gson a = new GsonBuilder().registerTypeAdapter(Text.class, new JsonDeserializer() {
|
||||
Text a(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException {
|
||||
if (jsonelement.isJsonPrimitive()) {
|
||||
return new TextComponent(jsonelement.getAsString());
|
||||
return new LiteralText(jsonelement.getAsString());
|
||||
} else if (jsonelement.isJsonArray()) {
|
||||
JsonArray jsonarray = jsonelement.getAsJsonArray();
|
||||
Component iTextComponent = null;
|
||||
Text iTextComponent = null;
|
||||
Iterator iterator = jsonarray.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
JsonElement jsonelement1 = (JsonElement) iterator.next();
|
||||
Component iTextComponent1 = this.a(jsonelement1, jsonelement1.getClass(), jsondeserializationcontext);
|
||||
Text iTextComponent1 = this.a(jsonelement1, jsonelement1.getClass(), jsondeserializationcontext);
|
||||
|
||||
if (iTextComponent == null) {
|
||||
iTextComponent = iTextComponent1;
|
||||
@ -2486,12 +2486,12 @@ class FabricDataFixer extends DataFixerBuilder implements com.sk89q.worldedit.wo
|
||||
|
||||
if (!"null".equals(s1) && !Strings.isNullOrEmpty(s1)) {
|
||||
if ((s1.charAt(0) != 34 || s1.charAt(s1.length() - 1) != 34) && (s1.charAt(0) != 123 || s1.charAt(s1.length() - 1) != 125)) {
|
||||
object = new TextComponent(s1);
|
||||
object = new LiteralText(s1);
|
||||
} else {
|
||||
try {
|
||||
object = JsonHelper.deserialize(DataConverterSignText.a, s1, Component.class, true);
|
||||
object = JsonHelper.deserialize(DataConverterSignText.a, s1, Text.class, true);
|
||||
if (object == null) {
|
||||
object = new TextComponent("");
|
||||
object = new LiteralText("");
|
||||
}
|
||||
} catch (JsonParseException jsonparseexception) {
|
||||
;
|
||||
@ -2499,7 +2499,7 @@ class FabricDataFixer extends DataFixerBuilder implements com.sk89q.worldedit.wo
|
||||
|
||||
if (object == null) {
|
||||
try {
|
||||
object = Component.Serializer.fromJsonString(s1);
|
||||
object = Text.Serializer.fromJson(s1);
|
||||
} catch (JsonParseException jsonparseexception1) {
|
||||
;
|
||||
}
|
||||
@ -2507,21 +2507,21 @@ class FabricDataFixer extends DataFixerBuilder implements com.sk89q.worldedit.wo
|
||||
|
||||
if (object == null) {
|
||||
try {
|
||||
object = Component.Serializer.fromLenientJsonString(s1);
|
||||
object = Text.Serializer.fromLenientJson(s1);
|
||||
} catch (JsonParseException jsonparseexception2) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
if (object == null) {
|
||||
object = new TextComponent(s1);
|
||||
object = new LiteralText(s1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
object = new TextComponent("");
|
||||
object = new LiteralText("");
|
||||
}
|
||||
|
||||
nbttagcompound.putString(s, Component.Serializer.toJsonString((Component) object));
|
||||
nbttagcompound.putString(s, Text.Serializer.toJson((Text) object));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,24 +39,24 @@ import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.ChatFormat;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.network.packet.BlockEntityUpdateS2CPacket;
|
||||
import net.minecraft.client.network.packet.BlockUpdateS2CPacket;
|
||||
import net.minecraft.client.network.packet.CustomPayloadS2CPacket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.PacketByteBuf;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class FabricPlayer extends AbstractPlayerActor {
|
||||
|
||||
// see ClientPlayNetHandler: search for "invalid update packet", lots of hardcoded consts
|
||||
@ -81,7 +81,7 @@ public class FabricPlayer extends AbstractPlayerActor {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.player.getName().getFormattedText();
|
||||
return this.player.getName().asFormattedString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -130,33 +130,33 @@ public class FabricPlayer extends AbstractPlayerActor {
|
||||
@Override
|
||||
public void printRaw(String msg) {
|
||||
for (String part : msg.split("\n")) {
|
||||
this.player.sendMessage(new TextComponent(part));
|
||||
this.player.sendMessage(new LiteralText(part));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printDebug(String msg) {
|
||||
sendColorized(msg, ChatFormat.GRAY);
|
||||
sendColorized(msg, Formatting.GRAY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(String msg) {
|
||||
sendColorized(msg, ChatFormat.LIGHT_PURPLE);
|
||||
sendColorized(msg, Formatting.LIGHT_PURPLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printError(String msg) {
|
||||
sendColorized(msg, ChatFormat.RED);
|
||||
sendColorized(msg, Formatting.RED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(Component component) {
|
||||
this.player.sendMessage(net.minecraft.network.chat.Component.Serializer.fromJsonString(GsonComponentSerializer.INSTANCE.serialize(component)));
|
||||
this.player.sendMessage(Text.Serializer.fromJson(GsonComponentSerializer.INSTANCE.serialize(component)));
|
||||
}
|
||||
|
||||
private void sendColorized(String msg, ChatFormat formatting) {
|
||||
private void sendColorized(String msg, Formatting formatting) {
|
||||
for (String part : msg.split("\n")) {
|
||||
TextComponent component = new TextComponent(part);
|
||||
LiteralText component = new LiteralText(part);
|
||||
component.getStyle().setColor(formatting);
|
||||
this.player.sendMessage(component);
|
||||
}
|
||||
|
@ -22,16 +22,15 @@ package com.sk89q.worldedit.fabric;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.damage.DamageSource;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.network.ServerPlayerInteractionManager;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.stat.Stat;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.UUID;
|
||||
|
||||
public class WorldEditFakePlayer extends ServerPlayerEntity {
|
||||
private static final GameProfile FAKE_WORLDEDIT_PROFILE = new GameProfile(UUID.nameUUIDFromBytes("worldedit".getBytes()), "[WorldEdit]");
|
||||
@ -53,11 +52,11 @@ public class WorldEditFakePlayer extends ServerPlayerEntity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(Component component) {
|
||||
public void sendMessage(Text component) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChatMessage(Component component, boolean opt) {
|
||||
public void addChatMessage(Text component, boolean opt) {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren