mirror of
https://github.com/kaboomserver/weapons.git
synced 2024-05-19 19:41:21 +00:00
Fix italic text
This commit is contained in:
parent
64e7b5b5f1
commit
2bb8c2f4d4
|
@ -10,7 +10,9 @@ import org.bukkit.entity.Player;
|
|||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
|
||||
public final class CommandWeapons implements CommandExecutor {
|
||||
private void addWeapon(final Inventory inventory, final Material material,
|
||||
|
@ -32,16 +34,26 @@ public final class CommandWeapons implements CommandExecutor {
|
|||
final Player player = (Player) sender;
|
||||
final Inventory inventory = Bukkit.createInventory(null, 18, Component.text("Weapons"));
|
||||
|
||||
addWeapon(inventory, Material.ANVIL, Component.text("Anvil Dropper"));
|
||||
addWeapon(inventory, Material.SPECTRAL_ARROW, Component.text("Archer"));
|
||||
addWeapon(inventory, Material.FIRE_CHARGE, Component.text("Armageddon"));
|
||||
addWeapon(inventory, Material.MAGMA_CREAM, Component.text("Blobinator"));
|
||||
addWeapon(inventory, Material.EGG, Component.text("Grenade"));
|
||||
addWeapon(inventory, Material.BLAZE_POWDER, Component.text("Laser"));
|
||||
addWeapon(inventory, Material.STICK, Component.text("Lightning Stick"));
|
||||
addWeapon(inventory, Material.GOLDEN_HORSE_ARMOR, Component.text("Machine Gun"));
|
||||
addWeapon(inventory, Material.BLAZE_ROD, Component.text("Nuker"));
|
||||
addWeapon(inventory, Material.IRON_HORSE_ARMOR, Component.text("Sniper"));
|
||||
addWeapon(inventory, Material.ANVIL, Component.text("Anvil Dropper")
|
||||
.decoration(TextDecoration.ITALIC, false));
|
||||
addWeapon(inventory, Material.SPECTRAL_ARROW, Component.text("Archer")
|
||||
.decoration(TextDecoration.ITALIC, false));
|
||||
addWeapon(inventory, Material.FIRE_CHARGE, Component.text("Armageddon")
|
||||
.decoration(TextDecoration.ITALIC, false));
|
||||
addWeapon(inventory, Material.MAGMA_CREAM, Component.text("Blobinator")
|
||||
.decoration(TextDecoration.ITALIC, false));
|
||||
addWeapon(inventory, Material.EGG, Component.text("Grenade")
|
||||
.decoration(TextDecoration.ITALIC, false));
|
||||
addWeapon(inventory, Material.BLAZE_POWDER, Component.text("Laser")
|
||||
.decoration(TextDecoration.ITALIC, false));
|
||||
addWeapon(inventory, Material.STICK, Component.text("Lightning Stick")
|
||||
.decoration(TextDecoration.ITALIC, false));
|
||||
addWeapon(inventory, Material.GOLDEN_HORSE_ARMOR, Component.text("Machine Gun")
|
||||
.decoration(TextDecoration.ITALIC, false));
|
||||
addWeapon(inventory, Material.BLAZE_ROD, Component.text("Nuker")
|
||||
.decoration(TextDecoration.ITALIC, false));
|
||||
addWeapon(inventory, Material.IRON_HORSE_ARMOR, Component.text("Sniper")
|
||||
.decoration(TextDecoration.ITALIC, false));
|
||||
player.openInventory(inventory);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.bukkit.World;
|
|||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
|
||||
public final class WeaponAnvilDropper {
|
||||
private WeaponAnvilDropper() {
|
||||
|
@ -13,7 +14,8 @@ public final class WeaponAnvilDropper {
|
|||
|
||||
public static void leftClick(final Material item, final Component name,
|
||||
final PlayerInteractEvent event) {
|
||||
if (item == Material.ANVIL && Component.text("Anvil Dropper").equals(name)) {
|
||||
if (item == Material.ANVIL && Component.text("Anvil Dropper")
|
||||
.decoration(TextDecoration.ITALIC, false).equals(name)) {
|
||||
final int min = -2;
|
||||
final int max = 2;
|
||||
|
||||
|
|
|
@ -17,11 +17,13 @@ import org.bukkit.util.Vector;
|
|||
import com.destroystokyo.paper.event.entity.ProjectileCollideEvent;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
|
||||
public final class WeaponArcher implements Listener {
|
||||
public static void leftClick(final Material item, final Component name,
|
||||
final PlayerInteractEvent event) {
|
||||
if (item == Material.SPECTRAL_ARROW && Component.text("Archer").equals(name)) {
|
||||
if (item == Material.SPECTRAL_ARROW && Component.text("Archer")
|
||||
.decoration(TextDecoration.ITALIC, false).equals(name)) {
|
||||
final Player player = event.getPlayer();
|
||||
final World world = player.getWorld();
|
||||
|
||||
|
|
|
@ -17,11 +17,13 @@ import org.bukkit.util.Vector;
|
|||
import com.destroystokyo.paper.event.entity.ProjectileCollideEvent;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
|
||||
public final class WeaponArmageddon implements Listener {
|
||||
public static void leftClick(final Material item, final Component name,
|
||||
final PlayerInteractEvent event) {
|
||||
if (item == Material.FIRE_CHARGE && Component.text("Armageddon").equals(name)) {
|
||||
if (item == Material.FIRE_CHARGE && Component.text("Armageddon")
|
||||
.decoration(TextDecoration.ITALIC, false).equals(name)) {
|
||||
final Player player = event.getPlayer();
|
||||
final World world = player.getWorld();
|
||||
|
||||
|
|
|
@ -21,13 +21,15 @@ import org.bukkit.util.Vector;
|
|||
import com.destroystokyo.paper.event.entity.ProjectileCollideEvent;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
|
||||
import pw.kaboom.weapons.Main;
|
||||
|
||||
public final class WeaponBlobinator implements Listener {
|
||||
public static void leftClick(final Material item, final Component name,
|
||||
final PlayerInteractEvent event) {
|
||||
if (item == Material.MAGMA_CREAM && Component.text("Blobinator").equals(name)) {
|
||||
if (item == Material.MAGMA_CREAM && Component.text("Blobinator")
|
||||
.decoration(TextDecoration.ITALIC, false).equals(name)) {
|
||||
final Player player = event.getPlayer();
|
||||
final Location eyeLocation = player.getEyeLocation();
|
||||
final Vector velocity = eyeLocation.getDirection().multiply(8);
|
||||
|
|
|
@ -15,11 +15,13 @@ import org.bukkit.event.player.PlayerEggThrowEvent;
|
|||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
|
||||
public final class WeaponGrenade implements Listener {
|
||||
public static void rightClick(final Material item, final Component name,
|
||||
final PlayerInteractEvent event) {
|
||||
if (item == Material.EGG && Component.text("Grenade").equals(name)) {
|
||||
if (item == Material.EGG && Component.text("Grenade")
|
||||
.decoration(TextDecoration.ITALIC, false).equals(name)) {
|
||||
event.setCancelled(true);
|
||||
|
||||
final Player player = event.getPlayer();
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.bukkit.util.BlockIterator;
|
|||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
|
||||
public final class WeaponLaser {
|
||||
private WeaponLaser() {
|
||||
|
@ -21,7 +22,8 @@ public final class WeaponLaser {
|
|||
|
||||
public static void rightClick(final Material item, final Component name,
|
||||
final PlayerInteractEvent event) {
|
||||
if (item == Material.BLAZE_POWDER && Component.text("Laser").equals(name)) {
|
||||
if (item == Material.BLAZE_POWDER && Component.text("Laser")
|
||||
.decoration(TextDecoration.ITALIC, false).equals(name)) {
|
||||
final Player player = event.getPlayer();
|
||||
final Location eyeLocation = player.getEyeLocation();
|
||||
final Vector direction = eyeLocation.getDirection();
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.bukkit.World;
|
|||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
|
||||
public final class WeaponLightningStick {
|
||||
private WeaponLightningStick() {
|
||||
|
@ -15,7 +16,8 @@ public final class WeaponLightningStick {
|
|||
|
||||
public static void leftClick(final Material item, final Component name,
|
||||
final PlayerInteractEvent event) {
|
||||
if (item == Material.STICK && Component.text("Lightning Stick").equals(name)) {
|
||||
if (item == Material.STICK && Component.text("Lightning Stick")
|
||||
.decoration(TextDecoration.ITALIC, false).equals(name)) {
|
||||
final int maxDistance = 100;
|
||||
final Location lookLocation = event.getPlayer().getTargetBlock(
|
||||
(Set<Material>) null, maxDistance).getLocation();
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.bukkit.util.Vector;
|
|||
import com.destroystokyo.paper.event.entity.ProjectileCollideEvent;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
|
||||
import pw.kaboom.weapons.Main;
|
||||
|
||||
|
@ -34,7 +35,8 @@ public final class WeaponMachineGun implements Listener {
|
|||
|
||||
public static void rightClick(final Material item, final Component name,
|
||||
final PlayerInteractEvent event) {
|
||||
if (item == Material.GOLDEN_HORSE_ARMOR && Component.text("Machine Gun").equals(name)) {
|
||||
if (item == Material.GOLDEN_HORSE_ARMOR && Component.text("Machine Gun")
|
||||
.decoration(TextDecoration.ITALIC, false).equals(name)) {
|
||||
final UUID playerUUID = event.getPlayer().getUniqueId();
|
||||
|
||||
if (!machineGunActive.contains(playerUUID)) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
|||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
|
||||
public final class WeaponNuker {
|
||||
private WeaponNuker() {
|
||||
|
@ -17,7 +18,8 @@ public final class WeaponNuker {
|
|||
|
||||
public static void leftClick(final Material item, final Component name,
|
||||
final PlayerInteractEvent event) {
|
||||
if (item == Material.BLAZE_ROD && Component.text("Nuker").equals(name)) {
|
||||
if (item == Material.BLAZE_ROD && Component.text("Nuker")
|
||||
.decoration(TextDecoration.ITALIC, false).equals(name)) {
|
||||
final Player player = event.getPlayer();
|
||||
final Location eyeLocation = player.getEyeLocation();
|
||||
final Vector velocity = eyeLocation.getDirection().multiply(10);
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.bukkit.potion.PotionEffectType;
|
|||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
|
||||
public final class WeaponSniper {
|
||||
private WeaponSniper() {
|
||||
|
@ -19,7 +20,8 @@ public final class WeaponSniper {
|
|||
|
||||
public static void leftClick(final Material item, final Component name,
|
||||
final PlayerInteractEvent event) {
|
||||
if (item == Material.IRON_HORSE_ARMOR && Component.text("Sniper").equals(name)) {
|
||||
if (item == Material.IRON_HORSE_ARMOR && Component.text("Sniper")
|
||||
.decoration(TextDecoration.ITALIC, false).equals(name)) {
|
||||
final Player player = event.getPlayer();
|
||||
final Location eyeLocation = player.getEyeLocation();
|
||||
final Vector velocity = eyeLocation.getDirection().multiply(12);
|
||||
|
@ -44,7 +46,8 @@ public final class WeaponSniper {
|
|||
|
||||
public static void rightClick(final Material item, final Component name,
|
||||
final PlayerInteractEvent event) {
|
||||
if (item == Material.IRON_HORSE_ARMOR && Component.text("Sniper").equals(name)) {
|
||||
if (item == Material.IRON_HORSE_ARMOR && Component.text("Sniper")
|
||||
.decoration(TextDecoration.ITALIC, false).equals(name)) {
|
||||
final Player player = event.getPlayer();
|
||||
|
||||
if (player.hasPotionEffect(PotionEffectType.SLOW)) {
|
||||
|
|
Loading…
Reference in a new issue