GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
InventoryType Class Reference

Public Member Functions

 getDefaultSize ()
 
 getDefaultTitle ()
 
 getNetworkType ()
 

Static Public Member Functions

static get ($index)
 
static init ()
 

Data Fields

const CHEST = 0
 
const DOUBLE_CHEST = 1
 
const PLAYER = 2
 
const FURNACE = 3
 
const CRAFTING = 4
 
const WORKBENCH = 5
 
const BREWING_STAND = 7
 
const ANVIL = 8
 
const ENCHANT_TABLE = 9
 
const DISPENSER = 10
 
const DROPPER = 11
 
const HOPPER = 12
 
const ENDER_CHEST = 13
 
const BEACON = 14
 
const PLAYER_FLOATING = 254
 

Detailed Description

Saves all the information regarding default inventory sizes and types

Member Function Documentation

◆ get()

static get (   $index)
static
Parameters
$index
Returns
InventoryType
70  {
71  return isset(static::$default[$index]) ? static::$default[$index] : null;
72  }

◆ getDefaultSize()

getDefaultSize ( )
Returns
int
115  {
116  return $this->size;
117  }

◆ getDefaultTitle()

getDefaultTitle ( )
Returns
string
122  {
123  return $this->title;
124  }

◆ getNetworkType()

getNetworkType ( )
Returns
int
129  {
130  return $this->typeId;
131  }

◆ init()

static init ( )
static
74  {
75  if(count(static::$default) > 0){
76  return;
77  }
78 
79  //TODO: move network stuff out of here
80  //TODO: move inventory data to json
81  static::$default = [
82  static::CHEST => new InventoryType(27, "Chest", InventoryNetworkIds::CONTAINER),
83  static::DOUBLE_CHEST => new InventoryType(27 + 27, "Double Chest", InventoryNetworkIds::CONTAINER),
84  static::PLAYER => new InventoryType(36 + 4, "Player", InventoryNetworkIds::INVENTORY), //36 CONTAINER, 4 ARMOR
85  static::CRAFTING => new InventoryType(5, "Crafting", InventoryNetworkIds::INVENTORY), //yes, the use of INVENTORY is intended! 4 CRAFTING slots, 1 RESULT
86  static::WORKBENCH => new InventoryType(10, "Crafting", InventoryNetworkIds::WORKBENCH), //9 CRAFTING slots, 1 RESULT
87  static::FURNACE => new InventoryType(3, "Furnace", InventoryNetworkIds::FURNACE), //2 INPUT, 1 OUTPUT
88  static::ENCHANT_TABLE => new InventoryType(2, "Enchant", InventoryNetworkIds::ENCHANTMENT), //1 INPUT/OUTPUT, 1 LAPIS
89  static::BREWING_STAND => new InventoryType(4, "Brewing", InventoryNetworkIds::BREWING_STAND), //1 INPUT, 3 POTION
90  static::ANVIL => new InventoryType(3, "Anvil", InventoryNetworkIds::ANVIL), //2 INPUT, 1 OUTPUT
91  static::DISPENSER => new InventoryType(9, "Dispenser", InventoryNetworkIds::DISPENSER), //9 CONTAINER
92  static::DROPPER => new InventoryType(9, "Dropper", InventoryNetworkIds::DROPPER), //9 CONTAINER
93  static::HOPPER => new InventoryType(5, "Hopper", InventoryNetworkIds::HOPPER), //5 CONTAINER
94  static::ENDER_CHEST => new InventoryType(27, "Ender Chest", InventoryNetworkIds::CONTAINER),
95  static::BEACON => new InventoryType(0, "Beacon", InventoryNetworkIds::BEACON), //信标
96 
97  static::PLAYER_FLOATING => new InventoryType(36, "Floating", null) //Mirror all slots of main inventory (needed for large item pickups)
98  ];
99  }

Field Documentation

◆ ANVIL

const ANVIL = 8

◆ BEACON

const BEACON = 14

◆ BREWING_STAND

const BREWING_STAND = 7

◆ CHEST

const CHEST = 0

◆ CRAFTING

const CRAFTING = 4

◆ DISPENSER

const DISPENSER = 10

◆ DOUBLE_CHEST

const DOUBLE_CHEST = 1

◆ DROPPER

const DROPPER = 11

◆ ENCHANT_TABLE

const ENCHANT_TABLE = 9

◆ ENDER_CHEST

const ENDER_CHEST = 13

◆ FURNACE

const FURNACE = 3

◆ HOPPER

const HOPPER = 12

◆ PLAYER

const PLAYER = 2

◆ PLAYER_FLOATING

const PLAYER_FLOATING = 254

◆ WORKBENCH

const WORKBENCH = 5

The documentation for this class was generated from the following file: