Changed player achievement method names

This commit is contained in:
Shoghi Cervantes 2014-03-23 00:21:51 +01:00
parent 08c6c1c1ac
commit 28c5443b0d

View File

@ -578,10 +578,10 @@ const CREATIVE_SLOTS = 112;
} }
switch($data["entity"]->type){ switch($data["entity"]->type){
case Item::WOOD: case Item::WOOD:
$this->grantAchievement("mineWood"); $this->awardAchievement("mineWood");
break; break;
case Item::DIAMOND: case Item::DIAMOND:
$this->grantAchievement("diamond"); $this->awardAchievement("diamond");
break; break;
} }
} elseif($data["entity"]->level === $this->level){ } elseif($data["entity"]->level === $this->level){
@ -629,7 +629,7 @@ const CREATIVE_SLOTS = 112;
} }
} }
public function grantAchievement($achievementId){ public function awardAchievement($achievementId){
if(isset(Achievement::$list[$achievementId]) and !$this->hasAchievement($achievementId)){ if(isset(Achievement::$list[$achievementId]) and !$this->hasAchievement($achievementId)){
foreach(Achievement::$list[$achievementId]["requires"] as $requerimentId){ foreach(Achievement::$list[$achievementId]["requires"] as $requerimentId){
if(!$this->hasAchievement($requerimentId)){ if(!$this->hasAchievement($requerimentId)){
@ -1797,7 +1797,7 @@ const CREATIVE_SLOTS = 112;
if($tile instanceof Furnace and $packet->slot == 2){ if($tile instanceof Furnace and $packet->slot == 2){
switch($slot->getID()){ switch($slot->getID()){
case Item::IRON_INGOT: case Item::IRON_INGOT:
$this->grantAchievement("acquireIron"); $this->awardAchievement("acquireIron");
break; break;
} }
} }
@ -2273,35 +2273,35 @@ const CREATIVE_SLOTS = 112;
switch($item->getID()){ switch($item->getID()){
case Item::WORKBENCH: case Item::WORKBENCH:
$this->grantAchievement("buildWorkBench"); $this->awardAchievement("buildWorkBench");
break; break;
case Item::WOODEN_PICKAXE: case Item::WOODEN_PICKAXE:
$this->grantAchievement("buildPickaxe"); $this->awardAchievement("buildPickaxe");
break; break;
case Item::FURNACE: case Item::FURNACE:
$this->grantAchievement("buildFurnace"); $this->awardAchievement("buildFurnace");
break; break;
case Item::WOODEN_HOE: case Item::WOODEN_HOE:
$this->grantAchievement("buildHoe"); $this->awardAchievement("buildHoe");
break; break;
case Item::BREAD: case Item::BREAD:
$this->grantAchievement("makeBread"); $this->awardAchievement("makeBread");
break; break;
case Item::CAKE: case Item::CAKE:
$this->grantAchievement("bakeCake"); $this->awardAchievement("bakeCake");
$this->addItem(Item::get(Item::BUCKET, 0, 3)); $this->addItem(Item::get(Item::BUCKET, 0, 3));
break; break;
case Item::STONE_PICKAXE: case Item::STONE_PICKAXE:
case Item::GOLD_PICKAXE: case Item::GOLD_PICKAXE:
case Item::IRON_PICKAXE: case Item::IRON_PICKAXE:
case Item::DIAMOND_PICKAXE: case Item::DIAMOND_PICKAXE:
$this->grantAchievement("buildBetterPickaxe"); $this->awardAchievement("buildBetterPickaxe");
break; break;
case Item::WOODEN_SWORD: case Item::WOODEN_SWORD:
$this->grantAchievement("buildSword"); $this->awardAchievement("buildSword");
break; break;
case Item::DIAMOND: case Item::DIAMOND:
$this->grantAchievement("diamond"); $this->awardAchievement("diamond");
break; break;
} }
@ -2423,4 +2423,7 @@ const CREATIVE_SLOTS = 112;
} }
} }
} }