Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ethan 2020-08-09 18:06:56 -04:00
commit 7743458445
2 changed files with 4 additions and 3 deletions

View File

@ -259,7 +259,7 @@ public class ItemBrowser extends PluginInventory {
} }
if (item.getItemMeta().getDisplayName().equals(ChatColor.GREEN + "Download Default Resourcepack")) { if (item.getItemMeta().getDisplayName().equals(ChatColor.GREEN + "Download Default Resourcepack")) {
MMOLib.plugin.getNMS().sendJson(player, "[{\"text\":\"Click to download!\",\"color\":\"green\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://mythiccraft.io/resources/MICustomBlockPack.zip\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":[\"\",{\"text\":\"https://drive.google.com/uc?id=1FjV7y-2cn8qzSiktZ2CUXmkdjepXdj5N\",\"italic\":true,\"color\":\"white\"}]}}]"); MMOLib.plugin.getVersion().getWrapper().sendJson(player, "[{\"text\":\"Click to download!\",\"color\":\"green\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://mythiccraft.io/resources/MICustomBlockPack.zip\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":[\"\",{\"text\":\"https://drive.google.com/uc?id=1FjV7y-2cn8qzSiktZ2CUXmkdjepXdj5N\",\"italic\":true,\"color\":\"white\"}]}}]");
player.closeInventory(); player.closeInventory();
return; return;
} }
@ -288,7 +288,8 @@ public class ItemBrowser extends PluginInventory {
} else { } else {
if (event.getAction() == InventoryAction.PICKUP_ALL) { if (event.getAction() == InventoryAction.PICKUP_ALL) {
ItemStack generatedItem = (NBTItem.get(item).getBoolean("UNSTACKABLE")) // this refreshes the item if it's unstackable // this refreshes the item if it's unstackable
ItemStack generatedItem = (NBTItem.get(item).getBoolean("UNSTACKABLE"))
? MMOItems.plugin.getItems().getMMOItem(type, id).clone().newBuilder().build() ? MMOItems.plugin.getItems().getMMOItem(type, id).clone().newBuilder().build()
: removeLastLoreLines(item, 3); : removeLastLoreLines(item, 3);
player.getInventory().addItem(generatedItem); player.getInventory().addItem(generatedItem);

View File

@ -59,7 +59,7 @@ public class CustomBlockListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void c(BlockPlaceEvent event) { public void c(BlockPlaceEvent event) {
if (!event.isCancelled() && !isMushroomBlock(event.getBlockPlaced().getType())) { if (!event.isCancelled() && !isMushroomBlock(event.getBlockPlaced().getType())) {
NBTItem nbtItem = MMOLib.plugin.getNMS().getNBTItem(event.getItemInHand()); NBTItem nbtItem = MMOLib.plugin.getVersion().getWrapper().getNBTItem(event.getItemInHand());
int blockId = nbtItem.getInteger("MMOITEMS_BLOCK_ID"); int blockId = nbtItem.getInteger("MMOITEMS_BLOCK_ID");
if (blockId > 160 || blockId < 1 || blockId == 54) // checks if block is a custom block if (blockId > 160 || blockId < 1 || blockId == 54) // checks if block is a custom block
return; return;