Commits

Mike Bayer committed 499a712

initial commit

  • Participants

Comments (0)

Files changed (9)

+target/
+.project
+.settings
+.classpath
+
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>com.zzzcomputing.bukkit</groupId>
+  <artifactId>atmcraft</artifactId>
+  <version>0.0.1</version>
+  <packaging>jar</packaging>
+  <description>Minecraft ATM Machine</description>
+
+  <name>AtmCraft</name>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <build>
+    <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
+    <resources>
+      <resource>
+        <targetPath>.</targetPath>
+        <filtering>true</filtering>
+        <directory>${basedir}/src/main/resources/</directory>
+        <includes>
+          <include>plugin.yml</include>
+        </includes>
+      </resource>
+      <resource>
+        <targetPath>defaults/</targetPath>
+        <filtering>true</filtering>
+        <directory>${basedir}/src/main/resources/</directory>
+        <includes>
+          <include>config.yml</include>
+        </includes>
+      </resource>
+      <resource>
+        <targetPath>defaults/</targetPath>
+        <filtering>true</filtering>
+        <directory>${basedir}/src/main/resources/</directory>
+        <includes>
+          <include>itemnames.properties</include>
+        </includes>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptors>
+            <descriptor>src/main/assembly/package.xml</descriptor>
+          </descriptors>
+        </configuration>
+        <executions>
+            <execution>
+                <id>build</id>
+                <phase>package</phase>
+                <goals>
+                    <goal>single</goal>
+                </goals>
+            </execution>
+        </executions>
+      </plugin>
+
+          <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-compiler-plugin</artifactId>
+              <version>2.4</version>
+              <configuration>
+                  <source>1.6</source>
+                  <target>1.6</target>
+                  <showWarnings>true</showWarnings>
+                  <showDeprecation>true</showDeprecation>
+              </configuration>
+          </plugin>
+
+  </plugins>
+    <finalName>${project.name}</finalName>
+  </build>
+
+  <dependencies>
+  	<dependency>
+  		<groupId>org.bukkit</groupId>
+  		<artifactId>bukkit</artifactId>
+  		<version>1.6.2-R0.2-SNAPSHOT</version>
+  	</dependency>
+  </dependencies>
+</project>

File src/main/assembly/package.xml

+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+    <id>bin</id>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <formats>
+        <format>tar.bz2</format>
+        <format>zip</format>
+    </formats>
+    <fileSets>
+        <fileSet>
+            <directory>${project.basedir}</directory>
+            <outputDirectory>/</outputDirectory>
+            <includes>
+                <include>README*</include>
+                <include>LICENSE*</include>
+                <include>NOTICE*</include>
+                <include>CHANGELOG*</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/resources/</directory>
+            <outputDirectory>/ZeekTools/</outputDirectory>
+            <includes>
+                <include>config.yml</include>
+                <include>itemnames.properties</include>
+            </includes>
+        </fileSet>
+    </fileSets>		
+    <files>
+        <file>
+            <source>${project.build.directory}/${artifactId}.jar</source>
+            <outputDirectory>/</outputDirectory>
+            <destName>ZeekTools.jar</destName>
+        </file>
+    </files>
+</assembly>

File src/main/java/com/zzzcomputing/bukkit/atmcraft/AtmCraft.java

+package com.zzzcomputing.bukkit.atmcraft;
+
+import org.bukkit.Bukkit;
+import org.bukkit.configuration.file.FileConfiguration;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.EventPriority;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerJoinEvent;
+import org.bukkit.plugin.java.JavaPlugin;
+
+public class AtmCraft extends JavaPlugin implements Listener{
+
+	
+    private FileConfiguration config;
+
+	@Override
+    public void onEnable() {
+
+        config = getConfig();
+        Bukkit.getPluginManager().registerEvents(this, this);        
+        Logger.info("AtmCraft online hooray !");
+    }
+	
+    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
+    public void onPlayerJoin(PlayerJoinEvent event) {
+        Util.sendPlayerMessage(event.getPlayer(), "AtmCraft enabled.");
+    }
+	
+}

File src/main/java/com/zzzcomputing/bukkit/atmcraft/Bootstrap.java

+package com.zzzcomputing.bukkit.atmcraft;
+
+public class Bootstrap {
+
+}

File src/main/java/com/zzzcomputing/bukkit/atmcraft/Logger.java

+package com.zzzcomputing.bukkit.atmcraft;
+
+import java.util.logging.Level;
+
+public class Logger {
+    static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger("Minecraft");
+
+    static final String PREFIX = "[AtmCraft]";
+    
+    public static void severe(String string, Exception ex) {
+        logLevel(Level.SEVERE, string, ex);
+    }
+
+    public static void severe(String string) {
+        logLevel(Level.SEVERE, string);
+    }
+
+    public static void info(String string) {
+        logLevel(Level.INFO, string);
+    }
+
+    public static void warning(String string) {
+        logLevel(Level.WARNING, string);
+    }
+
+    private static void logLevel(Level loglevel, String txt) {
+        logger.log(loglevel, PREFIX + " " + txt);
+    }
+    
+    private static void logLevel(Level loglevel, String txt, Exception e) {
+        logger.log(loglevel, PREFIX + " " + txt + " " + e.getMessage(), e);
+    }
+
+}

File src/main/java/com/zzzcomputing/bukkit/atmcraft/Util.java

+package com.zzzcomputing.bukkit.atmcraft;
+
+import org.bukkit.ChatColor;
+import org.bukkit.entity.Player;
+
+public class Util {
+
+	public static String [] slice(String [] src, int start) {
+		String [] dest = new String[src.length - start];
+		System.arraycopy(src, start, dest, 0, dest.length);
+		return dest;
+	}
+
+	public static String [] sliceEnd(String [] src, int end) {
+		String [] dest = new String[src.length - end];
+		System.arraycopy(src, 0, dest, 0, dest.length);
+		return dest;
+	}
+
+	public static void sendPlayerMessage(Player player, Object ... tokens) {
+		String msg = ChatColor.DARK_PURPLE + "[AC] " + ChatColor.AQUA;
+		for (Object token: tokens) {
+			msg = msg.concat(token.toString());
+		}
+		player.sendMessage(msg);
+	}
+
+}

File src/main/resources/config.yml

Empty file added.

File src/main/resources/plugin.yml

+name: atmcraft
+main: com.zzzcomputing.bukkit.atmcraft.AtmCraft
+version: 0.0.1
+description: ATM Machine for minecraft
+author: zzzeek