Merge branch 'next-minor' into next-major

This commit is contained in:
Dylan K. Taylor 2022-07-14 20:50:49 +01:00
commit c8320fe849
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 5 additions and 15 deletions

View File

@ -297,15 +297,10 @@ class TypeConverter{
}
case NetworkInventoryAction::SOURCE_TODO:
//These types need special handling.
switch($action->windowId){
case NetworkInventoryAction::SOURCE_TYPE_CRAFTING_RESULT:
case NetworkInventoryAction::SOURCE_TYPE_CRAFTING_USE_INGREDIENT:
//These are used to balance a transaction that involves special actions, like crafting, enchanting, etc.
//The vanilla server just accepted these without verifying them. We don't need to care about them since
//we verify crafting by checking for imbalances anyway.
return null;
}
//TODO: more stuff
throw new TypeConversionException("No open container with window ID $action->windowId");
default:
throw new TypeConversionException("Unknown inventory source type $action->sourceType");
}

View File

@ -315,12 +315,7 @@ class InGamePacketHandler extends PacketHandler{
$converter = TypeConverter::getInstance();
foreach($data->getActions() as $networkInventoryAction){
if(
(
$networkInventoryAction->sourceType === NetworkInventoryAction::SOURCE_TODO && (
$networkInventoryAction->windowId === NetworkInventoryAction::SOURCE_TYPE_CRAFTING_RESULT ||
$networkInventoryAction->windowId === NetworkInventoryAction::SOURCE_TYPE_CRAFTING_USE_INGREDIENT
)
) || (
$networkInventoryAction->sourceType === NetworkInventoryAction::SOURCE_TODO || (
$this->craftingTransaction !== null &&
!$networkInventoryAction->oldItem->getItemStack()->equals($networkInventoryAction->newItem->getItemStack()) &&
$networkInventoryAction->sourceType === NetworkInventoryAction::SOURCE_CONTAINER &&