First commit

This commit is contained in:
Erik Bročko 2018-09-03 00:09:38 +02:00
commit 0c4601070f
8 changed files with 114 additions and 0 deletions

11
.classpath Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Spigot API"/>
<classpathentry kind="output" path="bin"/>
</classpath>

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/bin/

17
.project Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MarwCore</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>

17
Export to JAR.jardesc Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jardesc>
<jar path="/home/erik/Dokumenty/Java/marwland/build/Untitled.jar"/>
<options buildIfNeeded="true" compress="true" descriptionLocation="/MarwCore/Export to JAR.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="true" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/>
<manifest generateManifest="true" manifestLocation="" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true">
<sealing sealJar="false">
<packagesToSeal/>
<packagesToUnSeal/>
</sealing>
</manifest>
<selectedElements exportClassFiles="true" exportJavaFiles="false" exportOutputFolder="false">
<file path="/MarwCore/plugin.yml"/>
<javaElement handleIdentifier="=MarwCore/src"/>
</selectedElements>
</jardesc>

8
plugin.yml Normal file
View File

@ -0,0 +1,8 @@
name: MarwCore
main: cz.marwland.mc.core.MarwCore
version: 1.0
api-version: 1.12
commands:
first:
description: First command.
usage: /first

View File

@ -0,0 +1,19 @@
package cz.marwland.mc.core;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerLoginEvent;
public class EventListener implements Listener {
private final MarwCore plugin;
public EventListener(MarwCore plugin) {
this.plugin = plugin;
}
@EventHandler
public void normalLogin(PlayerLoginEvent event) {
plugin.getServer().broadcastMessage("Welcome " + event.getPlayer().getDisplayName() + "!");
}
}

View File

@ -0,0 +1,19 @@
package cz.marwland.mc.core;
import org.bukkit.plugin.java.JavaPlugin;
import cz.marwland.mc.core.cmd.First;
public class MarwCore extends JavaPlugin {
@Override
public void onEnable() {
getCommand("first").setExecutor(new First(this));
getServer().getPluginManager().registerEvents(new EventListener(this), this);
getLogger().info("Enabled!");
}
@Override
public void onDisable() {
}
}

View File

@ -0,0 +1,22 @@
package cz.marwland.mc.core.cmd;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import cz.marwland.mc.core.MarwCore;
public class First implements CommandExecutor {
private final MarwCore plugin;
public First(MarwCore plugin) {
this.plugin = plugin;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
plugin.getLogger().info("Hello?");
sender.sendMessage("henlo");
return false;
}
}