mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
reset crafting type whenever resetting crafting arrays
This commit is contained in:
parent
2b38e4b20d
commit
6b0b1aa985
1 changed files with 14 additions and 2 deletions
|
|
@ -1975,6 +1975,7 @@ class Player{
|
||||||
}
|
}
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
$packet->eid = $this->eid;
|
$packet->eid = $this->eid;
|
||||||
$data = [];
|
$data = [];
|
||||||
$data["eid"] = $packet->eid;
|
$data["eid"] = $packet->eid;
|
||||||
|
|
@ -2101,6 +2102,7 @@ class Player{
|
||||||
$packet->eid = $this->eid;
|
$packet->eid = $this->eid;
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
|
|
||||||
switch($packet->action){
|
switch($packet->action){
|
||||||
case 5: //Shot arrow
|
case 5: //Shot arrow
|
||||||
|
|
@ -2182,6 +2184,7 @@ class Player{
|
||||||
}
|
}
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
$this->server->api->block->playerBlockBreak($this, $blockVector);
|
$this->server->api->block->playerBlockBreak($this, $blockVector);
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::PLAYER_ARMOR_EQUIPMENT_PACKET:
|
case ProtocolInfo::PLAYER_ARMOR_EQUIPMENT_PACKET:
|
||||||
|
|
@ -2190,6 +2193,7 @@ class Player{
|
||||||
}
|
}
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
|
|
||||||
$packet->eid = $this->eid;
|
$packet->eid = $this->eid;
|
||||||
for($i = 0; $i < 4; ++$i){
|
for($i = 0; $i < 4; ++$i){
|
||||||
|
|
@ -2234,6 +2238,7 @@ class Player{
|
||||||
$data["action"] = $packet->action;
|
$data["action"] = $packet->action;
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
$target = $this->server->api->entity->get($packet->target);
|
$target = $this->server->api->entity->get($packet->target);
|
||||||
if($target instanceof Entity and $this->entity instanceof Entity and $this->gamemode !== VIEW and $this->blocked === false and ($target instanceof Entity) and $this->entity->distance($target) <= 8){
|
if($target instanceof Entity and $this->entity instanceof Entity and $this->gamemode !== VIEW and $this->blocked === false and ($target instanceof Entity) and $this->entity->distance($target) <= 8){
|
||||||
$data["targetentity"] = $packet->target;
|
$data["targetentity"] = $packet->target;
|
||||||
|
|
@ -2261,6 +2266,7 @@ class Player{
|
||||||
}
|
}
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
|
|
||||||
$this->checkSpawnPosition();
|
$this->checkSpawnPosition();
|
||||||
$this->teleport($this->spawnPosition, false, false, true, false);
|
$this->teleport($this->spawnPosition, false, false, true, false);
|
||||||
|
|
@ -2299,6 +2305,7 @@ class Player{
|
||||||
}
|
}
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
$packet->eid = $this->eid;
|
$packet->eid = $this->eid;
|
||||||
if($this->entity->inAction === true){
|
if($this->entity->inAction === true){
|
||||||
$this->entity->inAction = false;
|
$this->entity->inAction = false;
|
||||||
|
|
@ -2359,6 +2366,7 @@ class Player{
|
||||||
|
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
$data["eid"] = $packet->eid;
|
$data["eid"] = $packet->eid;
|
||||||
$data["unknown"] = $packet->unknown;
|
$data["unknown"] = $packet->unknown;
|
||||||
$data["item"] = $packet->item;
|
$data["item"] = $packet->item;
|
||||||
|
|
@ -2391,6 +2399,7 @@ class Player{
|
||||||
}
|
}
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
if(trim($packet->message) != "" and strlen($packet->message) <= 255){
|
if(trim($packet->message) != "" and strlen($packet->message) <= 255){
|
||||||
$message = $packet->message;
|
$message = $packet->message;
|
||||||
if($message[0] === "/"){ //Command
|
if($message[0] === "/"){ //Command
|
||||||
|
|
@ -2428,6 +2437,7 @@ class Player{
|
||||||
}
|
}
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
if(isset($this->windows[$packet->windowid])){
|
if(isset($this->windows[$packet->windowid])){
|
||||||
if(is_array($this->windows[$packet->windowid])){
|
if(is_array($this->windows[$packet->windowid])){
|
||||||
foreach($this->windows[$packet->windowid] as $ob){
|
foreach($this->windows[$packet->windowid] as $ob){
|
||||||
|
|
@ -2484,6 +2494,7 @@ class Player{
|
||||||
}else{
|
}else{
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
}
|
}
|
||||||
if(!isset($this->windows[$packet->windowid])){
|
if(!isset($this->windows[$packet->windowid])){
|
||||||
break;
|
break;
|
||||||
|
|
@ -2597,6 +2608,7 @@ class Player{
|
||||||
}
|
}
|
||||||
$this->craftingItems = [];
|
$this->craftingItems = [];
|
||||||
$this->toCraft = [];
|
$this->toCraft = [];
|
||||||
|
$this->craftingType = CraftingRecipes::TYPE_INVENTORY;
|
||||||
$t = $this->server->api->tile->get(new Position($packet->x, $packet->y, $packet->z, $this->level));
|
$t = $this->server->api->tile->get(new Position($packet->x, $packet->y, $packet->z, $this->level));
|
||||||
if(($t instanceof Tile) and $t->class === TILE_SIGN){
|
if(($t instanceof Tile) and $t->class === TILE_SIGN){
|
||||||
if($t->data["creator"] !== $this->username){
|
if($t->data["creator"] !== $this->username){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue