Skip to content

Commit

Permalink
version 1.4 official release
Browse files Browse the repository at this point in the history
  • Loading branch information
malachi196 committed Oct 21, 2024
1 parent c699e8c commit 0481191
Show file tree
Hide file tree
Showing 21 changed files with 106 additions and 82 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.m196.projects</groupId>
<artifactId>m196-style-commands</artifactId>
<version>1.3-beta</version>
<version>1.4</version>
<packaging>jar</packaging>

<name>m196-style-commands</name>
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/com/m196/projects/commands/adminstick.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package src.main.java.com.m196.projects.commands;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import src.main.java.com.m196.projects.backend.runcommand;

public class adminstick implements CommandExecutor{
runcommand commandthing = new runcommand(); //use to run commands
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
{
if (sender instanceof Player){
if (cmd.getName().equalsIgnoreCase("adminstick")){
adminstickHandler(sender);
return true;
}
return false;
}
return false;
}
public void adminstickHandler(CommandSender sender){
String target = sender.getName();
commandthing.runMinecraftCommand("minecraft:give " + target + " stick[minecraft:attribute_modifiers=[{id:\"attack_damage\", type:\"generic.attack_damage\",amount:10000, operation:\"add_value\"}], minecraft:custom_name=\"'Admin Stick'\", minecraft:enchantments={levels:{channeling:1}}, minecraft:unbreakable={unbreaking:1}] 1", sender);
}
}
20 changes: 14 additions & 6 deletions src/main/java/com/m196/projects/commands/dropanvil.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package src.main.java.com.m196.projects.commands;

import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.Material;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import src.main.java.com.m196.projects.backend.runcommand;

public class dropanvil implements CommandExecutor {
runcommand commandthing = new runcommand(); //use to run commands
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
{
if (sender instanceof Player){
if (cmd.getName().equalsIgnoreCase("dropanvil")){ //maybe fix if args not work?
if (cmd.getName().equalsIgnoreCase("dropanvil")){
String target;
if (args.length == 0){
target = sender.getName();
Expand All @@ -30,7 +30,15 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
}
public void dropAnvilHandler(CommandSender sender, String target)
{
sender.sendMessage("May they be anvil'd!"); //This sends a message to the player
commandthing.runMinecraftCommand("execute at " + target + " run setblock ~ ~15 ~ anvil", sender);
sender.sendMessage("May " + target + " be anvil'd!"); //This sends a message to the player
Player targetPlayerObject = Bukkit.getPlayerExact(target);
if (targetPlayerObject == null){
sender.sendMessage("player not available");
return;
}
Location location = targetPlayerObject.getLocation().add(0, 15, 0);
Block block = location.getBlock();

block.setType(Material.ANVIL);
}
}
29 changes: 29 additions & 0 deletions src/main/java/com/m196/projects/commands/nm.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package src.main.java.com.m196.projects.commands;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import src.main.java.com.m196.projects.backend.runcommand;

public class nm implements CommandExecutor{
runcommand commandthing = new runcommand(); //use to run commands
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
{
if (sender instanceof Player){
if (cmd.getName().equalsIgnoreCase("nm")){
nutritionalMaceHandler(sender);
return true;
}
return false;
}
return false;
}
public void nutritionalMaceHandler(CommandSender sender){
String target = sender.getName();
commandthing.runMinecraftCommand("minecraft:give " + target + " mace[food={nutrition:20, saturation:1}]", sender);
}
}
10 changes: 7 additions & 3 deletions src/main/java/com/m196/projects/m196stylecommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,24 @@
import java.util.logging.Logger;

import src.main.java.com.m196.projects.commands.dropanvil;
import src.main.java.com.m196.projects.commands.adminstick;
import src.main.java.com.m196.projects.commands.nm;
//to build da jar run 'mvn clean package' to make da jar file

public final class m196stylecommands extends JavaPlugin{
private Logger logg = Bukkit.getLogger();
@Override
public void onEnable()
{
logg.info("m196 STYLE COMMANDS IS NOW ONLINE!!!!");
logg.info("\"m196-style commands\" IS NOW ONLINE!!!!");
this.getCommand("dropanvil").setExecutor(new dropanvil());
this.getCommand("adminstick").setExecutor(new adminstick());
this.getCommand("nm").setExecutor(new nm());
}
@Override
public void onDisable()
{
logg.info("Now shutting down!");
logg.info("Bye bye!");
logg.info("Now shutting down msc!");
logg.info("msc: Bye bye!");
}
}
10 changes: 8 additions & 2 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: m196stylecommands
version: 1.3-beta
version: 1.4
main: src.main.java.com.m196.projects.m196stylecommands
api-version: 1.21
commands:
dropanvil:
description: "drop an anvil on a player :)"
usage: "/dropanvil <player>"
usage: "/dropanvil <player>"
adminstick:
description: "obtain a stick that does 10,000 damage"
usage: "/adminstick"
nm:
description: "obtain 'nutritional mace' that is actually very healthy, while also dealing damage"
usage: "/nm"
Binary file not shown.
10 changes: 8 additions & 2 deletions target/classes/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: m196stylecommands
version: 1.3-beta
version: 1.4
main: src.main.java.com.m196.projects.m196stylecommands
api-version: 1.21
commands:
dropanvil:
description: "drop an anvil on a player :)"
usage: "/dropanvil <player>"
usage: "/dropanvil <player>"
adminstick:
description: "obtain a stick that does 10,000 damage"
usage: "/adminstick"
nm:
description: "obtain 'nutritional mace' that is actually very healthy, while also dealing damage"
usage: "/nm"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed target/m196-style-commands-1.3-beta.jar
Binary file not shown.
Binary file added target/m196-style-commands-1.4.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Created by Apache Maven 3.9.9
artifactId=m196-style-commands
groupId=com.m196.projects
version=1.3-beta
version=1.4
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
src\main\java\com\m196\projects\commands\adminstick.class
src\main\java\com\m196\projects\commands\dropanvil.class
src\main\java\com\m196\projects\commands\nm.class
src\main\java\com\m196\projects\backend\runcommand.class
src\main\java\com\m196\projects\m196stylecommands.class
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
F:\minecraft stuff\m196-style-commands-plugin\src\main\java\com\m196\projects\m196stylecommands.java
F:\minecraft stuff\m196-style-commands-plugin\src\main\java\com\m196\projects\commands\adminstick.java
F:\minecraft stuff\m196-style-commands-plugin\src\main\java\com\m196\projects\commands\dropanvil.java
F:\minecraft stuff\m196-style-commands-plugin\src\main\java\com\m196\projects\backend\runcommand.java
F:\minecraft stuff\m196-style-commands-plugin\src\main\java\com\m196\projects\commands\nm.java
Loading

0 comments on commit 0481191

Please sign in to comment.