Skip to content

Commit

Permalink
Add support for pulley blocks (#781)
Browse files Browse the repository at this point in the history
  • Loading branch information
democat3457 committed Jun 23, 2021
1 parent e300eb9 commit 0b5404c
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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);
}
}
}

0 comments on commit 0b5404c

Please sign in to comment.