Skip to content

Commit

Permalink
add entities displayName (see #11)
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1504 committed Apr 27, 2015
1 parent 3f40376 commit 3c54ec8
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/wiki_extractor/entities_extractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ var fs = require('fs');

var wikiTextParser = new WikiTextParser();

function getText(rawText)
{
return rawText
.replace(/\[\[(?:.+?\|)?(.+?)\]\]/g,"$1") // remove links
.replace(/\(.+\)/g,"") // remove text in parenthesis
.replace(/^(.+)<br \/>.+$/,"$1") // keep only the first line if two lines
.trim();
}

wikiTextParser.getArticle("Data_values/Entity_IDs",function(err,data){
var sectionObject=wikiTextParser.pageToSectionObject(data);

Expand All @@ -19,6 +28,7 @@ wikiTextParser.getArticle("Data_values/Entity_IDs",function(err,data){
var id=values[0].replace(/\| /g,"").trim();
entities[id]={
"id":parseInt(id),
"displayName":getText(values[4]),
"name":values[5].trim(),
"type":currentType};
}
Expand Down
61 changes: 61 additions & 0 deletions enums/entities.json
Original file line number Diff line number Diff line change
@@ -1,306 +1,367 @@
{
"1": {
"id": 1,
"displayName": "Dropped item",
"name": "Item",
"type": "Drops"
},
"2": {
"id": 2,
"displayName": "Experience Orb",
"name": "XPOrb",
"type": "Drops"
},
"8": {
"id": 8,
"displayName": "Lead knot",
"name": "LeashKnot",
"type": "Immobile"
},
"9": {
"id": 9,
"displayName": "Painting",
"name": "Painting",
"type": "Immobile"
},
"10": {
"id": 10,
"displayName": "Shot arrow",
"name": "Arrow",
"type": "Projectiles"
},
"11": {
"id": 11,
"displayName": "Thrown snowball",
"name": "Snowball",
"type": "Projectiles"
},
"12": {
"id": 12,
"displayName": "Ghast fireball",
"name": "Fireball",
"type": "Projectiles"
},
"13": {
"id": 13,
"displayName": "Blaze fireball",
"name": "SmallFireball",
"type": "Projectiles"
},
"14": {
"id": 14,
"displayName": "Thrown Ender Pearl",
"name": "ThrownEnderpearl",
"type": "Projectiles"
},
"15": {
"id": 15,
"displayName": "Thrown Eye of Ender",
"name": "EyeOfEnderSignal",
"type": "Projectiles"
},
"16": {
"id": 16,
"displayName": "Thrown splash potion",
"name": "ThrownPotion",
"type": "Projectiles"
},
"17": {
"id": 17,
"displayName": "Thrown Bottle o' Enchanting",
"name": "ThrownExpBottle",
"type": "Projectiles"
},
"18": {
"id": 18,
"displayName": "Item Frame",
"name": "ItemFrame",
"type": "Immobile"
},
"19": {
"id": 19,
"displayName": "Wither Skull",
"name": "WitherSkull",
"type": "Projectiles"
},
"20": {
"id": 20,
"displayName": "Primed TNT",
"name": "PrimedTnt",
"type": "Blocks"
},
"21": {
"id": 21,
"displayName": "Falling block",
"name": "FallingSand",
"type": "Blocks"
},
"22": {
"id": 22,
"displayName": "Firework Rocket",
"name": "FireworksRocketEntity",
"type": "Projectiles"
},
"30": {
"id": 30,
"displayName": "Armor Stand",
"name": "ArmorStand",
"type": "Immobile"
},
"40": {
"id": 40,
"displayName": "Minecart with Command Block",
"name": "MinecartCommandBlock",
"type": "Vehicles"
},
"41": {
"id": 41,
"displayName": "Boat",
"name": "Boat",
"type": "Vehicles"
},
"42": {
"id": 42,
"displayName": "Minecart",
"name": "MinecartRideable",
"type": "Vehicles"
},
"43": {
"id": 43,
"displayName": "Minecart with Chest",
"name": "MinecartChest",
"type": "Vehicles"
},
"44": {
"id": 44,
"displayName": "Minecart with Furnace",
"name": "MinecartFurnace",
"type": "Vehicles"
},
"45": {
"id": 45,
"displayName": "Minecart with TNT",
"name": "MinecartTNT",
"type": "Vehicles"
},
"46": {
"id": 46,
"displayName": "Minecart with Hopper",
"name": "MinecartHopper",
"type": "Vehicles"
},
"47": {
"id": 47,
"displayName": "Minecart with Spawner",
"name": "MinecartSpawner",
"type": "Vehicles"
},
"48": {
"id": 48,
"displayName": "Mob",
"name": "Mob",
"type": "Generic"
},
"49": {
"id": 49,
"displayName": "Monster",
"name": "Monster",
"type": "Generic"
},
"50": {
"id": 50,
"displayName": "Creeper",
"name": "Creeper",
"type": "Hostile mobs"
},
"51": {
"id": 51,
"displayName": "Skeleton",
"name": "Skeleton",
"type": "Hostile mobs"
},
"52": {
"id": 52,
"displayName": "Spider",
"name": "Spider",
"type": "Hostile mobs"
},
"53": {
"id": 53,
"displayName": "Giant",
"name": "Giant",
"type": "Hostile mobs"
},
"54": {
"id": 54,
"displayName": "Zombie Villager",
"name": "Zombie",
"type": "Hostile mobs"
},
"55": {
"id": 55,
"displayName": "Slime",
"name": "Slime",
"type": "Hostile mobs"
},
"56": {
"id": 56,
"displayName": "Ghast",
"name": "Ghast",
"type": "Hostile mobs"
},
"57": {
"id": 57,
"displayName": "Zombie Pigman",
"name": "PigZombie",
"type": "Hostile mobs"
},
"58": {
"id": 58,
"displayName": "Enderman",
"name": "Enderman",
"type": "Hostile mobs"
},
"59": {
"id": 59,
"displayName": "Cave Spider",
"name": "CaveSpider",
"type": "Hostile mobs"
},
"60": {
"id": 60,
"displayName": "Silverfish",
"name": "Silverfish",
"type": "Hostile mobs"
},
"61": {
"id": 61,
"displayName": "Blaze",
"name": "Blaze",
"type": "Hostile mobs"
},
"62": {
"id": 62,
"displayName": "Magma Cube",
"name": "LavaSlime",
"type": "Hostile mobs"
},
"63": {
"id": 63,
"displayName": "Ender Dragon",
"name": "EnderDragon",
"type": "Hostile mobs"
},
"64": {
"id": 64,
"displayName": "Wither",
"name": "WitherBoss",
"type": "Hostile mobs"
},
"65": {
"id": 65,
"displayName": "Bat",
"name": "Bat",
"type": "Passive mobs"
},
"66": {
"id": 66,
"displayName": "Witch",
"name": "Witch",
"type": "Hostile mobs"
},
"67": {
"id": 67,
"displayName": "Endermite",
"name": "Endermite",
"type": "Hostile mobs"
},
"68": {
"id": 68,
"displayName": "Guardian",
"name": "Guardian",
"type": "Hostile mobs"
},
"90": {
"id": 90,
"displayName": "Pig",
"name": "Pig",
"type": "Passive mobs"
},
"91": {
"id": 91,
"displayName": "Sheep",
"name": "Sheep",
"type": "Passive mobs"
},
"92": {
"id": 92,
"displayName": "Cow",
"name": "Cow",
"type": "Passive mobs"
},
"93": {
"id": 93,
"displayName": "Chicken",
"name": "Chicken",
"type": "Passive mobs"
},
"94": {
"id": 94,
"displayName": "Squid",
"name": "Squid",
"type": "Passive mobs"
},
"95": {
"id": 95,
"displayName": "Wolf",
"name": "Wolf",
"type": "Passive mobs"
},
"96": {
"id": 96,
"displayName": "Mooshroom",
"name": "MushroomCow",
"type": "Passive mobs"
},
"97": {
"id": 97,
"displayName": "Snow Golem",
"name": "SnowMan",
"type": "Passive mobs"
},
"98": {
"id": 98,
"displayName": "Ocelot",
"name": "Ozelot",
"type": "Passive mobs"
},
"99": {
"id": 99,
"displayName": "Iron Golem",
"name": "VillagerGolem",
"type": "Passive mobs"
},
"100": {
"id": 100,
"displayName": "Horse",
"name": "EntityHorse",
"type": "Passive mobs"
},
"101": {
"id": 101,
"displayName": "Rabbit",
"name": "Rabbit",
"type": "Passive mobs"
},
"120": {
"id": 120,
"displayName": "Villager",
"name": "Villager",
"type": "NPCs"
},
"200": {
"id": 200,
"displayName": "Ender Crystal",
"name": "EnderCrystal",
"type": "Immobile"
}
Expand Down
Loading

0 comments on commit 3c54ec8

Please sign in to comment.