mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-28 06:09:57 +00:00
Merge branch 'next-minor' into next-major
This commit is contained in:
commit
c8320fe849
@ -297,15 +297,10 @@ class TypeConverter{
|
|||||||
|
|
||||||
}
|
}
|
||||||
case NetworkInventoryAction::SOURCE_TODO:
|
case NetworkInventoryAction::SOURCE_TODO:
|
||||||
//These types need special handling.
|
//These are used to balance a transaction that involves special actions, like crafting, enchanting, etc.
|
||||||
switch($action->windowId){
|
//The vanilla server just accepted these without verifying them. We don't need to care about them since
|
||||||
case NetworkInventoryAction::SOURCE_TYPE_CRAFTING_RESULT:
|
//we verify crafting by checking for imbalances anyway.
|
||||||
case NetworkInventoryAction::SOURCE_TYPE_CRAFTING_USE_INGREDIENT:
|
return null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: more stuff
|
|
||||||
throw new TypeConversionException("No open container with window ID $action->windowId");
|
|
||||||
default:
|
default:
|
||||||
throw new TypeConversionException("Unknown inventory source type $action->sourceType");
|
throw new TypeConversionException("Unknown inventory source type $action->sourceType");
|
||||||
}
|
}
|
||||||
|
@ -315,12 +315,7 @@ class InGamePacketHandler extends PacketHandler{
|
|||||||
$converter = TypeConverter::getInstance();
|
$converter = TypeConverter::getInstance();
|
||||||
foreach($data->getActions() as $networkInventoryAction){
|
foreach($data->getActions() as $networkInventoryAction){
|
||||||
if(
|
if(
|
||||||
(
|
$networkInventoryAction->sourceType === NetworkInventoryAction::SOURCE_TODO || (
|
||||||
$networkInventoryAction->sourceType === NetworkInventoryAction::SOURCE_TODO && (
|
|
||||||
$networkInventoryAction->windowId === NetworkInventoryAction::SOURCE_TYPE_CRAFTING_RESULT ||
|
|
||||||
$networkInventoryAction->windowId === NetworkInventoryAction::SOURCE_TYPE_CRAFTING_USE_INGREDIENT
|
|
||||||
)
|
|
||||||
) || (
|
|
||||||
$this->craftingTransaction !== null &&
|
$this->craftingTransaction !== null &&
|
||||||
!$networkInventoryAction->oldItem->getItemStack()->equals($networkInventoryAction->newItem->getItemStack()) &&
|
!$networkInventoryAction->oldItem->getItemStack()->equals($networkInventoryAction->newItem->getItemStack()) &&
|
||||||
$networkInventoryAction->sourceType === NetworkInventoryAction::SOURCE_CONTAINER &&
|
$networkInventoryAction->sourceType === NetworkInventoryAction::SOURCE_CONTAINER &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user