This commit is contained in:
jslightham
2019-06-10 15:13:36 -04:00
commit 6115bb92a1
218 changed files with 7026 additions and 0 deletions

7
Plugin1/.classpath Normal file
View 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
View 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>

View 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

Binary file not shown.

Binary file not shown.

Binary file not shown.

10
Plugin1/plugin.yml Normal file
View File

@@ -0,0 +1,10 @@
name: Plugin1
version: 1.0
main: com.jslightham.plugin1.Main
description: Test1!
commands:
test:
usage: /<command>
heal:
usage: /<command>

View 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;
}
}

View 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() {
}
}

View 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);
}
}

View File

@@ -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;
}
}