Guest User

NMSUtils.java

a guest
Nov 5th, 2020 (edited)
622
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 40.49 KB | None | 0 0
  1. public class NMSUtils {
  2.     private static final Field META_LIST_MONSTER;
  3.     private static final Field META_LIST_CREATURE;
  4.     private static final Field META_LIST_WATER_CREATURE;
  5.     private static final Field META_LIST_AMBIENT;
  6.  
  7.     private static final BiomeBase[] BIOMES;
  8.  
  9.     public static final CraftServer CRAFTBUKKIT_SERVER;
  10.     public static final MinecraftServer MINECRAFT_SERVER;
  11.  
  12.     /**
  13.      * Registers an Item (Not an ItemStack!) to be available for use. an ItemStack can then be created using <code>new ItemStack(item)</code>.
  14.      *
  15.      * @param name - The name of the item, can be anything
  16.      * @param id - The ID of the item, will be rendered depending on this
  17.      * @param item - The net.minecraft.server.version.Item itself
  18.      */
  19.     public static void registerItem(String name, int id, Item item) {
  20.         Item.REGISTRY.a(id, new MinecraftKey(name), item);
  21.     }
  22.  
  23.     /**
  24.      * Makes the mob spawn randomly around the world just like vanilla mobs. <p> Unlike the other method, this allows you to choose the 'category' of your mob;
  25.      * Creature, Monster, Ambient or Water Creature - even if it in reality was none of those. <p> If you're using a custom entity class, remember to
  26.      * <b>register</b> it before using this! Otherwise it'll not be rendered by the client. <p> If {@link #isAccessible()} returns false, the process will not
  27.      * be executed.
  28.      *
  29.      * @see #registerEntity(MobType, Class, boolean)
  30.      * @param data - The spawn data (chance, amount, spawn weight..)
  31.      * @param meta - The category in which your mob'll spawn (i.e creatures'll spawn in day, monsters during night..)
  32.      * @param biomes - The array of biomes to let the mobs spawn in, use {@link Biome#COLLECTION_ALL} for all of them.
  33.      */
  34.     public static boolean addRandomSpawn(SpawnData data, MobMeta meta, Biome... biomes) {
  35.         Field field;
  36.         if ((field = meta.getField()) == null) {
  37.             return false;
  38.         }
  39.         try {
  40.             field.setAccessible(true);
  41.             for (Biome biome : biomes) {
  42.                 BiomeBase[] array = biome.getNMSBiomeArray();
  43.                 for (BiomeBase base : array) {
  44.                     @SuppressWarnings("unchecked")
  45.                     List<BiomeMeta> list = (List<BiomeMeta>) field.get(base);
  46.                     list.add(data);
  47.                     field.set(base, list);
  48.                 }
  49.             }
  50.             return true;
  51.         } catch (Exception e) {
  52.             e.printStackTrace();
  53.         }
  54.         return false;
  55.     }
  56.  
  57.     /**
  58.      * Adds a random spawn for the mob with the specified arguments. <p> If you're using a custom entity class, remember to <b>register</b> it before using
  59.      * this! Otherwise it'll not be rendered by the client. <p> If {@link #isAccessible()} returns false, the process will not be executed.
  60.      *
  61.      * @see #registerEntity(MobType, Class, boolean)
  62.      * @param type - The mob type to spawn
  63.      * @param data - The spawn data (chance, amount, spawn weight..)
  64.      * @param biomes - The array of biomes to let the mobs spawn in, use {@link Biome#COLLECTION_ALL} for all of them.
  65.      * @see #addRandomSpawn(SpawnData, MobMeta, Biome...)
  66.      */
  67.     public static boolean addRandomSpawn(Type type, SpawnData data, Biome... biomes) {
  68.         if (type.isSpecial()) {
  69.             return false;
  70.         }
  71.         Field field;
  72.         if ((field = type.getMeta().getField()) == null) {
  73.             return false;
  74.         }
  75.         try {
  76.             field.setAccessible(true);
  77.             for (Biome biome : biomes) {
  78.                 BiomeBase[] array = biome.getNMSBiomeArray();
  79.                 for (BiomeBase base : array) {
  80.                     @SuppressWarnings("unchecked")
  81.                     List<BiomeMeta> list = (List<BiomeMeta>) field.get(base);
  82.                     list.add(data);
  83.                     field.set(base, list);
  84.                 }
  85.             }
  86.             return true;
  87.         } catch (Exception e) {
  88.             e.printStackTrace();
  89.         }
  90.         return false;
  91.     }
  92.  
  93.     /**
  94.      * Registers your entity without an internal id like most of the mobs have. Not sure where you'd need this but here you go. <p> Can still be spawned via
  95.      * /summon. <p> <b>Note: </b>Since no mob Type can be provided, overriding default mobs is not possible.
  96.      *
  97.      * @param name - The 'savegame id' of your mob (ex. "custom_zombie")
  98.      * @param clazz - The class of your custom entity
  99.      */
  100.     public static void registerWithoutID(String name, Class<? extends Entity> clazz) {
  101.         MinecraftKey key = new MinecraftKey(name);
  102.         EntityTypes.b.a(key, clazz);
  103.         if (!EntityTypes.d.contains(key)) {
  104.             EntityTypes.d.add(key);
  105.         }
  106.     }
  107.  
  108.     /**
  109.      * Registers the custom class to be available for use.
  110.      *
  111.      * @param type - The type of your mob
  112.      * @param customClass - Your custom class that'll be used
  113.      * @param override - Should your mob be set as a default in each biome? Only one custom entity of this type entity can have this set as 'true'.
  114.      */
  115.     public static void registerEntity(Type type, Class<? extends Entity> customClass, boolean override) {
  116.         NMSUtils.registerEntity(type.getName(), type, customClass, override);
  117.     }
  118.  
  119.     /**
  120.      * Registers the custom class to be available for use.
  121.      *
  122.      * @param id - The mob id. BE CAREFUL with this. Your Minecraft client renders the entity based on this, and if used improperly, will cause unexpected
  123.      *        behavior!
  124.      * @param name - The 'savegame id' of the mob.
  125.      * @param type - The type of your mob
  126.      * @param customClass - Your custom class that'll be used
  127.      * @param biomes - The array of biomes to make the mob spawn in.
  128.      * @see #registerEntity(int, String, MobType, Class, Biome[])
  129.      * @see EntityType#getName() EntityType#getName() for the savegame id.
  130.      * @see EntityType#getId() EntityType#getId() for the correct mob id.
  131.      */
  132.     @SuppressWarnings("unchecked")
  133.     public static void registerEntity(String name, Type type, Class<? extends Entity> customClass, Biome... biomes) {
  134.         MinecraftKey key = new MinecraftKey(name);
  135.         EntityTypes.b.a(type.id, key, customClass);
  136.         if (!EntityTypes.d.contains(key)) {
  137.             EntityTypes.d.add(key);
  138.         }
  139.         if (biomes.length == 0 || type.isSpecial()) {
  140.             return;
  141.         }
  142.         Field field;
  143.         if ((field = type.getMeta().getField()) == null) {
  144.             return;
  145.         }
  146.         try {
  147.             field.setAccessible(true);
  148.             for (Biome biome : biomes) {
  149.                 BiomeBase[] array = biome.getNMSBiomeArray();
  150.                 for (BiomeBase base : array) {
  151.                     List<BiomeMeta> list = (List<BiomeMeta>) field.get(base);
  152.                     for (BiomeMeta meta : list) {
  153.                         if (meta.b == type.getNMSClass()) {
  154.                             meta.b = (Class<? extends EntityInsentient>) customClass;
  155.                             break;
  156.                         }
  157.                     }
  158.                 }
  159.             }
  160.         } catch (Exception e) {
  161.             e.printStackTrace();
  162.         }
  163.     }
  164.  
  165.     /**
  166.      * Registers the custom class to be available for use.
  167.      *
  168.      * @param name - The 'savegame id' of the mob.
  169.      * @param type - The type of your mob
  170.      * @param customClass - Your custom class that'll be used
  171.      * @param override - Should your mob be set as a default in each biome? Only one custom entity of this type entity can have this set as 'true'.
  172.      * @see #registerEntity(int, String, MobType, Class, Biome[])
  173.      * @see EntityType#getName() EntityType#getName() for the savegame id.
  174.      */
  175.     @SuppressWarnings("unchecked")
  176.     public static void registerEntity(String name, Type type, Class<? extends Entity> customClass, boolean override) {
  177.         MinecraftKey key = new MinecraftKey(name);
  178.         EntityTypes.b.a(type.getId(), key, customClass);
  179.         if (!EntityTypes.d.contains(key)) {
  180.             EntityTypes.d.add(key);
  181.         }
  182.         if (!override || type.isSpecial()) {
  183.             return;
  184.         }
  185.         Field field;
  186.         if ((field = type.getMeta().getField()) == null) {
  187.             return;
  188.         }
  189.         try {
  190.             field.setAccessible(true);
  191.             for (BiomeBase base : NMSUtils.BIOMES) {
  192.                 List<BiomeMeta> list = (List<BiomeMeta>) field.get(base);
  193.                 for (BiomeMeta meta : list) {
  194.                     if (meta.b == type.getNMSClass()) {
  195.                         meta.b = (Class<? extends EntityInsentient>) customClass;
  196.                         break;
  197.                     }
  198.                 }
  199.             }
  200.         } catch (Exception e) {
  201.             e.printStackTrace();
  202.         }
  203.     }
  204.  
  205.     /**
  206.      * An enum containing all the biomes of Minecraft. The descriptions are taken from the <a href="http://minecraft.gamepedia.com/Biome">Minecraft Wiki
  207.      * Page</a>, which also has images for each biome.
  208.      */
  209.     public enum Biome {
  210.  
  211.         /**
  212.          * A large, open biome made entirely of water going up to y=63, with underwater relief on the sea floor, such as small mountains and plains, usually
  213.          * including gravel. Oceans typically extend under 3,000 blocks in any direction, around 60% of the Overworld's surface is covered in Ocean. Small
  214.          * islands with infrequent vegetation can be found in oceans. Passive mobs are unable to spawn on these islands, but hostiles can. Cavern entrances can
  215.          * be found infrequently at the bottom of the ocean. In the Console versions, they surround the edges of the map.
  216.          */
  217.         OCEAN(0),
  218.         /**
  219.          * A relatively flat and grassy biome with rolling hills and few trees. Gullies, water holes, and NPC villages are common. Cave openings and water or
  220.          * lava springs are easily identifiable due to the flat unobstructed terrain. Passive mobs spawn often in plains biomes; this biome and its variants are
  221.          * also one of the only biomes where horses spawn naturally.
  222.          */
  223.         PLAINS(1),
  224.         /**
  225.          * A barren and relatively inhospitable biome consisting mostly of sand dunes, dead bushes, and cacti. Sandstone is commonly found underneath the sand.
  226.          * The only passive mobs to spawn naturally in deserts are gold rabbits, their coloring well-camouflaged against the sand. Sugar cane can be found if
  227.          * the desert is next to an ocean or river biome. The lack of visual obstruction makes mobs highly visible at night. Desert villages, desert wells and
  228.          * desert temples are found exclusively in this biome. This biome sometimes appear as edge of mesa biome.
  229.          */
  230.         DESERT(2),
  231.         /**
  232.          * A highland biome (with some mountaintops reaching y=130 or even higher) with a few scattered oak and spruce trees. Cliffs, peaks, valleys,
  233.          * waterfalls, overhangs, floating islands, caverns, and many other structures exist, offering outstanding views. This is one of the few biomes where
  234.          * llamas spawn naturally. Snowfall also occurs above certain heights, thus creating "snow caps" on the top of the mountains. Falling is a significant
  235.          * risk, as there are many steep ledges large enough to cause severe fall damage or even death. Extreme hills are the only biomes where emerald ores and
  236.          * silverfish can be found naturally.
  237.          */
  238.         EXTREME_HILLS(3),
  239.         /**
  240.          * A biome with a lot of oak and birch trees, occasional hills, and a fair amount of tall grass. Mushrooms and flowers can occasionally be found here.
  241.          * This is one of the most preferred biomes to start out in, due to the abundance of wood. However, the frequency of trees also makes it dangerous to
  242.          * navigate at night, due to obscured vision. Forest biomes are also one of the smallest biomes.
  243.          */
  244.         FOREST(4),
  245.         /**
  246.          * A biome densely filled with spruce trees, ferns and large ferns. Wolves tend to spawn here fairly commonly.
  247.          */
  248.         TAIGA(5),
  249.         /**
  250.          * A biome characterized by a mix of flat, dry areas around sea level and shallow pools of brackish green water with floating lily pads. Clay, sand, and
  251.          * dirt are commonly found at the bottom of these pools. Trees are often covered with dark green vines, and can be found growing out from the water.
  252.          * Witch huts generate exclusively in swamps. Slimes will also spawn naturally at night, most commonly on full moons, making this an especially
  253.          * dangerous biome at night. Temperature varies randomly within the biome, not affected by altitude, causing foliage and grass colors to vary.
  254.          */
  255.         SWAMPLAND(6),
  256.         /**
  257.          * A biome that consists of water blocks that form an elongated, curving shape similar to a real river. Unlike real rivers, however, they have no
  258.          * current. Rivers cut through terrain or separate the main biomes. They attempt to join up with ocean on the other side, but will sometimes loop around
  259.          * to the same area of ocean. Rarely, they can have no connection to the ocean and form a circle. They have a dull green grass hue, much like the ocean,
  260.          * and trace amounts of oak trees tend to generate there as well. Rivers are also a reliable source of clay. These biomes are good for fishing.
  261.          */
  262.         RIVER(7),
  263.         /**
  264.          * This is the biome used to generate the Nether. In a Superflat world using this biome, the Overworld will contain only Nether mobs (ghasts, packs of
  265.          * zombie pigmen and occasional magma cubes) and won't receive rain, but it won't have Nether structures (such as Nether quartz or glowstone veins or
  266.          * Nether fortresses), and it can still have water lakes and mineshafts, beds will also explode in this biome, even when in the Overworld.
  267.          */
  268.         HELL(8),
  269.         /**
  270.          * This biome is used to generate the End. The ender dragon, and large amounts of endermen, spawn in this biome. Most of the End's structure is provided
  271.          * by the dimension itself rather than the biome. It does not rain or snow in this biome unlike the other low temperature biomes. The outer islands in
  272.          * the End can be accessed using the End gateway portal after the ender dragon has been defeated. These contain endermen, chorus plants and End cities.
  273.          * End cites are the only place where shulkers naturally spawn .If the biome is used for a superflat world, the sky will be dark gray and an ender
  274.          * dragon will spawn at 0,0 coordinates in the Overworld. Only endermen will spawn at night.
  275.          */
  276.         SKY(9),
  277.         /**
  278.          * A variant of the ocean biome that is completely frozen over. However, warmer rivers occasionally run through it. Doesn't generate in default worlds,
  279.          * but can be accessed using the Customized world type.
  280.          */
  281.         FROZEN_OCEAN(10),
  282.         /**
  283.          * This variant of river only generates in ice plains biomes. The surface layer of water is frozen.
  284.          */
  285.         FROZEN_RIVER(11),
  286.         /**
  287.          * A somewhat rare but expansive, flat biome with a huge amount of snow. All sources of water exposed to the sky are frozen over. Sugar cane will
  288.          * generate in this biome, but can become uprooted when chunks load as the water sources freeze to ice. There are very few natural oak and spruce trees
  289.          * in this biome. It has a lower chance of spawning passive mobs during world generation than other biomes (7% versus 10%), however it is one of the few
  290.          * biomes where Polar bears and Strays spawn. Due to the biome's size, snow and ice cover, and scarcity of wood and animals, initial survival becomes
  291.          * difficult in comparison to other biomes.
  292.          */
  293.         ICE_PLAINS(12),
  294.         /**
  295.          * Snowy hills that generate in the {@link #ICE_PLAINS}. Ice Mountains are usually taller, with height comparable to Extreme Hills biomes, and has a
  296.          * lower chance of spawning passive mobs during world generation than other biomes (7% versus 10%).
  297.          */
  298.         ICE_MOUNTAINS(13),
  299.         /**
  300.          * This rare biome consists of a mixture of flat landscape and steep hills and has mycelium instead of grass as its surface. However, if you do place
  301.          * down grass, it is a very bright green color, not unlike that of the jungle. Mushroom islands are most often adjacent to an ocean and are often found
  302.          * isolated from other biomes. It is one of the only biomes where huge mushrooms can generate naturally, and where mushrooms can grow in full sunlight.
  303.          * <p> Technically no mobs other than mooshrooms spawn naturally in this biome, including the usual night-time hostile mobs. This also applies to caves,
  304.          * abandoned mine shafts, and other dark structures, meaning exploring underground is supposedly safe. However, mob spawners will still spawn mobs, and
  305.          * the player will also still be able to breed animals and spawn mobs using eggs.
  306.          */
  307.         MUSHROOM_ISLAND(14),
  308.         /**
  309.          * Mushroom shores represent the flat shore area of the mushroom biome.
  310.          */
  311.         MUSHROOM_ISLAND_SHORE(15),
  312.         /**
  313.          * Generated on the shores of oceans, beaches are composed of sand. Beaches penetrate the landscape, removing the original blocks and placing in sand
  314.          * blocks. Some beaches generate with gravel instead of sand. These are also useful for fishing.
  315.          */
  316.         BEACHES(16),
  317.         /**
  318.          * Basically its respective base biome, {@link #DESERT}, but partially taller.
  319.          */
  320.         DESERT_HILLS(17),
  321.         /**
  322.          * Basically its respective base biome, {@link #FOREST}, but partially taller.
  323.          */
  324.         FOREST_HILLS(18),
  325.         /**
  326.          * Basically its respective base biome, {@link #TAIGA}, but partially taller.
  327.          */
  328.         TAIGA_HILLS(19),
  329.         /**
  330.          * Similar to the jungle edge sub-biome, this sub-biome generates exclusively at the edge of extreme hills biomes (or any variant). Doesn't generate in
  331.          * default worlds, but can be accessed using the Customized world type.
  332.          */
  333.         EXTREME_HILLS_EDGE(20),
  334.         /**
  335.          * A very dense, but rather uncommon tropical biome. It features large jungle trees that can reach up to 31 blocks tall with 2×2 thick trunks. Oak
  336.          * trees are also common. The landscape is lush green and quite hilly, with many small lakes of water often nestled into deep valleys, sometimes above
  337.          * sea level. Leaves cover much of the forest floor—these "bush trees" have single-blocks of jungle wood for trunks, surrounded by oak leaves. When
  338.          * inside a jungle, the sky will become noticeably lighter. Vines are found alongside most blocks and may cover the surface of caves. Ocelots, jungle
  339.          * temples, melons, and cocoa plants can be found exclusively in this biome. Melons generate in small patches, similar to pumpkins.
  340.          */
  341.         JUNGLE(21),
  342.         /**
  343.          * Basically its respective base biome, {@link #JUNGLE}, but partially taller.
  344.          */
  345.         JUNGLE_HILLS(22),
  346.         /**
  347.          * A very rare biome that only generates at the border of a jungle biome and any other biome. Similar to a jungle but with much fewer and smaller trees,
  348.          * and relatively flat terrain.
  349.          */
  350.         JUNGLE_EDGE(23),
  351.         /**
  352.          * A variation of the Ocean biome. In deep ocean biomes, the ocean can exceed 30 blocks in depth, making it twice as deep as the normal ocean. In
  353.          * contrast to default oceans, the ground is mainly covered with gravel. Ocean monuments generate in deep oceans, which spawn guardians.
  354.          */
  355.         DEEP_OCEAN(24),
  356.         /**
  357.          * This stone-covered biome often appears adjacent to mountains and the ocean. Depending on the height of the nearby land, it can generate medium slopes
  358.          * or huge cliffs.
  359.          */
  360.         STONE_BEACH(25),
  361.         /**
  362.          * A beach with snowy weather conditions. Often found when the Ice Plain biome borders an ocean biome.
  363.          */
  364.         COLD_BEACH(26),
  365.         /**
  366.          * A forest made solely out of birch trees.
  367.          */
  368.         BIRCH_FOREST(27),
  369.         /**
  370.          * Basically its respective base biome, {@link #BIRCH_FOREST}, but partially taller.
  371.          */
  372.         BIRCH_FOREST_HILLS(28),
  373.         /**
  374.          * This biome is composed of dark oak trees, a mostly closed roof of leaves, and occasional large mushrooms. Trees in this forest are so plentiful and
  375.          * so close together, that at some spots it may become dark enough for hostile mobs to spawn, even during the day. Rarely, a woodland mansion may spawn
  376.          */
  377.         ROOFED_FOREST(29),
  378.         /**
  379.          * A snowy variation of the taiga biome, where ferns(and large ferns) and spruce trees grow. It is one of the few places where wolves will naturally
  380.          * spawn.
  381.          */
  382.         COLD_TAIGA(30),
  383.         /**
  384.          * Basically its respective base biome, {@link #COLD_TAIGA}, but partially taller.
  385.          */
  386.         COLD_TAIGA_HILLS(31),
  387.         /**
  388.          * Mega taiga is an uncommon biome composed of spruce trees, much like the standard taiga biome. However, some trees are 2×2 thick and very tall, not
  389.          * unlike large jungle trees. Moss stone boulders appear frequently, brown mushrooms are common and podzol can be found along the forest floor. There
  390.          * are also patches of coarse dirt, which will not grow grass. Wolves may also spawn here, as they do in normal taiga biomes.
  391.          */
  392.         MEGA_TAIGA(32),
  393.         /**
  394.          * Basically its respective base biome, {@link #MEGA_TAIGA}, but partially taller.
  395.          */
  396.         MEGA_TAIGA_HILLS(33),
  397.         /**
  398.          * A variant of the regular extreme hills biome, adding larger mountains, steeper cliffs, and a moderate amount of spruce trees and scattered oak trees.
  399.          */
  400.         EXTREME_HILLS_WITH_TREES(34),
  401.         /**
  402.          * A relatively flat and dry biome with a dry grass color and scattered acacia trees. Villages can generate in this biome, and it is the only biome
  403.          * where both horses and llamas spawn naturally.
  404.          */
  405.         SAVANNA(35),
  406.         /**
  407.          * Variation of the {@link #SAVANNA} biome. Like the hills biomes, but flattened at the top, coming to rest at about 20 to 30 blocks above sea level.
  408.          */
  409.         SAVANNA_PLATEAU(36),
  410.         /**
  411.          * A rare biome consisting of hardened clay, stained clay, and dead bushes – similar to a desert. Red sand will also generate here instead of regular
  412.          * sand, with occasional cacti. Its composition is useful when other sources of clay are scarce. However, finding mesa biomes can be difficult due to
  413.          * their rarity. On the other hand, it offers great variety - there are a total of 6 variations of this biome to explore. <p> Mesas can contain above
  414.          * ground abandoned mineshafts. They also allow gold ore to generate near surface levels, rather than just at layer 32 and below.
  415.          */
  416.         MESA(37),
  417.         /**
  418.          * A rare variation of the mesa plateau, where small forests of dry oak trees and grass generate at the top of the plateaus.
  419.          */
  420.         MESA_PLATEAU_F(38),
  421.         /**
  422.          * Variation of the {@link #MESA} bioime. Like the hills biomes, but flattened at the top, coming to rest at about 20 to 30 blocks above sea level. Only
  423.          * generates in savanna and mesa biomes.
  424.          */
  425.         MESA_PLATEAU(39),
  426.         /**
  427.          * A completely empty biome that generates only a single structure: a 33×33 stone platform with a single block of cobblestone in the center. No mobs
  428.          * (passive or hostile) can spawn without spawn eggs, monster spawners or commands. Can only be accessed through The Void superflat preset.
  429.          */
  430.         VOID(127),
  431.         /**
  432.          * A rare variation of the plains biome, where sunflowers naturally spawn in abundance.
  433.          */
  434.         SUNFLOWER_PLAINS(129),
  435.         /**
  436.          * Unlike in normal deserts, patches of water can be found in this biome.
  437.          */
  438.         DESERT_M(130),
  439.         /**
  440.          * Variant of the regular extreme hills biome that features higher mountain peaks, most of which reach into the clouds. Mountains here are composed
  441.          * mainly of gravel and a little bit of dirt and grass, with a sparse population of spruce and oak trees.
  442.          */
  443.         EXTREME_HILLS_M(131),
  444.         /**
  445.          * A variant of the forest biome that has fewer trees but has a huge amount of various flowers. There are certain flowers that are exclusive to the
  446.          * flower forest.
  447.          */
  448.         FLOWER_FOREST(132),
  449.         /**
  450.          * Mountainous version of the regular taiga biome.
  451.          */
  452.         TAIGA_M(133),
  453.         /**
  454.          * A slightly hillier swampland with greener grass. Witch huts do not generate in this biome, unlike the normal swampland biome.
  455.          */
  456.         SWAMPLAND_M(134),
  457.         /**
  458.          * A rare variation of the Ice Plains biome that features large spikes of packed ice, as well as packed ice 'lakes'. Usually the spikes are 10 to 20
  459.          * blocks tall, but some long, thin spikes can reach over 50 blocks in height. All grass blocks in this biome are replaced with blocks of snow. It has a
  460.          * lower chance of spawning passive mobs during world generation than other biomes (7% versus 10%).
  461.          */
  462.         ICE_SPIKES(140),
  463.         /**
  464.          * Much more mountainous version of the normal jungle, with foliage so thick that the ground is barely visible. A very resource-demanding biome. Due to
  465.          * the hilly nature of the terrain in this biome, and the height of the tall jungle trees, trees frequently reach into and go above the clouds.
  466.          * Extremely dense foliage and treacherous hilly terrain make this a very difficult biome to navigate, especially at night.
  467.          */
  468.         JUNGLE_M(149),
  469.         /**
  470.          * The rarest biome in Minecraft. A slightly more mountainous variation of the jungle edge biome, which only generates on the border of a jungle M and
  471.          * another biome. There are very few to no tall trees in this relatively tiny biome.
  472.          */
  473.         JUNGLE_EDGE_M(151),
  474.         /**
  475.          * A variation of the birch forest biome which features taller birch trees than usual.
  476.          */
  477.         BIRCH_FOREST_M(155),
  478.         /**
  479.          * Basically its respective base biome, {@link #BIRCH_FOREST_M}, but partially taller.
  480.          */
  481.         BIRCH_FOREST_HILLS_M(156),
  482.         /**
  483.          * A mountainous version of the roofed forest biome, with steep cliffs lining the edge.
  484.          */
  485.         ROOFED_FOREST_M(157),
  486.         /**
  487.          * Large, mountainous version of the snowy {@link #COLD_TAIGA}.
  488.          */
  489.         COLD_TAIGA_M(158),
  490.         /**
  491.          * A variation of the mega taiga. In this biome there is a much higher density of smaller spruce trees. Also, the tall trees look very similar to
  492.          * regular spruce trees, as opposed to the short-topped trees in the normal mega taiga biome.
  493.          */
  494.         MEGA_SPRUCE_TAIGA(160),
  495.         /**
  496.          * Basically its respective base biome, {@link #MEGA_SPRUCE_TAIGA}, but partially taller.
  497.          */
  498.         REDWOOD_TAIGA_HILLS_M(161),
  499.         /**
  500.          * A rare variant of the extreme hills+ biome where huge gravel mountains appear, with sparse oak and spruce trees and small patches of grass.
  501.          */
  502.         EXTREME_HILLS_PLUS_M(162),
  503.         /**
  504.          * Variant of the savanna biome. Dirt paths and giant mountains are prevalent in this biome. However, this biome is unique in that its mountains can
  505.          * generate past the clouds, and even to the world height limit, without using the AMPLIFIED world type.
  506.          */
  507.         SAVANNA_M(163),
  508.         /**
  509.          * The savanna plateau M biome features incredibly large and steep cliffs that jut violently out of the terrain, compared to the regular savanna
  510.          * plateau; these cliffs generally exceed cloud height, sometimes above y=200, and sometimes even border the world height limit.
  511.          */
  512.         SAVANNA_PLATEAU_M(164),
  513.         /**
  514.          * Mesa (Bryce) is a variant of the mesa biome, featuring a low desert-like ground area with tall, thin, spire-shaped columns of hardened clay, similar
  515.          * to the structures in the real Bryce Canyon.
  516.          */
  517.         MESA_BRYCE(165),
  518.         /**
  519.          * Very rare variant of the Mesa Plateau F biome. Features steeper cliffs than the normal Mesa Plateau F biome, with a reduced occurrence of trees and
  520.          * smaller, more erratic hills.
  521.          */
  522.         MESA_PLATEAU_F_M(166),
  523.         /**
  524.          * The mesa plateau M biome features slightly flatter terrain and smaller plateaus in general, compared to the average mesa plateau biome.
  525.          */
  526.         MESA_PLATEAU_M(167),
  527.         /**
  528.          * A Collection of all mesa biomes.
  529.          */
  530.         COLLECTION_MESA(37, 38, 39, 165, 166, 167),
  531.         /**
  532.          * A Collection of all forest biomes - excluding swamplands, jungles and extreme hills with trees. 16 biomes in total.
  533.          */
  534.         COLLECTION_FORESTS_ALL(4, 18, 27, 28, 29, 30, 31, 32, 33, 132, 133, 155, 156, 157, 158, 160),
  535.         /**
  536.          * A Collection consisting of all 3 desert biomes; {@link #DESERT}, {@link #DESERT_HILLS} and {@link #DESERT_M}.
  537.          */
  538.         COLLECTION_DESERTS(2, 17, 130),
  539.         /**
  540.          * A Collection of all 3 plains; consisting of {@link #PLAINS}, {@link #SUNFLOWER_PLAINS} and {@link #ICE_PLAINS}.
  541.          */
  542.         COLLECTION_PLAINS(1, 12, 129),
  543.         /**
  544.          * A Collection consisting of all 5 icy biomes; {@link #ICE_MOUNTAINS}, {@link #ICE_PLAINS}, {@link #ICE_SPIKES} , {@link #FROZEN_OCEAN} and
  545.          * {@link #FROZEN_RIVER}.
  546.          */
  547.         COLLECTION_ICY_BIOMES(12, 13, 10, 11, 140),
  548.         /**
  549.          * A Collection consisting of all taiga biomes - including mega- and cold taigas. 8 biomes in total.
  550.          */
  551.         COLLECTION_TAIGA(30, 31, 32, 33, 133, 158, 161, 5),
  552.         /**
  553.          * A Collection consisting of all 5 water-y biomes, oceans and rivers.
  554.          */
  555.         COLLECTION_WATER(0, 7, 10, 11, 24),
  556.         /**
  557.          * A Collection consisting of all 3 beaches; {@link #BEACHES}, {@link #STONE_BEACH} and {@link #COLD_BEACH}.
  558.          */
  559.         COLLECTION_BEACHES(16, 25, 26),
  560.         /**
  561.          * A Collection consisting of all 5 jungle biomes; {@link #JUNGLE}, {@link #JUNGLE_M}, {@link #JUNGLE_HILLS}, {@link #JUNGLE_EDGE} and
  562.          * {@link #JUNGLE_EDGE_M}.
  563.          */
  564.         COLLECTION_JUNGLE(21, 22, 23, 149, 151),
  565.         /**
  566.          * A Collection consisting of all 4 extreme hills biomes; {@link #EXTREME_HILLS_EDGE}, {@link #EXTREME_HILLS_M}, {@link #EXTREME_HILLS_PLUS_M} ,
  567.          * {@link #EXTREME_HILLS_WITH_TREES} and {@link #EXTREME_HILLS}.
  568.          */
  569.         COLLECTION_EXTREME_HILLS(3, 20, 34, 131, 162),
  570.         /**
  571.          * A Collection consisting of the two swampland biomes; {@link #SWAMPLAND} and {@link #SWAMPLAND_M}.
  572.          */
  573.         COLLECTION_SWAMPLAND(6, 134),
  574.         /**
  575.          * A Collection consisting of all x savanna variants; {@link #SAVANNA_M}, {@link #SAVANNA_PLATEAU_M}, {@link #SAVANNA_PLATEAU} and {@link #SAVANNA}.
  576.          */
  577.         COLLECTION_SAVANNA(35, 36, 163, 164),
  578.         /**
  579.          * ~lé sigh~ A Collection consisting of every single biome type in the game.
  580.          */
  581.         COLLECTION_ALL(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 127, 129, 130, 131, 132, 133, 134, 140, 149, 151, 155, 156, 157, 158, 160, 161, 162, 163, 164, 165, 166, 167);
  582.  
  583.         private static Biome[] ID_LOOKUP_TABLE = new Biome[168];
  584.  
  585.         private BiomeBase[] biomes;
  586.         private BiomeBase biome;
  587.  
  588.         private Biome(int... ids) {
  589.             assert ids.length > 0;
  590.             this.biomes = new BiomeBase[ids.length];
  591.             for (int i = 0; i < this.biomes.length; ++i) {
  592.                 this.biomes[i] = BiomeBase.REGISTRY_ID.getId(ids[i]);
  593.             }
  594.             this.biome = this.biomes[0];
  595.         }
  596.  
  597.         public BiomeBase asNMSBiome() {
  598.             return this.biome;
  599.         }
  600.  
  601.         public BiomeBase[] getNMSBiomeArray() {
  602.             return this.biomes;
  603.         }
  604.  
  605.         public static Biome fromId(int id) {
  606.             return Biome.ID_LOOKUP_TABLE[id];
  607.         }
  608.  
  609.         static {
  610.             Biome[] values = Biome.values();
  611.             for (Biome biome : values) {
  612.                 Biome.ID_LOOKUP_TABLE[BiomeBase.REGISTRY_ID.a(biome.biome)] = biome;
  613.             }
  614.         }
  615.     }
  616.  
  617.     public enum Type {
  618.         DROPPED_ITEM(1, "item", EntityItem.class, MobMeta.UNDEFINED, true),
  619.         EXPERIENCE_ORB(2, "xp_orb", EntityExperienceOrb.class, MobMeta.UNDEFINED, true),
  620.         AREA_EFFECT_CLOUD(3, "area_effect_cloud", EntityAreaEffectCloud.class, MobMeta.UNDEFINED, true),
  621.         ELDER_GUARDIAN(4, "elder_guardian", EntityGuardianElder.class, MobMeta.MONSTER, false),
  622.         WITHER_SKELETON(5, "wither_skeleton", EntitySkeletonWither.class, MobMeta.MONSTER, false),
  623.         STRAY(6, "stray", EntitySkeletonStray.class, MobMeta.MONSTER, false),
  624.         THROWN_EGG(7, "egg", EntityEgg.class, MobMeta.UNDEFINED, true),
  625.         LEAD_KNOT(8, "leash_knot", EntityLeash.class, MobMeta.UNDEFINED, true),
  626.         PAINTING(9, "painting", EntityPainting.class, MobMeta.UNDEFINED, true),
  627.         ARROW(10, "arrow", EntityArrow.class, MobMeta.UNDEFINED, true),
  628.         SNOWBALL(11, "snowball", EntitySnowball.class, MobMeta.UNDEFINED, true),
  629.         FIREBALL(12, "fireball", EntityFireball.class, MobMeta.UNDEFINED, true),
  630.         SMALL_FIREBALL(13, "fireball", EntitySmallFireball.class, MobMeta.UNDEFINED, true),
  631.         ENDER_PEARL(14, "ender_pearl", EntityEnderPearl.class, MobMeta.UNDEFINED, true),
  632.         EYE_OF_ENDER(15, "eye_of_ender_signal", EntityEnderSignal.class, MobMeta.UNDEFINED, true),
  633.         POTION(16, "potion", EntityPotion.class, MobMeta.UNDEFINED, true),
  634.         EXP_BOTTLE(17, "xp_bottle", EntityThrownExpBottle.class, MobMeta.UNDEFINED, true),
  635.         ITEM_FRAME(18, "item_frame", EntityItemFrame.class, MobMeta.UNDEFINED, true),
  636.         WITHER_SKULL(19, "wither_skull", EntityWitherSkull.class, MobMeta.UNDEFINED, true),
  637.         PRIMED_TNT(20, "tnt", EntityTNTPrimed.class, MobMeta.UNDEFINED, true),
  638.         FALLING_BLOCK(21, "falling_block", EntityFallingBlock.class, MobMeta.UNDEFINED, true),
  639.         FIREWORK_ROCKET(22, "fireworks_rocket", EntityFireworks.class, MobMeta.UNDEFINED, true),
  640.         HUSK(23, "husk", EntityZombieHusk.class, MobMeta.MONSTER, false),
  641.         SPECTRAL_ARROW(24, "spectral_arrow", EntitySpectralArrow.class, MobMeta.UNDEFINED, true),
  642.         SHULKER_BULLET(25, "shulker_bullet", EntityShulkerBullet.class, MobMeta.UNDEFINED, true),
  643.         DRAGON_FIREBALL(26, "dragon_fireball", EntityDragonFireball.class, MobMeta.UNDEFINED, true),
  644.         ZOMBIE_VILLAGER(27, "zombie_villager", EntityZombieVillager.class, MobMeta.MONSTER, false),
  645.         SKELETON_HORSE(28, "skeleton_horse", EntityHorseSkeleton.class, MobMeta.CREATURE, false),
  646.         ZOMBIE_HORSE(29, "zombie_horse", EntityHorseZombie.class, MobMeta.CREATURE, false),
  647.         ARMOR_STAND(30, "armor_stand", EntityArmorStand.class, MobMeta.UNDEFINED, true),
  648.         DONKEY(31, "donkey", EntityHorseDonkey.class, MobMeta.CREATURE, false),
  649.         MULE(32, "mule", EntityHorseMule.class, MobMeta.CREATURE, false),
  650.         EVOCATION_FANGS(33, "evocation_fangs", EntityEvokerFangs.class, MobMeta.UNDEFINED, true),
  651.         EVOKER(34, "evocation_illager", EntityEvoker.class, MobMeta.MONSTER, false),
  652.         VEX(35, "vex", EntityVex.class, MobMeta.MONSTER, false),
  653.         VINDICATOR(36, "vindication_illager", EntityVindicator.class, MobMeta.MONSTER, false),
  654.         ILLUSIONER(37, "illusion_illager", EntityIllagerIllusioner.class, MobMeta.MONSTER, false),
  655.         COMMAND_BLOCK_MINECART(40, "commandblock_minecart", EntityMinecartCommandBlock.class, MobMeta.UNDEFINED, true),
  656.         BOAT(41, "boat", EntityBoat.class, MobMeta.UNDEFINED, true),
  657.         MINECART(42, "minecart", EntityMinecartRideable.class, MobMeta.UNDEFINED, true),
  658.         CHEST_MINECART(43, "chest_minecart", EntityMinecartChest.class, MobMeta.UNDEFINED, true),
  659.         FURNACE_MINECART(44, "furnace_minecart", EntityMinecartFurnace.class, MobMeta.UNDEFINED, true),
  660.         TNT_MINECART(45, "tnt_minecart", EntityMinecartTNT.class, MobMeta.UNDEFINED, true),
  661.         HOPPER_MINECART(46, "hopper_minecart", EntityMinecartHopper.class, MobMeta.UNDEFINED, true),
  662.         SPAWNER_MINECART(47, "spawner_minecart", EntityMinecartMobSpawner.class, MobMeta.UNDEFINED, true),
  663.         CREEPER(50, "creeper", EntityCreeper.class, MobMeta.MONSTER, false),
  664.         SKELETON(51, "skeleton", EntitySkeleton.class, MobMeta.MONSTER, false),
  665.         SPIDER(52, "spider", EntitySpider.class, MobMeta.MONSTER, false),
  666.         GIANT(53, "giant", EntityGiantZombie.class, MobMeta.MONSTER, false),
  667.         ZOMBIE(54, "zombie", EntityZombie.class, MobMeta.MONSTER, false),
  668.         SLIME(55, "slime", EntitySlime.class, MobMeta.MONSTER, false),
  669.         GHAST(56, "ghast", EntityGhast.class, MobMeta.MONSTER, false),
  670.         PIG_ZOMBIE(57, "zombie_pigman", EntityPigZombie.class, MobMeta.MONSTER, false),
  671.         ENDERMAN(58, "enderman", EntityEnderman.class, MobMeta.MONSTER, false),
  672.         CAVE_SPIDER(59, "cave_spider", EntityCaveSpider.class, MobMeta.MONSTER, false),
  673.         SILVERFISH(60, "silverfish", EntitySilverfish.class, MobMeta.MONSTER, false),
  674.         BLAZE(61, "blaze", EntityBlaze.class, MobMeta.MONSTER, false),
  675.         MAGMACUBE(62, "magma_cube", EntityMagmaCube.class, MobMeta.MONSTER, false),
  676.         ENDER_DRAGON(63, "ender_dragon", EntityEnderDragon.class, MobMeta.MONSTER, false),
  677.         WITHER(64, "wither", EntityWither.class, MobMeta.MONSTER, false),
  678.         BAT(65, "bat", EntityBat.class, MobMeta.AMBIENT, false),
  679.         WITCH(66, "witch", EntityWitch.class, MobMeta.MONSTER, false),
  680.         ENDERMITE(67, "endermite", EntityEndermite.class, MobMeta.MONSTER, false),
  681.         GUARDIAN(68, "guardian", EntityGuardian.class, MobMeta.MONSTER, false),
  682.         SHULKER(69, "shulker", EntityShulker.class, MobMeta.MONSTER, false),
  683.         PIG(90, "pig", EntityPig.class, MobMeta.CREATURE, false),
  684.         SHEEP(91, "sheep", EntitySheep.class, MobMeta.CREATURE, false),
  685.         COW(92, "cow", EntityCow.class, MobMeta.CREATURE, false),
  686.         CHICKEN(93, "chicken", EntityChicken.class, MobMeta.CREATURE, false),
  687.         SQUID(94, "squid", EntitySquid.class, MobMeta.WATER_CREATURE, false),
  688.         WOLF(95, "wolf", EntityWolf.class, MobMeta.CREATURE, false),
  689.         MOOSHROOM(96, "mooshroom", EntityMushroomCow.class, MobMeta.CREATURE, false),
  690.         SNOWMAN(97, "snowman", EntitySnowman.class, MobMeta.CREATURE, false),
  691.         OCELOT(98, "ocelot", EntityOcelot.class, MobMeta.CREATURE, false),
  692.         IRON_GOLEM(99, "villager_golem", EntityIronGolem.class, MobMeta.CREATURE, false),
  693.         HORSE(100, "horse", EntityHorse.class, MobMeta.CREATURE, false),
  694.         RABBIT(101, "rabbit", EntityRabbit.class, MobMeta.CREATURE, false),
  695.         POLARBEAR(102, "polar_bear", EntityPolarBear.class, MobMeta.CREATURE, false),
  696.         LLAMA(103, "llama", EntityLlama.class, MobMeta.CREATURE, false),
  697.         LLAMA_SPIT(104, "llama_spit", EntityLlamaSpit.class, MobMeta.UNDEFINED, true),
  698.         PARROT(105, "parrot", EntityParrot.class, MobMeta.CREATURE, false),
  699.         VILLAGER(120, "villager", EntityVillager.class, MobMeta.CREATURE, false),
  700.         ENDER_CRYSTAL(200, "ender_crystal", EntityEnderCrystal.class, MobMeta.UNDEFINED, true);
  701.  
  702.         private int id;
  703.         private String name;
  704.         private Class<? extends Entity> clazz;
  705.         private MobMeta meta;
  706.         private boolean special;
  707.  
  708.         private Type(int id, String name, Class<? extends Entity> nmsClazz, MobMeta meta, boolean special) {
  709.             this.id = id;
  710.             this.name = name;
  711.             this.clazz = nmsClazz;
  712.             this.meta = meta;
  713.             this.special = special;
  714.         }
  715.  
  716.         public MobMeta getMeta() {
  717.             return this.meta;
  718.         }
  719.  
  720.         public int getId() {
  721.             return this.id;
  722.         }
  723.  
  724.         public String getName() {
  725.             return this.name;
  726.         }
  727.  
  728.         public Class<? extends Entity> getNMSClass() {
  729.             return this.clazz;
  730.         }
  731.  
  732.         public boolean isSpecial() {
  733.             return this.special;
  734.         }
  735.     }
  736.  
  737.     public enum MobMeta {
  738.         MONSTER(NMSUtils.META_LIST_MONSTER),
  739.         CREATURE(NMSUtils.META_LIST_CREATURE),
  740.         WATER_CREATURE(NMSUtils.META_LIST_WATER_CREATURE),
  741.         AMBIENT(NMSUtils.META_LIST_AMBIENT),
  742.         UNDEFINED(null);
  743.  
  744.         private Field field;
  745.  
  746.         private MobMeta(Field field) {
  747.             this.field = field;
  748.         }
  749.  
  750.         /**
  751.          * @return the BiomeMeta list field of this entity. <p> <b>Undefined will not be accepted and returns null.</b> </p>
  752.          */
  753.         public Field getField() {
  754.             return this.field;
  755.         }
  756.     }
  757.  
  758.     public class NBTTagType {
  759.         public static final int COMPOUND = 10;
  760.         public static final int LIST = 9;
  761.         public static final int STRING = 8;
  762.         public static final int LONG_ARRAY = 12;
  763.         public static final int INT_ARRAY = 11;
  764.         public static final int BYTE_ARRAY = 7;
  765.         public static final int DOUBLE = 6;
  766.         public static final int FLOAT = 5;
  767.         public static final int LONG = 4;
  768.         public static final int INT = 3;
  769.         public static final int SHORT = 2;
  770.         public static final int BYTE = 1;
  771.         public static final int BOOLEAN = 1;
  772.         public static final int END = 0;
  773.     }
  774.  
  775.     public static enum Attributes {
  776.         MAX_HEALTH("generic.maxHealth", GenericAttributes.maxHealth),
  777.         MOVEMENT_SPEED("generic.movementSpeed", GenericAttributes.MOVEMENT_SPEED),
  778.         ATTACK_DAMAGE("generic.attackDamage", GenericAttributes.ATTACK_DAMAGE),
  779.         FOLLOW_RANGE("generic.followRange", GenericAttributes.FOLLOW_RANGE),
  780.         LUCK("generic.luck", GenericAttributes.j),
  781.         ARMOR("generic.armor", GenericAttributes.h),
  782.         ARMOR_TOUGHNESS("generic.armorToughness", GenericAttributes.i),
  783.         ATTACK_SPEED("generic.attackSpeed", GenericAttributes.g),
  784.         KNOCKBACK_RESISTANCE("generic.knockbackResistance", GenericAttributes.c);
  785.  
  786.         private String name;
  787.         private IAttribute attribute;
  788.  
  789.         private Attributes(String nmsName, IAttribute nmsAttribute) {
  790.             this.name = nmsName;
  791.             this.attribute = nmsAttribute;
  792.         }
  793.  
  794.         /**
  795.          * Returns the NMS name of the attribute. For example, <code>MAX_HEALTH</code> returns <code>"generic.maxHealth"</code>, and so on and so forth.
  796.          *
  797.          * @return The name as a String.
  798.          */
  799.         public String getName() {
  800.             return this.name;
  801.         }
  802.  
  803.         /**
  804.          * @return the IAttribute value of this type, used in place of <code>GenericAttributes.h</code> (for Attributes.ARMOR as an example).
  805.          */
  806.         public IAttribute asIAttribute() {
  807.             return this.attribute;
  808.         }
  809.     }
  810.  
  811.     public static class SpawnData extends BiomeMeta {
  812.  
  813.         /**
  814.          * Creates a new instance of SpawnData, and at the same time, a new instanceof BiomeMeta, used to add random spawns and such.
  815.          *
  816.          * @param customClass - Your class to spawn
  817.          * @param spawnWeight - The chance for the mob(s) to spawn.
  818.          * @param minSpawns - The minimum amount of entities spawned at once.
  819.          * @param maxSpawns - The maximum amount of entities spawned at once.
  820.          */
  821.         public SpawnData(Class<? extends EntityInsentient> customClass, int spawnWeight, int minSpawns, int maxSpawns) {
  822.             super(customClass, spawnWeight, minSpawns, maxSpawns);
  823.         }
  824.  
  825.         public Class<? extends EntityInsentient> getCustomClass() {
  826.             return this.b;
  827.         }
  828.  
  829.         public int getSpawnWeight() {
  830.             return this.a;
  831.         }
  832.  
  833.         public int getMinSpawns() {
  834.             return this.c;
  835.         }
  836.  
  837.         public int getMaxSpawns() {
  838.             return this.d;
  839.         }
  840.     }
  841.  
  842.     static {
  843.         Class<BiomeBase> clazz = BiomeBase.class;
  844.         Field monster = null;
  845.         Field creature = null;
  846.         Field water = null;
  847.         Field ambient = null;
  848.         try {
  849.             // These fields may vary depending on your version.
  850.             // The new names can be found under
  851.             // net.minecraft.server.<version>.BiomeBase.class
  852.             monster = clazz.getDeclaredField("t");
  853.             creature = clazz.getDeclaredField("u");
  854.             water = clazz.getDeclaredField("v");
  855.             ambient = clazz.getDeclaredField("w");
  856.         } catch (Exception e) {
  857.             Bukkit.getLogger().warning("Wrong server version / software; BiomeMeta fields not found, aborting.");
  858.         }
  859.         META_LIST_MONSTER = monster;
  860.         META_LIST_CREATURE = creature;
  861.         META_LIST_WATER_CREATURE = water;
  862.         META_LIST_AMBIENT = ambient;
  863.         CRAFTBUKKIT_SERVER = (CraftServer) Bukkit.getServer();
  864.         MINECRAFT_SERVER = NMSUtils.CRAFTBUKKIT_SERVER.getServer();
  865.         BIOMES = new BiomeBase[BiomeBase.i.a()];
  866.         Iterator<BiomeBase> iterator = BiomeBase.i.iterator();
  867.         int index = 0;
  868.         while (iterator.hasNext()) {
  869.             NMSUtils.BIOMES[index++] = iterator.next();
  870.         }
  871.     }
  872. }
  873.  
Add Comment
Please, Sign In to add comment