mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Fixed items being consumed on CREATIVE mode
This commit is contained in:
parent
6fa0ef652e
commit
9d1369bfe9
7 changed files with 30 additions and 11 deletions
|
|
@ -365,13 +365,19 @@ class Player{
|
|||
return;
|
||||
$s = (int) $s;
|
||||
if(!isset($this->inventory[$s])){
|
||||
return false;
|
||||
$this->dataPacket(MC_CONTAINER_SET_SLOT, array(
|
||||
"windowid" => 0,
|
||||
"slot" => (int) $s,
|
||||
"block" => AIR,
|
||||
"stack" => 0,
|
||||
"meta" => 0,
|
||||
));
|
||||
}
|
||||
|
||||
$slot = $this->inventory[$s];
|
||||
$this->dataPacket(MC_CONTAINER_SET_SLOT, array(
|
||||
"windowid" => 0,
|
||||
"slot" => ((int) $s) + 9,
|
||||
"slot" => (int) $s,
|
||||
"block" => $slot->getID(),
|
||||
"stack" => $slot->count,
|
||||
"meta" => $slot->getMetadata(),
|
||||
|
|
@ -1349,7 +1355,7 @@ class Player{
|
|||
$damage = 1;//$this->server->difficulty;
|
||||
}
|
||||
$target->harm($damage, $this->eid);
|
||||
if($slot->isTool() === true){
|
||||
if($slot->isTool() === true and ($this->gamemode & 0x01) === 0){
|
||||
$slot->useOn($target);
|
||||
}
|
||||
}
|
||||
|
|
@ -1630,7 +1636,7 @@ class Player{
|
|||
$this->dataPacket(MC_CONTAINER_SET_CONTENT, array(
|
||||
"windowid" => 0,
|
||||
"count" => count($this->inventory),
|
||||
"slots" => $this->inventory
|
||||
"slots" => $this->inventory,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue