use default block registry

This commit is contained in:
dfsek
2022-06-02 08:07:21 -07:00
parent 5b2e8b7fbd
commit 6e18978586

View File

@@ -24,6 +24,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.block.Blocks;
import net.minecraft.command.argument.BlockArgumentParser;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry;
import org.jetbrains.annotations.NotNull;
@@ -39,7 +40,7 @@ public class FabricWorldHandle implements WorldHandle {
@Override
public @NotNull BlockState createBlockState(@NotNull String data) {
try {
net.minecraft.block.BlockState state = BlockArgumentParser.block(FabricEntryPoint.getPlatform().getServer().getRegistryManager().get(Registry.BLOCK_KEY), data, true).blockState();
net.minecraft.block.BlockState state = BlockArgumentParser.block(Registry.BLOCK, data, true).blockState();
if(state == null) throw new IllegalArgumentException("Invalid data: " + data);
return (BlockState) state;
} catch(CommandSyntaxException e) {