Package dan200.computercraft.api.pocket
Interface IPocketAccess
public interface IPocketAccess
Wrapper class for pocket computers.
- 
Method Summary
Modifier and TypeMethodDescriptionintGet the colour of this pocket computer as a RGB number.net.minecraft.world.entity.EntityGets the entity holding this item.intgetLight()Get the colour of this pocket computer's light as a RGB number.net.minecraft.nbt.CompoundTagGet the upgrade-specific NBT.Map<net.minecraft.resources.ResourceLocation,IPeripheral> Deprecated, for removal: This API element is subject to removal in a future version.This is a relic of a previous API, which no longer makes sense with newer versions of ComputerCraft.voidRemove the current peripheral and create a new one.voidsetColour(int colour) Set the colour of the pocket computer to a RGB number.voidsetLight(int colour) Set the colour of the pocket computer's light to a RGB number.voidMark the upgrade-specific NBT as dirty. 
- 
Method Details
- 
getEntity
@Nullable net.minecraft.world.entity.Entity getEntity()Gets the entity holding this item.This must be called on the server thread.
- Returns:
 - The holding entity, or 
nullif none exists. 
 - 
getColour
int getColour()Get the colour of this pocket computer as a RGB number.- Returns:
 - The colour this pocket computer is. This will be a RGB colour between 
0x000000and0xFFFFFFor -1 if it has no colour. - See Also:
 
 - 
setColour
void setColour(int colour) Set the colour of the pocket computer to a RGB number.- Parameters:
 colour- The colour this pocket computer should be changed to. This should be a RGB colour between0x000000and0xFFFFFFor -1 to reset to the default colour.- See Also:
 
 - 
getLight
int getLight()Get the colour of this pocket computer's light as a RGB number.- Returns:
 - The colour this light is. This will be a RGB colour between 
0x000000and0xFFFFFFor -1 if it has no colour. - See Also:
 
 - 
setLight
void setLight(int colour) Set the colour of the pocket computer's light to a RGB number.- Parameters:
 colour- The colour this modem's light will be changed to. This should be a RGB colour between0x000000and0xFFFFFFor -1 to reset to the default colour.- See Also:
 
 - 
getUpgradeNBTData
net.minecraft.nbt.CompoundTag getUpgradeNBTData()Get the upgrade-specific NBT.This is persisted between computer reboots and chunk loads.
- Returns:
 - The upgrade's NBT.
 - See Also:
 
 - 
updateUpgradeNBTData
void updateUpgradeNBTData()Mark the upgrade-specific NBT as dirty.- See Also:
 
 - 
invalidatePeripheral
void invalidatePeripheral()Remove the current peripheral and create a new one.You may wish to do this if the methods available change, for instance when the owning entity changes.
 - 
getUpgrades
@Deprecated(forRemoval=true) Map<net.minecraft.resources.ResourceLocation,IPeripheral> getUpgrades()Deprecated, for removal: This API element is subject to removal in a future version.This is a relic of a previous API, which no longer makes sense with newer versions of ComputerCraft.Get a list of all upgrades for the pocket computer.- Returns:
 - A collection of all upgrade names.
 
 
 -