mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
Remove FAWE-Piston
Disables a lot of previous functionality in FAWE until replacements can be made. This commit was untested and may cause major issues.
This commit is contained in:
@ -24,12 +24,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.command.AnvilCommands;
|
||||
import com.boydti.fawe.command.AnvilCommandsRegistration;
|
||||
import com.boydti.fawe.command.CFICommands;
|
||||
import com.boydti.fawe.command.CFICommandsRegistration;
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.brush.visualization.cfi.HeightMapMCAGenerator;
|
||||
import com.boydti.fawe.object.changeset.CFIChangeSet;
|
||||
import com.boydti.fawe.object.exception.FaweException;
|
||||
import com.boydti.fawe.object.task.ThrowableSupplier;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
@ -62,13 +58,9 @@ import com.sk89q.worldedit.command.HistoryCommands;
|
||||
import com.sk89q.worldedit.command.HistoryCommandsRegistration;
|
||||
import com.sk89q.worldedit.command.HistorySubCommands;
|
||||
import com.sk89q.worldedit.command.HistorySubCommandsRegistration;
|
||||
import com.sk89q.worldedit.command.MaskCommands;
|
||||
import com.sk89q.worldedit.command.MaskCommandsRegistration;
|
||||
import com.sk89q.worldedit.command.NavigationCommands;
|
||||
import com.sk89q.worldedit.command.NavigationCommandsRegistration;
|
||||
import com.sk89q.worldedit.command.PaintBrushCommands;
|
||||
import com.sk89q.worldedit.command.PatternCommands;
|
||||
import com.sk89q.worldedit.command.PatternCommandsRegistration;
|
||||
import com.sk89q.worldedit.command.RegionCommands;
|
||||
import com.sk89q.worldedit.command.RegionCommandsRegistration;
|
||||
import com.sk89q.worldedit.command.SchematicCommands;
|
||||
@ -87,8 +79,6 @@ import com.sk89q.worldedit.command.ToolCommands;
|
||||
import com.sk89q.worldedit.command.ToolCommandsRegistration;
|
||||
import com.sk89q.worldedit.command.ToolUtilCommands;
|
||||
import com.sk89q.worldedit.command.ToolUtilCommandsRegistration;
|
||||
import com.sk89q.worldedit.command.TransformCommands;
|
||||
import com.sk89q.worldedit.command.TransformCommandsRegistration;
|
||||
import com.sk89q.worldedit.command.UtilityCommands;
|
||||
import com.sk89q.worldedit.command.UtilityCommandsRegistration;
|
||||
import com.sk89q.worldedit.command.WorldEditCommands;
|
||||
@ -304,9 +294,10 @@ public final class PlatformCommandManager {
|
||||
});
|
||||
});
|
||||
*/
|
||||
globalInjectedValues.injectValue(Key.of(CFICommands.CFISettings.class),
|
||||
context -> context.injectedValue(Key.of(Actor.class))
|
||||
.orElseThrow(() -> new IllegalStateException("No CFI Settings")).getMeta("CFISettings"));
|
||||
// TODO: Ping @MattBDev to reimplement 2020-02-04
|
||||
// globalInjectedValues.injectValue(Key.of(CFICommands.CFISettings.class),
|
||||
// context -> context.injectedValue(Key.of(Actor.class))
|
||||
// .orElseThrow(() -> new IllegalStateException("No CFI Settings")).getMeta("CFISettings"));
|
||||
globalInjectedValues.injectValue(Key.of(World.class),
|
||||
context -> {
|
||||
LocalSession localSession = context.injectedValue(Key.of(LocalSession.class))
|
||||
@ -321,7 +312,6 @@ public final class PlatformCommandManager {
|
||||
} else {
|
||||
throw new MissingWorldException();
|
||||
}
|
||||
|
||||
} catch (MissingWorldException e) {
|
||||
exceptionConverter.convert(e);
|
||||
throw new AssertionError("Should have thrown a new exception.", e);
|
||||
@ -332,13 +322,13 @@ public final class PlatformCommandManager {
|
||||
}
|
||||
|
||||
private <CI> void registerSubCommands(String name, List<String> aliases, String desc,
|
||||
CommandRegistration<CI> registration, CI instance) {
|
||||
CommandRegistration<CI> registration, CI instance) {
|
||||
registerSubCommands(name, aliases, desc, registration, instance, m -> {});
|
||||
}
|
||||
|
||||
private <CI> void registerSubCommands(String name, List<String> aliases, String desc,
|
||||
CommandRegistration<CI> registration, CI instance,
|
||||
Consumer<CommandManager> additionalConfig) {
|
||||
CommandRegistration<CI> registration, CI instance,
|
||||
Consumer<CommandManager> additionalConfig) {
|
||||
commandManager.register(name, cmd -> {
|
||||
cmd.aliases(aliases);
|
||||
cmd.description(TextComponent.of(desc));
|
||||
@ -396,27 +386,28 @@ public final class PlatformCommandManager {
|
||||
|
||||
public void registerAllCommands() {
|
||||
if (Settings.IMP.ENABLED_COMPONENTS.COMMANDS) {
|
||||
registerSubCommands(
|
||||
"patterns",
|
||||
ImmutableList.of(),
|
||||
"Patterns determine what blocks are placed",
|
||||
PatternCommandsRegistration.builder(),
|
||||
new PatternCommands()
|
||||
);
|
||||
registerSubCommands(
|
||||
"masks",
|
||||
ImmutableList.of(),
|
||||
"Masks determine which blocks are placed",
|
||||
MaskCommandsRegistration.builder(),
|
||||
new MaskCommands(worldEdit)
|
||||
);
|
||||
registerSubCommands(
|
||||
"transforms",
|
||||
ImmutableList.of(),
|
||||
"Transforms modify how a block is placed",
|
||||
TransformCommandsRegistration.builder(),
|
||||
new TransformCommands()
|
||||
);
|
||||
// TODO: Ping @MattBDev to reimplement (or remove) 2020-02-04
|
||||
// registerSubCommands(
|
||||
// "patterns",
|
||||
// ImmutableList.of(),
|
||||
// "Patterns determine what blocks are placed",
|
||||
// PatternCommandsRegistration.builder(),
|
||||
// new PatternCommands()
|
||||
// );
|
||||
// registerSubCommands(
|
||||
// "masks",
|
||||
// ImmutableList.of(),
|
||||
// "Masks determine which blocks are placed",
|
||||
// MaskCommandsRegistration.builder(),
|
||||
// new MaskCommands(worldEdit)
|
||||
// );
|
||||
// registerSubCommands(
|
||||
// "transforms",
|
||||
// ImmutableList.of(),
|
||||
// "Transforms modify how a block is placed",
|
||||
// TransformCommandsRegistration.builder(),
|
||||
// new TransformCommands()
|
||||
// );
|
||||
registerSubCommands(
|
||||
"schematic",
|
||||
ImmutableList.of("schem", "/schematic", "/schem"),
|
||||
@ -460,13 +451,14 @@ public final class PlatformCommandManager {
|
||||
WorldEditCommandsRegistration.builder(),
|
||||
new WorldEditCommands(worldEdit)
|
||||
);
|
||||
registerSubCommands(
|
||||
"cfi",
|
||||
ImmutableList.of("/cfi"),
|
||||
"CFI commands",
|
||||
CFICommandsRegistration.builder(),
|
||||
new CFICommands(worldEdit)
|
||||
);
|
||||
// TODO: Ping @MattBDev to reimplement 2020-02-04
|
||||
// registerSubCommands(
|
||||
// "cfi",
|
||||
// ImmutableList.of("/cfi"),
|
||||
// "CFI commands",
|
||||
// CFICommandsRegistration.builder(),
|
||||
// new CFICommands(worldEdit)
|
||||
// );
|
||||
registerSubCommands(
|
||||
"/anvil",
|
||||
ImmutableList.of(),
|
||||
@ -608,16 +600,6 @@ public final class PlatformCommandManager {
|
||||
return CommandArgParser.forArgString(input).parseArgs();
|
||||
}
|
||||
|
||||
public <T> T parseCommand(String args, Actor actor) {
|
||||
InjectedValueAccess context;
|
||||
if (actor == null) {
|
||||
context = globalInjectedValues;
|
||||
} else {
|
||||
context = initializeInjectedValues(args::toString, actor, null);
|
||||
}
|
||||
return parseCommand(args, context);
|
||||
}
|
||||
|
||||
public <T> T parseConverter(String args, InjectedValueAccess access, Class<T> clazz) {
|
||||
ArgumentConverter<T> converter = commandManager.getConverter(Key.of(clazz)).orElse(null);
|
||||
if (converter != null) {
|
||||
@ -630,14 +612,6 @@ public final class PlatformCommandManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
public <T> T parseCommand(String args, InjectedValueAccess access) {
|
||||
if (args.isEmpty()) return null;
|
||||
String[] split = parseArgs(args)
|
||||
.map(Substring::getSubstring)
|
||||
.toArray(String[]::new);
|
||||
return (T) commandManager.execute(access, ImmutableList.copyOf(split));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void handleCommand(CommandEvent event) {
|
||||
Request.reset();
|
||||
@ -771,19 +745,20 @@ public final class PlatformCommandManager {
|
||||
|
||||
worldEdit.flushBlockBag(actor, editSession);
|
||||
}
|
||||
CFICommands.CFISettings cfi = actor.getMeta("CFISettings");
|
||||
if (cfi != null) {
|
||||
HeightMapMCAGenerator gen = cfi.getGenerator();
|
||||
if (gen != null && gen.isModified()) {
|
||||
try {
|
||||
gen.update();
|
||||
CFIChangeSet set = new CFIChangeSet(gen, actor.getUniqueId());
|
||||
session.remember(actor, gen, set, actor.getLimit());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: Ping @MattBDev to reimplement 2020-02-04
|
||||
// CFICommands.CFISettings cfi = actor.getMeta("CFISettings");
|
||||
// if (cfi != null) {
|
||||
// HeightMapMCAGenerator gen = cfi.getGenerator();
|
||||
// if (gen != null && gen.isModified()) {
|
||||
// try {
|
||||
// gen.update();
|
||||
// CFIChangeSet set = new CFIChangeSet(gen, actor.getUniqueId());
|
||||
// session.remember(actor, gen, set, actor.getLimit());
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Request.reset();
|
||||
}
|
||||
|
||||
|
@ -1,15 +1,7 @@
|
||||
package com.sk89q.worldedit.extension.platform.binding;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.object.extent.NullExtent;
|
||||
import com.boydti.fawe.object.extent.ResettableExtent;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extension.factory.DefaultTransformParser;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.internal.expression.EvaluationException;
|
||||
import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import com.sk89q.worldedit.internal.expression.ExpressionException;
|
||||
@ -17,7 +9,6 @@ import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector2;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import java.util.Locale;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -44,29 +35,31 @@ public class PrimitiveBindings extends Bindings {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an {@link Extent} from a {@link Binding}.
|
||||
*
|
||||
* @param argument the context
|
||||
* @return an extent
|
||||
* @throws InputParseException on other error
|
||||
*/
|
||||
@Binding
|
||||
public ResettableExtent getResettableExtent(Actor actor, String argument) throws InputParseException {
|
||||
if (argument.equalsIgnoreCase("#null")) {
|
||||
return new NullExtent();
|
||||
}
|
||||
DefaultTransformParser parser = Fawe.get().getTransformParser();
|
||||
ParserContext parserContext = new ParserContext();
|
||||
if (actor instanceof Entity) {
|
||||
Extent extent = ((Entity) actor).getExtent();
|
||||
if (extent instanceof World) {
|
||||
parserContext.setWorld((World) extent);
|
||||
}
|
||||
}
|
||||
parserContext.setSession(WorldEdit.getInstance().getSessionManager().get(actor));
|
||||
return parser.parseFromInput(argument, parserContext);
|
||||
}
|
||||
// TODO: Ping @MattBDev to reimplement 2020-02-04
|
||||
//
|
||||
// /**
|
||||
// * Gets an {@link Extent} from a {@link Binding}.
|
||||
// *
|
||||
// * @param argument the context
|
||||
// * @return an extent
|
||||
// * @throws InputParseException on other error
|
||||
// */
|
||||
// @Binding
|
||||
// public ResettableExtent getResettableExtent(Actor actor, String argument) throws InputParseException {
|
||||
// if (argument.equalsIgnoreCase("#null")) {
|
||||
// return new NullExtent();
|
||||
// }
|
||||
// DefaultTransformParser parser = Fawe.get().getTransformParser();
|
||||
// ParserContext parserContext = new ParserContext();
|
||||
// if (actor instanceof Entity) {
|
||||
// Extent extent = ((Entity) actor).getExtent();
|
||||
// if (extent instanceof World) {
|
||||
// parserContext.setWorld((World) extent);
|
||||
// }
|
||||
// }
|
||||
// parserContext.setSession(WorldEdit.getInstance().getSessionManager().get(actor));
|
||||
// return parser.parseFromInput(argument, parserContext);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Gets a type from a {@link Binding}.
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.sk89q.worldedit.extension.platform.binding;
|
||||
|
||||
import com.boydti.fawe.command.CFICommands;
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.database.DBHandler;
|
||||
import com.boydti.fawe.database.RollbackDatabase;
|
||||
|
Reference in New Issue
Block a user