mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Merge pull request #510 from EngineHub/feature/blocks-are-patterns
Make BlockStateHolder extend Pattern.
This commit is contained in:
commit
9a133c05d1
@ -62,7 +62,6 @@ import com.sk89q.worldedit.function.operation.ForwardExtentCopy;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.function.operation.OperationQueue;
|
||||
import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.pattern.WaterloggedRemover;
|
||||
import com.sk89q.worldedit.function.util.RegionOffset;
|
||||
@ -820,7 +819,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
public <B extends BlockStateHolder<B>> int fillXZ(BlockVector3 origin, B block, double radius, int depth, boolean recursive) throws MaxChangedBlocksException {
|
||||
return fillXZ(origin, new BlockPattern(block), radius, depth, recursive);
|
||||
return fillXZ(origin, (Pattern) block, radius, depth, recursive);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -885,8 +884,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
getWorld(), // Causes clamping of Y range
|
||||
position.add(-apothem + 1, 0, -apothem + 1),
|
||||
position.add(apothem - 1, height - 1, apothem - 1));
|
||||
Pattern pattern = new BlockPattern(BlockTypes.AIR.getDefaultState());
|
||||
return setBlocks(region, pattern);
|
||||
return setBlocks(region, BlockTypes.AIR.getDefaultState());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -907,8 +905,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
getWorld(), // Causes clamping of Y range
|
||||
position.add(-apothem + 1, 0, -apothem + 1),
|
||||
position.add(apothem - 1, -height + 1, apothem - 1));
|
||||
Pattern pattern = new BlockPattern(BlockTypes.AIR.getDefaultState());
|
||||
return setBlocks(region, pattern);
|
||||
return setBlocks(region, BlockTypes.AIR.getDefaultState());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -929,8 +926,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
getWorld(), // Causes clamping of Y range
|
||||
position.add(adjustment.multiply(-1)),
|
||||
position.add(adjustment));
|
||||
Pattern pattern = new BlockPattern(BlockTypes.AIR.getDefaultState());
|
||||
return replaceBlocks(region, mask, pattern);
|
||||
return replaceBlocks(region, mask, BlockTypes.AIR.getDefaultState());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -942,7 +938,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
public <B extends BlockStateHolder<B>> int setBlocks(Region region, B block) throws MaxChangedBlocksException {
|
||||
return setBlocks(region, new BlockPattern(block));
|
||||
return setBlocks(region, (Pattern) block);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -974,7 +970,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
public <B extends BlockStateHolder<B>> int replaceBlocks(Region region, Set<BaseBlock> filter, B replacement) throws MaxChangedBlocksException {
|
||||
return replaceBlocks(region, filter, new BlockPattern(replacement));
|
||||
return replaceBlocks(region, filter, (Pattern) replacement);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1046,7 +1042,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
public <B extends BlockStateHolder<B>> int makeCuboidFaces(Region region, B block) throws MaxChangedBlocksException {
|
||||
return makeCuboidFaces(region, new BlockPattern(block));
|
||||
return makeCuboidFaces(region, block);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1098,7 +1094,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
public <B extends BlockStateHolder<B>> int makeCuboidWalls(Region region, B block) throws MaxChangedBlocksException {
|
||||
return makeCuboidWalls(region, new BlockPattern(block));
|
||||
return makeCuboidWalls(region, (Pattern) block);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1165,7 +1161,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
public <B extends BlockStateHolder<B>> int overlayCuboidBlocks(Region region, B block) throws MaxChangedBlocksException {
|
||||
checkNotNull(block);
|
||||
|
||||
return overlayCuboidBlocks(region, new BlockPattern(block));
|
||||
return overlayCuboidBlocks(region, (Pattern) block);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1255,7 +1251,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
// Remove the original blocks
|
||||
Pattern pattern = replacement != null ?
|
||||
replacement :
|
||||
new BlockPattern(BlockTypes.AIR.getDefaultState());
|
||||
BlockTypes.AIR.getDefaultState();
|
||||
BlockReplace remove = new BlockReplace(this, pattern);
|
||||
|
||||
// Copy to a buffer so we don't destroy our original before we can copy all the blocks from it
|
||||
@ -1334,7 +1330,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
if (waterlogged) {
|
||||
replace = new BlockReplace(this, new WaterloggedRemover(this));
|
||||
} else {
|
||||
replace = new BlockReplace(this, new BlockPattern(BlockTypes.AIR.getDefaultState()));
|
||||
replace = new BlockReplace(this, BlockTypes.AIR.getDefaultState());
|
||||
}
|
||||
RecursiveVisitor visitor = new RecursiveVisitor(mask, replace);
|
||||
|
||||
@ -1376,7 +1372,7 @@ public class EditSession implements Extent, AutoCloseable {
|
||||
blockMask
|
||||
);
|
||||
|
||||
BlockReplace replace = new BlockReplace(this, new BlockPattern(fluid.getDefaultState()));
|
||||
BlockReplace replace = new BlockReplace(this, fluid.getDefaultState());
|
||||
NonRisingVisitor visitor = new NonRisingVisitor(mask, replace);
|
||||
|
||||
// Around the origin in a 3x3 block
|
||||
|
@ -47,7 +47,6 @@ import com.sk89q.worldedit.function.factory.Paint;
|
||||
import com.sk89q.worldedit.function.mask.BlockTypeMask;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.factory.RegionFactory;
|
||||
@ -207,8 +206,7 @@ public class BrushCommands {
|
||||
worldEdit.checkMaxBrushRadius(radius);
|
||||
|
||||
BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType());
|
||||
Pattern fill = new BlockPattern(BlockTypes.AIR.getDefaultState());
|
||||
tool.setFill(fill);
|
||||
tool.setFill(BlockTypes.AIR.getDefaultState());
|
||||
tool.setSize(radius);
|
||||
tool.setMask(new BlockTypeMask(new RequestExtent(), BlockTypes.FIRE));
|
||||
tool.setBrush(new SphereBrush(), "worldedit.brush.ex");
|
||||
|
@ -37,10 +37,10 @@ import com.sk89q.worldedit.command.tool.TreePlanter;
|
||||
import com.sk89q.worldedit.command.util.CommandPermissions;
|
||||
import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
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;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.item.ItemType;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
import org.enginehub.piston.annotation.CommandContainer;
|
||||
@ -209,11 +209,11 @@ public class ToolCommands {
|
||||
player.print("Long-range building tool bound to " + itemStack.getType().getName() + ".");
|
||||
String primaryName = "pattern";
|
||||
String secondaryName = "pattern";
|
||||
if (primary instanceof BlockPattern) {
|
||||
primaryName = ((BlockPattern) primary).getBlock().getBlockType().getName();
|
||||
if (primary instanceof BlockStateHolder) {
|
||||
primaryName = ((BlockStateHolder<?>) primary).getBlockType().getName();
|
||||
}
|
||||
if (secondary instanceof BlockPattern) {
|
||||
secondaryName = ((BlockPattern) secondary).getBlock().getBlockType().getName();
|
||||
if (secondary instanceof BlockStateHolder) {
|
||||
secondaryName = ((BlockStateHolder<?>) secondary).getBlockType().getName();
|
||||
}
|
||||
player.print("Left-click set to " + primaryName + "; right-click set to "
|
||||
+ secondaryName + ".");
|
||||
|
@ -27,7 +27,6 @@ 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.math.BlockVector3;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
@ -57,7 +56,7 @@ public class BlockReplacer implements DoubleActionBlockTool {
|
||||
try {
|
||||
editSession.disableBuffering();
|
||||
BlockVector3 position = clicked.toVector().toBlockPoint();
|
||||
editSession.setBlock(position, pattern.apply(position));
|
||||
editSession.setBlock(position, pattern);
|
||||
} catch (MaxChangedBlocksException ignored) {
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
@ -77,7 +76,7 @@ public class BlockReplacer implements DoubleActionBlockTool {
|
||||
BaseBlock targetBlock = player.getWorld().getFullBlock(clicked.toVector().toBlockPoint());
|
||||
|
||||
if (targetBlock != null) {
|
||||
pattern = new BlockPattern(targetBlock);
|
||||
pattern = targetBlock;
|
||||
player.print("Replacer tool switched to: " + targetBlock.getBlockType().getName());
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,6 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
@ -37,7 +36,7 @@ public class CylinderBrush implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
if (pattern == null) {
|
||||
pattern = new BlockPattern(BlockTypes.COBBLESTONE.getDefaultState());
|
||||
pattern = BlockTypes.COBBLESTONE.getDefaultState();
|
||||
}
|
||||
editSession.makeCylinder(position, pattern, size, size, height, true);
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
@ -37,7 +36,7 @@ public class HollowCylinderBrush implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
if (pattern == null) {
|
||||
pattern = new BlockPattern(BlockTypes.COBBLESTONE.getDefaultState());
|
||||
pattern = BlockTypes.COBBLESTONE.getDefaultState();
|
||||
}
|
||||
editSession.makeCylinder(position, pattern, size, size, height, false);
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
@ -31,7 +30,7 @@ public class HollowSphereBrush implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
if (pattern == null) {
|
||||
pattern = new BlockPattern(BlockTypes.COBBLESTONE.getDefaultState());
|
||||
pattern = BlockTypes.COBBLESTONE.getDefaultState();
|
||||
}
|
||||
editSession.makeSphere(position, pattern, size, size, size, false);
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ package com.sk89q.worldedit.command.tool.brush;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
@ -31,7 +30,7 @@ public class SphereBrush implements Brush {
|
||||
@Override
|
||||
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {
|
||||
if (pattern == null) {
|
||||
pattern = new BlockPattern(BlockTypes.COBBLESTONE.getDefaultState());
|
||||
pattern = BlockTypes.COBBLESTONE.getDefaultState();
|
||||
}
|
||||
editSession.makeSphere(position, pattern, size, size, size, true);
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
@ -70,10 +69,10 @@ public class BlockCategoryPatternParser extends InputParser<Pattern> {
|
||||
|
||||
if (anyState) {
|
||||
blocks.stream().flatMap(blockType -> blockType.getAllStates().stream()).forEach(state ->
|
||||
randomPattern.add(new BlockPattern(state), 1.0));
|
||||
randomPattern.add(state, 1.0));
|
||||
} else {
|
||||
for (BlockType blockType : blocks) {
|
||||
randomPattern.add(new BlockPattern(blockType.getDefaultState()), 1.0);
|
||||
randomPattern.add(blockType.getDefaultState(), 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@ package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.pattern.RandomStatePattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
@ -60,7 +59,7 @@ public class RandomStatePatternParser extends InputParser<Pattern> {
|
||||
context.setPreferringWildcard(wasFuzzy);
|
||||
if (block.getStates().size() == block.getBlockType().getPropertyMap().size()) {
|
||||
// they requested random with *, but didn't leave any states empty - simplify
|
||||
return new BlockPattern(block);
|
||||
return block;
|
||||
} else if (block.toImmutableState() instanceof FuzzyBlockState) {
|
||||
return new RandomStatePattern((FuzzyBlockState) block.toImmutableState());
|
||||
} else {
|
||||
|
@ -22,7 +22,6 @@ package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
|
||||
@ -41,7 +40,7 @@ public class SingleBlockPatternParser extends InputParser<Pattern> {
|
||||
|
||||
@Override
|
||||
public Pattern parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||
return new BlockPattern(worldEdit.getBlockFactory().parseFromInput(input, context));
|
||||
return worldEdit.getBlockFactory().parseFromInput(input, context);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ package com.sk89q.worldedit.function.generator;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
@ -83,9 +82,9 @@ public class FloraGenerator implements RegionFunction {
|
||||
*/
|
||||
public static Pattern getDesertPattern() {
|
||||
RandomPattern pattern = new RandomPattern();
|
||||
pattern.add(new BlockPattern(BlockTypes.DEAD_BUSH.getDefaultState()), 30);
|
||||
pattern.add(new BlockPattern(BlockTypes.CACTUS.getDefaultState()), 20);
|
||||
pattern.add(new BlockPattern(BlockTypes.AIR.getDefaultState()), 300);
|
||||
pattern.add(BlockTypes.DEAD_BUSH.getDefaultState(), 30);
|
||||
pattern.add(BlockTypes.CACTUS.getDefaultState(), 20);
|
||||
pattern.add(BlockTypes.AIR.getDefaultState(), 300);
|
||||
return pattern;
|
||||
}
|
||||
|
||||
@ -96,9 +95,9 @@ public class FloraGenerator implements RegionFunction {
|
||||
*/
|
||||
public static Pattern getTemperatePattern() {
|
||||
RandomPattern pattern = new RandomPattern();
|
||||
pattern.add(new BlockPattern(BlockTypes.GRASS.getDefaultState()), 300);
|
||||
pattern.add(new BlockPattern(BlockTypes.POPPY.getDefaultState()), 5);
|
||||
pattern.add(new BlockPattern(BlockTypes.DANDELION.getDefaultState()), 5);
|
||||
pattern.add(BlockTypes.GRASS.getDefaultState(), 300);
|
||||
pattern.add(BlockTypes.POPPY.getDefaultState(), 5);
|
||||
pattern.add(BlockTypes.DANDELION.getDefaultState(), 5);
|
||||
return pattern;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@ import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
@ -187,7 +186,7 @@ public class GardenPatchGenerator implements RegionFunction {
|
||||
* @return a pumpkin pattern
|
||||
*/
|
||||
public static Pattern getPumpkinPattern() {
|
||||
return new BlockPattern(BlockTypes.PUMPKIN.getDefaultState());
|
||||
return BlockTypes.PUMPKIN.getDefaultState();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -208,6 +207,6 @@ public class GardenPatchGenerator implements RegionFunction {
|
||||
* @return a melon pattern
|
||||
*/
|
||||
public static Pattern getMelonPattern() {
|
||||
return new BlockPattern(BlockTypes.MELON.getDefaultState());
|
||||
return BlockTypes.MELON.getDefaultState();
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,10 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
/**
|
||||
* A pattern that returns the same {@link BaseBlock} each time.
|
||||
*
|
||||
* @deprecated all BlockStateHolders can be used directly as a pattern
|
||||
*/
|
||||
@Deprecated
|
||||
public class BlockPattern extends AbstractPattern {
|
||||
|
||||
private BaseBlock block;
|
||||
|
@ -20,13 +20,15 @@
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public interface BlockStateHolder<B extends BlockStateHolder<B>> {
|
||||
public interface BlockStateHolder<B extends BlockStateHolder<B>> extends Pattern {
|
||||
|
||||
/**
|
||||
* Get the block type
|
||||
@ -89,6 +91,11 @@ public interface BlockStateHolder<B extends BlockStateHolder<B>> {
|
||||
*/
|
||||
BaseBlock toBaseBlock(CompoundTag compoundTag);
|
||||
|
||||
@Override
|
||||
default BaseBlock apply(BlockVector3 position) {
|
||||
return toBaseBlock();
|
||||
}
|
||||
|
||||
default String getAsString() {
|
||||
if (getStates().isEmpty()) {
|
||||
return this.getBlockType().getId();
|
||||
|
Loading…
Reference in New Issue
Block a user