Use standard format for color hex, some minor name alteration

This commit is contained in:
Dylan K. Taylor 2017-04-22 12:21:50 +01:00
parent 9e02f3c4e3
commit 6320a63ca5
2 changed files with 50 additions and 50 deletions

View File

@ -65,13 +65,13 @@ class Effect{
$config = new Config(\pocketmine\PATH . "src/pocketmine/resources/effects.json", Config::JSON, []); $config = new Config(\pocketmine\PATH . "src/pocketmine/resources/effects.json", Config::JSON, []);
foreach($config->getAll() as $name => $data){ foreach($config->getAll() as $name => $data){
$color = hexdec($data["color"]); $color = hexdec(substr($data["color"], 3));
$r = ($color >> 16) & 0xff; $r = ($color >> 16) & 0xff;
$g = ($color >> 8) & 0xff; $g = ($color >> 8) & 0xff;
$b = $color & 0xff; $b = $color & 0xff;
self::registerEffect($name, new Effect( self::registerEffect($name, new Effect(
$data["id"], $data["id"],
"%" . $data["name"], "%potion." . $data["name"],
$r, $r,
$g, $g,
$b, $b,

View File

@ -1,135 +1,135 @@
{ {
"speed": { "speed": {
"id": 1, "id": 1,
"color": "7cafc6", "color": "#FF7CAFC6",
"name": "potion.moveSpeed" "name": "moveSpeed"
}, },
"slowness": { "slowness": {
"id": 2, "id": 2,
"color": "5a6c81", "color": "#FF5A6C81",
"name": "potion.moveSlowdown", "name": "moveSlowdown",
"isBad": true "isBad": true
}, },
"haste": { "haste": {
"id": 3, "id": 3,
"color": "d9c043", "color": "#FFD9C043",
"name": "potion.digSpeed" "name": "digSpeed"
}, },
"mining_fatigue": { "mining_fatigue": {
"id": 4, "id": 4,
"color": "4a4217", "color": "#FF4A4217",
"name": "potion.digSlowDown", "name": "digSlowDown",
"isBad": true "isBad": true
}, },
"strength": { "strength": {
"id": 5, "id": 5,
"color": "932423", "color": "#FF932423",
"name": "potion.damageBoost" "name": "damageBoost"
}, },
"instant_health": { "instant_health": {
"id": 6, "id": 6,
"color": "f82423", "color": "#FFF82423",
"name": "potion.heal", "name": "heal",
"default_duration": 1, "default_duration": 1,
"has_bubbles": false "has_bubbles": false
}, },
"instant_damage": { "instant_damage": {
"id": 7, "id": 7,
"color": "430a09", "color": "#FF430A09",
"name": "potion.harm", "name": "harm",
"isBad": true, "isBad": true,
"default_duration": 1, "default_duration": 1,
"has_bubbles": false "has_bubbles": false
}, },
"jump_boost": { "jump_boost": {
"id": 8, "id": 8,
"color": "22ff4c", "color": "#FF22FF4C",
"name": "potion.jump" "name": "jump"
}, },
"nausea": { "nausea": {
"id": 9, "id": 9,
"color": "551d4a", "color": "#FF551D4A",
"name": "potion.confusion", "name": "confusion",
"isBad": true "isBad": true
}, },
"regeneration": { "regeneration": {
"id": 10, "id": 10,
"color": "cd5cab", "color": "#FFCD5CAB",
"name": "potion.regeneration" "name": "regeneration"
}, },
"resistance": { "resistance": {
"id": 11, "id": 11,
"color": "99453a", "color": "#FF99453A",
"name": "potion.resistance" "name": "resistance"
}, },
"fire_resistance": { "fire_resistance": {
"id": 12, "id": 12,
"color": "e49a3a", "color": "#FFE49A3A",
"name": "potion.fireResistance" "name": "fireResistance"
}, },
"water_breathing": { "water_breathing": {
"id": 13, "id": 13,
"color": "2e5299", "color": "#FF2E5299",
"name": "potion.waterBreathing" "name": "waterBreathing"
}, },
"invisibility": { "invisibility": {
"id": 14, "id": 14,
"color": "7f8392", "color": "#FF7F8392",
"name": "potion.invisibility" "name": "invisibility"
}, },
"blindness": { "blindness": {
"id": 15, "id": 15,
"color": "1f1f23", "color": "#FF1F1F23",
"name": "potion.blindness", "name": "blindness",
"isBad": true "isBad": true
}, },
"night_vision": { "night_vision": {
"id": 16, "id": 16,
"color": "1f1fa1", "color": "#FF1F1FA1",
"name": "potion.nightVision" "name": "nightVision"
}, },
"hunger": { "hunger": {
"id": 17, "id": 17,
"color": "587653", "color": "#FF587653",
"name": "potion.hunger", "name": "hunger",
"isBad": true "isBad": true
}, },
"weakness": { "weakness": {
"id": 18, "id": 18,
"color": "484d48", "color": "#FF484D48",
"name": "potion.weakness", "name": "weakness",
"isBad": true "isBad": true
}, },
"poison": { "poison": {
"id": 19, "id": 19,
"color": "4e9331", "color": "#FF4E9331",
"name": "potion.poison", "name": "poison",
"isBad": true "isBad": true
}, },
"wither": { "wither": {
"id": 20, "id": 20,
"color": "352a27", "color": "#FF352A27",
"name": "potion.wither", "name": "wither",
"isBad": true "isBad": true
}, },
"health_boost": { "health_boost": {
"id": 21, "id": 21,
"color": "f87d23", "color": "#FFF87D23",
"name": "potion.healthBoost" "name": "healthBoost"
}, },
"absorption": { "absorption": {
"id": 22, "id": 22,
"color": "2552a5", "color": "#FF2552A5",
"name": "potion.absorption" "name": "absorption"
}, },
"saturation": { "saturation": {
"id": 23, "id": 23,
"color": "f82423", "color": "#FFF82423",
"name": "potion.saturation" "name": "saturation"
}, },
"levitation": { "levitation": {
"id": 24, "id": 24,
"color": "ceffff", "color": "#FFCEFFFF",
"name": "potion.levitation" "name": "levitation"
} }
} }