mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-11-30 01:44:28 +00:00
feat: update to minestom 26_3
This commit is contained in:
5 files changed
+21
-3
No files matched your search
+12
@@ -4,6 +4,7 @@ import com.dfsek.tectonic.api.config.template.annotations.Default;
|
||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
||||
import net.kyori.adventure.nbt.CompoundBinaryTag;
|
||||
import net.kyori.adventure.nbt.StringBinaryTag;
|
||||
import net.minestom.server.adventure.MinestomAdventure;
|
||||
import net.minestom.server.codec.Transcoder;
|
||||
import net.minestom.server.particle.Particle;
|
||||
@@ -51,6 +52,17 @@ public class BiomeParticleConfigTemplate implements ObjectTemplate<AmbientPartic
|
||||
nbt = MinestomAdventure.NBT_CODEC.decode(dataString);
|
||||
// transform minecraft:x{a:"b"} into {type:"minecraft:x", a:"b"} as described in Particle.CODEC
|
||||
nbt = nbt.putString("type", key);
|
||||
|
||||
// TODO fix this
|
||||
CompoundBinaryTag blockState = nbt.getCompound("block_state", null);
|
||||
if (blockState != null) {
|
||||
String name = blockState.getString("Name", null);
|
||||
if (name != null) {
|
||||
blockState = blockState.put("id", StringBinaryTag.stringBinaryTag(name));
|
||||
nbt = nbt.put("block_state", blockState);
|
||||
}
|
||||
}
|
||||
|
||||
parsedParticle = Particle.CODEC.decode(Transcoder.NBT, nbt).orElseThrow();
|
||||
} catch(Exception e) {
|
||||
String nbtString = "null";
|
||||
|
||||
Reference in new issue
Block a user