begun implimenting gravity gauntlet mechnics
This commit is contained in:
parent
1883a19dbc
commit
660e131127
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.
@ -3,7 +3,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = 'com.newt-tech'
|
group = 'com.newt-tech'
|
||||||
version = '1.8-BETA'
|
version = '1.9-RELEASE'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
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.
@ -1,5 +1,5 @@
|
|||||||
name: CoswayUtil
|
name: CoswayUtil
|
||||||
version: '1.8-BETA'
|
version: '1.9-RELEASE'
|
||||||
main: CoswayUtil.CoswayUtil
|
main: CoswayUtil.CoswayUtil
|
||||||
description: "utility plugin for Cosway servers, a yescraft network server"
|
description: "utility plugin for Cosway servers, a yescraft network server"
|
||||||
api-version: '1.21'
|
api-version: '1.21'
|
||||||
@ -13,3 +13,7 @@ commands:
|
|||||||
description: Throws nearest player in a 10 block radius of you
|
description: Throws nearest player in a 10 block radius of you
|
||||||
usage: "/throw"
|
usage: "/throw"
|
||||||
permission: cosway.throw
|
permission: cosway.throw
|
||||||
|
commands:
|
||||||
|
gravitygauntlet:
|
||||||
|
description: "Gives the player a Gravity Gauntlet"
|
||||||
|
usage: "/gravitygauntlet"
|
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,6 +21,8 @@ import org.bukkit.util.Vector;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.bukkit.block.data.type.RespawnAnchor;
|
import org.bukkit.block.data.type.RespawnAnchor;
|
||||||
|
import CoswayUtil.GravityGauntletCommand;
|
||||||
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -59,6 +61,8 @@ public final class CoswayUtil extends JavaPlugin implements Listener {
|
|||||||
}.runTaskTimer(this, 0, 2); // Runs every 10 ticks (0.5 seconds)
|
}.runTaskTimer(this, 0, 2); // Runs every 10 ticks (0.5 seconds)
|
||||||
// Register Gravity Gauntlet
|
// Register Gravity Gauntlet
|
||||||
new GravityGauntlet(this);
|
new GravityGauntlet(this);
|
||||||
|
// Register command
|
||||||
|
this.getCommand("gravitygauntlet").setExecutor(new GravityGauntletCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
34
src/main/java/CoswayUtil/GravityGauntletCommand.java
Normal file
34
src/main/java/CoswayUtil/GravityGauntletCommand.java
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package CoswayUtil;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
public class GravityGauntletCommand implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
Player player = (Player) sender;
|
||||||
|
ItemStack gauntlet = new ItemStack(Material.NETHERITE_HOE); // You can change this to any item you prefer
|
||||||
|
ItemMeta meta = gauntlet.getItemMeta();
|
||||||
|
|
||||||
|
if (meta != null) {
|
||||||
|
meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Gravity Gauntlet");
|
||||||
|
meta.setUnbreakable(true);
|
||||||
|
gauntlet.setItemMeta(meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
player.getInventory().addItem(gauntlet);
|
||||||
|
player.sendMessage(ChatColor.GREEN + "You have been given the Gravity Gauntlet!");
|
||||||
|
} else {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Only players can use this command!");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -13,3 +13,7 @@ commands:
|
|||||||
description: Throws nearest player in a 10 block radius of you
|
description: Throws nearest player in a 10 block radius of you
|
||||||
usage: "/throw"
|
usage: "/throw"
|
||||||
permission: cosway.throw
|
permission: cosway.throw
|
||||||
|
commands:
|
||||||
|
gravitygauntlet:
|
||||||
|
description: "Gives the player a Gravity Gauntlet"
|
||||||
|
usage: "/gravitygauntlet"
|
Loading…
Reference in New Issue
Block a user