initial
This commit is contained in:
7
Plugin1/.classpath
Normal file
7
Plugin1/.classpath
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="lib" path="C:/Users/jmsdesk/Documents/Minecraft Plugins/MC-Plugins/bukkit/spigot-1.13.2.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
17
Plugin1/.project
Normal file
17
Plugin1/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Plugin1</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
11
Plugin1/.settings/org.eclipse.jdt.core.prefs
Normal file
11
Plugin1/.settings/org.eclipse.jdt.core.prefs
Normal file
@@ -0,0 +1,11 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
BIN
Plugin1/bin/com/jslightham/plugin1/CommandClass.class
Normal file
BIN
Plugin1/bin/com/jslightham/plugin1/CommandClass.class
Normal file
Binary file not shown.
BIN
Plugin1/bin/com/jslightham/plugin1/Main.class
Normal file
BIN
Plugin1/bin/com/jslightham/plugin1/Main.class
Normal file
Binary file not shown.
BIN
Plugin1/bin/com/jslightham/plugin1/Time.class
Normal file
BIN
Plugin1/bin/com/jslightham/plugin1/Time.class
Normal file
Binary file not shown.
BIN
Plugin1/bin/com/jslightham/plugin1/commands/HelloCommand.class
Normal file
BIN
Plugin1/bin/com/jslightham/plugin1/commands/HelloCommand.class
Normal file
Binary file not shown.
10
Plugin1/plugin.yml
Normal file
10
Plugin1/plugin.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
name: Plugin1
|
||||
version: 1.0
|
||||
main: com.jslightham.plugin1.Main
|
||||
description: Test1!
|
||||
|
||||
commands:
|
||||
test:
|
||||
usage: /<command>
|
||||
heal:
|
||||
usage: /<command>
|
||||
30
Plugin1/src/com/jslightham/plugin1/CommandClass.java
Normal file
30
Plugin1/src/com/jslightham/plugin1/CommandClass.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.jslightham.plugin1;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CommandClass implements CommandExecutor{
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String arg2, String[] arg3) {
|
||||
if(command.getName().equals("heal")) {
|
||||
if(sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
if(arg3.length > 0) {
|
||||
try {
|
||||
player.setHealth(Integer.parseInt(arg3[0]));
|
||||
System.out.println("Your health is now: " + arg3[0]);
|
||||
}catch (Exception e) {
|
||||
player.sendMessage("That is not a valid health!");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
System.out.println("Command may only be executed by players. ");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
28
Plugin1/src/com/jslightham/plugin1/Main.java
Normal file
28
Plugin1/src/com/jslightham/plugin1/Main.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.jslightham.plugin1;
|
||||
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.jslightham.plugin1.commands.HelloCommand;
|
||||
|
||||
public class Main extends JavaPlugin{
|
||||
|
||||
public int time = 2;
|
||||
private Time t = new Time(this);
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onEnable() {
|
||||
t.getTime();
|
||||
this.getCommand("test").setExecutor((CommandExecutor)new HelloCommand());
|
||||
this.getCommand("heal").setExecutor((CommandExecutor)new CommandClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
|
||||
}
|
||||
}
|
||||
12
Plugin1/src/com/jslightham/plugin1/Time.java
Normal file
12
Plugin1/src/com/jslightham/plugin1/Time.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.jslightham.plugin1;
|
||||
|
||||
public class Time {
|
||||
Main plugin;
|
||||
public Time(Main plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void getTime() {
|
||||
System.out.println(plugin.time);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jslightham.plugin1.commands;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class HelloCommand implements CommandExecutor{
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
Player player = (Player) sender;
|
||||
if(sender instanceof Player)
|
||||
player.sendMessage("Hello there");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user