Skip to content

Commit

Permalink
Merge pull request #17 from Driesboy/master
Browse files Browse the repository at this point in the history
more slots
  • Loading branch information
xZeroMCPE committed Dec 24, 2015
2 parents 1724a77 + fe35aa9 commit cf5c663
Showing 1 changed file with 141 additions and 0 deletions.
141 changes: 141 additions & 0 deletions src/Andre/SurvivalGame/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function onEnable() {
$this->api = EconomyAPI::getInstance();
$this->getServer()->getPluginManager()->registerEvents($this,$this);
$this->getServer()->getScheduler()->scheduleRepeatingTask(new CallbackTask([$this,"gameTimber"]),20);
@mkdir($this->getDataFolder(), 0777, true);
$this->points = new Config($this->getDataFolder()."points.yml", Config::YAML);
$this->config=new Config($this->getDataFolder() . "config.yml", Config::YAML, array());
if($this->config->exists("lastpos"))
Expand All @@ -71,6 +72,14 @@ public function onEnable() {
$this->pos14=$this->config->get("pos14");
$this->pos15=$this->config->get("pos15");
$this->pos16=$this->config->get("pos16");
$this->pos17=$this->config->get("pos17");
$this->pos18=$this->config->get("pos18");
$this->pos19=$this->config->get("pos19");
$this->pos20=$this->config->get("pos20");
$this->pos21=$this->config->get("pos21");
$this->pos22=$this->config->get("pos22");
$this->pos23=$this->config->get("pos23");
$this->pos24=$this->config->get("pos24");
$this->lastpos=$this->config->get("lastpos");
$this->signlevel=$this->getServer()->getLevelByName($this->config->get("sign")["level"]);
$this->sign=new Vector3($this->sign["x"],$this->sign["y"],$this->sign["z"]);
Expand All @@ -90,6 +99,14 @@ public function onEnable() {
$this->pos14=new Vector3($this->pos14["x"]+0.5,$this->pos14["y"],$this->pos14["z"]+0.5);
$this->pos15=new Vector3($this->pos15["x"]+0.5,$this->pos15["y"],$this->pos15["z"]+0.5);
$this->pos16=new Vector3($this->pos16["x"]+0.5,$this->pos16["y"],$this->pos16["z"]+0.5);
$this->pos17=new Vector3($this->pos17["x"]+0.5,$this->pos17["y"],$this->pos17["z"]+0.5);
$this->pos18=new Vector3($this->pos18["x"]+0.5,$this->pos18["y"],$this->pos18["z"]+0.5);
$this->pos19=new Vector3($this->pos19["x"]+0.5,$this->pos19["y"],$this->pos19["z"]+0.5);
$this->pos20=new Vector3($this->pos20["x"]+0.5,$this->pos20["y"],$this->pos20["z"]+0.5);
$this->pos21=new Vector3($this->pos21["x"]+0.5,$this->pos21["y"],$this->pos21["z"]+0.5);
$this->pos22=new Vector3($this->pos22["x"]+0.5,$this->pos22["y"],$this->pos22["z"]+0.5);
$this->pos23=new Vector3($this->pos23["x"]+0.5,$this->pos23["y"],$this->pos23["z"]+0.5);
$this->pos24=new Vector3($this->pos24["x"]+0.5,$this->pos24["y"],$this->pos24["z"]+0.5);
$this->lastpos=new Vector3($this->lastpos["x"]+0.5,$this->lastpos["y"],$this->lastpos["z"]+0.5);
}
if(!$this->config->exists("endTime"))
Expand Down Expand Up @@ -231,6 +248,14 @@ public function onCommand(CommandSender $sender, Command $command, $label, array
$this->config->remove("pos14");
$this->config->remove("pos15");
$this->config->remove("pos16");
$this->config->remove("pos17");
$this->config->remove("pos18");
$this->config->remove("pos19");
$this->config->remove("pos20");
$this->config->remove("pos21");
$this->config->remove("pos22");
$this->config->remove("pos23");
$this->config->remove("pos24");
$this->config->remove("lastpos");
$this->config->save();
unset($this->sign,$this->pos1,$this->pos2,$this->pos3,$this->pos4,$this->pos5,$this->pos6,$this->pos7,$this->pos8,$this->pos9,$this->pos10,$this->pos11,$this->pos12,$this->pos13,$this->pos14,$this->pos15,$this->pos16,$this->pos17,$this->pos18,$this->pos19,$this->pos20,$this->pos21,$this->pos22,$this->pos23,$this->pos24,$this->lastpos);
Expand Down Expand Up @@ -263,6 +288,14 @@ public function onCommand(CommandSender $sender, Command $command, $label, array
$this->pos14=$this->config->get("pos14");
$this->pos15=$this->config->get("pos15");
$this->pos16=$this->config->get("pos16");
$this->pos17=$this->config->get("pos17");
$this->pos18=$this->config->get("pos18");
$this->pos19=$this->config->get("pos19");
$this->pos20=$this->config->get("pos20");
$this->pos21=$this->config->get("pos21");
$this->pos22=$this->config->get("pos22");
$this->pos23=$this->config->get("pos23");
$this->pos24=$this->config->get("pos24");
$this->lastpos=$this->config->get("lastpos");
$this->signlevel=$this->getServer()->getLevelByName($this->config->get("sign")["level"]);
$this->sign=new Vector3($this->sign["x"],$this->sign["y"],$this->sign["z"]);
Expand All @@ -282,6 +315,14 @@ public function onCommand(CommandSender $sender, Command $command, $label, array
$this->pos14=new Vector3($this->pos14["x"]+0.5,$this->pos14["y"],$this->pos14["z"]+0.5);
$this->pos15=new Vector3($this->pos15["x"]+0.5,$this->pos15["y"],$this->pos15["z"]+0.5);
$this->pos16=new Vector3($this->pos16["x"]+0.5,$this->pos16["y"],$this->pos16["z"]+0.5);
$this->pos17=new Vector3($this->pos17["x"]+0.5,$this->pos17["y"],$this->pos17["z"]+0.5);
$this->pos18=new Vector3($this->pos18["x"]+0.5,$this->pos18["y"],$this->pos18["z"]+0.5);
$this->pos19=new Vector3($this->pos19["x"]+0.5,$this->pos19["y"],$this->pos19["z"]+0.5);
$this->pos20=new Vector3($this->pos20["x"]+0.5,$this->pos20["y"],$this->pos20["z"]+0.5);
$this->pos21=new Vector3($this->pos21["x"]+0.5,$this->pos21["y"],$this->pos21["z"]+0.5);
$this->pos22=new Vector3($this->pos22["x"]+0.5,$this->pos22["y"],$this->pos22["z"]+0.5);
$this->pos23=new Vector3($this->pos23["x"]+0.5,$this->pos23["y"],$this->pos23["z"]+0.5);
$this->pos24=new Vector3($this->pos24["x"]+0.5,$this->pos24["y"],$this->pos24["z"]+0.5);
$this->lastpos=new Vector3($this->lastpos["x"]+0.5,$this->lastpos["y"],$this->lastpos["z"]+0.5);
}
if(!$this->config->exists("gameTime"))
Expand Down Expand Up @@ -943,6 +984,106 @@ public function playerBlockTouch(PlayerInteractEvent $event){
$this->pos16=new Vector3($this->pos16["x"]+0.5,$this->pos16["y"],$this->pos16["z"]+0.5);
break;
case 17:
$this->pos17=array(
"x" =>$block->x,
"y" =>$block->y,
"z" =>$block->z,
"level" =>$levelname);
$this->config->set("pos17",$this->pos17);
$this->config->save();
$this->SetStatus[$username]++;
$player->sendMessage(TextFormat::GREEN."Spawnpoint 17 created!");
$player->sendMessage(TextFormat::GREEN."Please click on the 18th spawnpoint.");
$this->pos17=new Vector3($this->pos17["x"]+0.5,$this->pos17["y"],$this->pos17["z"]+0.5);
break;
case 18:
$this->pos18=array(
"x" =>$block->x,
"y" =>$block->y,
"z" =>$block->z,
"level" =>$levelname);
$this->config->set("pos18",$this->pos18);
$this->config->save();
$this->SetStatus[$username]++;
$player->sendMessage(TextFormat::GREEN."Spawnpoint 18 created!");
$player->sendMessage(TextFormat::GREEN."Please click on the 19th spawnpoint.");
$this->pos18=new Vector3($this->pos18["x"]+0.5,$this->pos18["y"],$this->pos18["z"]+0.5);
break;
case 19:
$this->pos19=array(
"x" =>$block->x,
"y" =>$block->y,
"z" =>$block->z,
"level" =>$levelname);
$this->config->set("pos19",$this->pos19);
$this->config->save();
$this->SetStatus[$username]++;
$player->sendMessage(TextFormat::GREEN."Spawnpoint 19 created!");
$player->sendMessage(TextFormat::GREEN."Please click on the 20th spawnpoint.");
$this->pos19=new Vector3($this->pos19["x"]+0.5,$this->pos19["y"],$this->pos19["z"]+0.5);
break;
case 20:
$this->pos20=array(
"x" =>$block->x,
"y" =>$block->y,
"z" =>$block->z,
"level" =>$levelname);
$this->config->set("pos20",$this->pos20);
$this->config->save();
$this->SetStatus[$username]++;
$player->sendMessage(TextFormat::GREEN."Spawnpoint 20 created!");
$player->sendMessage(TextFormat::GREEN."Please click on the 21st spawnpoint.");
$this->pos20=new Vector3($this->pos20["x"]+0.5,$this->pos20["y"],$this->pos20["z"]+0.5);
break;
case 21:
$this->pos21=array(
"x" =>$block->x,
"y" =>$block->y,
"z" =>$block->z,
"level" =>$levelname);
$this->config->set("pos21",$this->pos21);
$this->config->save();
$this->SetStatus[$username]++;
$player->sendMessage(TextFormat::GREEN."Spawnpoint 21 created!");
$player->sendMessage(TextFormat::GREEN."Please click on the 22nd spawnpoint.");
$this->pos21=new Vector3($this->pos21["x"]+0.5,$this->pos21["y"],$this->pos21["z"]+0.5);
break;
case 22:
$this->pos22=array(
"x" =>$block->x,
"y" =>$block->y,
"z" =>$block->z,
"level" =>$levelname);
$this->config->set("pos22",$this->pos22);
$this->config->save();
$this->SetStatus[$username]++;
$player->sendMessage(TextFormat::GREEN."Spawnpoint 22 created!");
$player->sendMessage(TextFormat::GREEN."Please click on the 23rd spawnpoint.");
$this->pos22=new Vector3($this->pos22["x"]+0.5,$this->pos22["y"],$this->pos22["z"]+0.5);
break;
case 23:
$this->pos23=array(
"x" =>$block->x,
"y" =>$block->y,
"z" =>$block->z,
"level" =>$levelname);
$this->config->set("pos23",$this->pos23);
$this->config->save();
$this->SetStatus[$username]++;
$player->sendMessage(TextFormat::GREEN."Spawnpoint 23 created!");
$player->sendMessage(TextFormat::GREEN."Please click on the deathmatch location");
$this->pos23=new Vector3($this->pos23["x"]+0.5,$this->pos23["y"],$this->pos23["z"]+0.5);
break;
case 24:
$this->pos24=array(
"x" =>$block->x,
"y" =>$block->y,
"z" =>$block->z,
"level" =>$levelname);
$this->config->set("pos24",$this->pos24);
$this->config->save();
$this->SetStatus[$username]++;
case 25:
$this->lastpos=array(
"x" =>$block->x,
"y" =>$block->y,
Expand Down

0 comments on commit cf5c663

Please sign in to comment.