Class BloodChestRepairActionRegistry
java.lang.Object
org.cyclops.evilcraft.blockentity.tickaction.bloodchest.BloodChestRepairActionRegistry
- All Implemented Interfaces:
org.cyclops.cyclopscore.init.IRegistry,IBloodChestRepairActionRegistry
public class BloodChestRepairActionRegistry
extends Object
implements IBloodChestRepairActionRegistry
Registry for
IBloodChestRepairAction instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcanRepair(net.minecraft.world.item.ItemStack itemStack, int tick) Check if a given item can be repaired.booleanisItemValidForSlot(net.minecraft.world.item.ItemStack itemStack) Check if the given item can be inserted into the Blood Chest.protected booleanisNotBlacklisted(net.minecraft.world.item.ItemStack itemStack) voidregister(IBloodChestRepairAction repairAction) Register a new repair action.org.apache.commons.lang3.tuple.Pair<Float,net.minecraft.world.item.ItemStack> repair(net.minecraft.world.item.ItemStack itemStack, net.minecraft.util.RandomSource random, int actionID, boolean doAction, boolean isBulk) The repair logic for a given item for one tick.
-
Constructor Details
-
BloodChestRepairActionRegistry
public BloodChestRepairActionRegistry()Make a new instance.
-
-
Method Details
-
register
Description copied from interface:IBloodChestRepairActionRegistryRegister a new repair action.- Specified by:
registerin interfaceIBloodChestRepairActionRegistry- Parameters:
repairAction- The repair action instance.
-
isItemValidForSlot
public boolean isItemValidForSlot(net.minecraft.world.item.ItemStack itemStack) Description copied from interface:IBloodChestRepairActionRegistryCheck if the given item can be inserted into the Blood Chest.- Specified by:
isItemValidForSlotin interfaceIBloodChestRepairActionRegistry- Parameters:
itemStack- TheItemStackthat could be inserted.- Returns:
- If the given item can be inserted into the given slot of the Blood Chest.
-
canRepair
public int canRepair(net.minecraft.world.item.ItemStack itemStack, int tick) Description copied from interface:IBloodChestRepairActionRegistryCheck if a given item can be repaired.- Specified by:
canRepairin interfaceIBloodChestRepairActionRegistry- Parameters:
itemStack- The item that could be repaired.tick- The current tick inside the Blood Chest.- Returns:
- -1 if none of the actions apply, otherwise the actionID that applies.
-
repair
public org.apache.commons.lang3.tuple.Pair<Float,net.minecraft.world.item.ItemStack> repair(net.minecraft.world.item.ItemStack itemStack, net.minecraft.util.RandomSource random, int actionID, boolean doAction, boolean isBulk) Description copied from interface:IBloodChestRepairActionRegistryThe repair logic for a given item for one tick.- Specified by:
repairin interfaceIBloodChestRepairActionRegistry- Parameters:
itemStack- The item to repair.random- A random instance.actionID- the ID of the action to call.doAction- If the actual repair action should be performed, otherwise this is just a simulation.isBulk- If the repairing container repairs things in bulk.- Returns:
- Pair of blood usage multiplier and new itemstack.
-
isNotBlacklisted
protected boolean isNotBlacklisted(net.minecraft.world.item.ItemStack itemStack)
-