Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DaPigGuy committed Apr 16, 2017
1 parent ba919ec commit 4d3fbee
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: PiggyAuth
main: PiggyAuth\Main
version: 3.0.0.10
version: 3.0.0.11
api: [2.0.0, 3.0.0-ALPHA1, 3.0.0-ALPHA2, 3.0.0-ALPHA3, 3.0.0-ALPHA4, 3.0.0-APLHA5]
load: POSTWORLD
author: MCPEPIG
Expand Down
2 changes: 1 addition & 1 deletion src/PiggyAuth/EventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public function onJoin(PlayerJoinEvent $event)
$event->setJoinMessage(str_replace("{player}", $player->getName(), $this->plugin->languagemanager->getMessageFromLanguage($this->plugin->languagemanager->getDefaultLanguage(), "new-player")));
}
if ($this->plugin->getConfig()->getNested("message.hold-join-message")) {
$this->plugin->sessionmanager->getSession($player)->setStartMessage($event->getJoinMessage());
$this->plugin->sessionmanager->getSession($player)->setJoinMessage($event->getJoinMessage());
$event->setJoinMessage(null);
}
if ($this->plugin->getConfig()->getNested("login.auto-authentication") && !is_null($data) && $player->getUniqueId()->toString() == $data["uuid"]) {
Expand Down
3 changes: 3 additions & 0 deletions src/PiggyAuth/Sessions/PiggyAuthSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use pocketmine\entity\Entity;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\DoubleTag;
use pocketmine\nbt\tag\FloatTag;
use pocketmine\nbt\tag\ListTag;
use pocketmine\network\protocol\MobEffectPacket;
use pocketmine\Player;
Expand Down Expand Up @@ -401,6 +402,7 @@ public function insertData($password, $email, $pin, $xbox, $callback = null, $ar
*/
public function startSession()
{
echo 1;
if (in_array(strtolower($this->player->getName()), $this->plugin->getConfig()->getNested("login.accounts-bypassed"))) {
$this->authenticated = true;
return true;
Expand Down Expand Up @@ -479,6 +481,7 @@ public function startSession()
$wither->spawnTo($this->player);
$wither->setNameTag($this->isRegistered() == false ? $this->plugin->languagemanager->getMessage($this->player, "register-boss-bar") : $this->plugin->languagemanager->getMessage($this->player, "login-boss-bar"));
$this->setWither($wither);
echo "h";
$wither->setMaxHealth($this->plugin->getConfig()->getNested("timeout.timeout-time"));
$wither->setHealth($this->plugin->getConfig()->getNested("timeout.timeout-time"));
$pk = new BossEventPacket();
Expand Down
10 changes: 6 additions & 4 deletions src/PiggyAuth/Tasks/OtherMessageTypeTick.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ public function onRun($currentTick)
$player->dataPacket($pk);
}
if ($this->plugin->getConfig()->getNested("message.boss-bar")) {
$pk = new UpdateAttributesPacket();
$pk->entries[] = new FakeAttribute(0.00, $this->plugin->getConfig()->getNested("timeout.timeout-time"), ($this->plugin->getConfig()->getNested("timeout.timeout-time") - $this->plugin->sessionmanager->getSession($player)->getTimeoutTick() - 1), "minecraft:health");
$pk->entityId = $this->plugin->sessionmanager->getSession($player)->getWither()->getId();
$player->dataPacket($pk);
if ($this->plugin->sessionmanager->getSession($player)->getWither() !== null) {
$pk = new UpdateAttributesPacket();
$pk->entries[] = new FakeAttribute(0.00, $this->plugin->getConfig()->getNested("timeout.timeout-time"), ($this->plugin->getConfig()->getNested("timeout.timeout-time") - $this->plugin->sessionmanager->getSession($player)->getTimeoutTick() - 1), "minecraft:health");
$pk->entityId = $this->plugin->sessionmanager->getSession($player)->getWither()->getId();
$player->dataPacket($pk);
}
}
$pk = new SetTitlePacket();
$pk->type = SetTitlePacket::TYPE_SET_ANIMATION_TIMES;
Expand Down

0 comments on commit 4d3fbee

Please sign in to comment.