mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 04:23:54 +00:00
Merge remote-tracking branch 'refs/remotes/sk89q/master'
# Conflicts: # worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java # worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java # worldedit-core/src/main/java/com/sk89q/worldedit/blocks/BlockType.java # worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java # worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java # worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java # worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java # worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java # worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java
This commit is contained in:
@ -32,7 +32,7 @@ import java.util.Map;
|
||||
/**
|
||||
* Represents a sign block.
|
||||
*/
|
||||
public class SignBlock extends BaseBlock implements TileEntityBlock {
|
||||
public class SignBlock extends BaseBlock {
|
||||
|
||||
private String[] text;
|
||||
|
||||
|
@ -31,7 +31,7 @@ import java.util.Map;
|
||||
/**
|
||||
* A skull block.
|
||||
*/
|
||||
public class SkullBlock extends BaseBlock implements TileEntityBlock {
|
||||
public class SkullBlock extends BaseBlock {
|
||||
|
||||
private String owner = ""; // notchian
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class YAMLProcessor extends YAMLNode {
|
||||
super(new LinkedHashMap<>(), writeDefaults);
|
||||
this.format = format;
|
||||
|
||||
DumperOptions options = new FancyDumperOptions();
|
||||
DumperOptions options = new DumperOptions();
|
||||
options.setIndent(4);
|
||||
options.setDefaultFlowStyle(format.getStyle());
|
||||
Representer representer = new FancyRepresenter();
|
||||
@ -289,19 +289,6 @@ public class YAMLProcessor extends YAMLNode {
|
||||
return new YAMLNode(new LinkedHashMap<>(), writeDefaults);
|
||||
}
|
||||
|
||||
// This will be included in snakeyaml 1.10, but until then we have to do it manually.
|
||||
private class FancyDumperOptions extends DumperOptions {
|
||||
// @Override
|
||||
// public DumperOptions.ScalarStyle calculateScalarStyle(ScalarAnalysis analysis,
|
||||
// DumperOptions.ScalarStyle style) {
|
||||
// if (format == YAMLFormat.EXTENDED && (analysis.scalar.contains("\n") || analysis.scalar.contains("\r"))) {
|
||||
// return ScalarStyle.LITERAL;
|
||||
// } else {
|
||||
// return super.calculateScalarStyle(analysis, style);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private static class FancyRepresenter extends Representer {
|
||||
private FancyRepresenter() {
|
||||
this.nullRepresenter = o -> representScalar(Tag.NULL, "");
|
||||
|
@ -46,6 +46,10 @@ import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.TreeGenerator;
|
||||
import com.sk89q.worldedit.util.command.parametric.Optional;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.TreeGenerator;
|
||||
|
||||
@Command(aliases = {"brush", "br", "tool"}, desc = "Bind functions to held items: [More Info](https://goo.gl/xPnPxj)")
|
||||
public class ToolCommands {
|
||||
@ -133,13 +137,13 @@ public class ToolCommands {
|
||||
max = 2
|
||||
)
|
||||
@CommandPermissions("worldedit.tool.flood-fill")
|
||||
public void floodFill(Player player, EditSession editSession, LocalSession session, Pattern pattern, double range) throws WorldEditException {
|
||||
public void floodFill(Player player, EditSession editSession, LocalSession session, Pattern pattern, int range) throws WorldEditException {
|
||||
LocalConfiguration config = we.getConfiguration();
|
||||
if (range > config.maxSuperPickaxeSize) {
|
||||
BBC.TOOL_RANGE_ERROR.send(player, config.maxSuperPickaxeSize);
|
||||
return;
|
||||
}
|
||||
session.setTool(new FloodFillTool((int) range, pattern), player);
|
||||
session.setTool(new FloodFillTool(range, pattern), player);
|
||||
BBC.TOOL_FLOOD_FILL.send(player, player.getItemInHand(HandSide.MAIN_HAND).getType().getName());
|
||||
}
|
||||
|
||||
@ -184,4 +188,4 @@ public class ToolCommands {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -25,10 +25,18 @@ import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
/**
|
||||
* A mode that replaces one block.
|
||||
|
@ -23,6 +23,7 @@ import com.boydti.fawe.config.BBC;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
@ -30,6 +31,7 @@ import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
/**
|
||||
* A tool that can place (or remove) blocks at a distance.
|
||||
@ -39,7 +41,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
|
||||
private Pattern primary;
|
||||
private Pattern secondary;
|
||||
|
||||
public LongRangeBuildTool(Pattern primary, Pattern secondary) {
|
||||
public LongRangeBuildTool(Pattern secondary, Pattern primary) {
|
||||
super("worldedit.tool.lrbuild");
|
||||
this.primary = primary;
|
||||
this.secondary = secondary;
|
||||
@ -55,7 +57,9 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
|
||||
Location pos = getTargetFace(player);
|
||||
if (pos == null) return false;
|
||||
EditSession eS = session.createEditSession(player);
|
||||
if (secondary instanceof BlockStateHolder && ((BlockStateHolder) secondary).getBlockType().getMaterial().isAir()) {
|
||||
|
||||
BlockStateHolder applied = secondary.apply(pos.toVector());
|
||||
if (applied.getBlockType().getMaterial().isAir()) {
|
||||
eS.setBlock(pos.toVector(), secondary);
|
||||
} else {
|
||||
eS.setBlock(pos.getDirection(), secondary);
|
||||
@ -68,7 +72,8 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
|
||||
Location pos = getTargetFace(player);
|
||||
if (pos == null) return false;
|
||||
EditSession eS = session.createEditSession(player);
|
||||
if (primary instanceof BlockStateHolder && ((BlockStateHolder) primary).getBlockType().getMaterial().isAir()) {
|
||||
BlockStateHolder applied = primary.apply(pos.toVector());
|
||||
if (applied.getBlockType().getMaterial().isAir()) {
|
||||
eS.setBlock(pos.toVector(), primary);
|
||||
} else {
|
||||
eS.setBlock(pos.getDirection(), primary);
|
||||
|
@ -21,10 +21,8 @@ package com.sk89q.worldedit.extent.reorder;
|
||||
|
||||
import com.google.common.collect.Iterators;
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.PlayerDirection;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.BlockType;
|
||||
import com.sk89q.worldedit.blocks.Blocks;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
@ -181,12 +179,12 @@ public class MultiStageReorder extends AbstractDelegateExtent implements Reorder
|
||||
}
|
||||
|
||||
// current = current.add(attachment.vector()).toBlockVector();
|
||||
|
||||
if (!blocks.contains(current)) {
|
||||
// We ran outside the remaining set => assume we can place blocks on this
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// if (!blocks.contains(current)) {
|
||||
// // We ran outside the remaining set => assume we can place blocks on this
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
if (walked.contains(current)) {
|
||||
// Cycle detected => This will most likely go wrong, but there's nothing we can do about it.
|
||||
break;
|
||||
|
@ -59,4 +59,9 @@ public abstract class Category<T> {
|
||||
this.set.clear();
|
||||
this.empty = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getId();
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,11 @@ public class EntityType {
|
||||
return getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.id.hashCode();
|
||||
|
@ -44,6 +44,11 @@ public class FluidType {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.id.hashCode();
|
||||
|
@ -44,6 +44,11 @@ public class GameMode {
|
||||
return getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.id.hashCode();
|
||||
|
@ -59,7 +59,7 @@ public interface ItemType {
|
||||
* @return The block representation
|
||||
*/
|
||||
@Nullable
|
||||
default BlockType getBlockType() {
|
||||
default BlockTypes getBlockType() {
|
||||
return BlockTypes.get(getId());
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,11 @@ public class WeatherType {
|
||||
return getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.id.hashCode();
|
||||
|
Reference in New Issue
Block a user