-
Notifications
You must be signed in to change notification settings - Fork 7
API
kotakotik22 edited this page Jul 16, 2021
·
2 revisions
CA has a special index/registry for drill partials, which are accessed when the drill instance data is made
- Drill partials can be added to the index at any time
- Drill partials should be tied to the item's registry name, as that's how the extractor finds them
// MyBlockPartials
public static PartialModel SVELTE_DRILL = get("drills/svelte");// MyBlocks
public static ItemEntry<SvelteDrillHead> SVELTE_DRILL = registrate.item("svelte_drill", SvelteDrillHead::new).doStuff().register();// at some point after creating the partials and drill heads are loaded
DrillPartialIndex.add(MyBlocks.SVELTE_DRILL.getRegistryName(), MyBlockPartials.SVELTE_DRILL)'CA has an IDrillHead interface for items
public class SvelteDrillHead extends Item implements IDrillHead {
public SvelteDrillHead(Properties properties) {
super(properties);
}
@Override
public int getDurability() {
return 200; // whatever your drill's durability is
}
}// MyBlocks
public static ItemEntry<SvelteDrillHead> SVELTE_DRILL = registrate.item("svelte_drill", SvelteDrillHead::new).doStuff().register();Most of the time you should probably just use the Extracting Recipe type, but if you want to customize exactly what happens in extraction, you can implement IExtractable
// This is an abstract (interface) method that is called every tick by ore extractors
void extractTick(OreExtractorTile oreExtractorTile);CreateAutomated developer wiki