Skip to content

Commit

Permalink
Add new entity types for 1.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
booky10 committed Oct 19, 2024
1 parent 93bac07 commit 56c9b73
Show file tree
Hide file tree
Showing 2 changed files with 188 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
import com.github.retrooper.packetevents.util.mappings.TypesBuilderData;
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

public class EntityTypes {
private static final Map<String, EntityType> ENTITY_TYPE_MAP = new HashMap<>();
Expand Down Expand Up @@ -151,7 +155,13 @@ public static EntityType getByLegacyId(ClientVersion version, int id) {
public static final EntityType BAT = define("bat", ABSTRACT_AMBIENT);
public static final EntityType BEE = define("bee", ABSTRACT_INSENTIENT);
public static final EntityType BLAZE = define("blaze", ABSTRACT_MONSTER);
/**
* <strong>WARNING:</strong> Does not exist itself anymore since 1.21.2
*/
public static final EntityType BOAT = define("boat", ENTITY);
/**
* <strong>WARNING:</strong> Does not exist itself anymore since 1.21.2
*/
public static final EntityType CHEST_BOAT = define("chest_boat", BOAT);
public static final EntityType CAT = define("cat", ABSTRACT_TAMEABLE_ANIMAL);
public static final EntityType CAMEL = define("camel", ABSTRACT_HORSE);
Expand Down Expand Up @@ -295,8 +305,33 @@ public static EntityType getByLegacyId(ClientVersion version, int id) {
public static final EntityType BREEZE_WIND_CHARGE = define("breeze_wind_charge", ABSTRACT_WIND_CHARGE);
public static final EntityType OMINOUS_ITEM_SPAWNER = define("ominous_item_spawner", ENTITY);

// added with 1.21.2
public static final EntityType ACACIA_BOAT = define("acacia_boat", BOAT);
public static final EntityType ACACIA_CHEST_BOAT = define("acacia_chest_boat", CHEST_BOAT);
public static final EntityType BAMBOO_CHEST_RAFT = define("bamboo_chest_raft", CHEST_BOAT);
public static final EntityType BAMBOO_RAFT = define("bamboo_raft", BOAT);
public static final EntityType BIRCH_BOAT = define("birch_boat", BOAT);
public static final EntityType BIRCH_CHEST_BOAT = define("birch_chest_boat", CHEST_BOAT);
public static final EntityType CHERRY_BOAT = define("cherry_boat", BOAT);
public static final EntityType CHERRY_CHEST_BOAT = define("cherry_chest_boat", CHEST_BOAT);
public static final EntityType CREAKING = define("creaking", ABSTRACT_MONSTER);
public static final EntityType CREAKING_TRANSIENT = define("creaking_transient", CREAKING);
public static final EntityType DARK_OAK_BOAT = define("dark_oak_boat", BOAT);
public static final EntityType DARK_OAK_CHEST_BOAT = define("dark_oak_chest_boat", CHEST_BOAT);
public static final EntityType JUNGLE_BOAT = define("jungle_boat", BOAT);
public static final EntityType JUNGLE_CHEST_BOAT = define("jungle_chest_boat", CHEST_BOAT);
public static final EntityType MANGROVE_BOAT = define("mangrove_boat", BOAT);
public static final EntityType MANGROVE_CHEST_BOAT = define("mangrove_chest_boat", CHEST_BOAT);
public static final EntityType OAK_BOAT = define("oak_boat", BOAT);
public static final EntityType OAK_CHEST_BOAT = define("oak_chest_boat", CHEST_BOAT);
public static final EntityType PALE_OAK_BOAT = define("pale_oak_boat", BOAT);
public static final EntityType PALE_OAK_CHEST_BOAT = define("pale_oak_chest_boat", CHEST_BOAT);
public static final EntityType SPRUCE_BOAT = define("spruce_boat", BOAT);
public static final EntityType SPRUCE_CHEST_BOAT = define("spruce_chest_boat", CHEST_BOAT);

/**
* Returns an immutable view of the entity types.
*
* @return Entity Types
*/
public static Collection<EntityType> values() {
Expand Down
152 changes: 152 additions & 0 deletions mappings/entity/entity_type_mappings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,156 @@
{
"V_1_21_2": {
"acacia_boat": 0,
"acacia_chest_boat": 1,
"allay": 2,
"area_effect_cloud": 3,
"armadillo": 4,
"armor_stand": 5,
"arrow": 6,
"axolotl": 7,
"bamboo_chest_raft": 8,
"bamboo_raft": 9,
"bat": 10,
"bee": 11,
"birch_boat": 12,
"birch_chest_boat": 13,
"blaze": 14,
"block_display": 15,
"bogged": 16,
"breeze": 17,
"breeze_wind_charge": 18,
"camel": 19,
"cat": 20,
"cave_spider": 21,
"cherry_boat": 22,
"cherry_chest_boat": 23,
"chest_minecart": 24,
"chicken": 25,
"cod": 26,
"command_block_minecart": 27,
"cow": 28,
"creaking": 29,
"creaking_transient": 30,
"creeper": 31,
"dark_oak_boat": 32,
"dark_oak_chest_boat": 33,
"dolphin": 34,
"donkey": 35,
"dragon_fireball": 36,
"drowned": 37,
"egg": 38,
"elder_guardian": 39,
"enderman": 40,
"endermite": 41,
"ender_dragon": 42,
"ender_pearl": 43,
"end_crystal": 44,
"evoker": 45,
"evoker_fangs": 46,
"experience_bottle": 47,
"experience_orb": 48,
"eye_of_ender": 49,
"falling_block": 50,
"fireball": 51,
"firework_rocket": 52,
"fox": 53,
"frog": 54,
"furnace_minecart": 55,
"ghast": 56,
"giant": 57,
"glow_item_frame": 58,
"glow_squid": 59,
"goat": 60,
"guardian": 61,
"hoglin": 62,
"hopper_minecart": 63,
"horse": 64,
"husk": 65,
"illusioner": 66,
"interaction": 67,
"iron_golem": 68,
"item": 69,
"item_display": 70,
"item_frame": 71,
"jungle_boat": 72,
"jungle_chest_boat": 73,
"leash_knot": 74,
"lightning_bolt": 75,
"llama": 76,
"llama_spit": 77,
"magma_cube": 78,
"mangrove_boat": 79,
"mangrove_chest_boat": 80,
"marker": 81,
"minecart": 82,
"mooshroom": 83,
"mule": 84,
"oak_boat": 85,
"oak_chest_boat": 86,
"ocelot": 87,
"ominous_item_spawner": 88,
"painting": 89,
"pale_oak_boat": 90,
"pale_oak_chest_boat": 91,
"panda": 92,
"parrot": 93,
"phantom": 94,
"pig": 95,
"piglin": 96,
"piglin_brute": 97,
"pillager": 98,
"polar_bear": 99,
"potion": 100,
"pufferfish": 101,
"rabbit": 102,
"ravager": 103,
"salmon": 104,
"sheep": 105,
"shulker": 106,
"shulker_bullet": 107,
"silverfish": 108,
"skeleton": 109,
"skeleton_horse": 110,
"slime": 111,
"small_fireball": 112,
"sniffer": 113,
"snowball": 114,
"snow_golem": 115,
"spawner_minecart": 116,
"spectral_arrow": 117,
"spider": 118,
"spruce_boat": 119,
"spruce_chest_boat": 120,
"squid": 121,
"stray": 122,
"strider": 123,
"tadpole": 124,
"text_display": 125,
"tnt": 126,
"tnt_minecart": 127,
"trader_llama": 128,
"trident": 129,
"tropical_fish": 130,
"turtle": 131,
"vex": 132,
"villager": 133,
"vindicator": 134,
"wandering_trader": 135,
"warden": 136,
"wind_charge": 137,
"witch": 138,
"wither": 139,
"wither_skeleton": 140,
"wither_skull": 141,
"wolf": 142,
"zoglin": 143,
"zombie": 144,
"zombie_horse": 145,
"zombie_villager": 146,
"zombified_piglin": 147,
"player": 148,
"fishing_bobber": 149
},
"V_1_20_5": {
"allay": 0,
"area_effect_cloud": 1,
Expand Down

0 comments on commit 56c9b73

Please sign in to comment.