@@ -306,6 +306,15 @@ public static SoundCategory getByKey(String key) {
306
306
}
307
307
}
308
308
309
+ public enum ItemSlot {
310
+ MAINHAND ,
311
+ OFFHAND ,
312
+ FEET ,
313
+ LEGS ,
314
+ CHEST ,
315
+ HEAD ;
316
+ }
317
+
309
318
private static Class <?> PROTOCOL_CLASS = null ;
310
319
private static Class <?> CLIENT_COMMAND_CLASS = null ;
311
320
private static Class <?> CHAT_VISIBILITY_CLASS = null ;
@@ -322,6 +331,7 @@ public static SoundCategory getByKey(String key) {
322
331
private static Class <?> SCOREBOARD_ACTION_CLASS = null ;
323
332
private static Class <?> PARTICLE_CLASS = null ;
324
333
private static Class <?> SOUND_CATEGORY_CLASS = null ;
334
+ private static Class <?> ITEM_SLOT_CLASS = null ;
325
335
326
336
private static boolean INITIALIZED = false ;
327
337
private static Map <Class <?>, EquivalentConverter <?>> FROM_NATIVE = Maps .newHashMap ();
@@ -355,6 +365,7 @@ private static void initialize() {
355
365
SCOREBOARD_ACTION_CLASS = getEnum (PacketType .Play .Server .SCOREBOARD_SCORE .getPacketClass (), 0 );
356
366
PARTICLE_CLASS = getEnum (PacketType .Play .Server .WORLD_PARTICLES .getPacketClass (), 0 );
357
367
SOUND_CATEGORY_CLASS = getEnum (PacketType .Play .Server .CUSTOM_SOUND_EFFECT .getPacketClass (), 0 );
368
+ ITEM_SLOT_CLASS = getEnum (PacketType .Play .Server .ENTITY_EQUIPMENT .getPacketClass (), 0 );
358
369
359
370
associate (PROTOCOL_CLASS , Protocol .class , getClientCommandConverter ());
360
371
associate (CLIENT_COMMAND_CLASS , ClientCommand .class , getClientCommandConverter ());
@@ -372,6 +383,7 @@ private static void initialize() {
372
383
associate (SCOREBOARD_ACTION_CLASS , ScoreboardAction .class , getUpdateScoreActionConverter ());
373
384
associate (PARTICLE_CLASS , Particle .class , getParticleConverter ());
374
385
associate (SOUND_CATEGORY_CLASS , SoundCategory .class , getSoundCategoryConverter ());
386
+ associate (ITEM_SLOT_CLASS , ItemSlot .class , getItemSlotConverter ());
375
387
INITIALIZED = true ;
376
388
}
377
389
@@ -485,6 +497,11 @@ public static Class<?> getSoundCategoryClass() {
485
497
return SOUND_CATEGORY_CLASS ;
486
498
}
487
499
500
+ public static Class <?> getItemSlotClass () {
501
+ initialize ();
502
+ return ITEM_SLOT_CLASS ;
503
+ }
504
+
488
505
// Get the converters
489
506
public static EquivalentConverter <Protocol > getProtocolConverter () {
490
507
return new EnumConverter <Protocol >(Protocol .class );
@@ -550,6 +567,10 @@ public static EquivalentConverter<SoundCategory> getSoundCategoryConverter() {
550
567
return new EnumConverter <SoundCategory >(SoundCategory .class );
551
568
}
552
569
570
+ public static EquivalentConverter <ItemSlot > getItemSlotConverter () {
571
+ return new EnumConverter <ItemSlot >(ItemSlot .class );
572
+ }
573
+
553
574
/**
554
575
* Retrieve a generic enum converter for use with StructureModifiers.
555
576
* @param enumClass - Enum class
0 commit comments