1.0.0-SNAPSHOT-U65

+ Removed need for NBTFactory
+ Added an ignore for players in creative/spectator for targeting
This commit is contained in:
Charles 2018-11-19 15:49:50 +08:00
parent 21cd7c02ec
commit 33c5438445
4 changed files with 15 additions and 17 deletions

View File

@ -4,6 +4,7 @@ import com.songoda.epicbosses.holder.IActiveHolder;
import com.songoda.epicbosses.managers.BossTargetManager;
import com.songoda.epicbosses.utils.ServerUtils;
import lombok.Getter;
import org.bukkit.GameMode;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
@ -59,7 +60,7 @@ public abstract class TargetHandler<Holder extends IActiveHolder> implements ITa
if(livingEntity instanceof Player) {
Player player = (Player) livingEntity;
if(player.getGameMode() == GameMode.SPECTATOR || player.getGameMode() == GameMode.CREATIVE) continue;
}
nearbyEntities.add(livingEntity);

View File

@ -2,7 +2,6 @@ package com.songoda.epicbosses.utils.itemstack;
import com.songoda.epicbosses.utils.IReplaceableConverter;
import com.songoda.epicbosses.utils.StringUtils;
import com.songoda.epicbosses.utils.factory.NbtFactory;
import com.songoda.epicbosses.utils.itemstack.converters.EnchantConverter;
import com.songoda.epicbosses.utils.itemstack.converters.MaterialConverter;
import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
@ -170,11 +169,7 @@ public class ItemStackConverter implements IReplaceableConverter<ItemStackHolder
}
if(isGlowing != null && isGlowing) {
ItemStack craftStack = NbtFactory.getCraftItemStack(itemStack);
NbtFactory.NbtCompound compound = NbtFactory.fromItemTag(craftStack);
compound.put("ench", NbtFactory.createList());
return craftStack;
//TODO
}
if(amount != null && amount > 1) {

View File

@ -2,7 +2,7 @@ package com.songoda.epicbosses.utils.itemstack;
import com.songoda.epicbosses.utils.NumberUtils;
import com.songoda.epicbosses.utils.StringUtils;
import com.songoda.epicbosses.utils.factory.NbtFactory;
//import com.songoda.epicbosses.utils.factory.NbtFactory;
import com.songoda.epicbosses.utils.itemstack.enchants.GlowEnchant;
import com.songoda.epicbosses.utils.itemstack.holder.ItemStackHolder;
import org.bukkit.ChatColor;
@ -62,14 +62,16 @@ public class ItemStackUtils {
if(compoundData == null || compoundData.isEmpty()) return cloneStack;
ItemStack craftStack = NbtFactory.getCraftItemStack(cloneStack);
NbtFactory.NbtCompound compound = NbtFactory.fromItemTag(craftStack);
for(String s : compoundData.keySet()) {
compound.put(s, compoundData.get(s));
}
return craftStack;
// TODO
// ItemStack craftStack = NbtFactory.getCraftItemStack(cloneStack);
// NbtFactory.NbtCompound compound = NbtFactory.fromItemTag(craftStack);
//
// for(String s : compoundData.keySet()) {
// compound.put(s, compoundData.get(s));
// }
//
// return craftStack;
return cloneStack;
}
public static ItemStack createItemStack(ConfigurationSection configurationSection) {

View File

@ -19,7 +19,7 @@
</modules>
<properties>
<plugin.version>maven-version-number-SNAPSHOT-U64</plugin.version>
<plugin.version>maven-version-number-SNAPSHOT-U65</plugin.version>
<plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
<plugin.author>AMinecraftDev</plugin.author>