This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
2020-04-28 00:15:24 +00:00
|
|
|
package com.thebrokenrail.scriptcraft.api.bridge;
|
|
|
|
|
|
|
|
import com.thebrokenrail.scriptcraft.core.ScriptCraftCore;
|
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
import net.minecraft.util.Identifier;
|
|
|
|
import net.minecraft.util.registry.Registry;
|
|
|
|
|
|
|
|
class BlockStateBridges {
|
|
|
|
static void register() {
|
|
|
|
ScriptCraftCore.addBridge("BlockState.getDefaultState", args -> Registry.BLOCK.get(new Identifier((String) args[0])).getDefaultState());
|
|
|
|
ScriptCraftCore.addBridge("BlockState.getBlock", args -> Registry.BLOCK.getId(((BlockState) args[0]).getBlock()).toString());
|
2020-06-02 17:24:32 +00:00
|
|
|
|
|
|
|
ScriptCraftCore.addBridge("BlockState.isValid", args -> args[0] instanceof BlockState);
|
2020-04-28 00:15:24 +00:00
|
|
|
}
|
|
|
|
}
|