Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@

# vim
.*.sw[a-p]
server/world
server/world_nether
server/server.log
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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! :'(");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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");
}
Expand Down