tweaked launch stick mechanics and added more useful info to other utility mechanics
This commit is contained in:
parent
86b28773a5
commit
9fcb081c5c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -21,3 +21,7 @@ commands:
|
|||||||
description: "Gives player a levitation wand"
|
description: "Gives player a levitation wand"
|
||||||
usage: "/getwand"
|
usage: "/getwand"
|
||||||
permission: CoswayUtil.wand
|
permission: CoswayUtil.wand
|
||||||
|
launchstick:
|
||||||
|
description: give player a stick to use for launching themselves
|
||||||
|
usage: /launchstick
|
||||||
|
permission: CoswayUtil.launchStick
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -9,6 +9,8 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
public class GravityGauntletCommand implements CommandExecutor {
|
public class GravityGauntletCommand implements CommandExecutor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -20,6 +22,7 @@ public class GravityGauntletCommand implements CommandExecutor {
|
|||||||
|
|
||||||
if (meta != null) {
|
if (meta != null) {
|
||||||
meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Gravity Gauntlet");
|
meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Gravity Gauntlet");
|
||||||
|
meta.setLore(Collections.singletonList(ChatColor.GOLD + "Right Click to pull, Shift+Right Click to throw"));
|
||||||
meta.setUnbreakable(true);
|
meta.setUnbreakable(true);
|
||||||
gauntlet.setItemMeta(meta);
|
gauntlet.setItemMeta(meta);
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package CoswayUtil;
|
package CoswayUtil;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.*;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -45,8 +43,9 @@ public class LaunchStick implements Listener {
|
|||||||
|
|
||||||
// Add player to no-fall damage list
|
// Add player to no-fall damage list
|
||||||
noFallPlayers.add(player);
|
noFallPlayers.add(player);
|
||||||
|
player.getWorld().playSound(player.getLocation(), Sound.ENTITY_BREEZE_JUMP,10,0);
|
||||||
player.sendMessage(ChatColor.GREEN + "You launched yourself forward!");
|
player.getWorld().playEffect(player.getLocation(), Effect.TRIAL_SPAWNER_DETECT_PLAYER_OMINOUS,1);
|
||||||
|
//player.sendMessage(ChatColor.GREEN + "You launched yourself forward!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent fall damage for launched players
|
// Prevent fall damage for launched players
|
||||||
|
@ -13,6 +13,7 @@ import org.bukkit.persistence.PersistentDataType;
|
|||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@ -57,7 +58,7 @@ public class MobLevitationWand implements Listener {
|
|||||||
|
|
||||||
|
|
||||||
private boolean isLevitationWand(ItemStack item) {
|
private boolean isLevitationWand(ItemStack item) {
|
||||||
if (item == null || item.getType() != Material.STICK || !item.hasItemMeta()) return false;
|
if (item == null || item.getType() != Material.CARROT_ON_A_STICK || !item.hasItemMeta()) return false;
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
return meta.getPersistentDataContainer().has(wandKey, PersistentDataType.STRING);
|
return meta.getPersistentDataContainer().has(wandKey, PersistentDataType.STRING);
|
||||||
}
|
}
|
||||||
@ -117,9 +118,10 @@ public class MobLevitationWand implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack createWand() {
|
public static ItemStack createWand() {
|
||||||
ItemStack wand = new ItemStack(Material.STICK);
|
ItemStack wand = new ItemStack(Material.CARROT_ON_A_STICK);
|
||||||
ItemMeta meta = wand.getItemMeta();
|
ItemMeta meta = wand.getItemMeta();
|
||||||
meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Levitation Wand");
|
meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Levitation Wand");
|
||||||
|
meta.setLore(Collections.singletonList(ChatColor.GOLD + "Right Click near a mob to pick it up"));
|
||||||
meta.getPersistentDataContainer().set(new NamespacedKey("coswayutil", "levitation_wand"), PersistentDataType.STRING, "true");
|
meta.getPersistentDataContainer().set(new NamespacedKey("coswayutil", "levitation_wand"), PersistentDataType.STRING, "true");
|
||||||
wand.setItemMeta(meta);
|
wand.setItemMeta(meta);
|
||||||
return wand;
|
return wand;
|
||||||
|
Loading…
Reference in New Issue
Block a user