commit 30b6948d42b8a1b8441d4e2b9df3fc12378691b0 Author: sigonasr2 Date: Fri Dec 8 22:39:43 2017 -0600 Initial setup of TwosideKeeper4. Add in basic features to handle server. diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..74140ff --- /dev/null +++ b/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae3c172 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/.project b/.project new file mode 100644 index 0000000..db6b660 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + TwosideKeeper4 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..bb35fa0 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -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 diff --git a/plugin.yml b/plugin.yml new file mode 100644 index 0000000..d39cfaa --- /dev/null +++ b/plugin.yml @@ -0,0 +1,10 @@ +name: TwosideKeeper4 +main: sig.plugin.TwosideKeeper.TwosideKeeper4.main +version: 3.99a +loadbefore: [aPlugin] +commands: + scan: + description: Analyzes the item found above the block you are looking at. + usage: /scan + permission: TwosideKeeper.admin + permission-message: You don't have permission to scan a block. \ No newline at end of file diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper4/advanced/AdvancedBlock.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/advanced/AdvancedBlock.java new file mode 100644 index 0000000..977e9b8 --- /dev/null +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/advanced/AdvancedBlock.java @@ -0,0 +1,21 @@ +package sig.plugin.TwosideKeeper.TwosideKeeper4.advanced; + +import org.bukkit.block.Block; +import org.bukkit.entity.Item; + +public class AdvancedBlock{ + Block b; + Item holdingitem; + + public AdvancedBlock(Block b) { + this.b = b; + this.holdingitem = getItemAboveBlock(); + } + + private Item getItemAboveBlock() { + Entity[] ents = getNearbyEntities(1); + return null; + } + + +} \ No newline at end of file diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper4/advanced/AdvancedLocation.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/advanced/AdvancedLocation.java new file mode 100644 index 0000000..d906c80 --- /dev/null +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/advanced/AdvancedLocation.java @@ -0,0 +1,29 @@ +package sig.plugin.TwosideKeeper.TwosideKeeper4.advanced; + +import java.util.Collection; +import java.util.function.Predicate; + +import org.bukkit.Location; +import org.bukkit.block.Block; +import org.bukkit.entity.Entity; + +public class AdvancedLocation { + Location l; + + public AdvancedLocation(Block b) { + this(b.getLocation()); + } + + public AdvancedLocation(Entity e) { + this(e.getLocation()); + } + + public AdvancedLocation(Location l) { + this.l = l; + } + + public Collection getNearbyEntities(double distance) { + return l.getWorld().getNearbyEntities(l, distance, distance, distance).removeIf()) + } + +} diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper4/commands/CommandHandler.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/commands/CommandHandler.java new file mode 100644 index 0000000..56c6f69 --- /dev/null +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/commands/CommandHandler.java @@ -0,0 +1,22 @@ +package sig.plugin.TwosideKeeper.TwosideKeeper4.commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; + +public class CommandHandler { + CommandSender sender; + Command cmd; + String label; + String[] args; + + public CommandHandler(CommandSender sender, Command command, String label, String[] args) { + this.sender = sender; + this.cmd = command; + this.label = label; + this.args = args; + } + + public boolean runCommand() { + + } +} diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper4/commands/CommandResult.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/commands/CommandResult.java new file mode 100644 index 0000000..4b62129 --- /dev/null +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/commands/CommandResult.java @@ -0,0 +1,12 @@ +package sig.plugin.TwosideKeeper.TwosideKeeper4.commands; + +public enum CommandResult { + OKAY("Command executed with no issues."), + NOTAPLAYER("This command can only be issued by a player!"); + + String response; + + CommandResult(String response) { + this.response = response; + } +} diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper4/commands/ScanCommand.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/commands/ScanCommand.java new file mode 100644 index 0000000..7341062 --- /dev/null +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/commands/ScanCommand.java @@ -0,0 +1,22 @@ +package sig.plugin.TwosideKeeper.TwosideKeeper4.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class ScanCommand { + CommandSender p; + + public ScanCommand(CommandSender sender) { + this.p = sender; + } + + public CommandResult runCommand() { + if (p instanceof Player) { + //Get block looking at and get item. + Item i = + return CommandResult.OKAY; + } else { + return CommandResult.NOTAPLAYER; + } + } +} diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper4/main.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/main.java new file mode 100644 index 0000000..ed65948 --- /dev/null +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper4/main.java @@ -0,0 +1,15 @@ +package sig.plugin.TwosideKeeper.TwosideKeeper4; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.plugin.java.JavaPlugin; + +import sig.plugin.TwosideKeeper.TwosideKeeper4.commands.CommandHandler; + +public class main extends JavaPlugin{ + + @Override + public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { + return (new CommandHandler(sender,cmd,label,args)).runCommand(); + } +}