@@ -317,7 +317,7 @@ public static Entity edit(@Nonnull Entity entity, @Nonnull ConfigurationSection
317317                if  (sheared ) sheep .setSheared (true );
318318            } else  if  (living  instanceof  Rabbit ) {
319319                Rabbit  rabbit  = (Rabbit ) living ;
320-                 rabbit .setRabbitType (Enums .getIfPresent (Rabbit .Type .class , config .getString ("rabbit-type " )).or (Rabbit .Type .WHITE ));
320+                 rabbit .setRabbitType (Enums .getIfPresent (Rabbit .Type .class , config .getString ("color " )).or (Rabbit .Type .WHITE ));
321321            } else  if  (living  instanceof  Bat ) {
322322                Bat  bat  = (Bat ) living ;
323323                if  (!config .getBoolean ("awake" )) bat .setAwake (false );
@@ -340,73 +340,23 @@ public static Entity edit(@Nonnull Entity entity, @Nonnull ConfigurationSection
340340                    } else  if  (XMaterial .supports (12 )) {
341341                        if  (living  instanceof  Parrot ) {
342342                            Parrot  parrot  = (Parrot ) living ;
343-                             parrot .setVariant (Enums .getIfPresent (Parrot .Variant .class , config .getString ("variant" )).or (Parrot .Variant .RED ));
344-                         } else  if  (XMaterial .supports (13 )) {
345-                             if  (living  instanceof  Husk ) {
346-                                 Husk  husk  = (Husk ) living ;
347-                                 husk .setConversionTime (config .getInt ("conversion-time" ));
348-                             } else  if  (living  instanceof  Vex ) {
349-                                 Vex  vex  = (Vex ) living ;
350-                                 vex .setCharging (config .getBoolean ("charging" ));
351-                             } else  if  (living  instanceof  PufferFish ) {
352-                                 PufferFish  pufferFish  = (PufferFish ) living ;
353-                                 pufferFish .setPuffState (config .getInt ("puff-state" ));
354-                             } else  if  (living  instanceof  TropicalFish ) {
355-                                 TropicalFish  tropicalFish  = (TropicalFish ) living ;
356-                                 tropicalFish .setBodyColor (Enums .getIfPresent (DyeColor .class , config .getString ("color" )).or (DyeColor .WHITE ));
357-                                 tropicalFish .setPattern (Enums .getIfPresent (TropicalFish .Pattern .class , config .getString ("pattern" )).or (TropicalFish .Pattern .BETTY ));
358-                                 tropicalFish .setPatternColor (Enums .getIfPresent (DyeColor .class , config .getString ("pattern-color" )).or (DyeColor .WHITE ));
359-                             } else  if  (living  instanceof  EnderDragon ) {
360-                                 EnderDragon  dragon  = (EnderDragon ) living ;
361-                                 dragon .setPhase (Enums .getIfPresent (EnderDragon .Phase .class , config .getString ("phase" )).or (EnderDragon .Phase .ROAR_BEFORE_ATTACK ));
362-                             } else  if  (living  instanceof  Phantom ) {
363-                                 Phantom  phantom  = (Phantom ) living ;
364-                                 phantom .setSize (config .getInt ("size" ));
365-                             } else  if  (XMaterial .supports (14 )) {
366-                                 if  (living  instanceof  Cat ) {
367-                                     Cat  cat  = (Cat ) living ;
368-                                     cat .setCatType (Enums .getIfPresent (Cat .Type .class , config .getString ("cat-type" )).or (Cat .Type .TABBY ));
369-                                     cat .setCollarColor (Enums .getIfPresent (DyeColor .class , config .getString ("color" )).or (DyeColor .GREEN ));
370-                                 } else  if  (living  instanceof  Fox ) {
371-                                     Fox  fox  = (Fox ) living ;
372-                                     fox .setCrouching (config .getBoolean ("crouching" ));
373-                                     fox .setSleeping (config .getBoolean ("sleeping" ));
374-                                     fox .setFoxType (Enums .getIfPresent (Fox .Type .class , config .getString ("type" )).or (Fox .Type .RED ));
375-                                 } else  if  (living  instanceof  Panda ) {
376-                                     Panda  panda  = (Panda ) living ;
377-                                     panda .setHiddenGene (Enums .getIfPresent (Panda .Gene .class , config .getString ("hidden-gene" )).or (Panda .Gene .PLAYFUL ));
378-                                     panda .setMainGene (Enums .getIfPresent (Panda .Gene .class , config .getString ("main-gene" )).or (Panda .Gene .NORMAL ));
379-                                 } else  if  (living  instanceof  MushroomCow ) {
380-                                     MushroomCow  mooshroom  = (MushroomCow ) living ;
381-                                     mooshroom .setVariant (Enums .getIfPresent (MushroomCow .Variant .class , config .getString ("variant" )).or (MushroomCow .Variant .RED ));
382-                                 } else  if  (XMaterial .supports (15 )) {
383-                                     if  (living  instanceof  Bee ) {
384-                                         Bee  bee  = (Bee ) living ;
385-                                         // Anger time ticks. 
386-                                         bee .setAnger (config .getInt ("anger" ) * 20 );
387-                                         bee .setHasNectar (config .getBoolean ("nectar" ));
388-                                         bee .setHasStung (config .getBoolean ("stung" ));
389-                                         bee .setCannotEnterHiveTicks (config .getInt ("disallow-hive" ) * 20 );
390-                                     } else  if  (XMaterial .supports (16 )) {
391-                                         if  (living  instanceof  Hoglin ) {
392-                                             Hoglin  hoglin  = (Hoglin ) living ;
393-                                             hoglin .setConversionTime (config .getInt ("conversation" ) * 20 );
394-                                             hoglin .setImmuneToZombification (config .getBoolean ("zombification-immunity" ));
395-                                             hoglin .setIsAbleToBeHunted (config .getBoolean ("can-be-hunted" ));
396-                                         } else  if  (living  instanceof  Piglin ) {
397-                                             // Idk why Spigot did this... 
398-                                             Piglin  piglin  = (Piglin ) living ;
399-                                             piglin .setConversionTime (config .getInt ("conversation" ) * 20 );
400-                                             piglin .setImmuneToZombification (config .getBoolean ("zombification-immunity" ));
401-                                         } else  if  (living  instanceof  Strider ) {
402-                                             Strider  strider  = (Strider ) living ;
403-                                             strider .setShivering (config .getBoolean ("shivering" ));
404-                                         }
405- 
406-                                         if  (XMaterial .supports (17 )) handleSeventeen (entity , config );
407-                                     }
408-                                 }
343+                             parrot .setVariant (Enums .getIfPresent (Parrot .Variant .class , config .getString ("color" )).or (Parrot .Variant .RED ));
344+                         }
345+ 
346+                         if  (XMaterial .supports (13 )) thirteen (entity , config );
347+                         if  (XMaterial .supports (14 )) fourteen (entity , config );
348+                         if  (XMaterial .supports (15 )) {
349+                             if  (living  instanceof  Bee ) {
350+                                 Bee  bee  = (Bee ) living ;
351+                                 // Anger time ticks. 
352+                                 bee .setAnger (config .getInt ("anger" ) * 20 );
353+                                 bee .setHasNectar (config .getBoolean ("nectar" ));
354+                                 bee .setHasStung (config .getBoolean ("stung" ));
355+                                 bee .setCannotEnterHiveTicks (config .getInt ("disallow-hive" ) * 20 );
409356                            }
357+ 
358+                             if  (XMaterial .supports (16 )) sixteen (entity , config );
359+                             if  (XMaterial .supports (17 )) seventeen (entity , config );
410360                        }
411361                    }
412362                }
@@ -429,10 +379,76 @@ public static Entity edit(@Nonnull Entity entity, @Nonnull ConfigurationSection
429379        return  entity ;
430380    }
431381
382+     private  static  void  fourteen (Entity  entity , ConfigurationSection  config ) {
383+         if  (entity  instanceof  Raider ) {
384+             // Illagers were added in 1.11 but the concept of raids and patrols were added in 1.14 
385+             Raider  raider  = (Raider ) entity ;
386+             if  (config .isSet ("can-join-raid" )) raider .setCanJoinRaid (config .getBoolean ("can-join-raid" ));
387+             if  (config .isSet ("is-patrol-leader" )) raider .setCanJoinRaid (config .getBoolean ("is-patrol-leader" ));
388+         } else  if  (entity  instanceof  Cat ) {
389+             Cat  cat  = (Cat ) entity ;
390+             cat .setCatType (Enums .getIfPresent (Cat .Type .class , config .getString ("variant" )).or (Cat .Type .TABBY ));
391+             cat .setCollarColor (Enums .getIfPresent (DyeColor .class , config .getString ("color" )).or (DyeColor .GREEN ));
392+         } else  if  (entity  instanceof  Fox ) {
393+             Fox  fox  = (Fox ) entity ;
394+             fox .setCrouching (config .getBoolean ("crouching" ));
395+             fox .setSleeping (config .getBoolean ("sleeping" ));
396+             fox .setFoxType (Enums .getIfPresent (Fox .Type .class , config .getString ("color" )).or (Fox .Type .RED ));
397+         } else  if  (entity  instanceof  Panda ) {
398+             Panda  panda  = (Panda ) entity ;
399+             panda .setHiddenGene (Enums .getIfPresent (Panda .Gene .class , config .getString ("hidden-gene" )).or (Panda .Gene .PLAYFUL ));
400+             panda .setMainGene (Enums .getIfPresent (Panda .Gene .class , config .getString ("main-gene" )).or (Panda .Gene .NORMAL ));
401+         } else  if  (entity  instanceof  MushroomCow ) {
402+             MushroomCow  mooshroom  = (MushroomCow ) entity ;
403+             mooshroom .setVariant (Enums .getIfPresent (MushroomCow .Variant .class , config .getString ("color" )).or (MushroomCow .Variant .RED ));
404+         }
405+     }
406+ 
407+     private  static  void  thirteen (Entity  entity , ConfigurationSection  config ) {
408+         if  (entity  instanceof  Husk ) {
409+             Husk  husk  = (Husk ) entity ;
410+             husk .setConversionTime (config .getInt ("conversion-time" ));
411+         } else  if  (entity  instanceof  Vex ) {
412+             Vex  vex  = (Vex ) entity ;
413+             vex .setCharging (config .getBoolean ("charging" ));
414+         } else  if  (entity  instanceof  PufferFish ) {
415+             PufferFish  pufferFish  = (PufferFish ) entity ;
416+             pufferFish .setPuffState (config .getInt ("puff-state" ));
417+         } else  if  (entity  instanceof  TropicalFish ) {
418+             TropicalFish  tropicalFish  = (TropicalFish ) entity ;
419+             tropicalFish .setBodyColor (Enums .getIfPresent (DyeColor .class , config .getString ("color" )).or (DyeColor .WHITE ));
420+             tropicalFish .setPattern (Enums .getIfPresent (TropicalFish .Pattern .class , config .getString ("pattern" )).or (TropicalFish .Pattern .BETTY ));
421+             tropicalFish .setPatternColor (Enums .getIfPresent (DyeColor .class , config .getString ("pattern-color" )).or (DyeColor .WHITE ));
422+         } else  if  (entity  instanceof  EnderDragon ) {
423+             EnderDragon  dragon  = (EnderDragon ) entity ;
424+             dragon .setPhase (Enums .getIfPresent (EnderDragon .Phase .class , config .getString ("phase" )).or (EnderDragon .Phase .ROAR_BEFORE_ATTACK ));
425+         } else  if  (entity  instanceof  Phantom ) {
426+             Phantom  phantom  = (Phantom ) entity ;
427+             phantom .setSize (config .getInt ("size" ));
428+         }
429+     }
430+ 
431+     private  static  void  sixteen (Entity  entity , ConfigurationSection  config ) {
432+         if  (entity  instanceof  Hoglin ) {
433+             Hoglin  hoglin  = (Hoglin ) entity ;
434+             hoglin .setConversionTime (config .getInt ("conversation" ) * 20 );
435+             hoglin .setImmuneToZombification (config .getBoolean ("zombification-immunity" ));
436+             hoglin .setIsAbleToBeHunted (config .getBoolean ("can-be-hunted" ));
437+         } else  if  (entity  instanceof  Piglin ) {
438+             // Idk why Spigot did this... 
439+             Piglin  piglin  = (Piglin ) entity ;
440+             piglin .setConversionTime (config .getInt ("conversation" ) * 20 );
441+             piglin .setImmuneToZombification (config .getBoolean ("zombification-immunity" ));
442+         } else  if  (entity  instanceof  Strider ) {
443+             Strider  strider  = (Strider ) entity ;
444+             strider .setShivering (config .getBoolean ("shivering" ));
445+         }
446+     }
447+ 
432448    /** 
433449     * AXOLOTL - GLOW_ITEM_FRAME - GLOW_SQUID - GOAT - MARKER 
434450     */ 
435-     private  static  boolean  handleSeventeen (Entity  entity , ConfigurationSection  config ) {
451+     private  static  boolean  seventeen (Entity  entity , ConfigurationSection  config ) {
436452        if  (entity  instanceof  Axolotl ) {
437453            Axolotl  axolotl  = (Axolotl ) entity ;
438454            String  variantStr  = config .getString ("variant" );
0 commit comments