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

Inventory glitch #1470

Closed
bulkdev opened this issue Jul 16, 2016 · 11 comments
Closed

Inventory glitch #1470

bulkdev opened this issue Jul 16, 2016 · 11 comments

Comments

@bulkdev
Copy link

bulkdev commented Jul 16, 2016

My plugin uses setItem to additems to the hotbar because when i used additem players had a worse glitch than setItem

basically the player loads into a duel but the items dont show until the player either:

  • Opens inventory
  • Breaks block
  • Rapidly tap hotbar

Please fix this it's annoying. here's my code for setting Inventory
``

    public function setInv(Player $player, $level){
$player->getInventory()->clearAll();

$type = explode(".", $level);

if($type[0] == "bronze"){
$player->getInventory()->setHelmet(Item::get(298));
$player->getInventory()->setChestplate(Item::get(299));
$player->getInventory()->setLeggings(Item::get(300));
$player->getInventory()->setBoots(Item::get(301));

$player->getInventory()->setItem(0, new Item(268, 0, 1));
$player->getInventory()->setItem(1, new Item(322, 0, 3));
}

if($type[0] == "silver"){
$player->getInventory()->setHelmet(Item::get(302));
$player->getInventory()->setChestplate(Item::get(303));
$player->getInventory()->setLeggings(Item::get(304));
$player->getInventory()->setBoots(Item::get(305));

$player->getInventory()->setItem(0, new Item(272, 0, 1));
$player->getInventory()->setItem(1, new Item(322, 0, 5));
}
if($type[0] == "gold"){
$player->getInventory()->setHelmet(Item::get(315));
$player->getInventory()->setChestplate(Item::get(316));
$player->getInventory()->setLeggings(Item::get(317));
$player->getInventory()->setBoots(Item::get(318));

$player->getInventory()->setItem(0, new Item(283, 0, 1));
$player->getInventory()->setItem(1, new Item(322, 0, 8));
}
$player->getInventory()->setItem(2, new Item(364, 0, 16));
$player->getInventory()->setHotbarSlotIndex(0, 0);
$player->getInventory()->setHotbarSlotIndex(1, 1);
$player->getInventory()->setHotbarSlotIndex(2, 2);

}

@ghost
Copy link

ghost commented Jul 16, 2016

setHotbarIndex i am sure

On Saturday, July 16, 2016, Bulk Developer notifications@github.com wrote:

My plugin uses setItem to additems to the hotbar because when i used
additem players had a worse glitch than setItem

basically the player loads into a duel but the items dont show until the
player either:

  • Opens inventory
  • Breaks block
  • Rapidly tap hotbar

Please fix this it's annoying. here's my code for setting Inventory
``
public function setInv(Player $player, $level){
$player->getInventory()->clearAll();

$type = explode(".", $level);

if($type[0] == "bronze"){
$player->getInventory()->setHelmet(Item::get(298));
$player->getInventory()->setChestplate(Item::get(299));
$player->getInventory()->setLeggings(Item::get(300));
$player->getInventory()->setBoots(Item::get(301));

$player->getInventory()->setItem(0, new Item(268, 0, 1));
$player->getInventory()->setItem(1, new Item(322, 0, 3));
}

if($type[0] == "silver"){
$player->getInventory()->setHelmet(Item::get(302));
$player->getInventory()->setChestplate(Item::get(303));
$player->getInventory()->setLeggings(Item::get(304));
$player->getInventory()->setBoots(Item::get(305));

$player->getInventory()->setItem(0, new Item(272, 0, 1));
$player->getInventory()->setItem(1, new Item(322, 0, 5));
}
if($type[0] == "gold"){
$player->getInventory()->setHelmet(Item::get(315));
$player->getInventory()->setChestplate(Item::get(316));
$player->getInventory()->setLeggings(Item::get(317));
$player->getInventory()->setBoots(Item::get(318));

$player->getInventory()->setItem(0, new Item(283, 0, 1));
$player->getInventory()->setItem(1, new Item(322, 0, 8));
}
$player->getInventory()->setItem(2, new Item(364, 0, 16));
$player->getInventory()->setHotbarSlotIndex(0, 0);
$player->getInventory()->setHotbarSlotIndex(1, 1);
$player->getInventory()->setHotbarSlotIndex(2, 2);

}


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1470, or mute the thread
https://github.com/notifications/unsubscribe-auth/ALoIcZie3omjSICSw9osJEBIUwvGSAHPks5qWQ1qgaJpZM4JODKW
.

@ghost
Copy link

ghost commented Jul 16, 2016

Take that back the email just fully loaded

On Saturday, July 16, 2016, Savion LegendZzz saviondeavault@gmail.com
wrote:

setHotbarIndex i am sure

On Saturday, July 16, 2016, Bulk Developer <notifications@github.com
javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

My plugin uses setItem to additems to the hotbar because when i used
additem players had a worse glitch than setItem

basically the player loads into a duel but the items dont show until the
player either:

  • Opens inventory
  • Breaks block
  • Rapidly tap hotbar

Please fix this it's annoying. here's my code for setting Inventory
``
public function setInv(Player $player, $level){
$player->getInventory()->clearAll();

$type = explode(".", $level);

if($type[0] == "bronze"){
$player->getInventory()->setHelmet(Item::get(298));
$player->getInventory()->setChestplate(Item::get(299));
$player->getInventory()->setLeggings(Item::get(300));
$player->getInventory()->setBoots(Item::get(301));

$player->getInventory()->setItem(0, new Item(268, 0, 1));
$player->getInventory()->setItem(1, new Item(322, 0, 3));
}

if($type[0] == "silver"){
$player->getInventory()->setHelmet(Item::get(302));
$player->getInventory()->setChestplate(Item::get(303));
$player->getInventory()->setLeggings(Item::get(304));
$player->getInventory()->setBoots(Item::get(305));

$player->getInventory()->setItem(0, new Item(272, 0, 1));
$player->getInventory()->setItem(1, new Item(322, 0, 5));
}
if($type[0] == "gold"){
$player->getInventory()->setHelmet(Item::get(315));
$player->getInventory()->setChestplate(Item::get(316));
$player->getInventory()->setLeggings(Item::get(317));
$player->getInventory()->setBoots(Item::get(318));

$player->getInventory()->setItem(0, new Item(283, 0, 1));
$player->getInventory()->setItem(1, new Item(322, 0, 8));
}
$player->getInventory()->setItem(2, new Item(364, 0, 16));
$player->getInventory()->setHotbarSlotIndex(0, 0);
$player->getInventory()->setHotbarSlotIndex(1, 1);
$player->getInventory()->setHotbarSlotIndex(2, 2);

}


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1470, or mute the thread
https://github.com/notifications/unsubscribe-auth/ALoIcZie3omjSICSw9osJEBIUwvGSAHPks5qWQ1qgaJpZM4JODKW
.

@bulkdev
Copy link
Author

bulkdev commented Jul 16, 2016

@SavionLegendZzz ye thats supposed to work. Do you use this function?

@dktapps
Copy link
Contributor

dktapps commented Jul 16, 2016

Known issue. This has been fixed on the Win10 beta branch and will be merged into master in the near future. Please wait for the update :)

@dktapps dktapps closed this as completed Jul 16, 2016
@dktapps
Copy link
Contributor

dktapps commented Jul 16, 2016

Also, please do not use setHotbarSlotIndex() any more; it will be deprecated in the coming update.

@bulkdev
Copy link
Author

bulkdev commented Jul 16, 2016

Thank you @dktapps so until the next update players will still have this bug?

@dktapps
Copy link
Contributor

dktapps commented Jul 16, 2016

@ItzBulkDev yes. Don't worry though. I can't give an exact ETA but it will be merged with the fix in the near future.

@bulkdev
Copy link
Author

bulkdev commented Jul 16, 2016

@dktapps my players are really biting my ass over it. Is there an alternative. And is the gapple glitch part of this bug (players have to rop the gapple then pick it up to use it)

@dktapps
Copy link
Contributor

dktapps commented Jul 16, 2016

@ItzBulkDev not really, unless you're willing to try a non-production build that will spam the Christ out of your terminal and may also cause other bugs.

Please be patient. A few days at most.

@ZedCee
Copy link
Member

ZedCee commented Jul 16, 2016

@ItzBulkDev If you try non-production builds, be sure to backup your maps. Errors can and will over time result in lost chunks and crashes.
@Dkapps I'm so excited!

@dktapps
Copy link
Contributor

dktapps commented Jul 17, 2016

@ZedCee :P

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