Skip to content
kotakotik22 edited this page Jul 16, 2021 · 2 revisions

Custom drill heads

Drill partials

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

Example:

// 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)'

Drill items

CA has an IDrillHead interface for items

Example:

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();

Custom extractables

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);
Clone this wiki locally