mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49:43 +00:00
fixed metadata check in useitem
This commit is contained in:
parent
9d82e28297
commit
5458c04983
2 changed files with 4 additions and 7 deletions
|
|
@ -1996,8 +1996,10 @@ class Player{
|
||||||
|
|
||||||
//nc: check item desync
|
//nc: check item desync
|
||||||
$heldItem = $this->getHeldItem();
|
$heldItem = $this->getHeldItem();
|
||||||
if($heldItem->getID() != $packet->item || $heldItem->getMetadata() != $packet->meta){
|
$pmeta = ($packet->meta & 0xff);
|
||||||
ConsoleAPI::warn("{$this->username}'s heldItem doesnt match on clientside({$packet->item} {$packet->meta}) and serverside({$heldItem->getID()} {$heldItem->getMetadata()}) when using item. Resending inventory.");
|
$hmeta = ($heldItem->getMetadata() & 0xff); //in 0.8.1 useitempacket uses byte for meta
|
||||||
|
if($heldItem->getID() != $packet->item || $hmeta != $pmeta){
|
||||||
|
ConsoleAPI::warn("{$this->username}'s heldItem doesnt match on clientside({$packet->item} {$pmeta}) and serverside({$heldItem->getID()} {$hmeta}) when using item. Resending inventory.");
|
||||||
$this->sendInventory();
|
$this->sendInventory();
|
||||||
if($packet->face >= 0 && $packet->face <= 5){
|
if($packet->face >= 0 && $packet->face <= 5){
|
||||||
$target = $this->level->getBlock($blockVector);
|
$target = $this->level->getBlock($blockVector);
|
||||||
|
|
|
||||||
|
|
@ -311,20 +311,15 @@ class CraftingRecipes{
|
||||||
$needcnt -= $it[2];
|
$needcnt -= $it[2];
|
||||||
}
|
}
|
||||||
if($needcnt != 0) {
|
if($needcnt != 0) {
|
||||||
console("awa");
|
|
||||||
goto skip_recipe;
|
goto skip_recipe;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$exceptedIndex = ($item[0] << 16) | ($item[1] & 0xffff);
|
$exceptedIndex = ($item[0] << 16) | ($item[1] & 0xffff);
|
||||||
if(!isset($recipeItems[$exceptedIndex])) {
|
if(!isset($recipeItems[$exceptedIndex])) {
|
||||||
|
|
||||||
console("awa1");
|
|
||||||
goto skip_recipe; //dont check count if no idmeta pair is in ingridients
|
goto skip_recipe; //dont check count if no idmeta pair is in ingridients
|
||||||
}
|
}
|
||||||
$it = $recipeItems[$exceptedIndex];
|
$it = $recipeItems[$exceptedIndex];
|
||||||
if($it[0] != $item[0] || $it[1] != $item[1] || $it[2] != $item[2]) {
|
if($it[0] != $item[0] || $it[1] != $item[1] || $it[2] != $item[2]) {
|
||||||
|
|
||||||
console("awa2");
|
|
||||||
goto skip_recipe;
|
goto skip_recipe;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue