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

Commit

Permalink
1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandroliu committed Jul 12, 2016
1 parent a83d8e8 commit 3f27f07
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ItemCasePE

* Summary: An implementation of Bukkit's ItemCase
* Dependency Plugins: n/a
* PocketMine-MP version: 1.4 - API 1.10.0
* PocketMine-MP version: 1.4 - API 1.10.0, 1.6 - API 1.13.0
* OptionalPlugins:
* Categories: General
* Plugin Access: Tile Entities, Items/Blocks
Expand Down Expand Up @@ -59,9 +59,16 @@ wave** mode is experimental and has not been fully tested.
* itemcase.cmd: allow players access to the itemcase command
* itemcase.destroy: allow players destroy cases

Changes
-------
## Changes

* 1.0.8 : No AIR cases
- Do not allow to place cases with AIR only. Reported by @Pub4Game.
Closes #30.
* 1.0.7 : Update for PM1.6dev
- Checks which function to call (isPlaceable/canBePlaced) without having
to check version.
* 1.0.6 : Update for PM1.6dev
- changed isPlaceable for canBePlaced
* 1.0.5 : BugFix
- Fixed a small bug related to new wave mode.
* 1.0.4 : new wave vs classic
Expand Down Expand Up @@ -92,4 +99,3 @@ Copyright

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

4 changes: 2 additions & 2 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
main: aliuly\itemcasepe\Main
api: 1.10.0
api: [1.10.0, 1.13.0]
load: POSTWORLD

name: ItemCasePE
description: An implementation of Bukkit's ItemCase
version: 1.0.5
version: 1.0.8
author: aliuly

commands:
Expand Down
14 changes: 12 additions & 2 deletions src/aliuly/itemcasepe/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ public function onPlayerInteract(PlayerInteractEvent $ev){
}
$cid = implode(":",[$bl->getX(),$bl->getY(),$bl->getZ()]);
$item = $pl->getInventory()->getItemInHand();
if ($item->getId() === Item::AIR) {
$pl->sendMessage("You must be holding an item!");
$ev->setCancelled();
return;
}

if (!$this->addItemCase($bl->getLevel(),$cid,
implode(":",[$item->getId(),$item->getDamage()]),
Expand All @@ -312,8 +317,13 @@ public function onPlayerInteract(PlayerInteractEvent $ev){
}
unset($this->touches[$pl->getName()]);
$ev->setCancelled();
if ($ev->getItem()->isPlaceable())
$this->places[$pl->getName()] = $pl->getName();
if (is_callable([$ev->getItem(),"canBePlaced"])) {
if ($ev->getItem()->canBePlaced())
$this->places[$pl->getName()] = $pl->getName();
} elseif (is_callable([$ev->getItem(),"isPlaceable"])) {
if ($ev->getItem()->isPlaceable())
$this->places[$pl->getName()] = $pl->getName();
}
}
public function onBlockPlace(BlockPlaceEvent $ev){
$pl = $ev->getPlayer();
Expand Down

0 comments on commit 3f27f07

Please sign in to comment.