fixes for 22w11a
This commit is contained in:
1 parent
3e419d1557
commit
302a7b4817
39 files changed
+410
-305
No files matched your search
@@ -18,6 +18,7 @@ import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.Direction.Axis;
|
||||
import net.minecraft.core.GlobalPos;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.StringTag;
|
||||
@@ -59,13 +60,13 @@ public class BlockValue extends Value
|
||||
{
|
||||
BlockValue bv = bvCache.get(str);
|
||||
if (bv != null) return bv;
|
||||
BlockStateParser blockstateparser = (new BlockStateParser(new StringReader(str), false)).parse(true);
|
||||
if (blockstateparser.getState() != null)
|
||||
BlockStateParser.BlockResult foo = BlockStateParser.parseForBlock(HolderLookup.forRegistry(Registry.BLOCK), new StringReader(str), true );
|
||||
if (foo.blockState() != null)
|
||||
{
|
||||
CompoundTag bd = blockstateparser.getNbt();
|
||||
CompoundTag bd = foo.nbt();
|
||||
if (bd == null)
|
||||
bd = new CompoundTag();
|
||||
bv = new BlockValue(blockstateparser.getState(), null, null, bd );
|
||||
bv = new BlockValue(foo.blockState(), null, null, bd );
|
||||
if (bvCache.size()>10000)
|
||||
bvCache.clear();
|
||||
bvCache.put(str, bv);
|
||||
|
||||
Reference in new issue
Block a user