mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-14 03:14:42 +02:00
Compare commits
1 Commits
feat/visib
...
refactor/v
Author | SHA1 | Date | |
---|---|---|---|
f54bb88394 |
@ -176,7 +176,7 @@ public class DatabaseCommand extends SubCommand {
|
|||||||
);
|
);
|
||||||
worldFile.renameTo(newFile);
|
worldFile.renameTo(newFile);
|
||||||
}
|
}
|
||||||
plot.setId(newId.copy());
|
plot.setId(newId);
|
||||||
plot.setArea(pa);
|
plot.setArea(pa);
|
||||||
plots.add(plot);
|
plots.add(plot);
|
||||||
continue;
|
continue;
|
||||||
|
@ -181,7 +181,6 @@ public class Download extends SubCommand {
|
|||||||
schematicHandler.upload(compoundTag, null, null, new RunnableVal<>() {
|
schematicHandler.upload(compoundTag, null, null, new RunnableVal<>() {
|
||||||
@Override
|
@Override
|
||||||
public void run(URL value) {
|
public void run(URL value) {
|
||||||
plot.removeRunning();
|
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("web.generation_link_success"),
|
TranslatableCaption.of("web.generation_link_success"),
|
||||||
Template.of("download", value.toString()),
|
Template.of("download", value.toString()),
|
||||||
|
@ -26,7 +26,6 @@ import com.plotsquared.core.util.task.RunnableVal2;
|
|||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
@CommandDeclaration(command = "near",
|
@CommandDeclaration(command = "near",
|
||||||
@ -49,13 +48,9 @@ public class Near extends Command {
|
|||||||
final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot"));
|
final Plot plot = check(player.getCurrentPlot(), TranslatableCaption.of("errors.not_in_plot"));
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("near.plot_near"),
|
TranslatableCaption.of("near.plot_near"),
|
||||||
Template.of("list", StringMan.join(getPlayersInPlotVisible(plot, player), ", "))
|
Template.of("list", StringMan.join(plot.getPlayersInPlot(), ", "))
|
||||||
);
|
);
|
||||||
return CompletableFuture.completedFuture(true);
|
return CompletableFuture.completedFuture(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<PlotPlayer<?>> getPlayersInPlotVisible(Plot plot, PlotPlayer<?> executor) {
|
|
||||||
return plot.getPlayersInPlot().stream().filter(executor::canSee).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -457,7 +457,7 @@ public class Plot {
|
|||||||
* that could alter the de facto owner of the plot.
|
* that could alter the de facto owner of the plot.
|
||||||
*
|
*
|
||||||
* @return The plot owner of this particular (sub-)plot
|
* @return The plot owner of this particular (sub-)plot
|
||||||
* as stored in the database, if one exists. Else, null.
|
* as stored in the database, if one exists. Else, null.
|
||||||
*/
|
*/
|
||||||
public @Nullable UUID getOwnerAbs() {
|
public @Nullable UUID getOwnerAbs() {
|
||||||
return this.owner;
|
return this.owner;
|
||||||
@ -1836,8 +1836,8 @@ public class Plot {
|
|||||||
}
|
}
|
||||||
// Swap cached
|
// Swap cached
|
||||||
final PlotId temp = PlotId.of(this.getId().getX(), this.getId().getY());
|
final PlotId temp = PlotId.of(this.getId().getX(), this.getId().getY());
|
||||||
this.id = plot.getId().copy();
|
this.id = plot.getId();
|
||||||
plot.id = temp.copy();
|
plot.id = temp;
|
||||||
this.area.removePlot(this.getId());
|
this.area.removePlot(this.getId());
|
||||||
plot.area.removePlot(plot.getId());
|
plot.area.removePlot(plot.getId());
|
||||||
this.area.addPlotAbs(this);
|
this.area.addPlotAbs(this);
|
||||||
@ -1863,7 +1863,7 @@ public class Plot {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.area.removePlot(this.id);
|
this.area.removePlot(this.id);
|
||||||
this.id = plot.getId().copy();
|
this.id = plot.getId();
|
||||||
this.area.addPlotAbs(this);
|
this.area.addPlotAbs(this);
|
||||||
DBFunc.movePlot(this, plot);
|
DBFunc.movePlot(this, plot);
|
||||||
TaskManager.runTaskLater(whenDone, TaskTime.ticks(1L));
|
TaskManager.runTaskLater(whenDone, TaskTime.ticks(1L));
|
||||||
|
@ -110,9 +110,11 @@ public final class PlotId {
|
|||||||
* Get a copy of the plot ID
|
* Get a copy of the plot ID
|
||||||
*
|
*
|
||||||
* @return Plot ID copy
|
* @return Plot ID copy
|
||||||
|
* @deprecated PlotId is immutable, copy is not required.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated(forRemoval = true, since = "TODO")
|
||||||
public @NonNull PlotId copy() {
|
public @NonNull PlotId copy() {
|
||||||
return of(this.getX(), this.getY());
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user