mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Fixes #435
This commit is contained in:
parent
e6ea62ad1e
commit
8151ec8e1a
@ -171,14 +171,15 @@ public class PlotListener extends APlotListener {
|
|||||||
player.playEffect(lastLoc, Effect.RECORD_PLAY, 0);
|
player.playEffect(lastLoc, Effect.RECORD_PLAY, 0);
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
pp.deleteMeta("music");
|
pp.deleteMeta("music");
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
if (id != 0) {
|
||||||
pp.setMeta("music", loc);
|
try {
|
||||||
player.playEffect(loc, Effect.RECORD_PLAY, Material.getMaterial(id));
|
pp.setMeta("music", loc);
|
||||||
|
player.playEffect(loc, Effect.RECORD_PLAY, Material.getMaterial(id));
|
||||||
|
}
|
||||||
|
catch (Exception e) {}
|
||||||
}
|
}
|
||||||
catch (Exception e) {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -196,16 +197,16 @@ public class PlotListener extends APlotListener {
|
|||||||
else {
|
else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (titles) {
|
if (titles) {
|
||||||
if (C.TITLE_ENTERED_PLOT.s().length() != 0 || C.TITLE_ENTERED_PLOT_SUB.s().length() != 0) {
|
if (C.TITLE_ENTERED_PLOT.s().length() != 0 || C.TITLE_ENTERED_PLOT_SUB.s().length() != 0) {
|
||||||
TaskManager.runTaskLaterAsync(new Runnable() {
|
TaskManager.runTaskLaterAsync(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
PlotId id = (PlotId) pp.getMeta("lastplotid");
|
Plot lastPlot = (Plot) pp.getMeta("lastplot");
|
||||||
if (plot.id.equals(id)) {
|
if (plot.id.equals(lastPlot.id)) {
|
||||||
Map<String, String> replacements = new HashMap<>();
|
Map<String, String> replacements = new HashMap<>();
|
||||||
replacements.put("%x%", id.x + "");
|
replacements.put("%x%", lastPlot.id.x + "");
|
||||||
replacements.put("%z%", id.y + "");
|
replacements.put("%z%", lastPlot.id.y + "");
|
||||||
replacements.put("%world%", plot.world);
|
replacements.put("%world%", plot.world);
|
||||||
replacements.put("%greeting%", greeting);
|
replacements.put("%greeting%", greeting);
|
||||||
replacements.put("%alias", plot.toString());
|
replacements.put("%alias", plot.toString());
|
||||||
|
Loading…
Reference in New Issue
Block a user