Merge remote-tracking branch 'origin/stable' into minor-next

This commit is contained in:
Dylan K. Taylor
2024-02-05 12:43:39 +00:00
8 changed files with 24 additions and 19 deletions

View File

@ -165,7 +165,7 @@ class ParserPacketHandler extends PacketHandler{
$data->block_states = self::blockStatePropertiesToString($blockState);
}
}elseif($itemStack->getBlockRuntimeId() !== ItemTranslator::NO_BLOCK_RUNTIME_ID){
throw new PacketHandlingException("Non-blockitems should have a zero block runtime ID");
throw new PacketHandlingException("Non-blockitems should have a zero block runtime ID (" . $itemStack->getBlockRuntimeId() . " on " . $itemStringId . ")");
}elseif($meta !== 0){
$data->meta = $meta;
}

View File

@ -94,9 +94,14 @@ foreach($files as $file){
$newDiff = [];
foreach($target["simple"] as $oldId => $newId){
if(($merged["simple"][$oldId] ?? null) !== $newId){
$newDiff["renamedIds"][$oldId] = $newId;
$previousNewId = $merged["simple"][$oldId] ?? null;
if(
$previousNewId === $newId || //if previous schemas already accounted for this
($previousNewId !== null && isset($target["simple"][$previousNewId])) //or the item's ID has been changed for a second time
){
continue;
}
$newDiff["renamedIds"][$oldId] = $newId;
}
if(isset($newDiff["renamedIds"])){
ksort($newDiff["renamedIds"], SORT_STRING);