Ranger mode and Bow arrow shooting fixed, while still preventing them
from being hit by Strikers. Obey hidden flags with item description.
This commit is contained in:
parent
22e1dc51bc
commit
e779ccb420
Binary file not shown.
@ -26,6 +26,7 @@ import org.bukkit.entity.Item;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.ItemFlag;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.BannerMeta;
|
import org.bukkit.inventory.meta.BannerMeta;
|
||||||
import org.bukkit.inventory.meta.BlockStateMeta;
|
import org.bukkit.inventory.meta.BlockStateMeta;
|
||||||
@ -125,6 +126,7 @@ public class WorldShop {
|
|||||||
if (item.getType()==Material.ENCHANTED_BOOK) {
|
if (item.getType()==Material.ENCHANTED_BOOK) {
|
||||||
if (item.getItemMeta() instanceof EnchantmentStorageMeta) {
|
if (item.getItemMeta() instanceof EnchantmentStorageMeta) {
|
||||||
EnchantmentStorageMeta e = (EnchantmentStorageMeta)item.getItemMeta();
|
EnchantmentStorageMeta e = (EnchantmentStorageMeta)item.getItemMeta();
|
||||||
|
if (!e.getItemFlags().contains(ItemFlag.HIDE_ENCHANTS)) {
|
||||||
for (int i=0;i<Enchantment.values().length;i++) {
|
for (int i=0;i<Enchantment.values().length;i++) {
|
||||||
if (e.hasStoredEnchant((Enchantment.values()[i]))) {
|
if (e.hasStoredEnchant((Enchantment.values()[i]))) {
|
||||||
message+="\n"+ChatColor.GRAY+getRealName(Enchantment.values()[i])+" "+toRomanNumeral(e.getStoredEnchantLevel(Enchantment.getByName(Enchantment.values()[i].getName()))); //This is an enchantment we have.
|
message+="\n"+ChatColor.GRAY+getRealName(Enchantment.values()[i])+" "+toRomanNumeral(e.getStoredEnchantLevel(Enchantment.getByName(Enchantment.values()[i].getName()))); //This is an enchantment we have.
|
||||||
@ -132,6 +134,7 @@ public class WorldShop {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (item.getType()==Material.WRITTEN_BOOK) {
|
if (item.getType()==Material.WRITTEN_BOOK) {
|
||||||
if (item.getItemMeta() instanceof BookMeta) {
|
if (item.getItemMeta() instanceof BookMeta) {
|
||||||
BookMeta book = (BookMeta)item.getItemMeta();
|
BookMeta book = (BookMeta)item.getItemMeta();
|
||||||
@ -143,6 +146,7 @@ public class WorldShop {
|
|||||||
if (item.getType()==Material.POTION || item.getType()==Material.SPLASH_POTION || item.getType()==Material.LINGERING_POTION) {
|
if (item.getType()==Material.POTION || item.getType()==Material.SPLASH_POTION || item.getType()==Material.LINGERING_POTION) {
|
||||||
if (item.getItemMeta() instanceof PotionMeta) {
|
if (item.getItemMeta() instanceof PotionMeta) {
|
||||||
PotionMeta pot = (PotionMeta)item.getItemMeta();
|
PotionMeta pot = (PotionMeta)item.getItemMeta();
|
||||||
|
if (!pot.getItemFlags().contains(ItemFlag.HIDE_POTION_EFFECTS)) {
|
||||||
List<PotionEffect> effects = pot.getCustomEffects();
|
List<PotionEffect> effects = pot.getCustomEffects();
|
||||||
|
|
||||||
for (int i=0;i<effects.size();i++) {
|
for (int i=0;i<effects.size();i++) {
|
||||||
@ -215,7 +219,7 @@ public class WorldShop {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5375,6 +5375,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
arr.setCustomName("HIT");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5399,7 +5400,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ev.getProjectile().getType()==EntityType.TIPPED_ARROW)) {
|
ev.getProjectile().getType()==EntityType.TIPPED_ARROW)) {
|
||||||
//Now we know this is a player who shot a regular old arrow.
|
//Now we know this is a player who shot a regular old arrow.
|
||||||
final Player p = (Player)ev.getEntity();
|
final Player p = (Player)ev.getEntity();
|
||||||
ev.getProjectile().setCustomName("HIT");
|
|
||||||
//We need to give one back to them.
|
//We need to give one back to them.
|
||||||
if (ev.getProjectile().getType()==EntityType.ARROW) {
|
if (ev.getProjectile().getType()==EntityType.ARROW) {
|
||||||
//This was an arrow quiver. We need to verify that, check the player's inventory for one.
|
//This was an arrow quiver. We need to verify that, check the player's inventory for one.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user