Add support for pulley blocks (#781)

This commit is contained in:
Colin Wong 2021-06-23 11:34:06 -05:00 committed by GitHub
parent e300eb9209
commit 0b5404c711
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,37 @@
package com.blamejared.compat.betterwithmods;
import betterwithmods.common.registry.PulleyStructureManager;
import com.blamejared.mtlib.utils.BaseAction;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.annotations.ModOnly;
import crafttweaker.annotations.ZenRegister;
import crafttweaker.api.minecraft.CraftTweakerMC;
import net.minecraft.block.state.IBlockState;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.betterwithmods.PulleyManager")
@ModOnly("betterwithmods")
@ZenRegister
public class PulleyManager {
@ZenMethod
public static void addPulleyBlock(crafttweaker.api.block.IBlockState state) {
CraftTweakerAPI.apply(new AddPulleyBlock(CraftTweakerMC.getBlockState(state)));
}
public static class AddPulleyBlock extends BaseAction {
private IBlockState state;
AddPulleyBlock(IBlockState state) {
super("Add Pulley Block");
this.state = state;
}
@Override
public void apply() {
PulleyStructureManager.registerPulleyBlock(state);
}
}
}