PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
ItemTypeIds.php
1<?php
2
3/*
4 *
5 * ____ _ _ __ __ _ __ __ ____
6 * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
7 * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
8 * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
9 * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
10 *
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * @author PocketMine Team
17 * @link http://www.pocketmine.net/
18 *
19 *
20 */
21
22declare(strict_types=1);
23
24namespace pocketmine\item;
25
33final class ItemTypeIds{
34
35 private function __construct(){
36 //NOOP
37 }
38
39 public const ACACIA_BOAT = 20000;
40 public const ACACIA_SIGN = 20001;
41 public const APPLE = 20002;
42 public const ARROW = 20003;
43 public const BAKED_POTATO = 20004;
44 public const BAMBOO = 20005;
45 public const BANNER = 20006;
46
47 public const BEETROOT = 20008;
48 public const BEETROOT_SEEDS = 20009;
49 public const BEETROOT_SOUP = 20010;
50 public const BIRCH_BOAT = 20011;
51 public const BIRCH_SIGN = 20012;
52 public const BLAZE_POWDER = 20013;
53 public const BLAZE_ROD = 20014;
54 public const BLEACH = 20015;
55 public const BONE = 20016;
56 public const BONE_MEAL = 20017;
57 public const BOOK = 20018;
58 public const BOW = 20019;
59 public const BOWL = 20020;
60 public const BREAD = 20021;
61 public const BRICK = 20022;
62 public const BUCKET = 20023;
63 public const CARROT = 20024;
64 public const CHAINMAIL_BOOTS = 20025;
65 public const CHAINMAIL_CHESTPLATE = 20026;
66 public const CHAINMAIL_HELMET = 20027;
67 public const CHAINMAIL_LEGGINGS = 20028;
68 public const CHARCOAL = 20029;
69 public const CHEMICAL_ALUMINIUM_OXIDE = 20030;
70 public const CHEMICAL_AMMONIA = 20031;
71 public const CHEMICAL_BARIUM_SULPHATE = 20032;
72 public const CHEMICAL_BENZENE = 20033;
73 public const CHEMICAL_BORON_TRIOXIDE = 20034;
74 public const CHEMICAL_CALCIUM_BROMIDE = 20035;
75 public const CHEMICAL_CALCIUM_CHLORIDE = 20036;
76 public const CHEMICAL_CERIUM_CHLORIDE = 20037;
77 public const CHEMICAL_CHARCOAL = 20038;
78 public const CHEMICAL_CRUDE_OIL = 20039;
79 public const CHEMICAL_GLUE = 20040;
80 public const CHEMICAL_HYDROGEN_PEROXIDE = 20041;
81 public const CHEMICAL_HYPOCHLORITE = 20042;
82 public const CHEMICAL_INK = 20043;
83 public const CHEMICAL_IRON_SULPHIDE = 20044;
84 public const CHEMICAL_LATEX = 20045;
85 public const CHEMICAL_LITHIUM_HYDRIDE = 20046;
86 public const CHEMICAL_LUMINOL = 20047;
87 public const CHEMICAL_MAGNESIUM_NITRATE = 20048;
88 public const CHEMICAL_MAGNESIUM_OXIDE = 20049;
89 public const CHEMICAL_MAGNESIUM_SALTS = 20050;
90 public const CHEMICAL_MERCURIC_CHLORIDE = 20051;
91 public const CHEMICAL_POLYETHYLENE = 20052;
92 public const CHEMICAL_POTASSIUM_CHLORIDE = 20053;
93 public const CHEMICAL_POTASSIUM_IODIDE = 20054;
94 public const CHEMICAL_RUBBISH = 20055;
95 public const CHEMICAL_SALT = 20056;
96 public const CHEMICAL_SOAP = 20057;
97 public const CHEMICAL_SODIUM_ACETATE = 20058;
98 public const CHEMICAL_SODIUM_FLUORIDE = 20059;
99 public const CHEMICAL_SODIUM_HYDRIDE = 20060;
100 public const CHEMICAL_SODIUM_HYDROXIDE = 20061;
101 public const CHEMICAL_SODIUM_HYPOCHLORITE = 20062;
102 public const CHEMICAL_SODIUM_OXIDE = 20063;
103 public const CHEMICAL_SUGAR = 20064;
104 public const CHEMICAL_SULPHATE = 20065;
105 public const CHEMICAL_TUNGSTEN_CHLORIDE = 20066;
106 public const CHEMICAL_WATER = 20067;
107 public const CHORUS_FRUIT = 20068;
108 public const CLAY = 20069;
109 public const CLOCK = 20070;
110 public const CLOWNFISH = 20071;
111 public const COAL = 20072;
112 public const COCOA_BEANS = 20073;
113 public const COMPASS = 20074;
114 public const COOKED_CHICKEN = 20075;
115 public const COOKED_FISH = 20076;
116 public const COOKED_MUTTON = 20077;
117 public const COOKED_PORKCHOP = 20078;
118 public const COOKED_RABBIT = 20079;
119 public const COOKED_SALMON = 20080;
120 public const COOKIE = 20081;
121 public const CORAL_FAN = 20082;
122 public const DARK_OAK_BOAT = 20083;
123 public const DARK_OAK_SIGN = 20084;
124 public const DIAMOND = 20085;
125 public const DIAMOND_AXE = 20086;
126 public const DIAMOND_BOOTS = 20087;
127 public const DIAMOND_CHESTPLATE = 20088;
128 public const DIAMOND_HELMET = 20089;
129 public const DIAMOND_HOE = 20090;
130 public const DIAMOND_LEGGINGS = 20091;
131 public const DIAMOND_PICKAXE = 20092;
132 public const DIAMOND_SHOVEL = 20093;
133 public const DIAMOND_SWORD = 20094;
134 public const DRAGON_BREATH = 20095;
135 public const DRIED_KELP = 20096;
136 public const DYE = 20097;
137 public const EGG = 20098;
138 public const EMERALD = 20099;
139 public const ENCHANTED_GOLDEN_APPLE = 20100;
140 public const ENDER_PEARL = 20101;
141 public const EXPERIENCE_BOTTLE = 20102;
142 public const FEATHER = 20103;
143 public const FERMENTED_SPIDER_EYE = 20104;
144 public const FISHING_ROD = 20105;
145 public const FLINT = 20106;
146 public const FLINT_AND_STEEL = 20107;
147 public const GHAST_TEAR = 20108;
148 public const GLASS_BOTTLE = 20109;
149 public const GLISTERING_MELON = 20110;
150 public const GLOWSTONE_DUST = 20111;
151 public const GOLD_INGOT = 20112;
152 public const GOLD_NUGGET = 20113;
153 public const GOLDEN_APPLE = 20114;
154 public const GOLDEN_AXE = 20115;
155 public const GOLDEN_BOOTS = 20116;
156 public const GOLDEN_CARROT = 20117;
157 public const GOLDEN_CHESTPLATE = 20118;
158 public const GOLDEN_HELMET = 20119;
159 public const GOLDEN_HOE = 20120;
160 public const GOLDEN_LEGGINGS = 20121;
161 public const GOLDEN_PICKAXE = 20122;
162 public const GOLDEN_SHOVEL = 20123;
163 public const GOLDEN_SWORD = 20124;
164 public const GUNPOWDER = 20125;
165 public const HEART_OF_THE_SEA = 20126;
166 public const INK_SAC = 20127;
167 public const IRON_AXE = 20128;
168 public const IRON_BOOTS = 20129;
169 public const IRON_CHESTPLATE = 20130;
170 public const IRON_HELMET = 20131;
171 public const IRON_HOE = 20132;
172 public const IRON_INGOT = 20133;
173 public const IRON_LEGGINGS = 20134;
174 public const IRON_NUGGET = 20135;
175 public const IRON_PICKAXE = 20136;
176 public const IRON_SHOVEL = 20137;
177 public const IRON_SWORD = 20138;
178 public const JUNGLE_BOAT = 20139;
179 public const JUNGLE_SIGN = 20140;
180 public const LAPIS_LAZULI = 20141;
181 public const LAVA_BUCKET = 20142;
182 public const LEATHER = 20143;
183 public const LEATHER_BOOTS = 20144;
184 public const LEATHER_CAP = 20145;
185 public const LEATHER_PANTS = 20146;
186 public const LEATHER_TUNIC = 20147;
187 public const MAGMA_CREAM = 20148;
188 public const MELON = 20149;
189 public const MELON_SEEDS = 20150;
190 public const MILK_BUCKET = 20151;
191 public const MINECART = 20152;
192
193 public const MUSHROOM_STEW = 20154;
194 public const NAUTILUS_SHELL = 20155;
195 public const NETHER_BRICK = 20156;
196 public const NETHER_QUARTZ = 20157;
197 public const NETHER_STAR = 20158;
198 public const OAK_BOAT = 20159;
199 public const OAK_SIGN = 20160;
200 public const PAINTING = 20161;
201 public const PAPER = 20162;
202 public const POISONOUS_POTATO = 20163;
203 public const POPPED_CHORUS_FRUIT = 20164;
204 public const POTATO = 20165;
205 public const POTION = 20166;
206 public const PRISMARINE_CRYSTALS = 20167;
207 public const PRISMARINE_SHARD = 20168;
208 public const PUFFERFISH = 20169;
209 public const PUMPKIN_PIE = 20170;
210 public const PUMPKIN_SEEDS = 20171;
211 public const RABBIT_FOOT = 20172;
212 public const RABBIT_HIDE = 20173;
213 public const RABBIT_STEW = 20174;
214 public const RAW_BEEF = 20175;
215 public const RAW_CHICKEN = 20176;
216 public const RAW_FISH = 20177;
217 public const RAW_MUTTON = 20178;
218 public const RAW_PORKCHOP = 20179;
219 public const RAW_RABBIT = 20180;
220 public const RAW_SALMON = 20181;
221 public const RECORD_11 = 20182;
222 public const RECORD_13 = 20183;
223 public const RECORD_BLOCKS = 20184;
224 public const RECORD_CAT = 20185;
225 public const RECORD_CHIRP = 20186;
226 public const RECORD_FAR = 20187;
227 public const RECORD_MALL = 20188;
228 public const RECORD_MELLOHI = 20189;
229 public const RECORD_STAL = 20190;
230 public const RECORD_STRAD = 20191;
231 public const RECORD_WAIT = 20192;
232 public const RECORD_WARD = 20193;
233 public const REDSTONE_DUST = 20194;
234 public const ROTTEN_FLESH = 20195;
235 public const SCUTE = 20196;
236 public const SHEARS = 20197;
237 public const SHULKER_SHELL = 20198;
238 public const SLIMEBALL = 20199;
239 public const SNOWBALL = 20200;
240 public const SPIDER_EYE = 20201;
241 public const SPLASH_POTION = 20202;
242 public const SPRUCE_BOAT = 20203;
243 public const SPRUCE_SIGN = 20204;
244 public const SQUID_SPAWN_EGG = 20205;
245 public const STEAK = 20206;
246 public const STICK = 20207;
247 public const STONE_AXE = 20208;
248 public const STONE_HOE = 20209;
249 public const STONE_PICKAXE = 20210;
250 public const STONE_SHOVEL = 20211;
251 public const STONE_SWORD = 20212;
252 public const STRING = 20213;
253 public const SUGAR = 20214;
254 public const SWEET_BERRIES = 20215;
255 public const TOTEM = 20216;
256 public const VILLAGER_SPAWN_EGG = 20217;
257 public const WATER_BUCKET = 20218;
258 public const WHEAT = 20219;
259 public const WHEAT_SEEDS = 20220;
260 public const WOODEN_AXE = 20221;
261 public const WOODEN_HOE = 20222;
262 public const WOODEN_PICKAXE = 20223;
263 public const WOODEN_SHOVEL = 20224;
264 public const WOODEN_SWORD = 20225;
265 public const WRITABLE_BOOK = 20226;
266 public const WRITTEN_BOOK = 20227;
267 public const ZOMBIE_SPAWN_EGG = 20228;
268 public const CRIMSON_SIGN = 20229;
269 public const MANGROVE_SIGN = 20230;
270 public const WARPED_SIGN = 20231;
271 public const AMETHYST_SHARD = 20232;
272 public const COPPER_INGOT = 20233;
273 public const DISC_FRAGMENT_5 = 20234;
274 public const ECHO_SHARD = 20235;
275 public const GLOW_INK_SAC = 20236;
276 public const HONEY_BOTTLE = 20237;
277 public const HONEYCOMB = 20238;
278 public const RECORD_5 = 20239;
279 public const RECORD_OTHERSIDE = 20240;
280 public const RECORD_PIGSTEP = 20241;
281 public const NETHERITE_INGOT = 20242;
282 public const NETHERITE_AXE = 20243;
283 public const NETHERITE_HOE = 20244;
284 public const NETHERITE_PICKAXE = 20245;
285 public const NETHERITE_SHOVEL = 20246;
286 public const NETHERITE_SWORD = 20247;
287 public const NETHERITE_BOOTS = 20248;
288 public const NETHERITE_CHESTPLATE = 20249;
289 public const NETHERITE_HELMET = 20250;
290 public const NETHERITE_LEGGINGS = 20251;
291 public const PHANTOM_MEMBRANE = 20252;
292 public const RAW_COPPER = 20253;
293 public const RAW_IRON = 20254;
294 public const RAW_GOLD = 20255;
295 public const SPYGLASS = 20256;
296 public const NETHERITE_SCRAP = 20257;
297 public const POWDER_SNOW_BUCKET = 20258;
298 public const LINGERING_POTION = 20259;
299 public const FIRE_CHARGE = 20260;
300 public const SUSPICIOUS_STEW = 20261;
301 public const TURTLE_HELMET = 20262;
302 public const MEDICINE = 20263;
303 public const MANGROVE_BOAT = 20264;
304 public const GLOW_BERRIES = 20265;
305 public const CHERRY_SIGN = 20266;
306 public const ENCHANTED_BOOK = 20267;
307 public const TORCHFLOWER_SEEDS = 20268;
308 public const NETHERITE_UPGRADE_SMITHING_TEMPLATE = 20269;
309 public const SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE = 20270;
310 public const VEX_ARMOR_TRIM_SMITHING_TEMPLATE = 20271;
311 public const WILD_ARMOR_TRIM_SMITHING_TEMPLATE = 20272;
312 public const COAST_ARMOR_TRIM_SMITHING_TEMPLATE = 20273;
313 public const DUNE_ARMOR_TRIM_SMITHING_TEMPLATE = 20274;
314 public const WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE = 20275;
315 public const RAISER_ARMOR_TRIM_SMITHING_TEMPLATE = 20276;
316 public const SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE = 20277;
317 public const HOST_ARMOR_TRIM_SMITHING_TEMPLATE = 20278;
318 public const WARD_ARMOR_TRIM_SMITHING_TEMPLATE = 20279;
319 public const SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE = 20280;
320 public const TIDE_ARMOR_TRIM_SMITHING_TEMPLATE = 20281;
321 public const SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE = 20282;
322 public const RIB_ARMOR_TRIM_SMITHING_TEMPLATE = 20283;
323 public const EYE_ARMOR_TRIM_SMITHING_TEMPLATE = 20284;
324 public const SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE = 20285;
325 public const PITCHER_POD = 20286;
326 public const NAME_TAG = 20287;
327 public const GOAT_HORN = 20288;
328 public const END_CRYSTAL = 20289;
329
330 public const FIRST_UNUSED_ITEM_ID = 20290;
331
332 private static int $nextDynamicId = self::FIRST_UNUSED_ITEM_ID;
333
337 public static function newId() : int{
338 return self::$nextDynamicId++;
339 }
340
341 public static function fromBlockTypeId(int $blockTypeId) : int{
342 if($blockTypeId < 0){
343 throw new \InvalidArgumentException("Block type IDs cannot be negative");
344 }
345 //negative item type IDs are treated as block IDs
346 return -$blockTypeId;
347 }
348
349 public static function toBlockTypeId(int $itemTypeId) : ?int{
350 if($itemTypeId > 0){ //not a blockitem
351 return null;
352 }
353 return -$itemTypeId;
354 }
355}