-
Notifications
You must be signed in to change notification settings - Fork 76
Code Updates for PMMP 3.19.0, fix for #448 #449
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not been able to verify that this actually fixes the targeted problem or is completely compatible with 3.19. Please update the requested items and I will continue to review as I can.
plugin.yml
Outdated
|
||
load: STARTUP | ||
authors: ["milk0417", "RevivalPMMP"] | ||
authors: ["milk0417", "RevivalPMMP", "supercrafter333"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove your username from the authors list. There are a large number of contributors to this project and it is preferred that people look at Github to get a full list of everyone's contributions. That is why the website is included in the plugin details.
@@ -39,7 +39,6 @@ | |||
use pocketmine\item\IronHelmet; | |||
use pocketmine\item\IronLeggings; | |||
use pocketmine\item\Item; | |||
use pocketmine\item\ItemIds; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the use of ItemIds to Item is not required to be compatible with 3.19.0. Please revert all related changes and open a separate PR to handle this.
$pk->item = $this->mainHand !== null ? $this->mainHand : Item::get(ItemIds::AIR); | ||
if ($this->mainHand instanceof Item) { | ||
$pk->item = ItemStackWrapper::legacy($this->mainHand); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shorthand could be maintained here by using $pk->item = $this->mainHand instanceof Item ? ItemStackWrapper::legacy($this->mainHand) : ItemStackWrapper::legacy(Item::get(Item::AIR));
Fixed with commit "Code cleanup" |
Please accept it, it was not so easy for me to find the error. |
@@ -76,7 +76,7 @@ public function dataPacketReceiveEvent(DataPacketReceiveEvent $event){ | |||
if($btnTxt === null){ | |||
return; | |||
} | |||
if($packet->transactionType !== InventoryTransactionPacket::TYPE_USE_ITEM_ON_ENTITY){ | |||
if($packet->trData !== InventoryTransactionPacket::TYPE_USE_ITEM_ON_ENTITY){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you should use !$packet->trData instanceof UseItemOnEntityTransactionData
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wtf... no
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please read the changes carefully. He is right. You should use the
!$packet->trData instanceof UseItemOnEntityTransactionData
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it works, that's the most important thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most important thing is that the code is written correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@supercrafter333 I made the requested changes for you, just review and merge my pull request into your branch supercrafter333#1
What about adding the mcpe-protocol directive to the plugin.yml to avoid future crashes? @95CivicSi |
Comply with requested changes
Fix this bug as well, Crashdump: Error: include(phar:///home/container/plugins/PureEntitiesX_dev-351.phar/src/revivalpmmp/pureentities/data/MobTypeMaps.php): failed to open stream: phar error: Cannot open phar archive "/home/container/plugins/PureEntitiesX_dev-351.phar" for reading A PLUGIN WAS INVOLVED IN THIS CRASH Code: Backtrace: PocketMine-MP version: 3.19.0 [Protocol 431]
Loaded plugins: ----------------------REPORT THE DATA BELOW THIS LINE----------------------- ===BEGIN CRASH DUMP=== Not 100% sure how it even happened. |
Fix some too old codes for the new version of pocketmine (3.19.0).
-> Tested - Works