From d2ce140fe538119eb32fed6f02593dc4e3387089 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 28 Dec 2018 08:55:40 -0600 Subject: [PATCH] Add code. --- pom.xml | 47 ++++++++++ .../coderdojotest/CoderDojoTest.java | 84 ++++++++++++++++++ src/main/resources/plugin.yml | 3 + target/CoderDojoTest-0.1.3-SNAPSHOT.jar | Bin 0 -> 4475 bytes .../coderdojotest/CoderDojoTest.class | Bin 0 -> 3456 bytes target/classes/plugin.yml | 3 + target/maven-archiver/pom.properties | 5 ++ .../compile/default-compile/createdFiles.lst | 0 .../compile/default-compile/inputFiles.lst | 1 + .../default-testCompile/inputFiles.lst | 0 10 files changed, 143 insertions(+) create mode 100644 pom.xml create mode 100644 src/main/java/com/hyperling/minecraft/coderdojotest/CoderDojoTest.java create mode 100644 src/main/resources/plugin.yml create mode 100644 target/CoderDojoTest-0.1.3-SNAPSHOT.jar create mode 100644 target/classes/com/hyperling/minecraft/coderdojotest/CoderDojoTest.class create mode 100644 target/classes/plugin.yml create mode 100644 target/maven-archiver/pom.properties create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst create mode 100644 target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..a208105 --- /dev/null +++ b/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + com.hyperling.minecraft + CoderDojoTest + 0.1.3-SNAPSHOT + Coder Dojo Test + Test project written to learn how to do Minecraft plug-in for Coder Dojo. + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.7 + 1.7 + + + + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + + + + org.bukkit + bukkit + 1.12.2-R0.1-SNAPSHOT + jar + provided + + + + org.spigotmc + spigot-api + 1.12.2-R0.1-SNAPSHOT + jar + provided + + + + \ No newline at end of file diff --git a/src/main/java/com/hyperling/minecraft/coderdojotest/CoderDojoTest.java b/src/main/java/com/hyperling/minecraft/coderdojotest/CoderDojoTest.java new file mode 100644 index 0000000..fb8395a --- /dev/null +++ b/src/main/java/com/hyperling/minecraft/coderdojotest/CoderDojoTest.java @@ -0,0 +1,84 @@ +package com.hyperling.minecraft.coderdojotest; + +import org.bukkit.Bukkit; +import org.bukkit.GameMode; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerLoginEvent; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.PlayerInventory; +import org.bukkit.plugin.java.JavaPlugin; + +public final class CoderDojoTest extends JavaPlugin implements Listener { + public CoderDojoTest() { + + } + + @Override + public void onEnable() { + getLogger().info("onEnable has been accessed."); + getServer().getPluginManager().registerEvents(this, this); + } + + @Override + public void onDisable() { + getLogger().info("onDisable has been accessed."); + } + + @EventHandler + public void onJoin(PlayerJoinEvent event) { + getLogger().info("Running onJoin."); + Player player = event.getPlayer(); + + getServer().broadcastMessage("Welcome to the server, " + player.getDisplayName() + "!"); + + final PlayerInventory inv = player.getInventory(); + + // Give diamond tools and food if not in creative + if (getServer().getDefaultGameMode() != GameMode.CREATIVE) { + getServer().broadcastMessage("Enjoy your items!"); + ItemStack item; + item = new ItemStack(Material.DIAMOND_SWORD); + inv.remove(Material.DIAMOND_SWORD); + inv.addItem(item); + item = new ItemStack(Material.DIAMOND_AXE); + inv.remove(Material.DIAMOND_AXE); + inv.addItem(item); + item = new ItemStack(Material.DIAMOND_PICKAXE); + inv.remove(Material.DIAMOND_PICKAXE); + inv.addItem(item); + item = new ItemStack(Material.DIAMOND_SPADE); + inv.remove(Material.DIAMOND_SPADE); + inv.addItem(item); + item = new ItemStack(Material.DIAMOND_HOE); + inv.remove(Material.DIAMOND_HOE); + inv.addItem(item); + + // Give food + item = new ItemStack(Material.GOLDEN_APPLE); + inv.remove(Material.GOLDEN_APPLE); + item.setAmount(64); + inv.addItem(item); + + // These work + item = new ItemStack(Material.DIAMOND_BOOTS); + inv.setBoots(item); + item = new ItemStack(Material.DIAMOND_LEGGINGS); + inv.setLeggings(item); + item = new ItemStack(Material.DIAMOND_CHESTPLATE); + inv.setChestplate(item); + item = new ItemStack(Material.DIAMOND_HELMET); + inv.setHelmet(item); + } + else { + inv.clear(); + getServer().broadcastMessage("Inventory has been cleared for Creative mode."); + } + + getLogger().info("Refreshed diamond items."); + } +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..2257280 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,3 @@ +name: CoderDojoTest +main: com.hyperling.minecraft.coderdojotest.CoderDojoTest +version: 0.1.2 \ No newline at end of file diff --git a/target/CoderDojoTest-0.1.3-SNAPSHOT.jar b/target/CoderDojoTest-0.1.3-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..d46a0b51b0726067f44cd6eeb10c0563cfeb394a GIT binary patch literal 4475 zcmbtX2{hFE7auX2Eb&l`C6dT8W6hqjFJs0MBg-Q(gc-viOG@;jL3V@8Bt^EeMk>UM zY|}8=Q)IHFw8$>>pLxB~`p!G=f9L$>_dRFs{oMP#=gz(NV+mtsVFNHETayU?>+tv2 zHu@WGXrl`;MHtCj{;dWAT%@Zds@I^=^q-^X58u~na9xC{k>Oz*DBNfcPVO{^L7-Gl z7(|9b?y9m@=v96;fs-?%w8_CBdZ4Z2dC0V#vW*fUw~1!T0cL?DnHzjKrMX9;w~2Aq zyfEv-jp7MFd^@;^tpSfJ3T1l`b}j4y_k#2tXXzm^S-E)*8YhG^^mfQ?z~|@yfFaB5 zZ!WV|d=2p}OHgN5vNY$RNF zN3S&FNzu(-kN25oxA~%(ZYSC7HmKO)SmZ7Q3le0LaGM^yWN^{nc+c6(mJXnsd-?V) z9qM6EbG{AqBTPr}kA#e+=QMIXtCn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2POE4)C+?7oR^Z!^ zZ4p@?d%{)>&v(!-IkxFh{RCbqV zyfl<~?5oV3SpUlIH7((H#gv2V3p%IuCl}89EJIEkLwE6SKize=J2Fmtnzf$oxrI)E zzG!R-s}YBGA1vf!&qSa&_SMFzR*w%x)Vl*S6lm0 zEKDJ|_O1>tQwVgd15PGaS({M0`Z^2cOduWYWY|FGLoy5wH8Yo`!dQ#oOvMnU;y(R8 zdxC=vF^j7gec7|nljW<`;`{xGi|+KxeuQy7f%5%o2l!rD>PKbzS_1vDbU=T$NPG{n z|KEdrvju#K3j{bz-;Zz)$w<2`06-aix6uBtkbd;&Lon!i8+c-m0(bq}GKKn9-@7Iz z>G+#lB$6CX7|J&H1zp46#bbsLJsT%y)V)$4v8f+IWT|0w-g`*e2vu)=(_JBxf9jw# zv4>qx<^%wrSn}aQ77qy-8{T;HT-#CAM<~+C z7AgW9SQIG@zP5nU%f~=EYF@wV=AJh08)im>s{Q0I+!&BZxwF@W7{$aQk*?;C(&PHwW`&)+rFJH8|m|&P7IjTAR z*%Dy8z>SQgH(9gnJR?Rro#`=a_PY#Nvqo?BH?)Q6XWg^DAv*Im=vB=*ui1#|4>8`H zXUcu+L%24`vsslS zdfWD+fHzbv3)du6$M;&I)5sIEmqn*C8gwoQWcII23K^#gFM(HtXkrE2)QZ=sFQmw=+vn7ma3m@~ZX&3#Dbm0cP)@8iEG?`7apVKggGDGqrziBsLk+MyM zABhlyDt!`$;}-hy6LH!M^?P!~piZBJVKGHNGAzFIGkOMQGELZ9#UqcNi{HjUvw8vlAI{Th@pmNr3C{ype78T+bQem4`b{k6=kUnbx08aYn9WwwBL}&B>!2bXi C2Fq6f literal 0 HcmV?d00001 diff --git a/target/classes/com/hyperling/minecraft/coderdojotest/CoderDojoTest.class b/target/classes/com/hyperling/minecraft/coderdojotest/CoderDojoTest.class new file mode 100644 index 0000000000000000000000000000000000000000..237b1c6aa33aca5d01c91c50e28bd093b9acca03 GIT binary patch literal 3456 zcmbVOTX!2*758%|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