use of com.plotsquared.core.util.task.AutoClaimFinishTask in project PlotSquared by IntellectualSites.
the class Auto method claimSingle.
private void claimSingle(@NonNull final PlotPlayer<?> player, @NonNull final Plot plot, @NonNull final PlotArea plotArea, @Nullable final String schematic) {
try (final MetaDataAccess<Boolean> metaDataAccess = player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_AUTO)) {
metaDataAccess.set(true);
}
plot.setOwnerAbs(player.getUUID());
final RunnableVal<Plot> runnableVal = new RunnableVal<>() {
{
this.value = plot;
}
@Override
public void run(final Plot plot) {
try {
TaskManager.getPlatformImplementation().sync(new AutoClaimFinishTask(player, plot, plotArea, schematic, PlotSquared.get().getEventDispatcher()));
} catch (final Exception e) {
e.printStackTrace();
}
}
};
DBFunc.createPlotSafe(plot, runnableVal, () -> claimSingle(player, plot, plotArea, schematic));
}
Aggregations