Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-09 17:50:23 +01:00
fix command block #1212
Dieser Commit ist enthalten in:
Ursprung
3c0282b04f
Commit
aca764c288
@ -22,6 +22,7 @@ public class BlockEntityProvider implements Provider {
|
|||||||
handlers.put("minecraft:banner", new BannerHandler());
|
handlers.put("minecraft:banner", new BannerHandler());
|
||||||
handlers.put("minecraft:skull", new SkullHandler());
|
handlers.put("minecraft:skull", new SkullHandler());
|
||||||
handlers.put("minecraft:mob_spawner", new SpawnerHandler());
|
handlers.put("minecraft:mob_spawner", new SpawnerHandler());
|
||||||
|
handlers.put("minecraft:command_block", new CommandBlockHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.blockentities;
|
||||||
|
|
||||||
|
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||||
|
import com.github.steveice10.opennbt.tag.builtin.StringTag;
|
||||||
|
import com.github.steveice10.opennbt.tag.builtin.Tag;
|
||||||
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
|
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.ChatRewriter;
|
||||||
|
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.BlockEntityProvider;
|
||||||
|
|
||||||
|
public class CommandBlockHandler implements BlockEntityProvider.BlockEntityHandler {
|
||||||
|
@Override
|
||||||
|
public int transform(UserConnection user, CompoundTag tag) {
|
||||||
|
Tag name = tag.get("CustomName");
|
||||||
|
if (name instanceof StringTag) {
|
||||||
|
((StringTag) name).setValue(ChatRewriter.legacyTextToJson(((StringTag) name).getValue()));
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren