2021-06-08 19:36:45 +02:00
|
|
|
/*
|
2022-06-15 20:17:17 +02:00
|
|
|
* PlotSquared, a land and world management plugin for Minecraft.
|
|
|
|
* Copyright (C) IntellectualSites <https://intellectualsites.com>
|
|
|
|
* Copyright (C) IntellectualSites team and contributors
|
2021-06-08 19:36:45 +02:00
|
|
|
*
|
2022-06-15 20:17:17 +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.
|
2021-06-08 19:36:45 +02:00
|
|
|
*
|
2022-06-15 20:17:17 +02:00
|
|
|
* 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.
|
2021-06-08 19:36:45 +02:00
|
|
|
*
|
2022-06-15 20:17:17 +02:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* 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;
|
2022-12-02 13:39:38 +01:00
|
|
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
2021-06-08 19:36:45 +02:00
|
|
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.net.URL;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
public class FaweSchematicHandler extends SchematicHandler {
|
|
|
|
|
|
|
|
private final FaweDelegateSchematicHandler delegate = new FaweDelegateSchematicHandler();
|
|
|
|
|
|
|
|
@Inject
|
2022-12-02 13:39:38 +01:00
|
|
|
public FaweSchematicHandler(WorldUtil worldUtil, ProgressSubscriberFactory subscriberFactory) {
|
2021-06-08 19:36:45 +02:00
|
|
|
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
|
2022-12-02 13:39:38 +01:00
|
|
|
public Schematic getSchematic(@NonNull InputStream is) {
|
2021-06-08 19:36:45 +02:00
|
|
|
return delegate.getSchematic(is);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|