Bugfix: remove portal blocks when deleting a gate.
This commit is contained in:
parent
d4f33a1885
commit
afe693d491
@ -47,8 +47,7 @@ public class CommandRemove extends BaseCommand
|
|||||||
public void perform()
|
public void perform()
|
||||||
{
|
{
|
||||||
Plugin.getPlugin().getGatesManager().handleDeletion(gate);
|
Plugin.getPlugin().getGatesManager().handleDeletion(gate);
|
||||||
GateBlockChangeSender.updateGateBlocks(gate);
|
GateBlockChangeSender.updateGateBlocks(gate, true);
|
||||||
sendMessage(ChatColor.GREEN + "Gate with id '" + gate.getId() + "' was deleted.");
|
sendMessage(ChatColor.GREEN + "Gate with id '" + gate.getId() + "' was deleted.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,11 +102,16 @@ public class GateBlockChangeSender
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void updateGateBlocks(final Gate gate)
|
||||||
|
{
|
||||||
|
updateGateBlocks(gate, false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends block changes to players near a given gate.
|
* Sends block changes to players near a given gate.
|
||||||
* @param gate Must not be 'null'!
|
* @param gate Must not be 'null'!
|
||||||
*/
|
*/
|
||||||
public static void updateGateBlocks(final Gate gate)
|
public static void updateGateBlocks(final Gate gate, boolean deleted)
|
||||||
{
|
{
|
||||||
if (gate == null) {
|
if (gate == null) {
|
||||||
throw new IllegalArgumentException("'gate must not be 'null'!");
|
throw new IllegalArgumentException("'gate must not be 'null'!");
|
||||||
@ -126,7 +131,7 @@ public class GateBlockChangeSender
|
|||||||
|
|
||||||
Material material;
|
Material material;
|
||||||
|
|
||||||
if (gate.isOpen() && !gate.isHidden()) {
|
if (gate.isOpen() && !gate.isHidden() && !deleted) {
|
||||||
material = Material.PORTAL;
|
material = Material.PORTAL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user