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-08-25 01:28:06 +00:00
|
|
|
package com.thebrokenrail.scriptcraft.api.bridge;
|
|
|
|
|
|
|
|
import com.thebrokenrail.scriptcraft.core.ScriptCraftCore;
|
|
|
|
import net.minecraft.block.Block;
|
2020-08-26 21:52:17 +00:00
|
|
|
import net.minecraft.util.registry.Registry;
|
2020-08-25 01:28:06 +00:00
|
|
|
|
|
|
|
class BlockBridges {
|
|
|
|
static void register() {
|
|
|
|
ScriptCraftCore.addBridge("Block.getMaterial", args -> ((Block) args[0]).getDefaultState().getMaterial());
|
|
|
|
ScriptCraftCore.addBridge("Block.getMaterialColor", args -> ((Block) args[0]).getDefaultState().getTopMaterialColor(null, null));
|
2020-08-26 21:52:17 +00:00
|
|
|
ScriptCraftCore.addBridge("Block.getID", args -> Registry.BLOCK.getId((Block) args[0]).toString());
|
|
|
|
ScriptCraftCore.addBridge("Block.getDefaultState", args -> ((Block) args[0]).getDefaultState());
|
|
|
|
|
2020-08-25 01:28:06 +00:00
|
|
|
ScriptCraftCore.addBridge("Block.isValid", args -> args[0] instanceof Block);
|
|
|
|
}
|
|
|
|
}
|