2021-06-08 19:36:45 +02:00
|
|
|
/*
|
|
|
|
* _____ _ _ _____ _
|
|
|
|
* | __ \| | | | / ____| | |
|
|
|
|
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
|
|
|
|
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
|
|
|
|
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
|
|
|
|
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
|
|
|
|
* | |
|
|
|
|
* |_|
|
|
|
|
* PlotSquared plot management system for Minecraft
|
2022-01-02 22:22:19 +01:00
|
|
|
* Copyright (C) 2014 - 2022 IntellectualSites
|
2021-06-08 19:36:45 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-06-08 19:41:10 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2021-06-08 19:36:45 +02:00
|
|
|
*/
|
|
|
|
package com.plotsquared.bukkit.util.fawe;
|
|
|
|
|
2021-06-26 17:19:07 +02:00
|
|
|
import com.fastasyncworldedit.bukkit.regions.plotsquared.FaweDelegateSchematicHandler;
|
2021-06-08 19:36:45 +02:00
|
|
|
import com.google.inject.Inject;
|
|
|
|
import com.plotsquared.core.inject.factory.ProgressSubscriberFactory;
|
|
|
|
import com.plotsquared.core.player.PlotPlayer;
|
|
|
|
import com.plotsquared.core.plot.Plot;
|
|
|
|
import com.plotsquared.core.plot.schematic.Schematic;
|
|
|
|
import com.plotsquared.core.queue.QueueCoordinator;
|
|
|
|
import com.plotsquared.core.util.SchematicHandler;
|
|
|
|
import com.plotsquared.core.util.WorldUtil;
|
|
|
|
import com.plotsquared.core.util.task.RunnableVal;
|
|
|
|
import com.sk89q.jnbt.CompoundTag;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.net.URL;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
public class FaweSchematicHandler extends SchematicHandler {
|
|
|
|
|
|
|
|
private final FaweDelegateSchematicHandler delegate = new FaweDelegateSchematicHandler();
|
|
|
|
|
|
|
|
@Inject
|
|
|
|
public FaweSchematicHandler(@NotNull WorldUtil worldUtil, @NotNull ProgressSubscriberFactory subscriberFactory) {
|
|
|
|
super(worldUtil, subscriberFactory);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean restoreTile(QueueCoordinator queue, CompoundTag tag, int x, int y, int z) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void paste(
|
|
|
|
final Schematic schematic,
|
|
|
|
final Plot plot,
|
|
|
|
final int xOffset,
|
|
|
|
final int yOffset,
|
|
|
|
final int zOffset,
|
|
|
|
final boolean autoHeight,
|
|
|
|
final PlotPlayer<?> actor,
|
|
|
|
final RunnableVal<Boolean> whenDone
|
|
|
|
) {
|
2022-03-09 14:58:00 +01:00
|
|
|
delegate.paste(schematic, plot, xOffset, yOffset, zOffset, autoHeight, actor, whenDone);
|
2021-06-08 19:36:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean save(CompoundTag tag, String path) {
|
|
|
|
return delegate.save(tag, path);
|
|
|
|
}
|
|
|
|
|
2022-01-20 12:39:40 +01:00
|
|
|
@SuppressWarnings("removal") // Just the override
|
2021-06-08 19:36:45 +02:00
|
|
|
@Override
|
|
|
|
public void upload(final CompoundTag tag, final UUID uuid, final String file, final RunnableVal<URL> whenDone) {
|
|
|
|
delegate.upload(tag, uuid, file, whenDone);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Schematic getSchematic(@NotNull InputStream is) {
|
|
|
|
return delegate.getSchematic(is);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|