Merge branch 'development' of github.com:craftinc/craftinc-gates into development

This commit is contained in:
Tobias Ottenweller 2014-02-05 20:36:34 +01:00
commit b37f1000ab
6 changed files with 14 additions and 5 deletions

View File

@ -7,4 +7,5 @@ gateTeleportMessage: "Thank you for traveling with Craft Inc. Gates."
showTeleportMessage: true
gateTeleportNoPermissionMessage: "You are not allowed to use this gate!"
showTeleportNoPermissionMessage: true
gateTeleportVehicleNotAllowedMessage: "You must not use that gate while riding!"
gateMaterial: "nether portal"

View File

@ -535,7 +535,7 @@ public class GatesManager
}
}
// TODO: call this method!
public void handleGateExitChange(final Gate g, final Location oldExit)
{
// nothing to do

View File

@ -22,6 +22,7 @@ import de.craftinc.gates.util.GateBlockChangeSender;
import org.bukkit.ChatColor;
import de.craftinc.gates.Plugin;
import org.bukkit.Location;
public class CommandExit extends BaseCommand
@ -47,8 +48,10 @@ public class CommandExit extends BaseCommand
{
try
{
Location oldExit = gate.getExit();
gate.setExit(player.getLocation());
sendMessage(ChatColor.GREEN + "The exit of gate '" + gate.getId() + "' is now where you stand.");
Plugin.getPlugin().getGatesManager().handleGateExitChange(gate, oldExit);
}
catch (Exception e) {
GateBlockChangeSender.updateGateBlocks(gate);

View File

@ -20,6 +20,7 @@ package de.craftinc.gates.commands;
import de.craftinc.gates.Plugin;
import de.craftinc.gates.util.GateBlockChangeSender;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import java.util.logging.Level;
@ -46,8 +47,10 @@ public class CommandExitOpen extends BaseCommand
{
try
{
Location oldExit = gate.getExit();
gate.setExit(player.getLocation());
sendMessage(ChatColor.GREEN + "The exit of gate '" + gate.getId() + "' is now where you stand.");
Plugin.getPlugin().getGatesManager().handleGateExitChange(gate, oldExit);
try {
boolean needsGateManagerUpdate = false;

View File

@ -110,8 +110,9 @@ public class PlayerMoveListener implements Listener
if (vehicle != null && (!vehicleIsSuitable) || !gate.getAllowsVehicles()) {
if (!gate.getAllowsVehicles()) {
// TODO: display not allowed message
if (!gate.getAllowsVehicles() && Plugin.getPlugin().getConfig().getBoolean(ConfigurationUtil.confShowTeleportNoPermissionMessageKey)) {
final String notAllowedMessage = Plugin.getPlugin().getConfig().getString(ConfigurationUtil.confGateTeleportVehicleNotAllowedMessageKey);
player.sendMessage(ChatColor.DARK_AQUA + notAllowedMessage);
}
return;

View File

@ -29,6 +29,7 @@ public class ConfigurationUtil
public static final String confPlayerGateBlockUpdateRadiusKey = "playerGateBlockUpdateRadius";
public static final String confCheckForBrokenGateFramesKey = "checkForBrokenGateFrames";
public static final String confGateTeleportMessageKey = "gateTeleportMessage";
public static final String confGateTeleportVehicleNotAllowedMessageKey = "gateTeleportVehicleNotAllowedMessage";
public static final String confShowTeleportMessageKey = "showTeleportMessage";
public static final String confGateTeleportNoPermissionMessageKey = "gateTeleportNoPermissionMessage";
public static final String confShowTeleportNoPermissionMessageKey = "showTeleportNoPermissionMessage";
@ -62,10 +63,10 @@ public class ConfigurationUtil
material.material = Material.DEAD_BUSH;
}
else if (materialString.equals("dandelion")) {
material.material = Material.YELLOW_FLOWER; // TODO: this will change with minecraft 1.7
material.material = Material.YELLOW_FLOWER;
}
else if (materialString.equals("poppy")) {
material.material = Material.RED_ROSE; // TODO: this will change with minecraft 1.7
material.material = Material.RED_ROSE;
}
else if (materialString.equals("brown mushroom")) {
material.material = Material.BROWN_MUSHROOM;