Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

A Floating Inventory + NBT tags Issue. #2387

Open
Muqsit opened this issue Mar 15, 2017 · 5 comments
Open

A Floating Inventory + NBT tags Issue. #2387

Muqsit opened this issue Mar 15, 2017 · 5 comments

Comments

@Muqsit
Copy link
Collaborator

Muqsit commented Mar 15, 2017

Issue description

Items having at least 1 namedtag can/will keep glitching in and out of your inventory.
When you drop them, it won't drop anything; and when you pick them up and open your inventory, the item drops by itself.

This does not happen with allow-cheats turned on.

Steps to reproduce the issue

Using this code:

$item = Item::get(Item::TNT, 0, 10);
$item->setCustomName(TextFormat::RESET.TextFormat::AQUA.'A Custom Named TNT');
Player::getInventory()->addItem($item);

Now throw the item. If the above code doesn't work, try with this item...

$item = Item::get(Item::DIAMOND_SWORD, 0, 10);
$item->setCustomName(TextFormat::RESET.TextFormat::AQUA.'A Custom Named TNT');
$nbt = $item->getNamedTag();
$nbt->tag1 = new StringTag('tag1', 'A custom tag');
$nbt->tag2 = new StringTag('tag2', 'Another custom tag');
$item->setNamedTag($nbt);
//Player::getInventory()->addItem($item);

OS and versions

  • Genisys: 0fa8ebf
  • PHP: 7.0.16
  • Server OS: Ubuntu 14.04
  • Game version: 1.0.4

Crashdump, backtrace, memory dumps, plugins list or other files

@Muqsit Muqsit changed the title A Floating Inventory Issue. A Floating Inventory + NBT tags Issue. Mar 15, 2017
@JunkDaCoder
Copy link

Can confirm, if allow cheats are on there are possibilites for hackers unless there would be a plugin to cancel it

@JackNoordhuis
Copy link
Contributor

Perhaps this has something to do with the deep equals issues?

@JunkDaCoder
Copy link

@JackNoordhuis no, i went into the src code and remove all the deepequals code and replaced the equals from the official pmmp

@Muqsit
Copy link
Collaborator Author

Muqsit commented Mar 17, 2017

It works for most part if you remove the floating inventory lines off DropItemTransaction.

@JunkDaCoder
Copy link

ill keep looking to see if theres any issues, its probably 99% floating inventory though

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants