public interface IWrenchRegistry
PneumaticRegistry.IPneumaticCraftInterface#getWrenchRegistry()| Modifier and Type | Method and Description |
|---|---|
void |
addModdedWrenchBehaviour(java.lang.String modid,
java.util.function.BiFunction<net.minecraft.item.ItemUseContext,net.minecraft.block.BlockState,net.minecraft.util.ActionResultType> behaviourPre,
java.util.function.BiConsumer<net.minecraft.item.ItemUseContext,net.minecraft.block.BlockState> behaviourPost)
Register a third-party behaviour for when blocks from another mod are wrenched with the Pneumatic Wrench.
|
boolean |
isModdedWrench(net.minecraft.item.ItemStack stack)
Check if the given item is considered as a modded wrench (so does not include the Pneumatic Wrench).
|
boolean |
isWrench(net.minecraft.item.ItemStack stack)
Check if the given item is any known wrench item, including the Pneumatic Wrench.
|
void |
registerWrench(net.minecraft.item.Item wrench)
Register the given item as a wrench, as far as PneumaticCraft is concerned.
|
boolean isModdedWrench(@Nonnull
net.minecraft.item.ItemStack stack)
forge:tools/wrench item tag will also be considered as modded wrenches.stack - the item to checkboolean isWrench(@Nonnull
net.minecraft.item.ItemStack stack)
stack - the item to checkvoid registerWrench(net.minecraft.item.Item wrench)
forge:tools/wrench item tag.wrench - a wrench itemvoid addModdedWrenchBehaviour(java.lang.String modid,
java.util.function.BiFunction<net.minecraft.item.ItemUseContext,net.minecraft.block.BlockState,net.minecraft.util.ActionResultType> behaviourPre,
java.util.function.BiConsumer<net.minecraft.item.ItemUseContext,net.minecraft.block.BlockState> behaviourPost)
The return
value from behaviourPre is also returned by IForgeItem.onItemUseFirst(ItemStack, ItemUseContext)
when the Pneumatic Wrench is used. Any return value other than PASS will suppress the default Pneumatic Wrench
behaviour (including air usage); returning CONSUME will also suppress the Pneumatic Wrench's sound effect.
The code in behaviourPost will only be run if behaviourPre returned PASS (i.e. did
not suppress the default Pneumatic Wrench behaviour).
modid - the mod whose blocks to register the behaviour for; must exactly match the mod's namespacebehaviourPre - code to run when blocks from the mod are about to be wrenched with the Pneumatic WrenchbehaviourPost - code to run when blocks from the mod have just been wrenched with the Pneumatic Wrench