public interface IPocketUpgrade
ITurtleUpgrade.| Modifier and Type | Method and Description |
|---|---|
IPeripheral |
createPeripheral(IPocketAccess access)
Creates a peripheral for the pocket computer.
|
ItemStack |
getCraftingItem()
Return an item stack representing the type of item that a pocket computer must be crafted with to create a
pocket computer which holds this upgrade.
|
java.lang.String |
getUnlocalisedAdjective()
Return an unlocalised string to describe the type of pocket computer this upgrade provides.
|
ResourceLocation |
getUpgradeID()
Gets a unique identifier representing this type of turtle upgrade.
|
default boolean |
onRightClick(World world,
IPocketAccess access,
IPeripheral peripheral)
Called when the pocket computer is right clicked.
|
default void |
update(IPocketAccess access,
IPeripheral peripheral)
Called when the pocket computer item stack updates.
|
ResourceLocation getUpgradeID()
getUpgradeID(),
ComputerCraftAPI.registerPocketUpgrade(IPocketUpgrade)java.lang.String getUnlocalisedAdjective()
ITurtleUpgrade.getUnlocalisedAdjective()ItemStack getCraftingItem()
pocket.equip()/pocket.unequip().ItemStack#EMPTY if crafting is disabled.IPeripheral createPeripheral(IPocketAccess access)
update(IPocketAccess, IPeripheral) and will be attached, detached and have methods called in the same
manner as an ordinary peripheral.access - The access object for the pocket item stack.update(IPocketAccess, IPeripheral)default void update(IPocketAccess access, IPeripheral peripheral)
access - The access object for the pocket item stack.peripheral - The peripheral for this upgrade.createPeripheral(IPocketAccess)default boolean onRightClick(World world,
IPocketAccess access,
IPeripheral peripheral)
world - The world the computer is in.access - The access object for the pocket item stack.peripheral - The peripheral for this upgrade.true to stop the GUI from opening, otherwise false. You should always provide some code path
which returns false, such as requiring the player to be sneaking - otherwise they will be unable to
access the GUI.createPeripheral(IPocketAccess)