mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-22 10:15:54 +01:00
Merge pull request #1 from TeamHRLive/detached
[Fixed] Heads in some GUI Menus
This commit is contained in:
commit
4c1cee895c
@ -582,9 +582,9 @@ public class EntityListeners implements Listener {
|
|||||||
EntityEquipment equipment = livingEntity.getEquipment();
|
EntityEquipment equipment = livingEntity.getEquipment();
|
||||||
if (equipment != null) {
|
if (equipment != null) {
|
||||||
for (ItemStack item : event.getDrops()) {
|
for (ItemStack item : event.getDrops()) {
|
||||||
if (item.equals(equipment.getHelmet()) || item.equals(equipment.getChestplate())
|
if (item.isSimilar(equipment.getHelmet()) || item.isSimilar(equipment.getChestplate())
|
||||||
|| item.equals(equipment.getLeggings()) || item.equals(equipment.getBoots())
|
|| item.isSimilar(equipment.getLeggings()) || item.isSimilar(equipment.getBoots())
|
||||||
|| item.equals(equipment.getItemInMainHand()) || item.equals(equipment.getItemInOffHand())) {
|
|| item.isSimilar(equipment.getItemInMainHand()) || item.isSimilar(equipment.getItemInOffHand())) {
|
||||||
dontMultiply.add(item);
|
dontMultiply.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -607,12 +607,18 @@ public class EntityListeners implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ItemStack is : event.getDrops()) {
|
// Only drop items that are not in the dontMultiply set
|
||||||
for (ItemStack is2 : dontMultiply) {
|
for (ItemStack item : event.getDrops()) {
|
||||||
if (!is2.isSimilar(is)) {
|
boolean shouldDrop = true;
|
||||||
livingEntity.getWorld().dropItemNaturally(livingEntity.getLocation(), is);
|
for (ItemStack dontMultiplyItem : dontMultiply) {
|
||||||
|
if (item.isSimilar(dontMultiplyItem)) {
|
||||||
|
shouldDrop = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (shouldDrop) {
|
||||||
|
livingEntity.getWorld().dropItemNaturally(livingEntity.getLocation(), item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.craftaro.skyblock.menus;
|
package com.craftaro.skyblock.menus;
|
||||||
|
|
||||||
|
import com.craftaro.core.utils.ItemUtils;
|
||||||
import com.craftaro.core.utils.NumberUtils;
|
import com.craftaro.core.utils.NumberUtils;
|
||||||
import com.craftaro.core.utils.SkullItemCreator;
|
import com.craftaro.core.utils.SkullItemCreator;
|
||||||
import com.craftaro.skyblock.SkyBlock;
|
import com.craftaro.skyblock.SkyBlock;
|
||||||
@ -11,9 +12,12 @@ import com.craftaro.skyblock.utils.player.OfflinePlayer;
|
|||||||
import com.craftaro.skyblock.visit.Visit;
|
import com.craftaro.skyblock.visit.Visit;
|
||||||
import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
|
import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
|
||||||
import com.craftaro.third_party.com.cryptomorin.xseries.XSound;
|
import com.craftaro.third_party.com.cryptomorin.xseries.XSound;
|
||||||
|
import com.craftaro.third_party.com.cryptomorin.xseries.profiles.builder.XSkull;
|
||||||
|
import com.craftaro.third_party.com.cryptomorin.xseries.profiles.objects.Profileable;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.Skull;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
@ -290,9 +294,9 @@ public class Leaderboard {
|
|||||||
|
|
||||||
ItemStack phead;
|
ItemStack phead;
|
||||||
if (playerTexture.length >= 1 && playerTexture[0] != null) {
|
if (playerTexture.length >= 1 && playerTexture[0] != null) {
|
||||||
phead = SkullItemCreator.byTextureValue(playerTexture[0]);
|
phead = XSkull.createItem().profile(new Profileable.PlayerProfileable(player)).apply();
|
||||||
} else {
|
} else {
|
||||||
phead = SkullItemCreator.byUuid(visit.getOwnerUUID());
|
phead = XSkull.createItem().profile(new Profileable.PlayerProfileable(player)).apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
nInv.addItem(
|
nInv.addItem(
|
||||||
|
@ -190,6 +190,7 @@ public class Levelling {
|
|||||||
long value = testIslandMaterials.get(materialName);
|
long value = testIslandMaterials.get(materialName);
|
||||||
Optional<XMaterial> materials = CompatibleMaterial.getMaterial(materialName);
|
Optional<XMaterial> materials = CompatibleMaterial.getMaterial(materialName);
|
||||||
|
|
||||||
|
|
||||||
if (!materials.isPresent()) {
|
if (!materials.isPresent()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,8 @@ import com.craftaro.skyblock.playerdata.PlayerDataManager;
|
|||||||
import com.craftaro.skyblock.sound.SoundManager;
|
import com.craftaro.skyblock.sound.SoundManager;
|
||||||
import com.craftaro.skyblock.utils.item.nInventoryUtil;
|
import com.craftaro.skyblock.utils.item.nInventoryUtil;
|
||||||
import com.craftaro.skyblock.utils.player.OfflinePlayer;
|
import com.craftaro.skyblock.utils.player.OfflinePlayer;
|
||||||
|
import com.craftaro.third_party.com.cryptomorin.xseries.profiles.builder.XSkull;
|
||||||
|
import com.craftaro.third_party.com.cryptomorin.xseries.profiles.objects.Profileable;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -228,9 +230,9 @@ public class Ownership {
|
|||||||
|
|
||||||
ItemStack phead;
|
ItemStack phead;
|
||||||
if (playerTexture.length >= 1 && playerTexture[0] != null) {
|
if (playerTexture.length >= 1 && playerTexture[0] != null) {
|
||||||
phead = SkullItemCreator.byTextureValue(playerTexture[0]);
|
phead = XSkull.createItem().profile(new Profileable.PlayerProfileable(player)).apply();
|
||||||
} else {
|
} else {
|
||||||
phead = SkullItemCreator.byUuid(originalOwnerUUID);
|
phead = XSkull.createItem().profile(new Profileable.PlayerProfileable(player)).apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
nInv.addItem(nInv.createItem(XMaterial.OAK_FENCE_GATE.parseItem(),
|
nInv.addItem(nInv.createItem(XMaterial.OAK_FENCE_GATE.parseItem(),
|
||||||
|
Loading…
Reference in New Issue
Block a user