diff --git a/.gitignore b/.gitignore index bf6fc64..737cdc4 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ # vim .*.sw[a-p] +server/world +server/world_nether +server/server.log diff --git a/README.md b/README.md index 504b2c9..ff2be04 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,10 @@ Run `mvn package -Pstart-server`. This will compile and packge your plugin, then download all the necessary dependencies to run the server which will be started in the folder `server`. + +Note: the code will only compile with JDK 1.6 (cause: @Override for interface methods) + + +For Eclipse Users: +-to run the server from eclipse, create a Maven Run Configuration, set Goal to "package" and Profile to "start-server" +-to submit your own changes to your own github repository, you need to add your ssh key to your $HOME/.ssh folder (github help has further information) diff --git a/pom.xml b/pom.xml index a773057..6611823 100644 --- a/pom.xml +++ b/pom.xml @@ -19,8 +19,8 @@ maven-compiler-plugin 2.0.2 - 1.5 - 1.5 + 1.6 + 1.6 diff --git a/src/main/java/com/dinnerbone/bukkit/sample/SampleBlockListener.java b/src/main/java/com/dinnerbone/bukkit/sample/SampleBlockListener.java index 960a5e1..60b49a5 100644 --- a/src/main/java/com/dinnerbone/bukkit/sample/SampleBlockListener.java +++ b/src/main/java/com/dinnerbone/bukkit/sample/SampleBlockListener.java @@ -24,7 +24,7 @@ public void onBlockPhysics(BlockPhysicsEvent event) { Block block = event.getBlock(); if ((block.getType() == Material.SAND) || (block.getType() == Material.GRAVEL)) { - Block above = block.getFace(BlockFace.UP); + Block above = block.getRelative(BlockFace.UP); if (above.getType() == Material.IRON_BLOCK) { event.setCancelled(true); } diff --git a/src/main/java/com/dinnerbone/bukkit/sample/SamplePlayerListener.java b/src/main/java/com/dinnerbone/bukkit/sample/SamplePlayerListener.java index 3ec8f9a..64e6002 100644 --- a/src/main/java/com/dinnerbone/bukkit/sample/SamplePlayerListener.java +++ b/src/main/java/com/dinnerbone/bukkit/sample/SamplePlayerListener.java @@ -2,7 +2,8 @@ package com.dinnerbone.bukkit.sample; import org.bukkit.Location; -import org.bukkit.event.player.PlayerEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerListener; import org.bukkit.event.player.PlayerMoveEvent; @@ -18,12 +19,12 @@ public SamplePlayerListener(SamplePlugin instance) { } @Override - public void onPlayerJoin(PlayerEvent event) { + public void onPlayerJoin(PlayerJoinEvent event) { System.out.println(event.getPlayer().getName() + " joined the server! :D"); } @Override - public void onPlayerQuit(PlayerEvent event) { + public void onPlayerQuit(PlayerQuitEvent event) { System.out.println(event.getPlayer().getName() + " left the server! :'("); } diff --git a/src/main/java/com/dinnerbone/bukkit/sample/SamplePosCommand.java b/src/main/java/com/dinnerbone/bukkit/sample/SamplePosCommand.java index 4e0f6c1..5417bc2 100644 --- a/src/main/java/com/dinnerbone/bukkit/sample/SamplePosCommand.java +++ b/src/main/java/com/dinnerbone/bukkit/sample/SamplePosCommand.java @@ -17,7 +17,7 @@ public class SamplePosCommand implements CommandExecutor { public SamplePosCommand(SamplePlugin plugin) { this.plugin = plugin; } - + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] split) { if (!(sender instanceof Player)) { @@ -36,7 +36,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St double y = Double.parseDouble(split[1]); double z = Double.parseDouble(split[2]); - player.teleportTo(new Location(player.getWorld(), x, y, z)); + player.teleport(new Location(player.getWorld(), x, y, z)); } catch (NumberFormatException ex) { player.sendMessage("Given location is invalid"); }