public interface IPocketUpgrade
ITurtleUpgrade
.Modifier and Type | Method and Description |
---|---|
IPeripheral |
createPeripheral(IPocketAccess access)
Creates a peripheral for the pocket computer.
|
net.minecraft.item.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.
|
net.minecraft.util.ResourceLocation |
getUpgradeID()
Gets a unique identifier representing this type of turtle upgrade.
|
default boolean |
onRightClick(net.minecraft.world.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.
|
@Nonnull net.minecraft.util.ResourceLocation getUpgradeID()
getUpgradeID()
,
ComputerCraftAPI.registerPocketUpgrade(IPocketUpgrade)
@Nonnull java.lang.String getUnlocalisedAdjective()
ITurtleUpgrade.getUnlocalisedAdjective()
@Nonnull net.minecraft.item.ItemStack getCraftingItem()
pocket.equip()
/pocket.unequip()
.ItemStack.EMPTY
if crafting is disabled.@Nullable IPeripheral createPeripheral(@Nonnull 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(@Nonnull IPocketAccess access, @Nullable IPeripheral peripheral)
access
- The access object for the pocket item stack.peripheral
- The peripheral for this upgrade.createPeripheral(IPocketAccess)
default boolean onRightClick(@Nonnull net.minecraft.world.World world, @Nonnull IPocketAccess access, @Nullable 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)